Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1501

Support bind statements within generate blocks

Added by Dan Petrisko 16 days ago. Updated 15 days ago.

Status:
Confirmed
Priority:
Normal
Assignee:
-
Category:
-
% Done:

0%


Description

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

testbench.v (109 Bytes) Dan Petrisko, 09/06/2019 06:23 AM

test.cpp View (308 Bytes) Dan Petrisko, 09/06/2019 06:23 AM

dut.v (24 Bytes) Dan Petrisko, 09/06/2019 06:23 AM

foo.v (59 Bytes) Dan Petrisko, 09/06/2019 06:23 AM

History

#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