1

Lets say there is a signal a . When the signal goes high, it has to stay high at least for three positive clock edges.

We can write the property as

property p;
@(posedge clk) $rose(a) -> a[*3];
endproperty

The property fails for the case below.

clk _ _ _ | = = = | _ _ _ | = = = | _ _ _ | = = = | _ _ _ | = = = |

a _ _ | = = = | _ _ | = = = = = = = = = = = = = = = = = =

This is not in accordance with the specification where a is going low in the middle but will be pulled high by the next posedge and hence the above assertion wont catch this.

Can anyone tell if there is any way to write assertion to catch this bug?

Thank you

AndresM
  • 1,293
  • 10
  • 19
user1978273
  • 484
  • 10
  • 24

2 Answers2

0

You're mixing up stuff here. By writing a clocked assertion on signal a you're verifying that it is a synchronous signal that has a specific behavior.

Synchronous signals can glitch all they want in between clock edges, because they never get sampled there. This is exactly the reason why we use synchronous signals nowadays, i.e. to let the signal have a chance to settle to its value before we sample it.

If your signal a isn't supposed to glitch for some reason (I'm not a designer so I don't know where this would be useful), as far as I know you'd find this out using some kind of linting tool (e.g. Spyglass) that does a structural analysis on the HDL code.

Tudor Timi
  • 7,453
  • 1
  • 24
  • 53
0

Tudor right, that in most of cases it does not matter what happening between clock edges. But at CDC, or asynchronous design we must verify that the design is glitch free. There is a inside-out way to do this. (I found this solution at http://www.verificationguild.com/modules.php?name=Forums&file=viewtopic&p=20045)

property detect_glitch;
    time leading;                  // declare the last edge occurence variable
    @(glitch)                      // At every change of glitch signal
        //The following line saves the current time and check
        // the delay from the previous edge.
        (1, leading = $time) |=> (($time - leading) >= duration);
endproperty : detect_glitch

DETECT_GLITCH : assert property (detect_glitch)
else
    $display ("ERROR"); 
betontalpfa
  • 3,454
  • 1
  • 33
  • 65