How to write a assertion to check no of pos edges of a clock within 120ns from trigger condition

Be cause you have an analog type of requirement (the 120ns). I would use tasks, as described in my paper,link below.


task automatic t_AB;
   bit status;
   int count:
  if ($fell(a)) 
    fork 
     begin : the120ns
      #120ns
     end
     begin : thecount
      // count the b's
      Statis=1: // under count values
     end
    join_any
    assert(status);
 endtask 
always @(posedge clk) 
   fork t_AB(); 
   join_none  

Above is a framework for your code, you need to tune it.
See my paper 1) SVA Alternative for Complex Assertions
Verification Horizons - March 2018 Issue | Verification Academy


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


  1. Verification Horizons - March 2018 Issue | Verification Academy
  2. SVA: Package for dynamic and range delays and repeats | Verification Academy
  3. SVA in a UVM Class-based Environment
    SVA in a UVM Class-based Environment | Verification Horizons | Verification Academy