mirror of
https://github.com/verilator/verilator.git
synced 2026-09-02 18:58:51 +02:00
Internals: Replace unnecessary AstSel::widthp() child node with const in node (#6117)
This commit is contained in:
+3
-5
@@ -931,13 +931,11 @@ class CoverageVisitor final : public VNVisitor {
|
||||
const int width = lhsp->dtypep()->width();
|
||||
const size_t expected = std::is_same<T_Oper, AstXor>::value ? 0x1 << width : width + 1;
|
||||
if (checkMaxExprs(expected)) return;
|
||||
AstNodeExpr* unrolledp = new AstSel{fl, lhsp->cloneTree(false),
|
||||
new AstConst{fl, static_cast<uint32_t>(width - 1)},
|
||||
new AstConst{fl, 1}};
|
||||
AstNodeExpr* unrolledp = new AstSel{
|
||||
fl, lhsp->cloneTree(false), new AstConst{fl, static_cast<uint32_t>(width - 1)}, 1};
|
||||
for (int bit = width - 2; bit >= 0; bit--) {
|
||||
AstSel* const selp = new AstSel{fl, lhsp->cloneTree(false),
|
||||
new AstConst{fl, static_cast<uint32_t>(bit)},
|
||||
new AstConst{fl, 1}};
|
||||
new AstConst{fl, static_cast<uint32_t>(bit)}, 1};
|
||||
unrolledp = new T_Oper{fl, selp, unrolledp};
|
||||
}
|
||||
iterate(unrolledp);
|
||||
|
||||
Reference in New Issue
Block a user