#868 Assertion on task argument involving time expression

Craig Ulmer

While compiling someone else's verilog, I received the below icarus assertion error for some verilog that tries to pass an expression involving time as an argument to a task. The original code looked like "my_task( timeval - $realtime)", I found I could work around this assertion by assigning the time calculation to a temporary variable, and then passing the variable to the task. I'm using a tarball build of the 0.9.5 release, but the problem also appears in prior releases (eg, 0.9.2). The attached example shows a minimal version of the problem, plus an example of how to fix it. I'm not positive the verilog is legitimate, but it did compile ok under Riviera a couple years ago.

iverilog -o example task_time_arg.v
ivl: eval_expr.c:2736: draw_sfunc_expr: Assertion `ivl_expr_value(expr) == IVL_VT_LOGIC || ivl_expr_value(expr) == IVL_VT_BOOL' failed.
sh: line 1: 25853 Done /opt/verilog-0.9.5/lib/ivl/ivlpp -L -F"/tmp/ivrlg27a6b7bb3" -f"/tmp/ivrlg7a6b7bb3" -p"/tmp/ivrli7a6b7bb3"
25854 Aborted (core dumped) | /opt/verilog-0.9.5/lib/ivl/ivl -C"/tmp/ivrlh7a6b7bb3" -C"/opt/verilog-0.9.5/lib/ivl/vvp.conf" -- -

Ps- you've done a great job with Icarus


  • Craig Ulmer

    Craig Ulmer - 2011-11-29

    Example that includes work around

  • Stephen Williams

    It appears that the problem is not present in the master (devel) branch so I've switched it to the v0.9 group as I confirmed that it exists there.

  • Stephen Williams

    • milestone: 530321 --> v0.9
  • Cary R.

    Cary R. - 2011-12-03

    The issue appears to be that the task is being called with a real expression when it is expecting an integer. There should be an implicit conversion to integer which would then likely satisfy the assertion. This may require some digging to figure out if the change in development can be back ported to development.

    FYI the modified code I have also runs under V0.8.7.

    I'll try to see if I can find time over the weekend to look at this.

  • Cary R.

    Cary R. - 2011-12-03

    I just looked at the vvp code for the case that does not fail and it is incorrectly converting the real variable to an integer using a width of 1 instead of 32, so there are a number of issues in V0.9. I seems to remember a real argument task/function patch some time in the past.

  • Cary R.

    Cary R. - 2011-12-06

    I have push a patch for this to git head for V0.9.

  • Cary R.

    Cary R. - 2011-12-06
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks