Skip to content

Rename pma_region_t -> pma_cfg_t in RTL and SVA #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bhv/cv32e40x_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module cv32e40x_wrapper
parameter int SMCLIC_ID_WIDTH = 6,
parameter int DBG_NUM_TRIGGERS = 1,
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(
// Clock and Reset
Expand Down
2 changes: 1 addition & 1 deletion rtl/cv32e40x_core.sv
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module cv32e40x_core import cv32e40x_pkg::*;
parameter int SMCLIC_ID_WIDTH = 6,
parameter int DBG_NUM_TRIGGERS = 1,
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(
// Clock and Reset
Expand Down
2 changes: 1 addition & 1 deletion rtl/cv32e40x_if_stage.sv
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module cv32e40x_if_stage import cv32e40x_pkg::*;
parameter bit X_EXT = 0,
parameter int X_ID_WIDTH = 4,
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(
input logic clk,
Expand Down
2 changes: 1 addition & 1 deletion rtl/cv32e40x_load_store_unit.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module cv32e40x_load_store_unit import cv32e40x_pkg::*;
#(
parameter bit A_EXT = 0,
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(
input logic clk,
Expand Down
2 changes: 1 addition & 1 deletion rtl/cv32e40x_mpu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module cv32e40x_mpu import cv32e40x_pkg::*;
parameter type CORE_RESP_TYPE = inst_resp_t,
parameter type BUS_RESP_TYPE = obi_inst_resp_t,
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT})
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT})
(
input logic clk,
input logic rst_n,
Expand Down
4 changes: 2 additions & 2 deletions rtl/cv32e40x_pma.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module cv32e40x_pma import cv32e40x_pkg::*;
#(
parameter bit A_EXT = 0,
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(
input logic [31:0] trans_addr_i,
Expand All @@ -42,7 +42,7 @@ module cv32e40x_pma import cv32e40x_pkg::*;

parameter PMA_ADDR_LSB = 0; // TODO:OE experiment and see if this makes a difference

pma_region_t pma_cfg;
pma_cfg_t pma_cfg;
logic [31:0] word_addr;
logic pma_cfg_atomic;

Expand Down
2 changes: 1 addition & 1 deletion rtl/cv32e40x_write_buffer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
module cv32e40x_write_buffer import cv32e40x_pkg::*;
#(
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(
// clock and reset
Expand Down
24 changes: 12 additions & 12 deletions rtl/include/cv32e40x_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -859,23 +859,23 @@ typedef struct packed {
logic bufferable;
logic cacheable;
logic atomic;
} pma_region_t;
} pma_cfg_t;

// Default attribution when PMA is not configured (PMA_NUM_REGIONS=0) (Address is don't care)
parameter pma_region_t NO_PMA_R_DEFAULT = '{word_addr_low : 0,
word_addr_high : 0,
main : 1'b1,
bufferable : 1'b0,
cacheable : 1'b0,
atomic : 1'b1};

// Default attribution when PMA is configured (Address is don't care)
parameter pma_region_t PMA_R_DEFAULT = '{word_addr_low : 0,
parameter pma_cfg_t NO_PMA_R_DEFAULT = '{word_addr_low : 0,
word_addr_high : 0,
main : 1'b0,
main : 1'b1,
bufferable : 1'b0,
cacheable : 1'b0,
atomic : 1'b0};
atomic : 1'b1};

// Default attribution when PMA is configured (Address is don't care)
parameter pma_cfg_t PMA_R_DEFAULT = '{word_addr_low : 0,
word_addr_high : 0,
main : 1'b0,
bufferable : 1'b0,
cacheable : 1'b0,
atomic : 1'b0};

// MPU status. Used for PMA
typedef enum logic [1:0] {
Expand Down
6 changes: 3 additions & 3 deletions sva/cv32e40x_mpu_sva.sv
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

module cv32e40x_mpu_sva import cv32e40x_pkg::*; import uvm_pkg::*;
#( parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT},
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT},
parameter int unsigned IS_INSTR_SIDE = 0)
(
input logic clk,
Expand All @@ -40,7 +40,7 @@ module cv32e40x_mpu_sva import cv32e40x_pkg::*; import uvm_pkg::*;
// PMA signals
input logic pma_err,
input logic [31:0] pma_addr,
input pma_region_t pma_cfg,
input pma_cfg_t pma_cfg,

// Core OBI signals
input logic [ 1:0] obi_memtype,
Expand Down Expand Up @@ -206,7 +206,7 @@ module cv32e40x_mpu_sva import cv32e40x_pkg::*; import uvm_pkg::*;
endgenerate

// RTL vs SVA expectations
pma_region_t pma_expected_cfg;
pma_cfg_t pma_expected_cfg;
logic pma_expected_err;
always_comb begin
pma_expected_cfg = NO_PMA_R_DEFAULT;
Expand Down
2 changes: 1 addition & 1 deletion sva/cv32e40x_write_buffer_sva.sv
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module cv32e40x_write_buffer_sva
import uvm_pkg::*;
#(
parameter int PMA_NUM_REGIONS = 0,
parameter pma_region_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
parameter pma_cfg_t PMA_CFG[PMA_NUM_REGIONS-1:0] = '{default:PMA_R_DEFAULT}
)
(input logic clk,
input logic rst_n,
Expand Down