Refactor SimulateVisitor to use AstConst

This commit is contained in:
Todd Strader
2019-07-23 13:58:17 -04:00
parent 654571bd1c
commit b045111a67
10 changed files with 213 additions and 181 deletions
+3 -3
View File
@@ -304,9 +304,9 @@ private:
it != m_inVarps.end(); ++it) {
AstVarScope* invscp = *it;
// LSB is first variable, so extract it that way
simvis.newNumber(invscp,
V3Number(invscp, invscp->width(),
VL_MASK_I(invscp->width()) & (inValue>>shift)));
AstConst cnst(invscp->fileline(), AstConst::WidthedValue(), invscp->width(),
VL_MASK_I(invscp->width()) & (inValue>>shift));
simvis.newValue(invscp, &cnst);
shift += invscp->width();
// We're just using32 bit arithmetic, because there's no
// way the input table can be 2^32 bytes!