simplify CSR decoding code
This commit is contained in:
parent
655f9ae1af
commit
cde7c9d869
@ -113,10 +113,7 @@ class CSRFile extends Module
|
|||||||
val map = for ((v, i) <- CSRs.all.zipWithIndex)
|
val map = for ((v, i) <- CSRs.all.zipWithIndex)
|
||||||
yield v -> UInt(BigInt(1) << i)
|
yield v -> UInt(BigInt(1) << i)
|
||||||
val out = ROM(map)(addr)
|
val out = ROM(map)(addr)
|
||||||
val a = Array.fill(CSRs.all.max+1)(null.asInstanceOf[Bool])
|
Map((CSRs.all zip out.toBools):_*)
|
||||||
for (i <- 0 until CSRs.all.size)
|
|
||||||
a(CSRs.all(i)) = out(i)
|
|
||||||
a
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val wen = cpu_req_valid || host_pcr_req_fire && host_pcr_bits.rw
|
val wen = cpu_req_valid || host_pcr_req_fire && host_pcr_bits.rw
|
||||||
|
Loading…
Reference in New Issue
Block a user