Skip to content

Commit

Permalink
[rv_core_ibex,rtl] Parametrize alert_handler dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Schilling <[email protected]>
  • Loading branch information
Razer6 authored and andreaskurth committed Dec 2, 2024
1 parent 1eb96b3 commit 6e3f575
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 5 deletions.
16 changes: 16 additions & 0 deletions hw/ip/rv_core_ibex/data/rv_core_ibex.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,22 @@
randtype: "data"
},

{ name: "NEscalationSeverities"
type: "int unsigned"
default: "4"
desc: "Number of escalation severities"
local: "true"
expose: "true"
},

{ name: "WidthPingCounter"
type: "int unsigned"
default: "16"
desc: "Width of the ping counter"
local: "true"
expose: "true"
},

{ name: "PMPEnable"
type: "bit"
default: "1'b0"
Expand Down
8 changes: 5 additions & 3 deletions hw/ip/rv_core_ibex/rtl/rv_core_ibex.sv
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ module rv_core_ibex
parameter logic [ibex_pkg::SCRAMBLE_KEY_W-1:0] RndCnstIbexKeyDefault =
ibex_pkg::RndCnstIbexKeyDefault,
parameter logic [ibex_pkg::SCRAMBLE_NONCE_W-1:0] RndCnstIbexNonceDefault =
ibex_pkg::RndCnstIbexNonceDefault
ibex_pkg::RndCnstIbexNonceDefault,
parameter int unsigned NEscalationSeverities = 4,
parameter int unsigned WidthPingCounter = 16
) (
// Clock and Reset
input logic clk_i,
Expand Down Expand Up @@ -231,8 +233,8 @@ module rv_core_ibex
// protocol into single ended signal.
logic esc_irq_nm;
prim_esc_receiver #(
.N_ESC_SEV (alert_handler_reg_pkg::N_ESC_SEV),
.PING_CNT_DW (alert_handler_reg_pkg::PING_CNT_DW)
.N_ESC_SEV (NEscalationSeverities),
.PING_CNT_DW (WidthPingCounter)
) u_prim_esc_receiver (
.clk_i ( clk_esc_i ),
.rst_ni ( rst_esc_ni ),
Expand Down
1 change: 0 additions & 1 deletion hw/ip/rv_core_ibex/rv_core_ibex.core
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ filesets:
- lowrisc:ip_interfaces:pwrmgr_pkg
- lowrisc:ip:rv_core_ibex_pkg
- lowrisc:ip:tlul
- lowrisc:ip_interfaces:alert_handler_reg
- lowrisc:prim:all
- lowrisc:prim:clock_gating
- lowrisc:prim:edn_req
Expand Down
20 changes: 20 additions & 0 deletions hw/top_earlgrey/data/autogen/top_earlgrey.gen.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -8277,6 +8277,8 @@
DmHaltAddr: tl_main_pkg::ADDR_SPACE_RV_DM__MEM + dm::HaltAddress[31:0]
DmExceptionAddr: tl_main_pkg::ADDR_SPACE_RV_DM__MEM + dm::ExceptionAddress[31:0]
PipeLine: "0"
NEscalationSeverities: alert_handler_reg_pkg::N_ESC_SEV
WidthPingCounter: alert_handler_reg_pkg::PING_CNT_DW
}
clock_srcs:
{
Expand Down Expand Up @@ -8371,6 +8373,24 @@
default: 0x5279fcbcd2bd2c13
randwidth: 64
}
{
name: NEscalationSeverities
desc: Number of escalation severities
type: int unsigned
default: alert_handler_reg_pkg::N_ESC_SEV
local: "true"
expose: "true"
name_top: RvCoreIbexNEscalationSeverities
}
{
name: WidthPingCounter
desc: Width of the ping counter
type: int unsigned
default: alert_handler_reg_pkg::PING_CNT_DW
local: "true"
expose: "true"
name_top: RvCoreIbexWidthPingCounter
}
{
name: PMPEnable
desc: Enable PMP
Expand Down
4 changes: 3 additions & 1 deletion hw/top_earlgrey/data/top_earlgrey.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,9 @@
SecureIbex: "1",
DmHaltAddr: "tl_main_pkg::ADDR_SPACE_RV_DM__MEM + dm::HaltAddress[31:0]",
DmExceptionAddr: "tl_main_pkg::ADDR_SPACE_RV_DM__MEM + dm::ExceptionAddress[31:0]",
PipeLine: "0"
PipeLine: "0",
NEscalationSeverities: "alert_handler_reg_pkg::N_ESC_SEV",
WidthPingCounter: "alert_handler_reg_pkg::PING_CNT_DW"
},
clock_srcs: {
clk_i: "main",
Expand Down
5 changes: 5 additions & 0 deletions hw/top_earlgrey/rtl/autogen/top_earlgrey.sv
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ module top_earlgrey #(
import top_earlgrey_rnd_cnst_pkg::*;

// Local Parameters
// local parameters for rv_core_ibex
localparam int unsigned RvCoreIbexNEscalationSeverities = alert_handler_reg_pkg::N_ESC_SEV;
localparam int unsigned RvCoreIbexWidthPingCounter = alert_handler_reg_pkg::PING_CNT_DW;

// Signals
logic [56:0] mio_p2d;
Expand Down Expand Up @@ -2634,6 +2637,8 @@ module top_earlgrey #(
.RndCnstLfsrPerm(RndCnstRvCoreIbexLfsrPerm),
.RndCnstIbexKeyDefault(RndCnstRvCoreIbexIbexKeyDefault),
.RndCnstIbexNonceDefault(RndCnstRvCoreIbexIbexNonceDefault),
.NEscalationSeverities(RvCoreIbexNEscalationSeverities),
.WidthPingCounter(RvCoreIbexWidthPingCounter),
.PMPEnable(RvCoreIbexPMPEnable),
.PMPGranularity(RvCoreIbexPMPGranularity),
.PMPNumRegions(RvCoreIbexPMPNumRegions),
Expand Down

0 comments on commit 6e3f575

Please sign in to comment.