From 52da831aa30ed4b69173ac3f257aa4c095b1b850 Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Thu, 23 Feb 2012 18:12:50 -0800 Subject: [PATCH] finished xact_finish and xact_abort transactors in coherence hub --- rocket/src/main/scala/coherence.scala | 32 +++++++-------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/rocket/src/main/scala/coherence.scala b/rocket/src/main/scala/coherence.scala index 3744fdb6..534c4bb9 100644 --- a/rocket/src/main/scala/coherence.scala +++ b/rocket/src/main/scala/coherence.scala @@ -205,7 +205,9 @@ class CoherenceHubNoDir extends CoherenceHub { trackerList(i).io.xact_finish := free_arr.read(UFix(i)) } - // In parallel, every cycle: nack conflicting transactions, free finished ones + // Nack conflicting transaction init attempts + val aborting = Wire() { Bits(width = NTILES) } + val initiating = Wire() { Bits(width = NTILES) } for( j <- 0 until NTILES ) { val init = io.tiles(j).xact_init val abort = io.tiles(j).xact_abort @@ -214,34 +216,16 @@ class CoherenceHubNoDir extends CoherenceHub { val t = trackerList(i).io conflicts(i) := t.busy(i) && coherenceConflict(t.addr, init.bits.address) } - abort.valid := init.valid && (conflicts.orR || busy_arr.flatten().andR) + aborting(j) := (conflicts.orR || busy_arr.flatten().andR) + abort.valid := init.valid && aborting abort.bits.tileTransactionID := init.bits.tileTransactionID - // TODO: - // Reg(aborted) := (abort.ready && abort.valid) - // Reg(allocated) : = had_priority(j) & !(abort.ready && abort.valid) - // init.rdy = aborted || allocated + init.ready := aborting(j) || initiating(j) } - -/* -// Todo: which implementation is clearer? - for( i <- 0 until NGLOBAL_XACTS) { - val t = trackerList(i).io - val freed = Bits(width = NTILES) - for( j <- 0 until NTILES ) { - val finish = io.tiles(j).xact_finish - free(j) := finish.valid && (UFix(i) === finish.bits.globalTransactionID) - finish.ready := Bool(true) // finsh.pop() - } - t.xact_finish := freed.orR - } -*/ - free_arr := Bits(0, width=NGLOBAL_XACTS) + // Free finished transactions for( j <- 0 until NTILES ) { val finish = io.tiles(j).xact_finish - when(finish.valid) { - free_arr.write(finish.bits.globalTransactionID, Bool(true)) - } + free_arr.write(finish.bits.globalTransactionID, finish.valid) finish.ready := Bool(true) }