From 53477b2c85a9f0c467d67c639de7dd0f89ea127f Mon Sep 17 00:00:00 2001 From: David Harris Date: Fri, 14 Jun 2024 07:08:17 -0700 Subject: [PATCH] Code cleanup --- src/fpu/postproc/shiftcorrection.sv | 2 +- src/lsu/amoalu.sv | 2 +- src/privileged/csrsr.sv | 2 +- src/uncore/clint_apb.sv | 2 +- studies/ppa/ppa.sv | 2 -- testbench/common/DCacheFlushFSM.sv | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/fpu/postproc/shiftcorrection.sv b/src/fpu/postproc/shiftcorrection.sv index b7829a62e..03ec66a72 100644 --- a/src/fpu/postproc/shiftcorrection.sv +++ b/src/fpu/postproc/shiftcorrection.sv @@ -51,7 +51,7 @@ module shiftcorrection import cvw::*; #(parameter cvw_t P) ( logic LeftShiftQm; // should the divsqrt result be shifted one to the left logic RightShift; // shift right by 1 - // *** 4/16/24 this code is a mess and needs cleaning and explaining + // dh 4/16/24 this code is a mess and needs cleaning and explaining // define bit widths // seems to shift by 0, 1, or 2. right and left shift is confusing diff --git a/src/lsu/amoalu.sv b/src/lsu/amoalu.sv index 194573d21..bc8a29471 100644 --- a/src/lsu/amoalu.sv +++ b/src/lsu/amoalu.sv @@ -73,7 +73,7 @@ module amoalu import cvw::*; #(parameter cvw_t P) ( 5'b10100: y = cmp ? a : b; // amomax 5'b11000: y = cmp ? a : b; // amominu 5'b11100: y = cmp ? a : b; // amomaxu - default: y = 'x; // undefined; *** could change to b for efficiency + default: y = 'x; // undefined endcase // sign extend output if necessary for w64 diff --git a/src/privileged/csrsr.sv b/src/privileged/csrsr.sv index 18a171856..22f34124c 100644 --- a/src/privileged/csrsr.sv +++ b/src/privileged/csrsr.sv @@ -66,7 +66,7 @@ module csrsr import cvw::*; #(parameter cvw_t P) ( STATUS_XS, STATUS_FS, /*STATUS_MPP, 2'b0*/ 4'b0, STATUS_SPP, /*STATUS_MPIE*/ 1'b0, STATUS_UBE, STATUS_SPIE, /*1'b0, STATUS_MIE, 1'b0*/ 3'b0, STATUS_SIE, 1'b0}; - assign MSTATUSH_REGW = '0; // *** does not exist when XLEN=64, but don't want it to have an undefined value. Spec is not clear what it should be. + assign MSTATUSH_REGW = '0; // does not exist when XLEN=64, and accessing will throw an illegal instruction end else begin: csrsr32 // RV32 assign MSTATUS_REGW = {STATUS_SD, 8'b0, STATUS_TSR, STATUS_TW, STATUS_TVM, STATUS_MXR, STATUS_SUM, STATUS_MPRV, diff --git a/src/uncore/clint_apb.sv b/src/uncore/clint_apb.sv index 1f69a4529..b5fc920f1 100644 --- a/src/uncore/clint_apb.sv +++ b/src/uncore/clint_apb.sv @@ -85,7 +85,7 @@ module clint_apb import cvw::*; #(parameter cvw_t P) ( if (entry == CLINT_MTIMECMP) begin for(i=0;i> $clog2(P.XLEN/8)] = cacheline[P.XLEN*(k+1)-1:P.XLEN*k]; /* verilator lint_off WIDTHTRUNC */ - // *** lint error: address trunc warning for shadowram index + // avoid lint error: address trunc warning for shadowram index ShadowRAM[(CacheAdr[j][i][l] >> $clog2(P.XLEN/8)) + {{{P.PA_BITS-32}{1'b0}}, k}] = CacheData[j][i][l][P.XLEN*k +: P.XLEN]; /* verilator lint_on WIDTHTRUNC */ end