Issue #509
Better error when illegal bit select of array
| Status: | Assigned | Start date: | 05/08/2012 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Lint | |||
| Target version: | - |
Description
The following code fails with an internal error:
module t (clk); input clk; wire a[0:0]; wire b[0:0]; assign b = 1'b0; assign a = b[0]; endmodule
The error message is:
%Error: t/t_bitsel_array.v:20: Internal: Unexpected Call %Error: Internal Error: t/t_bitsel_array.v:20: ../V3AstNodes.h:585: Unexpected Call
This appears to be valid SystemVerilog. The problem doesn't occur in real code, but was discovered by accident when I mistyped b[0:0] instead of [0:0]b in the declaration, while investigating issue 508.
Please pull a testcase from https://github.com/jeremybennett/verilator/tree/bitsel-array.
History
Updated by Wilson Snyder about 1 year ago
- Subject changed from Bit select of array fails to Internal error on illegal bit select of array
- Category set to Lint
- Status changed from New to Assigned
- Priority changed from Normal to Low
This code is illegal, you're using an array of wires to assign a constant. This code fails on other simulators too.
The bug will stay open as the error should obviously be better.
Committed the test as t_bitsel_wire_array_bad.pl; the test will need updating for the better error when implemented.
Updated by Wilson Snyder about 1 year ago
- Subject changed from Internal error on illegal bit select of array to Better error when illegal bit select of array
Updated by Jeremy Bennett about 1 year ago
Thanks for the clarification. I had misread section 7.4.3 of the IEEE 1800-2009. This sort of assignment is only permitted for packed arrays.
Also available in: Atom
![[logo]](/img/veripool_small.png)