Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#595 Wrong requirements for width

v0.9
closed-works-for-me
nobody
5
2008-12-12
2008-12-12
Uwe Bonnes
No

Appended code is a cutdown from
../Xilinx/10.1/ISE/verilog/src/XilinxCoreLib//C_DIST_MEM_V7_0.v

While the code seem obfuscated, it should be legal, resulting in
wire[5:0].
It seems, that Iverilog makes wrong assumptions about the required width. Here the result of the ? operator could even be negative, up to -4.

> env LANG=C iverilog use_wid.v
use_wid.v:4: assert: elab_expr.cc:2765: failed assertion use_wid > 0
sh: line 1: 29359 Done /usr/local/lib/ivl/ivlpp -L -F/tmp/ivrlg23746e16f -f/tmp/ivrlg3746e16f -p/tmp/ivrli3746e16f
29360 Aborted | /usr/local/lib/ivl/ivl -C/tmp/ivrlh3746e16f -C/usr/local/lib/ivl/vvp.conf -- -

Discussion

  • Uwe Bonnes
    Uwe Bonnes
    2008-12-12

    Verilog file that shows the problem when run

     
    Attachments
    • milestone: 530321 --> v0.9
     
  • What version are you using?

     
  • Uwe Bonnes
    Uwe Bonnes
    2008-12-12

    I frequently update from git by "git pull; make; su; make install", and so I did this afternoon.

    iverilog -V gave
    Icarus Verilog version 0.9.devel (s20080429-284-gbe3d7b4)

    After "make distclean; configure; make ..." the assert is unaffected.

     
  • Cary R.
    Cary R.
    2008-12-12

    I verified that this works as expected on cygwin, mingw, RHEL and RHEL with valgrind. I added one line so that the net was actually put in the a.out file "initial $displayb(A);". So this is working on my end.

     
  • Cary R.
    Cary R.
    2008-12-12

    FYI in my source there is no assert at line 2765 and the one that is at 2764 is just an assert(value_);. It appears that your source is out of date even thought you did the git pull. Are you referencing the correct repository? In gitk I see "Fix elaboration of part-select ports" by Steve as the latest patch (2008-12-11 21:35:28). Also in your copy of the source what function is this ivl_assert in? As a last resort you may want to remove the entire verilog directory and start from scratch.

     
  • Cary R.
    Cary R.
    2008-12-12

    • status: open --> open-works-for-me
     
  • Uwe Bonnes
    Uwe Bonnes
    2008-12-12

    Thanks Cary,

    purging the tree and a clean checkout made the trick.

    I have appended a diff between the failing tree after a "make distclean" and the fresh git checkout.
    Perhaps somebody can see some problem in it. Hunting those phantom bugs is annoying...

     
  • Uwe Bonnes
    Uwe Bonnes
    2008-12-12

    running
    sh autoconf.sh
    ./configure
    make

    makes the problem go away even on the old, formerly failing tree.
    Perhaps we should advertise the "sh autoconf.sh" step much louder

     
  • Cary R.
    Cary R.
    2008-12-12

    • status: open-works-for-me --> closed-works-for-me
     
  • Cary R.
    Cary R.
    2008-12-12

    I don't see an attached diff. I'm working on fixing some of the build dependency problems and Steve or I will fix the header dependency problems (missing dependency on config.h, etc.). Without your diff I don't know if this will fix the problem or not. Given that you did a distclean and rebuild I'm guessing it will not. This looks like configure.in, etc. changed and these are only updated by autoconf.sh. In the future if you see these files change you need to remember to rebuild using autoconf.sh. I don't know if we can force a rebuild from the Makefile for this case.

    I'm going to close this report so please email me the diff directly.