0

I want to verify that if an event occurrs, then at “num_ticks” in the past, some signal should have been asserted.

As an example, the property I wrote is:

property test_past;
  @(posedge clk)
    $rose(gnt) |-> $past(req, num_ticks);
endproperty

The problem here is with num_ticks. If num_ticks is an input signal to the module in which the property is written, then the assertion fails. If I declare num_ticks as an int, and assign it to a constant, it passes.

Does $past only work for constant values? This is not mentioned in the LRM.

I am using Questasim 10.3

noobuntu
  • 903
  • 1
  • 18
  • 42
  • I just noticed I was using an outdated version of the LRM - 2002 Accellera extensions version. Any suggestions on how to achieve $past functionality with variable num_ticks? – noobuntu Jan 11 '17 at 19:13
  • I used some logic around this to figure it out. Not pretty, but does the job – noobuntu Jan 11 '17 at 21:12

1 Answers1

3

You might use multiple assertions for this purpose.

Suppose num_ticks is 4 bits wide, then you can do like this.

genvar x;
generate
  for (x=0; x<16; x++)
  begin
    property test_past;
      @(posedge clk)
      (num_ticks == x) && $rose(gnt) |-> $past(req, x);
    endproperty
  end
endgenerate
Karan Shah
  • 1,912
  • 1
  • 29
  • 42