Commit c74b8a56 authored by Jens Korinth's avatar Jens Korinth
Browse files

Implement wire defaults for Axi4Lite sub-bundles

parent ee598c83
......@@ -20,6 +20,13 @@ object Axi4Lite {
val region = UInt(cfg.regionWidth)
val user = UInt(cfg.userWidth)
def defaults {
addr := "h12345678".U
prot.prot := Protection(Protection.Flag.NON_PRIVILEGED, Protection.Flag.NON_SECURE, Protection.Flag.DATA).U
region := 0.U
user := 0.U
}
override def cloneType = { new Address()(cfg).asInstanceOf[this.type] }
}
......@@ -27,17 +34,32 @@ object Axi4Lite {
abstract private[axi] class DataChannel(implicit cfg: Configuration) extends Bundle {
val data = UInt(cfg.dataWidth)
val user = UInt(cfg.userWidth)
def defaults {
data := "hDEADBEEF".U
user := "hDEADDEED".U
}
}
class Read(implicit cfg: Configuration) extends DataChannel {
val resp = UInt(2.W)
override def defaults {
super.defaults
resp := Response.slverr
}
override def cloneType = { new Read()(cfg).asInstanceOf[this.type] }
}
class Write(implicit cfg: Configuration) extends DataChannel {
val strb = new Strobe(cfg.dataWidth)
override def defaults {
super.defaults
strb.strb := Strobe(0 until cfg.dataWidth / 8:_*)
}
override def cloneType = { new Write()(cfg).asInstanceOf[this.type] }
}
}
......@@ -46,6 +68,11 @@ object Axi4Lite {
val buser = UInt(cfg.userWidth)
val bresp = UInt(2.W)
def defaults {
buser := 0.U
bresp := Response.slverr
}
override def cloneType = { new WriteResponse()(cfg).asInstanceOf[this.type] }
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment