From 57ea39d6857b5227c19bb46f51a0d64fead0ea9f Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Tue, 23 Jul 2024 16:22:23 -0500 Subject: [PATCH] Fixed rvvi csr counting. --- src/rvvi/rvvisynth.sv | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rvvi/rvvisynth.sv b/src/rvvi/rvvisynth.sv index d4847c9d4..7bdc05d10 100644 --- a/src/rvvi/rvvisynth.sv +++ b/src/rvvi/rvvisynth.sv @@ -123,7 +123,15 @@ module rvvisynth import cvw::*; #(parameter cvw_t P, assign CSRs[(index+1) * (P.XLEN + 12)- 1: index * (P.XLEN + 12)] = {CSRValue[index], CSRAddr[index]}; assign EnabledCSRs[index] = |CSRWenPriorityMatrix[index]; end - assign CSRCountShort = +EnabledCSRs; + + integer index2; + always_comb begin + CSRCountShort = '0; + for(index2 = 0; index2 < MAX_CSRS; index2++) begin + CSRCountShort += EnabledCSRs[index2]; + end + end + assign CSRCount = {{{12-MAX_CSRS}{1'b0}}, CSRCountShort}; assign rvvi = {CSRs, Registers, Required};