added 1 tick delay to dtim flops

This commit is contained in:
bbracker 2021-03-25 02:23:30 -04:00
parent 02e924e55a
commit a3788eb218

View File

@ -85,15 +85,15 @@ module dtim #(parameter BASE=0, RANGE = 65535) (
generate
if (`XLEN == 64) begin
always_ff @(posedge HCLK) begin
HWADDR <= A;
HREADTim0 <= RAM[A[31:3]];
if (memwrite && risingHREADYTim) RAM[HWADDR[31:3]] <= HWDATA;
HWADDR <= #1 A;
HREADTim0 <= #1 RAM[A[31:3]];
if (memwrite && risingHREADYTim) RAM[HWADDR[31:3]] <= #1 HWDATA;
end
end else begin
always_ff @(posedge HCLK) begin
HWADDR <= A;
HREADTim0 <= RAM[A[31:2]];
if (memwrite && risingHREADYTim) RAM[HWADDR[31:2]] <= HWDATA;
HWADDR <= #1 A;
HREADTim0 <= #1 RAM[A[31:2]];
if (memwrite && risingHREADYTim) RAM[HWADDR[31:2]] <= #1 HWDATA;
end
end
endgenerate