Skip to content

Commit 2155d0e

Browse files
* Fix #2400: define new PmpNapotEn parameter to disable NAPOT * Fix #2665 by removing NA4 related RTL lines * Fix Spyglass * Fix gate count
1 parent 86a80f0 commit 2155d0e

21 files changed

+26
-9
lines changed

.gitlab-ci/expected_synth.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cv32a65x:
2-
gates: 188652
2+
gates: 184679

core/csr_regfile.sv

+2-2
Original file line numberDiff line numberDiff line change
@@ -2680,8 +2680,8 @@ module csr_regfile
26802680
if (!CVA6Cfg.PMPEntryReadOnly[i]) begin
26812681
// PMP locked logic is handled in the CSR write process above
26822682
pmpcfg_next[i] = pmpcfg_d[i];
2683-
// We only support >=8-byte granularity, NA4 is disabled
2684-
if (pmpcfg_d[i].addr_mode == riscv::NA4) begin
2683+
// We only support >=8-byte granularity, NA4 is not supported
2684+
if ((!CVA6Cfg.PMPNapotEn && pmpcfg_d[i].addr_mode == riscv::NAPOT) ||pmpcfg_d[i].addr_mode == riscv::NA4) begin
26852685
pmpcfg_next[i].addr_mode = pmpcfg_q[i].addr_mode;
26862686
end
26872687
// Follow collective WARL spec for RWX fields

core/include/build_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ package build_config_pkg;
108108
cfg.PMPCfgRstVal = CVA6Cfg.PMPCfgRstVal;
109109
cfg.PMPAddrRstVal = CVA6Cfg.PMPAddrRstVal;
110110
cfg.PMPEntryReadOnly = CVA6Cfg.PMPEntryReadOnly;
111+
cfg.PMPNapotEn = CVA6Cfg.PMPNapotEn;
111112
cfg.NOCType = CVA6Cfg.NOCType;
112113
cfg.NrNonIdempotentRules = CVA6Cfg.NrNonIdempotentRules;
113114
cfg.NonIdempotentAddrBase = CVA6Cfg.NonIdempotentAddrBase;

core/include/config_pkg.sv

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ package config_pkg;
112112
logic [63:0][63:0] PMPAddrRstVal;
113113
// PMP CSR read-only bits
114114
bit [63:0] PMPEntryReadOnly;
115+
// PMP NA4 and NAPOT mode enable
116+
bit PMPNapotEn;
115117
// PMA non idempotent rules number
116118
int unsigned NrNonIdempotentRules;
117119
// PMA NonIdempotent region base address
@@ -291,6 +293,7 @@ package config_pkg;
291293
logic [63:0][63:0] PMPCfgRstVal;
292294
logic [63:0][63:0] PMPAddrRstVal;
293295
bit [63:0] PMPEntryReadOnly;
296+
bit PMPNapotEn;
294297
noc_type_e NOCType;
295298
int unsigned NrNonIdempotentRules;
296299
logic [NrMaxRules-1:0][63:0] NonIdempotentAddrBase;

core/include/cv32a60x_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ package cva6_config_pkg;
6767
PMPCfgRstVal: {64{64'h0}},
6868
PMPAddrRstVal: {64{64'h0}},
6969
PMPEntryReadOnly: 64'd0,
70+
PMPNapotEn: bit'(0),
7071
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
7172
NrNonIdempotentRules: unsigned'(0),
7273
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv32a65x_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ package cva6_config_pkg;
6767
PMPCfgRstVal: {64{64'h0}},
6868
PMPAddrRstVal: {64{64'h0}},
6969
PMPEntryReadOnly: 64'd0,
70+
PMPNapotEn: bit'(0),
7071
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
7172
NrNonIdempotentRules: unsigned'(0),
7273
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv32a6_embedded_config_pkg_deprecated.sv

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ package cva6_config_pkg;
118118
PMPCfgRstVal: {64{64'h0}},
119119
PMPAddrRstVal: {64{64'h0}},
120120
PMPEntryReadOnly: 64'd0,
121+
PMPNapotEn: bit'(1),
121122
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
122123
NrNonIdempotentRules: unsigned'(2),
123124
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv32a6_ima_sv32_fpga_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv32a6_imac_sv0_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv32a6_imac_sv32_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ package cva6_config_pkg;
118118
PMPCfgRstVal: {64{64'h0}},
119119
PMPAddrRstVal: {64{64'h0}},
120120
PMPEntryReadOnly: 64'd0,
121+
PMPNapotEn: bit'(1),
121122
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
122123
NrNonIdempotentRules: unsigned'(1),
123124
NonIdempotentAddrBase: 1024'({64'b0}),

core/include/cv32a6_imafc_sv32_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imadfcv_sv39_polara_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_L15_BIG_ENDIAN,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdc_sv39_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdc_sv39_hpdcache_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ package cva6_config_pkg;
126126
PMPCfgRstVal: {64{64'h0}},
127127
PMPAddrRstVal: {64{64'h0}},
128128
PMPEntryReadOnly: 64'd0,
129+
PMPNapotEn: bit'(1),
129130
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
130131
NrNonIdempotentRules: unsigned'(2),
131132
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdc_sv39_openpiton_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_L15_BIG_ENDIAN,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdc_sv39_wb_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdch_sv39_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdch_sv39_wb_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_imafdcv_sv39_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ package cva6_config_pkg;
119119
PMPCfgRstVal: {64{64'h0}},
120120
PMPAddrRstVal: {64{64'h0}},
121121
PMPEntryReadOnly: 64'd0,
122+
PMPNapotEn: bit'(1),
122123
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
123124
NrNonIdempotentRules: unsigned'(2),
124125
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/include/cv64a6_mmu_config_pkg.sv

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ package cva6_config_pkg;
7474
PMPCfgRstVal: {64{64'h0}},
7575
PMPAddrRstVal: {64{64'h0}},
7676
PMPEntryReadOnly: 64'd0,
77+
PMPNapotEn: bit'(1),
7778
NOCType: config_pkg::NOC_TYPE_AXI4_ATOP,
7879
NrNonIdempotentRules: unsigned'(2),
7980
NonIdempotentAddrBase: 1024'({64'b0, 64'b0}),

core/pmp/src/pmp_entry.sv

+3-6
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,10 @@ module pmp_entry #(
6464
// synthesis translate_on
6565

6666
end
67-
riscv::NA4, riscv::NAPOT: begin
67+
riscv::NAPOT: begin
6868

69-
if (conf_addr_mode_i == riscv::NA4) size = 2;
70-
else begin
71-
// use the extracted trailing ones
72-
size = {{(32 - $clog2(PLEN)) {1'b0}}, trail_ones} + 3;
73-
end
69+
// use the extracted trailing ones
70+
size = {{(32 - $clog2(PLEN)) {1'b0}}, trail_ones} + 3;
7471

7572
mask = '1 << size;
7673
base = ({2'b0, conf_addr_i} << 2) & mask;

0 commit comments

Comments
 (0)