From 9e47fca2b71a9cef682eebceff978d7ab926e20f Mon Sep 17 00:00:00 2001 From: David Harris Date: Tue, 3 May 2022 10:10:28 +0000 Subject: [PATCH] Changed loop variable in CLINT because of error only seen on VLSI --- pipelined/src/uncore/clint.sv | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pipelined/src/uncore/clint.sv b/pipelined/src/uncore/clint.sv index b0b275a3..5dbb89b8 100644 --- a/pipelined/src/uncore/clint.sv +++ b/pipelined/src/uncore/clint.sv @@ -52,7 +52,7 @@ module clint ( logic initTrans; (* mark_debug = "true" *) logic [63:0] MTIMECMP; logic [`XLEN/8-1:0] ByteMaskM; - integer i; + integer i, j; 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 @@ -94,7 +94,7 @@ module clint ( if (entryd == 16'h4000) begin for(i=0;i<`XLEN/8;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 @@ -107,9 +107,9 @@ module clint ( // MTIMECMP is not reset end else if (memwrite & entryd == 16'hBFF8) begin // MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed - for(i=0;i<`XLEN/8;i++) - if(ByteMaskM[i]) - MTIME[i*8 +: 8] <= HWDATA[i*8 +: 8]; + for(j=0;j<`XLEN/8;j++) + if(ByteMaskM[j]) + MTIME[j*8 +: 8] <= HWDATA[j*8 +: 8]; end else MTIME <= MTIME + 1; end else begin:clint // 32-bit always @(posedge HCLK) begin @@ -130,13 +130,13 @@ module clint ( end else if (memwrite) begin if (entryd == 16'h0000) MSIP <= HWDATA[0]; if (entryd == 16'h4000) - for(i=0;i<`XLEN/8;i++) - if(ByteMaskM[i]) - MTIMECMP[i*8 +: 8] <= HWDATA[i*8 +: 8]; + for(j=0;j<`XLEN/8;j++) + if(ByteMaskM[j]) + MTIMECMP[j*8 +: 8] <= HWDATA[j*8 +: 8]; if (entryd == 16'h4004) - for(i=0;i<`XLEN/8;i++) - if(ByteMaskM[i]) - MTIMECMP[32 + i*8 +: 8] <= HWDATA[i*8 +: 8]; + for(j=0;j<`XLEN/8;j++) + if(ByteMaskM[j]) + MTIMECMP[32 + j*8 +: 8] <= HWDATA[j*8 +: 8]; // MTIME Counter. Eventually change this to run off separate clock. Synchronization then needed end