svgb/rtl/sva_common.svh
Koray Yanik fda176d3b5 Complete rewrite from scratch, bootstrap WIP
Rewrite to use several bus multiplexers, resulting into a less messy
microarchitecture (hopefully). Some more room for cleanup though...

Supports every instruction from the bootstrap rom, more or less.
LY hacked at 0x90 to progress through vsync instantly.
No cartridge is present yet, so we will always fail checksum test and lock up.
2023-10-01 23:00:56 +01:00

40 lines
974 B
Systemverilog

`ifndef SVA_COMMON_SVH
`define SVA_COMMON_SVH
`ifdef SVA_ENABLE
`define SVA_DEF_CLK(clk) \
logic sva_clk; \
assign sva_clk = clk;
`define SVA_DEF_NRESET(nrst) \
logic sva_nreset; \
assign sva_nreset = nrst;
`define SVA_ASSERT_PROP(label, prop, err) \
property label``_prop; \
@(posedge sva_clk) disable iff (!nreset) \
(prop); \
endproperty \
label``_sva: assert property (label``_prop) else $display($sformatf("[%0t] %s", $time, err));
`define SVA_ASSERT_PROP_FATAL(label, prop, err) \
property label``_prop; \
@(posedge sva_clk) disable iff (!nreset) \
(prop); \
endproperty \
label``_sva: assert property (label``_prop) else begin \
$display($sformatf("[%0t] %s", $time, err)); \
$fatal(); \
end
`else /* SVA_ENABLE */
`define SVA_DEF_CLK(clk)
`define SVA_DEF_NRESET(nrst)
`define SVA_ASSERT_PROP(label, prop, err)
`define SVA_ASSERT_PROP_FATAL(label, prop, err)
`endif /* SVA_ENABLE */
`endif /* SVA_COMMON_SVH */