Skip to content

Commit a6e1fa2

Browse files
authored
csr_regfile.sv: use CVA6Cfg.ASID_WIDTH instead of AsidWidth (fix cv64a6) (#1956)
1 parent 9ecdaa1 commit a6e1fa2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/csr_regfile.sv

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module csr_regfile
2121
parameter type irq_ctrl_t = logic,
2222
parameter type scoreboard_entry_t = logic,
2323
parameter type rvfi_probes_csr_t = logic,
24-
parameter int AsidWidth = 1,
2524
parameter int unsigned MHPMCounterNum = 6
2625
) (
2726
// Subsystem Clock - SUBSYSTEM
@@ -100,7 +99,7 @@ module csr_regfile
10099
// TO_BE_COMPLETED - EX_STAGE
101100
output logic [CVA6Cfg.PPNW-1:0] satp_ppn_o,
102101
// TO_BE_COMPLETED - EX_STAGE
103-
output logic [AsidWidth-1:0] asid_o,
102+
output logic [CVA6Cfg.ASID_WIDTH-1:0] asid_o,
104103
// external interrupt in - SUBSYSTEM
105104
input logic [1:0] irq_i,
106105
// inter processor interrupt -> connected to machine mode sw - SUBSYSTEM
@@ -828,9 +827,9 @@ module csr_regfile
828827
// intercept SATP writes if in S-Mode and TVM is enabled
829828
if (priv_lvl_o == riscv::PRIV_LVL_S && mstatus_q.tvm) update_access_exception = 1'b1;
830829
else begin
831-
satp = satp_t'(csr_wdata);
830+
satp = satp_t'(csr_wdata);
832831
// only make ASID_LEN - 1 bit stick, that way software can figure out how many ASID bits are supported
833-
satp.asid = satp.asid & {{(CVA6Cfg.ASIDW - AsidWidth) {1'b0}}, {AsidWidth{1'b1}}};
832+
satp.asid = satp.asid & {{(CVA6Cfg.ASIDW - CVA6Cfg.ASID_WIDTH) {1'b0}}, {CVA6Cfg.ASID_WIDTH{1'b1}}};
834833
// only update if we actually support this mode
835834
if (config_pkg::vm_mode_t'(satp.mode) == config_pkg::ModeOff ||
836835
config_pkg::vm_mode_t'(satp.mode) == CVA6Cfg.MODE_SV)
@@ -1551,7 +1550,7 @@ module csr_regfile
15511550
assign fprec_o = fcsr_q.fprec;
15521551
// MMU outputs
15531552
assign satp_ppn_o = satp_q.ppn;
1554-
assign asid_o = satp_q.asid[AsidWidth-1:0];
1553+
assign asid_o = satp_q.asid[CVA6Cfg.ASID_WIDTH-1:0];
15551554
assign sum_o = mstatus_q.sum;
15561555
// we support bare memory addressing and SV39
15571556
assign en_translation_o = ((CVA6Cfg.RVS && config_pkg::vm_mode_t'(satp_q.mode) == CVA6Cfg.MODE_SV) &&

0 commit comments

Comments
 (0)