mirror of
https://github.com/verilator/verilator.git
synced 2026-09-04 16:40:12 +02:00
Support negative bit indexes.
Allow arbitrary characters in symbols (to make '-' work.) Final merge from negative_lsb branch.
This commit is contained in:
@@ -223,7 +223,7 @@ private:
|
||||
AstNode* widthp;
|
||||
if (msbp->castConst() && lsbp->castConst()) {
|
||||
// Quite common, save V3Const some effort
|
||||
V3Number widnum (msbp->fileline(),32,msbp->castConst()->asInt() +1-lsbp->castConst()->asInt());
|
||||
V3Number widnum (msbp->fileline(),32,msbp->castConst()->toSInt() +1-lsbp->castConst()->toSInt());
|
||||
widnum.width(32,false); // Unsized so width from user
|
||||
widthp = new AstConst (msbp->fileline(), widnum);
|
||||
pushDeletep(msbp);
|
||||
|
||||
Reference in New Issue
Block a user