mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Add lsb index to V3Number::setMask (#5522)
This commit is contained in:
+1
-4
@@ -531,10 +531,7 @@ class DelayedVisitor final : public VNVisitor {
|
||||
// Constant mask we can compute here
|
||||
if (AstConst* const cLsbp = VN_CAST(sLsbp, Const)) {
|
||||
AstConst* const cp = new AstConst{flp, AstConst::DTyped{}, eDTypep};
|
||||
cp->num().setAllBits0();
|
||||
const int lsb = cLsbp->toSInt();
|
||||
const int msb = lsb + sWidthp->toSInt() - 1;
|
||||
for (int bit = lsb; bit <= msb; ++bit) cp->num().setBit(bit, '1');
|
||||
cp->num().setMask(sWidthp->toSInt(), cLsbp->toSInt());
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user