修复smunit计数器位宽
This commit is contained in:
@@ -85,10 +85,11 @@ abstract class SMUnitBase(depth: Int = 4) extends Module {
|
|||||||
( (rPtr(log2Ceil(depth)-1, 0)) === i.U ) -> io.sram(i).rd.datar
|
( (rPtr(log2Ceil(depth)-1, 0)) === i.U ) -> io.sram(i).rd.datar
|
||||||
})
|
})
|
||||||
|
|
||||||
val cnt = RegInit(0.U((log2Ceil(depth)).W)); io.cnt := cnt
|
val cnt = RegInit(0.U((log2Ceil(depth+1)).W)); io.cnt := cnt
|
||||||
|
|
||||||
when( io.enq & ~isFull ){
|
when( io.enq & ~isFull ){
|
||||||
cnt := cnt + 1.U
|
cnt := cnt + 1.U
|
||||||
|
assert(cnt =/= depth.U)
|
||||||
} .elsewhen( io.deq & ~isEmpty ){
|
} .elsewhen( io.deq & ~isEmpty ){
|
||||||
cnt := cnt - 1.U
|
cnt := cnt - 1.U
|
||||||
assert(cnt =/= 0.U)
|
assert(cnt =/= 0.U)
|
||||||
|
|||||||
Reference in New Issue
Block a user