[dv/fpv] Clean up FPV script and add EndpointType to tlul_assert.sv This commit strives at eliminating some of the explicitly added demotions (from assert -> assume) in the fpv.tcl file. In particular, tlul_assert module contains now a parameter EndpointType that can either be set to "Host" or "Device", depending on what kind of endpoint it is bound to. Internally, some of the assertions are switched to assumptions based on that parameter. In order to keep code duplication to a minimum, the asserted/assumed sequences have been split out as discrete sequence items such that they are only declared once. The assertion enable/disable functions had to be revised as well, and the tlul_assert interface has been changed into a module. Further, two additional ASSUME macros have been added to prim_assert in order to support immediate assumptions, and the reqParity assertion in the register file is changed into an assumption everywhere. All FPV and DV testbenches have been adapted to use the proper EndpointType. Note that the behavior of the assertions/assumptions will remain the same for all DV sims, but it changes the way they behave in FPV.
diff --git a/hw/ip/pinmux/fpv/pinmux_fpv.core b/hw/ip/pinmux/fpv/pinmux_fpv.core index 88f5de5..5f01ff8 100644 --- a/hw/ip/pinmux/fpv/pinmux_fpv.core +++ b/hw/ip/pinmux/fpv/pinmux_fpv.core
@@ -7,6 +7,7 @@ filesets: files_fpv: depend: + - lowrisc:ip:tlul - lowrisc:ip:pinmux files: - tb/pinmux_tb.sv
diff --git a/hw/ip/pinmux/fpv/tb/pinmux_bind.sv b/hw/ip/pinmux/fpv/tb/pinmux_bind.sv index f60944b..844aa29 100644 --- a/hw/ip/pinmux/fpv/tb/pinmux_bind.sv +++ b/hw/ip/pinmux/fpv/tb/pinmux_bind.sv
@@ -13,4 +13,13 @@ .* ); + bind pinmux tlul_assert #( + .EndpointType("Device") + ) tlul_assert_device ( + .clk_i, + .rst_ni, + .h2d (tl_i), + .d2h (tl_o) + ); + endmodule : pinmux_bind
diff --git a/hw/ip/pinmux/rtl/pinmux_reg_top.sv b/hw/ip/pinmux/rtl/pinmux_reg_top.sv index cd0958d..d1dd6a0 100644 --- a/hw/ip/pinmux/rtl/pinmux_reg_top.sv +++ b/hw/ip/pinmux/rtl/pinmux_reg_top.sv
@@ -969,6 +969,8 @@ `ASSERT(en2addrHit, (reg_we || reg_re) |-> $onehot0(addr_hit), clk_i, !rst_ni) - `ASSERT(reqParity, tl_reg_h2d.a_valid |-> tl_reg_h2d.a_user.parity_en == 1'b0, clk_i, !rst_ni) + // this is formulated as an assumption such that the FPV testbenches do disprove this + // property by mistake + `ASSUME(reqParity, tl_reg_h2d.a_valid |-> tl_reg_h2d.a_user.parity_en == 1'b0, clk_i, !rst_ni) endmodule