#906 iverilog generates code that causes syntax error

devel
closed-fixed
Cary R.
5
2012-08-31
2012-08-30
Anonymous
No

The attached module can be compiled without error by iverilog. The resulting output, however, will yield the following error when run:

./a.out:14: syntax error

It appears that iverilog truncates the very long line in such a way that the output contains an unterminated string.

I observed this behavior with version 0.9.2 and version 0.9.5. Strangely, this bug is not present with the older version 0.8.6.

It would be ideal if iverilog could compile (and simulate) this module properly. However, at the very least, iverilog should
report an error rather than silently ignoring the problem and generating corrupt output.

Discussion

  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-30
     
  • Cary R.

    Cary R. - 2012-08-30
    • milestone: --> devel
     
  • Cary R.

    Cary R. - 2012-08-30

    This code also fails using development. The problem will likely be fixed in development first and then the fix will be back ported to V0.9 if possible.

    V0.8 was significantly different from V0.9 and the current development. At the moment V0.9 and development are different, but not as different as V0.8 and V0.9.

     
  • Cary R.

    Cary R. - 2012-08-31
    • assigned_to: nobody --> caryr
     
  • Cary R.

    Cary R. - 2012-08-31

    In development and I'm assuming in V0.9 this is caused by using a fixed 4096 character buffer for processing the arguments to a system task/function call. It's fairly easy to make the code generator allocate just enough space for the string. Since writing to the fixed buffer was followed by a strdup() it's just as easy to allocate enough space and then write to the dynamically allocated buffer. Doing this fixes the crash, but there appears to also be a fixed 4096 buffer in vvp that gives truncated output. I'll look at fixing that as well.

     
  • Cary R.

    Cary R. - 2012-08-31

    I have pushed a patch that fixes this under Ubuntu 12.04 using both gcc and clang as well as cygwin under windows. There is some problem under RHEL 5.6 (64-bit) that is preventing vvp from outputting the string, though the compiler is producing the correct intermediate code (it's not crashing). I'll try to look at the RHEL 5 issue tomorrow.

     
  • Cary R.

    Cary R. - 2012-08-31
    • status: open --> closed-fixed
     
  • Cary R.

    Cary R. - 2012-08-31

    I have pushed a fix that should make this now work on all systems.

     
  • Cary R.

    Cary R. - 2012-08-31

    The executable created with the i686-w64-mingw32 compiler under cygwin is crashing when running this test. I'll look into this when I have some free time, but I'm assuming this is a mingw (windows) specific problem since all my other systems are working correctly.

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks