Menu

#234 Unable to bind wire/reg/memory

devel
closed-fixed
4
2008-03-24
2007-04-21
thiede
No

verilog-20080418/bin/iverilog test.v
test.v:50: error: Unable to bind wire/reg/memory `i_WEN' in `test.x_it'
test.v:50: error: Unable to elaborate condition expression.
test.v:49: Unable to elaborate statement in task test.x_it at test.v:47.
2 error(s) during elaboration.

Discussion

  • thiede

    thiede - 2007-04-21
     
  • Nobody/Anonymous

    Logged In: NO

    As a workaround; if you explicitly declare i_WEN (wire) at the top level this will compile.

     
  • Larry Doolittle

    Larry Doolittle - 2007-06-05

    Logged In: YES
    user_id=1169926
    Originator: NO

    Here's a more succinct example of the concern. Icarus manages to infer wire declarations in some cases, but not others. Of course, it's terrible form to depend on such implicit behavior in production code, so any `fix' to this needs checking that -Wall will still bark.

    module main();
    wire bar;
    reg rbar;

    assign bar=foo1; // no complaints unless -Wall
    initial rbar=foo2; // error: Unable to bind wire/reg/memory `foo2' in `main'

    endmodule

     
  • Larry Doolittle

    Larry Doolittle - 2007-06-05

    Logged In: YES
    user_id=1169926
    Originator: NO

    Here's a more succinct example of the concern. Icarus manages to infer wire declarations in some cases, but not others. Of course, it's terrible form to depend on such implicit behavior in production code, so any `fix' to this needs checking that -Wall will still bark.

    module main();
    wire bar;
    reg rbar;

    assign bar=foo1; // no complaints unless -Wall
    initial rbar=foo2; // error: Unable to bind wire/reg/memory `foo2' in `main'

    endmodule

     
  • Nobody/Anonymous

    Logged In: NO

    I'm fully aware of the workaround, but since this code went thru several "other" verilog readers without errors (some warnings) I would like iverilog to be able to read it too ...

    And yes, it's production code (from a memory vendor) and no, I don't think that using implicit one bit wires is a terrible thing to do.

    Stefan

     
  • thiede

    thiede - 2008-01-16

    Logged In: YES
    user_id=1606747
    Originator: YES

    Git as of Jan 16, this used to elaborate before.

    If you uncomment the wire statement everything is fine.

    iverilog test1.v
    test1.v:3: error: Unable to bind wire/reg/memory `r' in `test'
    test1.v:3: internal error: Port expression too complicated for elaboration.
    1 error(s) during elaboration.

    module test();
    // wire r;
    a ua ( .r ( !r ));
    endmodule

    module a ( r );
    input r;
    endmodule

    File Added: test1.v

     
  • thiede

    thiede - 2008-01-16
     
  • Cary R.

    Cary R. - 2008-02-21
    • priority: 5 --> 4
     
  • Cary R.

    Cary R. - 2008-02-21

    Logged In: YES
    user_id=1651735
    Originator: NO

    Updated priority to math new guidelines

     
  • Stephen Williams

    • assigned_to: nobody --> stevewilliams
     
  • Stephen Williams

    Logged In: YES
    user_id=97566
    Originator: NO

    The test.v example now compiles properly, the test1.v does not quiet yet.

    Note that ldoolitt2's example is not correct. The foo2 variable is an r-value, and in behavioral code. These are both contexts that do *not* cause implicit declaration.

     
  • Stephen Williams

    Logged In: YES
    user_id=97566
    Originator: NO

    The test1.v example compiles with git as of 23 March 2008. The test1.v example passes an implicitly declared wire within an expression to an input port. I can't see that this is illegal, even though this is increasingly funky coding style.

     
  • Stephen Williams

    • status: open --> closed-fixed
     

Log in to post a comment.