Guest
I have defined a couple of generic properties to detect fifo overflow
or underflow (see below).
property no_overflow(clock, reset, signal, watermark);
@(posedge clock) disable iff(!reset)
((signal == (watermark-1)) |=> ((signal <= (watermark-1)) &&
(signal > 0)));
endproperty : no_overflow
property no_underflow(clock, reset, signal, watermark);
@(posedge clock) disable iff(!reset)
((signal == 0) |=> ((signal < (watermark-1)) && (signal >= 0)));
endproperty : no_underflow
I use these properties as follows:
assert_ingress_desc_a_fifo_no_ofl:
assert property (no_overflow(clk, ring_rst_n[0],
ingress_desc_fifo_a_usedw, 128));
assert_ingress_desc_a_fifo_no_ufl:
assert property (no_underflow(clk, ring_rst_n[0],
ingress_desc_fifo_a_usedw, 128));
I would like to have one copy of the property definitions located in
one file. It can be one of my existing rtl modules or a separate file
with just the property definitions and I would like to put the
assertions in whichever modules contain fifos. Is there a way to do
this? When I tried putting the definitions in my top level module and
the assertions in a lower level module I got an error message that the
"clk must be explicit".
Thanks.
Brian
or underflow (see below).
property no_overflow(clock, reset, signal, watermark);
@(posedge clock) disable iff(!reset)
((signal == (watermark-1)) |=> ((signal <= (watermark-1)) &&
(signal > 0)));
endproperty : no_overflow
property no_underflow(clock, reset, signal, watermark);
@(posedge clock) disable iff(!reset)
((signal == 0) |=> ((signal < (watermark-1)) && (signal >= 0)));
endproperty : no_underflow
I use these properties as follows:
assert_ingress_desc_a_fifo_no_ofl:
assert property (no_overflow(clk, ring_rst_n[0],
ingress_desc_fifo_a_usedw, 128));
assert_ingress_desc_a_fifo_no_ufl:
assert property (no_underflow(clk, ring_rst_n[0],
ingress_desc_fifo_a_usedw, 128));
I would like to have one copy of the property definitions located in
one file. It can be one of my existing rtl modules or a separate file
with just the property definitions and I would like to put the
assertions in whichever modules contain fifos. Is there a way to do
this? When I tried putting the definitions in my top level module and
the assertions in a lower level module I got an error message that the
"clk must be explicit".
Thanks.
Brian