Calculate the width of an array word correctly.

When finding the width of an array word we need to skip any word
selects for the array dimensions.
This commit is contained in:
Cary R 2009-04-27 18:13:19 -07:00 committed by Stephen Williams
parent 192522b3d8
commit 31fae351d2
1 changed files with 4 additions and 1 deletions

View File

@ -1936,7 +1936,10 @@ unsigned PEIdent::test_width(Design*des, NetScope*scope,
if (!name_tail.index.empty()) {
probe_index_expr_width(des, scope, name_tail);
const index_component_t&index_tail = name_tail.index.back();
use_sel = index_tail.sel;
// Skip full array word net selects.
if (!net || (name_tail.index.size() > net->array_dimensions())) {
use_sel = index_tail.sel;
}
}
unsigned use_width = UINT_MAX;