mirror of
https://github.com/verilator/verilator.git
synced 2026-10-07 02:23:19 +02:00
Fix implicit one bit parameter selection, bug603.
This commit is contained in:
+11
-1
@@ -840,7 +840,17 @@ private:
|
||||
width = 32;
|
||||
}
|
||||
// Can't just inherit valuep()->dtypep() as mwidth might not equal width
|
||||
nodep->dtypeChgWidthSigned(width, nodep->valuep()->widthMin(),issigned);
|
||||
if (width==1) {
|
||||
// one bit parameter is same as "parameter [0] foo", not "parameter logic foo"
|
||||
// as you can extract "foo[0]" from a parameter but not a wire
|
||||
nodep->dtypeChgWidthSigned(width, nodep->valuep()->widthMin(),issigned);
|
||||
nodep->dtypep(nodep->findLogicRangeDType
|
||||
(VNumRange(0,0,false),
|
||||
nodep->valuep()->widthMin(),
|
||||
issigned?AstNumeric::SIGNED : AstNumeric::UNSIGNED));
|
||||
} else {
|
||||
nodep->dtypeChgWidthSigned(width, nodep->valuep()->widthMin(),issigned);
|
||||
}
|
||||
didchk = true;
|
||||
nodep->valuep()->iterateAndNext(*this,WidthVP(width,nodep->widthMin(),FINAL).p());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user