DPI: Support strings in DPI Imports

This commit is contained in:
Wilson Snyder
2010-01-17 15:10:37 -05:00
parent 08b63b4f01
commit 788f69a8c9
19 changed files with 192 additions and 28 deletions
+6 -1
View File
@@ -1090,6 +1090,11 @@ private:
nodep->v3error("Expecting expression to be constant, but variable isn't const: "<<nodep->itemp()->prettyName());
}
}
// virtual void visit(AstCvtPackString* nodep, AstNUser*) {
// Not constant propagated (for today) because AstMath::isOpaque is set
// Someday if lower is constant, convert to quoted "string".
virtual void visit(AstAttrOf* nodep, AstNUser*) {
// Don't iterate children, don't want to loose VarRef.
if (nodep->attrType()==AstAttrType::BITS) {
@@ -1504,7 +1509,7 @@ private:
TREEOP1("AstSel{warnSelect(nodep)}", "NEVER");
// Generic constants on both side. Do this first to avoid other replacements
TREEOP("AstNodeBiop {$lhsp.castConst, $rhsp.castConst}", "replaceConst(nodep)");
TREEOP("AstNodeUniop{$lhsp.castConst}", "replaceConst(nodep)");
TREEOP("AstNodeUniop{$lhsp.castConst, !nodep->isOpaque()}", "replaceConst(nodep)");
// Zero on one side or the other
TREEOP("AstAdd {$lhsp.isZero, $rhsp}", "replaceWRhs(nodep)");
TREEOP("AstAnd {$lhsp.isZero, $rhsp}", "replaceZero(nodep)");