Fix select operation on assoc array with wide keys (#4360)
This commit is contained in:
parent
0774f825cf
commit
ced1dfeffd
|
|
@ -386,11 +386,7 @@ public:
|
||||||
AstAssocArrayDType* const adtypep
|
AstAssocArrayDType* const adtypep
|
||||||
= VN_AS(nodep->fromp()->dtypep()->skipRefp(), AssocArrayDType);
|
= VN_AS(nodep->fromp()->dtypep()->skipRefp(), AssocArrayDType);
|
||||||
UASSERT_OBJ(adtypep, nodep, "Associative select on non-associative type");
|
UASSERT_OBJ(adtypep, nodep, "Associative select on non-associative type");
|
||||||
if (adtypep->keyDTypep()->isWide()) {
|
iterateAndNextConstNull(nodep->bitp());
|
||||||
emitCvtWideArray(nodep->bitp(), nodep->fromp());
|
|
||||||
} else {
|
|
||||||
iterateAndNextConstNull(nodep->bitp());
|
|
||||||
}
|
|
||||||
puts(")");
|
puts(")");
|
||||||
}
|
}
|
||||||
void visit(AstWildcardSel* nodep) override {
|
void visit(AstWildcardSel* nodep) override {
|
||||||
|
|
|
||||||
|
|
@ -102,8 +102,11 @@ module t (/*AUTOARG*/
|
||||||
begin
|
begin
|
||||||
// Wide-wides - need special array container classes, ick.
|
// Wide-wides - need special array container classes, ick.
|
||||||
logic [91:2] a [ logic [65:1] ];
|
logic [91:2] a [ logic [65:1] ];
|
||||||
|
int b [ bit [99:0] ];
|
||||||
a[~65'hfe] = ~ 90'hfee;
|
a[~65'hfe] = ~ 90'hfee;
|
||||||
`checkh(a[~65'hfe], ~ 90'hfee);
|
`checkh(a[~65'hfe], ~ 90'hfee);
|
||||||
|
b[100'b1] = 1;
|
||||||
|
`checkh(b[100'b1], 1);
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue