Issue #443
verilator hangs up on circular macro definition
| Status: | Closed | Start date: | 02/23/2012 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | Wilson Snyder | % Done: | 0% |
|
| Category: | Parser | |||
| Target version: | - |
Description
Test case:
`define CSR_LOCAL_ADDR_WIDTH 12
`define CSR_SUBMOD_SEL_NUM_BITS `CSR_LOCAL_ADDR_WIDTH-`CSR_SUBMOD_SEL_NUM_BITS +: `CSR_SUBMOD_SEL_NUM_BITS
`define CSR_SUBMOD_SEL_BITS `CSR_LOCAL_ADDR_WIDTH-`CSR_SUBMOD_SEL_NUM_BITS +: `CSR_SUBMOD_SEL_NUM_BITS
`define CSR_SUBMOD_ADDR_BITS 0 +: `CSR_LOCAL_ADDR_WIDTH-`CSR_SUBMOD_SEL_NUM_BITS
typedef logic [`CSR_LOCAL_ADDR_WIDTH-1:0] csr_laddr_t;
typedef logic [64-1:0] csr_data_t;
module mod_a
(
output csr_data_t csr_rdata_out,
input logic csr_en_in,
input logic csr_we_in,
input csr_laddr_t csr_addr_in,
input csr_data_t csr_wdata_in,
);
endmodule
module mod_b
(
output csr_data_t csr_rdata_out,
input logic csr_en_in,
input logic csr_we_in,
input csr_laddr_t csr_addr_in,
input csr_data_t csr_wdata_in,
);
mod_a u_mod_a(.csr_en_in (csr_en_in && (csr_addr_in[`CSR_SUBMOD_SEL_BITS] == 7)),
.csr_addr_in(csr_laddr_t'(csr_addr_in[`CSR_SUBMOD_ADDR_BITS])),
.* );
endmodule // mod_b
verilator never exits.
History
Updated by Wilson Snyder about 1 year ago
- Category set to Parser
- Status changed from New to Resolved
- Assignee set to Wilson Snyder
The verilog preprocessor must be one of the most complicated things I've worked on relative to how simple one would think it should be.
Anyhow, there was a warning for this sort of thing, but it wasn't working due to the nature of expansion. Fixed in git towards 3.832. Also affects Verilog-Perl; fixed in git towards 3.314.
Updated by Wilson Snyder about 1 year ago
In Verilog-Perl 3.314.
Also available in: Atom
![[logo]](/img/veripool_small.png)