Specman e: Can delay() get a variable as an input with time unit?

376 Views Asked by At

I try to pass a variable with time unit to the delay() temporal expression:

var bla : real = 0.1;
wait delay (bla ns);

And get the next error:

  *** Error: Unrecognized exp
    [Unrecognized expression 'bla ns']

Is there a way in Specman e to pass a variable to delay expression with time unit?

Thank you for your help

2

There are 2 best solutions below

0
Tudor Timi On

Do the following:

var bla : real = 0.1;
wait delay (bla * 1 ns);
0
Milos Mirosavljevic On

One more approach:

var delay_for_uart: uint = 50;
wait delay(to_specman_scale(delay_for_uart, us)); 

Just as additional comment: as you probably know, you need to ensure that your timescale is small enough to be able to perform required wait. If for example you need to wait 100ps, but timescale is in ns, then you will not be able to do so.