mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
More cleanup.
This commit is contained in:
parent
143c6ca4d1
commit
4149ae6c11
@ -66,7 +66,7 @@ module align import cvw::*; #(parameter cvw_t P) (
|
|||||||
logic SelSpillM;
|
logic SelSpillM;
|
||||||
logic SpillSaveM;
|
logic SpillSaveM;
|
||||||
logic [P.LLEN-1:0] ReadDataWordFirstHalfM;
|
logic [P.LLEN-1:0] ReadDataWordFirstHalfM;
|
||||||
logic ValidMisalignedM, MisalignedM;
|
logic MisalignedM;
|
||||||
logic [P.LLEN*2-1:0] ReadDataWordSpillAllM;
|
logic [P.LLEN*2-1:0] ReadDataWordSpillAllM;
|
||||||
logic [P.LLEN*2-1:0] ReadDataWordSpillShiftedM;
|
logic [P.LLEN*2-1:0] ReadDataWordSpillShiftedM;
|
||||||
|
|
||||||
@ -92,6 +92,9 @@ module align import cvw::*; #(parameter cvw_t P) (
|
|||||||
// 2) offset
|
// 2) offset
|
||||||
// 3) access location within the cacheline
|
// 3) access location within the cacheline
|
||||||
|
|
||||||
|
assign ValidAccess = (|MemRWM);
|
||||||
|
|
||||||
|
// compute misalignement
|
||||||
always_comb begin
|
always_comb begin
|
||||||
case (Funct3M[1:0])
|
case (Funct3M[1:0])
|
||||||
2'b00: AccessByteOffsetM = '0; // byte access
|
2'b00: AccessByteOffsetM = '0; // byte access
|
||||||
@ -111,13 +114,7 @@ module align import cvw::*; #(parameter cvw_t P) (
|
|||||||
assign MisalignedM = ValidAccess & (AccessByteOffsetM != '0);
|
assign MisalignedM = ValidAccess & (AccessByteOffsetM != '0);
|
||||||
assign SpillM = MisalignedM & PotentialSpillM;
|
assign SpillM = MisalignedM & PotentialSpillM;
|
||||||
|
|
||||||
// compute misalignement
|
assign ValidSpillM = SpillM & ~CacheBusHPWTStall; // Don't take the spill if there is a stall
|
||||||
assign ValidAccess = (|MemRWM);
|
|
||||||
|
|
||||||
// align by shifting
|
|
||||||
// Don't take the spill if there is a stall, TLB miss, or hardware update to the D/A bits
|
|
||||||
assign ValidSpillM = SpillM & ~CacheBusHPWTStall;
|
|
||||||
assign ValidMisalignedM = MisalignedM & ~SelHPTW;
|
|
||||||
|
|
||||||
always_ff @(posedge clk)
|
always_ff @(posedge clk)
|
||||||
if (reset | FlushM) CurrState <= #1 STATE_READY;
|
if (reset | FlushM) CurrState <= #1 STATE_READY;
|
||||||
@ -154,7 +151,7 @@ module align import cvw::*; #(parameter cvw_t P) (
|
|||||||
|
|
||||||
// shifter (4:1 mux for 32 bit, 8:1 mux for 64 bit)
|
// shifter (4:1 mux for 32 bit, 8:1 mux for 64 bit)
|
||||||
// 8 * is for shifting by bytes not bits
|
// 8 * is for shifting by bytes not bits
|
||||||
assign ShiftAmount = ValidMisalignedM ? 8 * AccessByteOffsetM : '0;
|
assign ShiftAmount = MisalignedM & ~SelHPTW ? {AccessByteOffsetM, 3'b0} : '0; // AND gate
|
||||||
assign ReadDataWordSpillShiftedM = ReadDataWordSpillAllM >> ShiftAmount;
|
assign ReadDataWordSpillShiftedM = ReadDataWordSpillAllM >> ShiftAmount;
|
||||||
assign DCacheReadDataWordSpillM = ReadDataWordSpillShiftedM[P.LLEN-1:0];
|
assign DCacheReadDataWordSpillM = ReadDataWordSpillShiftedM[P.LLEN-1:0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user