Negative parameter indexes
A recent addition to the CV32E40X (sha 4206fff4 on 2021-04-27) introduced "negative indexes" for the PMA_CFG
parameter. An example of this is bhv/cv32e40x_wrapper.sv
:
module cv32e40x_wrapper
import cv32e40x_pkg::*;
#(
parameter NUM_MHPMCOUNTERS = 1,
parameter int unsigned PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG [PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
The default value of PMA_NUM_REGIONS
is zero which means the range of PMA_CFG
is [-1:0]. Most SV simulators will accept this, but Metrics DSIM interprets SV parameters as unsigned values (which, I believe is correct) and therefore the size of PMA_CFG is (2**31)-1 which exceeds a built-in DSIM limit.