In reply to ak180:
Changed your code.
module m;
`include "uvm_macros.svh" import uvm_pkg::*;
bit clk, busy, valid;
/* busy ___|-------------|_____
valid _____|-------|________ */
/* sequence seq_busy;
$rose(busy) ##[1:$] $fell(busy);
endsequence
sequence seq_valid;
$rose(valid) ##[1:$] $fell(valid);
endsequence */
initial forever #10 clk = !clk;
ap_busy_valid: assert property (@(posedge clk)
$rose(busy) |-> ##1 // is ##1 Needed?? Depends on requirements
$rose(valid)[->1] ##1 $fell(valid)[->1] intersect $fell(busy)[=1] );
initial begin
repeat (90) begin
@(posedge clk); #2;
if (!randomize(busy, valid) with {
busy dist {1'b1 := 8, 1'b0 := 1};
valid dist {1'b1 := 1, 1'b0 := 1};
}) `uvm_error("MYERR", "This is a randomize error");
end
$finish;
end
endmodule
Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448
…
- SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats | Verification Academy
- Free books: Component Design by Example FREE BOOK: Component Design by Example … A Step-by-Step Process Using VHDL with UART as Vehicle | Verification Academy
Real Chip Design and Verification Using Verilog and VHDL($3) https://rb.gy/cwy7nb - Papers:
- Understanding the SVA Engine,
Verification Horizons - July 2020 | Verification Academy - SVA Alternative for Complex Assertions
Verification Horizons - March 2018 Issue | Verification Academy - SVA in a UVM Class-based Environment
SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy
Udemy courses by Srinivasan Venkataramanan (http://cvcblr.com/home.html)
https://www.udemy.com/course/sva-basic/
https://www.udemy.com/course/sv-pre-uvm/