Add hardcoded types to OM classes.

This commit is contained in:
Richard Xia 2018-11-19 12:55:23 -08:00
parent bb3e2b7c21
commit b6c8c705e4
16 changed files with 51 additions and 29 deletions

View File

@ -11,7 +11,8 @@ trait OMBitRange extends OMRange
case class OMAddressSet(
base: BigInt,
mask: BigInt
mask: BigInt,
_types: Seq[String] = Seq("OMAddressSet", "OMCompoundType")
) extends OMCompoundType
// Permissions are for memory regions
@ -20,7 +21,8 @@ case class OMPermissions(
writeable: Boolean,
executable: Boolean,
cacheable: Boolean,
atomics: Boolean
atomics: Boolean,
_types: Seq[String] = Seq("OMPermissions", "OMCompoundType")
) extends OMCompoundType
case class OMRegFieldDesc(
@ -31,24 +33,28 @@ case class OMRegFieldDesc(
wrType: Option[OMRegFieldWrType],
rdAction: Option[OMRegFieldRdAction],
volatile: Boolean,
resetValue: Option[Int]
resetValue: Option[Int],
_types: Seq[String] = Seq("OMRegFieldDesc", "OMCompoundType")
) extends OMCompoundType
case class OMRegField (
bitRange: OMBitRange,
description: Option[OMRegFieldDesc]
description: Option[OMRegFieldDesc],
_types: Seq[String] = Seq("OMRegField", "OMCompoundType")
) extends OMCompoundType
case class OMRegFieldGroup (
name: String,
description: Option[String]
description: Option[String],
_types: Seq[String] = Seq("OMRegFieldGroup", "OMCompoundType")
) extends OMCompoundType
case class OMRegisterMap (
name: String,
description: String,
registerFields: Seq[OMRegField],
groups: Seq[OMRegFieldGroup]
groups: Seq[OMRegFieldGroup],
_types: Seq[String] = Seq("OMRegisterMap", "OMCompoundType")
) extends OMCompoundType
/**
@ -61,6 +67,7 @@ case class OMMemoryRegion (
description: String,
addressSets: Seq[OMAddressSet],
permissions: OMPermissions,
registerMap: Option[OMRegisterMap]
registerMap: Option[OMRegisterMap],
_types: Seq[String] = Seq("OMMemoryRegion", "OMCompoundType")
) extends OMCompoundType

View File

@ -5,5 +5,6 @@ package freechips.rocketchip.diplomaticobjectmodel.model
case class OMCLINT(
memoryRegions: Seq[OMMemoryRegion],
interrupts: Seq[OMInterrupt],
specifications: List[OMSpecification]
) extends OMDevice
specifications: List[OMSpecification],
_types: Seq[String] = Seq("OMCLINT", "OMDevice", "OMComponent", "OMCompoundType")
) extends OMDevice

View File

@ -33,7 +33,8 @@ case class OMICache(
tagECC: Option[OMECC],
nTLBEntries: Int,
memories: List[OMMemory],
maxTimSize: Int
maxTimSize: Int,
_types: Seq[String] = Seq("OMICache", "OMCache", "OMDevice", "OMComponent", "OMCompoundType")
) extends OMCache
case class OMDCache(
@ -47,5 +48,6 @@ case class OMDCache(
tagECC: Option[OMECC],
nTLBEntries: Int,
memories: List[OMMemory],
maxTimSize: Int
maxTimSize: Int,
_types: Seq[String] = Seq("OMDCache", "OMCache", "OMDevice", "OMComponent", "OMCompoundType")
) extends OMCache

View File

@ -8,5 +8,6 @@ case class OMDebug(
specifications: List[OMSpecification],
nAbstractDataWords: Int,
nProgramBufferWords: Int,
hasJtagDTM: Boolean
) extends OMDevice
hasJtagDTM: Boolean,
_types: Seq[String] = Seq("OMDebug", "OMDevice", "OMComponent", "OMCompoundType")
) extends OMDevice

View File

@ -33,5 +33,6 @@ case class OMISA(
c: Option[OMSpecification],
u: Option[OMSpecification],
s: Option[OMSpecification],
addressTranslationModes: Seq[OMAddressTranslationMode]
addressTranslationModes: Seq[OMAddressTranslationMode],
_types: Seq[String] = Seq("OMISA", "OMCompoundType")
) extends OMCompoundType

View File

@ -5,6 +5,7 @@ package freechips.rocketchip.diplomaticobjectmodel.model
case class OMInterrupt(
receiver: String, // TODO Reference
numberAtReceiver: Int,
name: String
name: String,
_types: Seq[String] = Seq("OMInterrupt", "OMCompoundType")
) extends OMCompoundType

View File

@ -8,5 +8,6 @@ case class OMMemory(
dataWidth: Int,
depth: Int,
writeMaskGranularity: Int,
rtlModule: OMRTLModule
)
rtlModule: OMRTLModule,
_types: Seq[String] = Seq("OMMemory")
)

View File

@ -11,7 +11,8 @@ case class OMMulDiv(
multiplyBitsPerCycle: Int,
multiplyFullyPipelined: Boolean,
multiplyMaxLatency: Int,
multiplyMinLatency: Int
multiplyMinLatency: Int,
_types: Seq[String] = Seq("OMMulDiv", "OMComponent", "OMCompoundType")
) extends OMComponent

View File

@ -9,7 +9,8 @@ case object OMUserMode extends OMPrivilegeMode
case class OMInterruptTarget(
hartId: Int,
mode: OMPrivilegeMode
mode: OMPrivilegeMode,
_types: Seq[String] = Seq("OMInterrupt", "OMCompoundType")
) extends OMCompoundType
case class OMPLIC(
@ -19,5 +20,6 @@ case class OMPLIC(
latency: Int,
nInterrupts: Int, // plic.nInterrupts - coreComplex.nExternalGlobalInterrupts == internal global interrupts from devices inside of the Core Complex
nPriorities: Int,
targets: List[OMInterruptTarget]
) extends OMDevice
targets: List[OMInterruptTarget],
_types: Seq[String] = Seq("OMPLIC", "OMDevice", "OMComponent", "OMCompoundType")
) extends OMDevice

View File

@ -5,5 +5,6 @@ package freechips.rocketchip.diplomaticobjectmodel.model
case class OMPMP(
specifications: Seq[OMSpecification],
nRegions: Int,
granularity: Int
granularity: Int,
_types: Seq[String] = Seq("OMPMP", "OMComponent", "OMCompoundType")
) extends OMComponent

View File

@ -5,5 +5,6 @@ package freechips.rocketchip.diplomaticobjectmodel.model
case class OMPerformanceMonitor(
specifications: List[OMSpecification],
hasBasicCounters: Boolean,
nAdditionalCounters: Int
nAdditionalCounters: Int,
_types: Seq[String] = Seq("OMPerformanceMonitor", "OMComponent", "OMCompoundType")
) extends OMComponent

View File

@ -2,7 +2,7 @@
package freechips.rocketchip.diplomaticobjectmodel.model
sealed trait OMRegFieldAccessType
sealed trait OMRegFieldAccessType extends OMEnum
case object R extends OMRegFieldAccessType
case object W extends OMRegFieldAccessType
case object RW extends OMRegFieldAccessType

View File

@ -2,7 +2,7 @@
package freechips.rocketchip.diplomaticobjectmodel.model
sealed trait OMRegFieldRdAction
sealed trait OMRegFieldRdAction extends OMEnum
case object RFRA_CLEAR extends OMRegFieldRdAction
case object RFRA_SET extends OMRegFieldRdAction
case object RFRA_MODIFY extends OMRegFieldRdAction

View File

@ -3,7 +3,7 @@
package freechips.rocketchip.diplomaticobjectmodel.model
/* The following enum names come from IP-XACT */
sealed trait OMRegFieldWrType
sealed trait OMRegFieldWrType extends OMEnum
case object RFWT_ONE_TO_CLEAR extends OMRegFieldWrType
case object RFWT_ONE_TO_SET extends OMRegFieldWrType
case object RFWT_ONE_TO_TOGGLE extends OMRegFieldWrType

View File

@ -5,7 +5,8 @@ package freechips.rocketchip.diplomaticobjectmodel.model
case class OMRocketBranchPredictor(
nBtbEntries: Int,
nBhtEntries: Int,
nRasEntries: Int
nRasEntries: Int,
_types: Seq[String] = Seq("OMRocketBranchPredictor", "OMBranchPredictor", "OMComponent", "OMCompoundType")
) extends OMBranchPredictor
case class OMRocketCore(
@ -22,5 +23,6 @@ case class OMRocketCore(
nBreakpoints: Int,
branchPredictor: Option[OMRocketBranchPredictor],
dcache: Option[OMDCache],
icache: Option[OMICache]
icache: Option[OMICache],
_types: Seq[String] = Seq("OMRocketCore", "OMCore", "OMComponent", "OMCompoundType")
) extends OMCore

View File

@ -4,5 +4,6 @@ package freechips.rocketchip.diplomaticobjectmodel.model
case class OMSpecification(
name: String,
version: String
version: String,
_types: Seq[String] = Seq("OMSpecification")
)