1
0
Fork 0

fix bugs from adding ComparatorSource backpressure

This commit is contained in:
Howard Mao 2016-07-12 13:47:42 -07:00
parent d435bb4185
commit 676a536706
1 changed files with 2 additions and 8 deletions

View File

@ -69,13 +69,10 @@ class ComparatorSource(implicit val p: Parameters) extends Module
}
// Output exactly nOperations of Acquires
val counter = RegInit(UInt(nOperations))
val finished = RegInit(Bool(false))
val valid = RegInit(Bool(false))
valid := Bool(true)
counter := counter - (!finished && valid).asUInt
when (counter === UInt(1)) { finished := Bool(true) }
io.finished := finished
io.out.valid := !finished && valid
@ -148,15 +145,13 @@ class ComparatorSource(implicit val p: Parameters) extends Module
UInt("b101") -> getPrefetch,
UInt("b110") -> putPrefetch)))
when (!done_wipe && valid) {
wipe_addr_block := wipe_addr_block + UInt(1)
}
val idx = Reg(init = UInt(0, log2Up(nOperations)))
when (io.out.fire()) {
when (idx === UInt(nOperations - 1)) { finished := Bool(true) }
when (!done_wipe) {
printf("[acq %d]: PutBlock(addr_block = %x, data = %x)\n",
idx, wipe_addr_block, data)
wipe_addr_block := wipe_addr_block + UInt(1)
} .otherwise {
switch (a_type_sel) {
is (UInt("b000")) {
@ -343,7 +338,6 @@ class ComparatorSink(implicit val p: Parameters) extends Module
}
}
when (all_valid) {
// Skip the results generated by the block wiping
when (base.hasData()) {
printf("[gnt %d]: g_type = %x, addr_beat = %x, data = %x\n",
idx, base.g_type, base.addr_beat, base.data)