From 198b0720382c19dffa1debfdd34bdc86572aab81 Mon Sep 17 00:00:00 2001 From: choucl Date: Fri, 22 Sep 2023 16:16:47 +0800 Subject: [PATCH] Update CsrId type --- src/OboeDecoder.bsv | 2 +- src/OboeTypeDef.bsv | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OboeDecoder.bsv b/src/OboeDecoder.bsv index 0c7501a..7b98be0 100644 --- a/src/OboeDecoder.bsv +++ b/src/OboeDecoder.bsv @@ -385,7 +385,7 @@ module mkOboeDecoder(OboeDecoder); rs2: 0, rd: decoded_inst.rd, imm: zeroExtend(pack(decoded_inst.rs1)), - csr: inst[31:20], + csr: unpack(decoded_inst.imm), fu: tagged CSRU csru_ctrl, trap: (isInvalid)? tagged Valid TrapCause {isInterrupt: False, code: 2} : tagged Invalid }; diff --git a/src/OboeTypeDef.bsv b/src/OboeTypeDef.bsv index 3337e21..31bdf15 100644 --- a/src/OboeTypeDef.bsv +++ b/src/OboeTypeDef.bsv @@ -32,7 +32,7 @@ typedef Bit#(XLEN) Word; // Typdef: CsrId // Identifier of CSR -typedef Bit#(12) CsrId; +typedef UInt#(12) CsrId; // Section: Decoder type definitions