How to write assertions for a Clock divider

In reply to pk_94:


//structurally, the first_match() is not needed here 
($rose(div_clk[n]) ,local_cnte=0) |=> first_match((1'b1,local_cnte=local_cnte+1)[*(VALUE/2)])##0 $fell(div_clk[n]);

// But the above is same as 
let MY_DELAY = VALUE; // VALUE is a constant 
$rose(div_clk[n]) |=> ##MY_DELAY $fell(div_clk[n]);
 

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact Home - My cvcblr


  1. VF Horizons:PAPER: SVA Alternative for Complex Assertions | Verification Academy
  2. http://systemverilog.us/vf/SolvingComplexUsersAssertions.pdf
  3. “Using SVA for scoreboarding and TB designs”
    http://systemverilog.us/papers/sva4scoreboarding.pdf
  4. “Assertions Instead of FSMs/logic for Scoreboarding and Verification”
    October 2013 | Volume 9, Issue 3 | Verification Academy
  5. SVA in a UVM Class-based Environment
    SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy