1
0

RegField: the JSON will just leave things out of type None

This commit is contained in:
Megan Wachs 2018-01-10 15:53:13 -08:00
parent 3b44f380d8
commit 5ab4204e8a

View File

@ -92,12 +92,12 @@ case class TLRegisterNode(
("addressOffset" -> s"0x${offset.toHexString}") ~ ("addressOffset" -> s"0x${offset.toHexString}") ~
("fields" -> seq.zipWithIndex.map { case (f, i) => { ("fields" -> seq.zipWithIndex.map { case (f, i) => {
val tmp = (f.description.map{ _.displayName }.getOrElse(s"unnamedRegField${i}") -> ( val tmp = (f.description.map{ _.displayName }.getOrElse(s"unnamedRegField${i}") -> (
("description" -> f.description.map{_.description}.getOrElse("No Description Provided")) ~
("bitOffset" -> currentBitOffset) ~ ("bitOffset" -> currentBitOffset) ~
("bitWidth" -> f.width) ~ ("bitWidth" -> f.width) ~
("resetMask" -> f.description.map { d => if (d.resetType != RegFieldResetType.N) "all" else "none"}.getOrElse("none")) ~ ("description" -> f.description.map{ _.description}) ~
("resetValue" -> f.description.map { _.resetValue}.getOrElse(0)) ~ ("resetMask" -> f.description.map { d => if (d.resetType != RegFieldResetType.N) "all" else "none"}) ~
("headerName" -> f.description.map { _.headerName}.getOrElse("")))) ("resetValue" -> f.description.map { _.resetValue})
("headerName" -> f.description.map { _.headerName}))
currentBitOffset = currentBitOffset + f.width currentBitOffset = currentBitOffset + f.width
tmp tmp
}}))} }}))}