mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Changed loop variable in CLINT because of error only seen on VLSI
This commit is contained in:
parent
208827502e
commit
7268ff1fd4
@ -52,7 +52,7 @@ module clint (
|
|||||||
logic initTrans;
|
logic initTrans;
|
||||||
(* mark_debug = "true" *) logic [63:0] MTIMECMP;
|
(* mark_debug = "true" *) logic [63:0] MTIMECMP;
|
||||||
logic [`XLEN/8-1:0] ByteMaskM;
|
logic [`XLEN/8-1:0] ByteMaskM;
|
||||||
integer i;
|
integer i, j;
|
||||||
|
|
||||||
assign initTrans = HREADY & HSELCLINT & (HTRANS != 2'b00);
|
assign initTrans = HREADY & HSELCLINT & (HTRANS != 2'b00);
|
||||||
// entryd and memwrite are delayed by a cycle because AHB controller waits a cycle before outputting write data
|
// entryd and memwrite are delayed by a cycle because AHB controller waits a cycle before outputting write data
|
||||||
@ -94,7 +94,7 @@ module clint (
|
|||||||
if (entryd == 16'h4000) begin
|
if (entryd == 16'h4000) begin
|
||||||
for(i=0;i<`XLEN/8;i++)
|
for(i=0;i<`XLEN/8;i++)
|
||||||
if(ByteMaskM[i])
|
if(ByteMaskM[i])
|
||||||
MTIMECMP[i*8 +: 8] <= HWDATA[i*8 +: 8];
|
MTIMECMP[i*8 +: 8] <= HWDATA[i*8 +: 8]; // ***dh: this notation isn't in book yet - maybe from Ross
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -107,9 +107,9 @@ module clint (
|
|||||||
// MTIMECMP is not reset
|
// MTIMECMP is not reset
|
||||||
end else if (memwrite & entryd == 16'hBFF8) begin
|
end else if (memwrite & entryd == 16'hBFF8) begin
|
||||||
// MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed
|
// MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed
|
||||||
for(i=0;i<`XLEN/8;i++)
|
for(j=0;j<`XLEN/8;j++)
|
||||||
if(ByteMaskM[i])
|
if(ByteMaskM[j])
|
||||||
MTIME[i*8 +: 8] <= HWDATA[i*8 +: 8];
|
MTIME[j*8 +: 8] <= HWDATA[j*8 +: 8];
|
||||||
end else MTIME <= MTIME + 1;
|
end else MTIME <= MTIME + 1;
|
||||||
end else begin:clint // 32-bit
|
end else begin:clint // 32-bit
|
||||||
always @(posedge HCLK) begin
|
always @(posedge HCLK) begin
|
||||||
@ -130,13 +130,13 @@ module clint (
|
|||||||
end else if (memwrite) begin
|
end else if (memwrite) begin
|
||||||
if (entryd == 16'h0000) MSIP <= HWDATA[0];
|
if (entryd == 16'h0000) MSIP <= HWDATA[0];
|
||||||
if (entryd == 16'h4000)
|
if (entryd == 16'h4000)
|
||||||
for(i=0;i<`XLEN/8;i++)
|
for(j=0;j<`XLEN/8;j++)
|
||||||
if(ByteMaskM[i])
|
if(ByteMaskM[j])
|
||||||
MTIMECMP[i*8 +: 8] <= HWDATA[i*8 +: 8];
|
MTIMECMP[j*8 +: 8] <= HWDATA[j*8 +: 8];
|
||||||
if (entryd == 16'h4004)
|
if (entryd == 16'h4004)
|
||||||
for(i=0;i<`XLEN/8;i++)
|
for(j=0;j<`XLEN/8;j++)
|
||||||
if(ByteMaskM[i])
|
if(ByteMaskM[j])
|
||||||
MTIMECMP[32 + i*8 +: 8] <= HWDATA[i*8 +: 8];
|
MTIMECMP[32 + j*8 +: 8] <= HWDATA[j*8 +: 8];
|
||||||
// MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed
|
// MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user