class Apb2CSTrgt extends Module
Apb2CSTrgt
Basic APB2 Control/Status register target generator with Control/Status register map supplied via a simple JSON description.
The following register bit field types are supported:
RW register bits
Read-write. Generally these are static configuration bit fields and are connected to Outputs. The register bits can only be set or cleared by writing to the register.
RO register bits
Read-only. These are connected to Inputs which should be driven by registered external status signals from the design instantiating Apb2CSTrgt. Writing to these registers has no effect.
WO register bits
Write-only. These are connected to Outputs but after being written to '1' they are always set back to to '0' on the following clock cycle, so writing a '1' to a WO register bit will create a single-cycle pulse on the corresponding Output. This bit field mode can be used to implement 'go bits' which trigger some event elsewhere in the design instantiating Apb2CSTrgt. Writing a '0' has no effect, reads are always '0'.
W1C register bits
Write-1-to-clear. These are connected to Inputs on which a single cycle pulse will set the corresponding register bit to '1'. Writing a '1' to the same bit will clear it. Writing a '0' has no effect, regardless of the current value of the bit. This bit field mode is the one to use for interrupt status registers. Interrupt enable/mask registers should be implemented using RW bit fields with the enable/mask logic implemented externally in the design instantiating Apb2CSTrgt.
- To do
implement pProt
implement check that there are no spaces in register or regType names in JSON
- Note
pStrb is implemented as follows: pStrb bits are used to mask or enable writes to individual bytes of bit fields. However, if a bit field straddles two or more byte lanes and not ALL the corresponding bits of pStrb are set then the bit field is not written (at all) and pSlvErr is signalled. In other words, partial writes to bitfields are not supported; either the whole bit field is written, when ALL corresponding pStrb bits are set, or the bit field is not written at all. Writing to a register with NONE of the pStrb bits corresponding to a given bit field set is OK and is NOT an error condition. This is a design decision. The AMBA APB2 spec only discusses the pStrb bits in the context of the validity of the byte lanes of the write data bus. The JSON register description specifies the width of each register type. All registers in a given JSON must have width >= DATA_W and if width is > DATA_W then it must be power of two a multiple of DATA_W. i.e. 64 bit registers are supported with 32 bit access but 96 bit registers are not supported and 16 bit registers are not supported with 32 bit access, for example. If a register wider than DATA_W specifies a field which straddles the DATA_W boundary then it is broken into two (or more) pieces, for DATA_W access, which are concatenated together.
- Alphabetic
- By Inheritance
- Apb2CSTrgt
- Module
- RawModule
- BaseModule
- IsInstantiable
- HasId
- InstanceId
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Apb2CSTrgt(DATA_W: Int = 32, REG_DESC_JSON: String, VERBOSE: Boolean = false, GEN_BUNDLE: Boolean = false)
- DATA_W
the width of the APB2 data bus in bits
- REG_DESC_JSON
a string giving the path to the register description JSON to be generated
- VERBOSE
enables verbose output during generation
- GEN_BUNDLE
enables generation of Scala Bundles suitable for connection to the generated MixedVec IOs. The signal names used in the Bundles match their corresponding register and bit field names, as specified in the JSON. They are declared in the same order as the entries of the corresponding MixedVecs and are therefore very simple to connect to create wrapper Modules with named IO for specific (JSON) parameterizations of Apb2CSTrgt
Type Members
- case class BitField(bits: List[Int], name: String, mode: Option[String], resetVal: Option[Int], comment: Option[String]) extends Product with Serializable
- case class BitFieldDetails(reg: UInt, pos: Int, width: Int, mode: String, name: String) extends Product with Serializable
- case class Register(offset: Int, name: String, typeRef: String, comment: Option[String]) extends Product with Serializable
- case class RegisterAttr(offset: Int, width: Int, typeRef: String) extends Product with Serializable
- case class RegisterBits(name: String, fields: List[BitField]) extends Product with Serializable
- case class RegisterDesc(regMap: List[Register], regTypes: List[RegisterType]) extends Product with Serializable
- case class RegisterType(typeRef: String, width: Int, fields: List[BitField], comment: Option[String]) extends Product with Serializable
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val ADDR_W: Int
-
def
IO[T <: Data](iodef: T): T
- Attributes
- protected
- Definition Classes
- BaseModule
- val MAX_REGS: Int
- val NUM_BITS_SHIFT: Int
- val NUM_BYTE: Int
- val NUM_REGS: Int
-
def
_bindIoInPlace(iodef: Data): Unit
- Attributes
- protected
- Definition Classes
- BaseModule
-
var
_closed: Boolean
- Attributes
- protected
- Definition Classes
- BaseModule
-
def
_compatAutoWrapPorts(): Unit
- Definition Classes
- BaseModule
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val attributes: List[RegisterAttr]
- val bundlePrefix: String
- var bytes: Int
- val chisel3BundleFileName: String
- val chisel3BundleFilePath: String
-
def
circuitName: String
- Attributes
- protected
- Definition Classes
- HasId
-
final
val
clock: Clock
- Definition Classes
- Module
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
val
compileOptions: CompileOptions
- Definition Classes
- RawModule
-
def
desiredName: String
- Definition Classes
- BaseModule
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
- Definition Classes
- HasId → AnyRef → Any
- val fields: List[List[BitField]]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
getCommands: Seq[Command]
- Attributes
- protected
- Definition Classes
- RawModule
-
def
getModulePorts: Seq[Data]
- Attributes
- protected[chisel3]
- Definition Classes
- BaseModule
-
def
hasSeed: Boolean
- Definition Classes
- HasId
-
def
hashCode(): Int
- Definition Classes
- HasId → AnyRef → Any
-
def
instanceName: String
- Definition Classes
- BaseModule → HasId → InstanceId
- val io: Bundle { ... /* 5 definitions in type refinement */ }
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val jsonString: String
-
final
lazy val
name: String
- Definition Classes
- BaseModule
-
def
nameIds(rootClass: Class[_]): HashMap[HasId, String]
- Attributes
- protected
- Definition Classes
- BaseModule
- val names: List[String]
- val namesAndBits: List[RegisterBits]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val offNameMap: Map[Int, String]
- val offsets: List[Int]
- val pAddrFF: UInt
- val pRDataFF: UInt
- val pReadyFF: Bool
- val pSlvErrFF: Bool
- val pWriteFF: Bool
-
def
parentModName: String
- Definition Classes
- HasId → InstanceId
-
def
parentPathName: String
- Definition Classes
- HasId → InstanceId
-
def
pathName: String
- Definition Classes
- HasId → InstanceId
-
def
portsContains(elem: Data): Boolean
- Attributes
- protected
- Definition Classes
- BaseModule
-
def
portsSize: Int
- Attributes
- protected
- Definition Classes
- BaseModule
- def prettyPrintBitField(f: BitField): Unit
- def prettyPrintReg(r: Register): Unit
- def prettyPrintRegType(t: RegisterType): Unit
- def printRegMap(m: RegisterDesc): Unit
- val regArr: Array[ArrayBuffer[BitFieldDetails]]
- val regDesc: Option[RegisterDesc]
- val regIndex: UInt
- val regMap: Map[String, RegisterAttr]
-
final
val
reset: Reset
- Definition Classes
- Module
- val roBundleBuffer: ListBuffer[String]
- val roIt: Iterator[UInt]
- var roRegBits: ListMap[String, Int]
- val rwBundleBuffer: ListBuffer[String]
- val rwIt: Iterator[UInt]
- var rwRegBits: ListMap[String, Int]
- val sorted: List[RegisterAttr]
-
def
suggestName(seed: ⇒ String): Apb2CSTrgt.this.type
- Definition Classes
- HasId
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toAbsoluteTarget: IsModule
- Definition Classes
- BaseModule → InstanceId
- def toCamelCase(s: String): String
-
final
def
toNamed: ModuleName
- Definition Classes
- BaseModule → InstanceId
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
toTarget: ModuleTarget
- Definition Classes
- BaseModule → InstanceId
- val typeFieldMap: Map[String, List[BitField]]
- val typeWidthMap: Map[String, Int]
- val types: List[String]
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- val wcBundleBuffer: ListBuffer[String]
- val wcIt: Iterator[UInt]
- var wcRegBits: ListMap[String, Int]
- val widths: List[Int]
- val woBundleBuffer: ListBuffer[String]
- val woIt: Iterator[UInt]
- var woRegBits: ListMap[String, Int]
- def writeBundleMember(f: BitFieldDetails): String
- object RegisterDescDecoder
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated
-
lazy val
getPorts: Seq[Port]
- Definition Classes
- RawModule
- Annotations
- @deprecated
- Deprecated
(Since version Chisel 3.5) Use DataMirror.modulePorts instead. this API will be removed in Chisel 3.6
-
def
override_clock: Option[Clock]
- Attributes
- protected
- Definition Classes
- Module
- Annotations
- @deprecated
- Deprecated
(Since version Chisel 3.5) Use withClock at Module instantiation
-
def
override_clock_=(rhs: Option[Clock]): Unit
- Attributes
- protected
- Definition Classes
- Module
- Annotations
- @deprecated
- Deprecated
(Since version Chisel 3.5) Use withClock at Module instantiation
-
def
override_reset: Option[Bool]
- Attributes
- protected
- Definition Classes
- Module
- Annotations
- @deprecated
- Deprecated
(Since version Chisel 3.5) Use withClock at Module instantiation
-
def
override_reset_=(rhs: Option[Bool]): Unit
- Attributes
- protected
- Definition Classes
- Module
- Annotations
- @deprecated
- Deprecated
(Since version Chisel 3.5) Use withClock at Module instantiation