Assertions Examples
Assertions Examples
property check_clk;
realtime current_time;
realtime difference;
difference == 10ns;
endproperty
#100ns; \
force ``x = 1; \
#200ns; \
release ``x; \
#200ns; \
force ``x = 0; \
#200ns; \
release ``x; \
#400ns;
`CONNECTIVITY_CHECK(tb.dut.a);
//a is asserted high on each clock cycle and after 2 clk cycles b has to be asserted
high
property asserthigh
endproperty
//a has to be asserted high in the same clk cycle b has to be asserted as well
property assertoverlap
endproperty
property nonoverlap;
endproperty
assert $rose(a) |=> (b throughout (!c[->1])); //b has to e=be high continuously until c
goes low
-------------
property reset_sig(clk,ARESETn)
end property
- During reset :
property valid_data(
$stable(AWID) &&
$stable(AWLEN) &&
$stable(AWPROT)
))
);
assert property (
@(posedge clk) AWVALID -> (AWLEN >= min && AWLEN <= max)
endproperty
xxx_range: assert property (xxx_range(0,15)
property valid_trans(valid,ready);
@(posedge aclk)
end property
- length encoding
property range_inside;
end property
- Error assertion
property valid_check(
@(posedge ACLK)
endproperty
- property valid_check(
endproperty
Assert_valid_check: assert()
- WRITE BURST
sequence s;
endsequence
property wr_burst(
WREADY==1 &&$stable(WDATA))[->1:4]
endproperty
-- write burst
property xyz
@(posedge ACLK)
endproperty
- out of transaction
sequence s;
endsequence