mirror of
https://github.com/verilator/verilator.git
synced 2025-01-04 05:37:48 +00:00
Optimize expansion of extend operators - fix earlier commit.
This commit is contained in:
parent
073af8e1f2
commit
a554dd7c8d
@ -344,11 +344,11 @@ private:
|
||||
bool expandWide(AstNodeAssign* nodep, AstExtend* rhsp) {
|
||||
UINFO(8, " Wordize ASSIGN(EXTEND) " << nodep << endl);
|
||||
if (!doExpand(nodep)) return false;
|
||||
AstNodeExpr* const lhsp = nodep->lhsp();
|
||||
for (int w = 0; w < lhsp->widthWords(); ++w) {
|
||||
addWordAssign(nodep, w, newAstWordSelClone(lhsp, w));
|
||||
AstNodeExpr* const rlhsp = rhsp->lhsp();
|
||||
for (int w = 0; w < rlhsp->widthWords(); ++w) {
|
||||
addWordAssign(nodep, w, newAstWordSelClone(rlhsp, w));
|
||||
}
|
||||
for (int w = rhsp->widthWords(); w < nodep->widthWords(); ++w) {
|
||||
for (int w = rlhsp->widthWords(); w < nodep->widthWords(); ++w) {
|
||||
addWordAssign(nodep, w, new AstConst{nodep->fileline(), AstConst::SizedEData{}, 0});
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user