Add generate to avoid elaborating internals of PMP/triggers with 0 PMP regions or triggers.
This commit is contained in:
parent
18c64bd633
commit
9eb8590858
|
@ -39,6 +39,19 @@ localparam PMP_A_NAPOT = 2'b11;
|
||||||
|
|
||||||
`include "hazard3_csr_addr.vh"
|
`include "hazard3_csr_addr.vh"
|
||||||
|
|
||||||
|
generate
|
||||||
|
if (PMP_REGIONS == 0) begin: no_pmp
|
||||||
|
|
||||||
|
// This should already be stubbed out in core.v, but use a generate here too
|
||||||
|
// so that we don't get a warning for elaborating this module with a region
|
||||||
|
// count of 0.
|
||||||
|
|
||||||
|
always @ (*) cfg_rdata = {W_DATA{1'b0}};
|
||||||
|
assign i_kill = 1'b0;
|
||||||
|
assign d_kill = 1'b0;
|
||||||
|
|
||||||
|
end else begin: have_pmp
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Config registers and read/write interface
|
// Config registers and read/write interface
|
||||||
|
|
||||||
|
@ -279,6 +292,9 @@ assign i_kill = i_partial_match || (
|
||||||
(!i_m_mode || i_l || i_m) && !i_x
|
(!i_m_mode || i_l || i_m) && !i_x
|
||||||
);
|
);
|
||||||
|
|
||||||
|
end
|
||||||
|
endgenerate
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
`ifndef YOSYS
|
`ifndef YOSYS
|
||||||
|
|
|
@ -36,6 +36,19 @@ module hazard3_triggers #(
|
||||||
|
|
||||||
`include "hazard3_csr_addr.vh"
|
`include "hazard3_csr_addr.vh"
|
||||||
|
|
||||||
|
generate
|
||||||
|
if (BREAKPOINT_TRIGGERS == 0) begin: no_triggers
|
||||||
|
|
||||||
|
// The instantiation of this block should already be stubbed out in core.v if
|
||||||
|
// there are no triggers, but we still get warnings for elaborating this
|
||||||
|
// module with zero triggers, so add a generate block here too.
|
||||||
|
|
||||||
|
always @ (*) cfg_rdata = {W_DATA{1'b0}};
|
||||||
|
assign break_any = 1'b0;
|
||||||
|
assign break_d_mode = 1'b0;
|
||||||
|
|
||||||
|
end else begin: have_triggers
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Configuration state
|
// Configuration state
|
||||||
|
|
||||||
|
@ -156,6 +169,9 @@ end
|
||||||
assign break_any = |want_m_mode_break || |want_d_mode_break;
|
assign break_any = |want_m_mode_break || |want_d_mode_break;
|
||||||
assign break_d_mode = |want_d_mode_break;
|
assign break_d_mode = |want_d_mode_break;
|
||||||
|
|
||||||
|
end
|
||||||
|
endgenerate
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
`ifndef YOSYS
|
`ifndef YOSYS
|
||||||
|
|
Loading…
Reference in New Issue