Slight cleanups from review with Alexandre.
This commit is contained in:
@@ -63,8 +63,8 @@ typedef Bit#(TLog#(SupSizeX2)) BtbBank;
|
||||
// Total entries/lanes of superscalar lookup/associativity
|
||||
typedef TDiv#(TDiv#(BtbEntries,SupSizeX2),BtbAssociativity) BtbIndices;
|
||||
typedef Bit#(TLog#(BtbIndices)) BtbIndex;
|
||||
typedef Bit#(16) HashedTag;
|
||||
typedef Bit#(TSub#(TSub#(TSub#(AddrSz,SizeOf#(BtbBank)), SizeOf#(BtbIndex)), PcLsbsIgnore)) BtbTag;
|
||||
typedef Bit#(16) HashedTag;
|
||||
|
||||
typedef struct {
|
||||
BtbTag tag;
|
||||
|
||||
@@ -124,7 +124,11 @@ Bitwise#(ix), Eq#(ix), Arith#(ix), PrimIndex#(ix, a__));
|
||||
Reg#(ix) clearCount <- mkReg(0);
|
||||
(* fire_when_enabled, no_implicit_conditions *)
|
||||
rule updateCanon;
|
||||
if (updateFresh) begin
|
||||
if (clearReg) begin
|
||||
for (Integer i = 0; i < a; i = i + 1) mem[i].wrReq(clearCount, unpack(0));
|
||||
clearCount <= clearCount + 1;
|
||||
if (clearCount == ~0) clearReg <= False;
|
||||
end else if (updateFresh) begin
|
||||
let u = updateReg;
|
||||
Bit#(TLog#(as)) way = wayNext;
|
||||
for (Integer i = 0; i < a; i = i + 1)
|
||||
@@ -135,10 +139,6 @@ Bitwise#(ix), Eq#(ix), Arith#(ix), PrimIndex#(ix, a__));
|
||||
mem[way].wrReq(u.index, MapKeyValue{key: u.key, value: u.value});
|
||||
updateKeys[way].wrReq(u.index, u.key);
|
||||
wayNext <= (wayNext == fromInteger(a-1)) ? 0 : (wayNext + 1);
|
||||
end else if (clearReg) begin
|
||||
for (Integer i = 0; i < a; i = i + 1) mem[i].wrReq(clearCount, unpack(0));
|
||||
clearCount <= clearCount + 1;
|
||||
if (clearCount == ~0) clearReg <= False;
|
||||
end
|
||||
endrule
|
||||
|
||||
|
||||
Reference in New Issue
Block a user