Support bind statements within generate blocks
A bind statement within a generate if, if the generate if evaluates to false, should not bind.
// Should not bind localparam do_bind = 0; if (do_bind) bind .... // Should bind localparam do_bind = 1; if (do_bind) bind ....
I've attached a complete testcase. If you set do_bind to 1, the module is bound. If you set do_bind to 0, the module is still bound! The code works as expected in Synopsys VCS.
Tested on Verilator 4.017 devel rev UNKNOWN_REV on CENTOS 7
#1 Updated by Wilson Snyder 15 days ago
- Status changed from New to Confirmed
Thanks for the test.
This is a bug due to Bind being expanded up front before parameters are resolved.
Note to self/fixer: there's a minor complication in fixing this in that Verilator currently computes the possible hierarchy before parameter resolution, probably the bind needs to be considered then backed out if parameters rip it out; similar to AstNotFoundModule's.
Also available in: Atom