In reply to chandnidodiya:
Where are you applying the assertion?
If it’s in the interface then you can use my package at
https://verificationacademy.com/forums/systemverilog/sva-package-dynamic-and-range-delays-and-repeats
From the package you need to apply
sequence dynamic_delay(count);
int v;
(count<=0) or ((1, v=count) ##0 (v>0, v=v-1) [*0:$] ##1 v<=0);
endsequence // dynamic_delay
// in your interface
interface name;
import sva_delay_repeat_range_pkg::*;
int delay=2; // can be reassigned as needed later on
property p;
int v;
(1, v=input1) ##0 dynamic_delay(delay) ##0 output1==v;
endproperty
ap_dyn_delay: assert property(@(posedge clk) p);
From your code, it seems that you want to do the assertion from the class.
SVA does not support uses in classes, but you have 2 options:
- Copy the class variables into the virtual interface that has the SVA as shown above.
I addressed that in my paper SVA-in-a-UVM-Class-based-Environment - Create a task that at every clock edge initiates a forked task that computes this assertion. Read my paper Understanding the SVA Engine (link to the paper is in my signature).
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 - Reflections on Users’ Experiences with SVA
Reflections on Users’ Experiences with SVA | Verification Horizons - March 2022 | 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/