How to write Assertion for 3 clock?

specification:
how to write a assertion for check clk frequency?
sys_clk 50-300MHZ
flash_clk 200MHZ
flash_clk1 300-400MHz
in form of MAX:MIN:NOMINAL

In reply to anjali swarnkar:
See Clock Frequency Checker | Verification Academy

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

In reply to ben@SystemVerilog.us:

BTW, use realtime instead of time Anyway, back to your question.

  
property p_clk_hi; 
	  realtime v; 
	  @(posedge clk) (1, v=$time) |-> @(negedge clk) ($realtime-v)==300ns;
endproperty 
ap_clk_hi: assert property(p_clk_hi);  
// Above measures the time btween a posedse of clk and any negedge thereafter. 
// For a normal clock, if you expect a duty cycle of 300HI and 700lo, 
// that and chcecks the hi time.  If there is a gligtch, the assertion will fail as 
// the time will not be 300ns. 
 
	property p_clk_lo; 
	  readtime v; 
	  @(negedge clk) (1, v=$time) |-> @(posedge clk) ($realtime-v)==700ns;
	endproperty 
    ap_clk_lo: assert property(p_clk_lo); 
// same thing here for the time the clock is lo. 

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