Uncloak array expressions generated by read_verilog -dump_vlog2

Explicit conversion of AST_TO_SIGNED, AST_TO_UNSIGNED, and AST_CAST_SIZE
makes it possible to reason about simplified array expressions.
This commit is contained in:
Dag Lem 2023-08-11 23:23:57 +02:00
parent cca12d9d9b
commit 655921e851
1 changed files with 9 additions and 0 deletions

View File

@ -658,11 +658,20 @@ void AstNode::dumpVlog(FILE *f, std::string indent) const
if (0) { case AST_NEG: txt = "-"; }
if (0) { case AST_LOGIC_NOT: txt = "!"; }
if (0) { case AST_SELFSZ: txt = "@selfsz@"; }
if (0) { case AST_TO_SIGNED: txt = "signed'"; }
if (0) { case AST_TO_UNSIGNED: txt = "unsigned'"; }
fprintf(f, "%s(", txt.c_str());
children[0]->dumpVlog(f, "");
fprintf(f, ")");
break;
case AST_CAST_SIZE:
children[0]->dumpVlog(f, "");
fprintf(f, "'(");
children[1]->dumpVlog(f, "");
fprintf(f, ")");
break;
if (0) { case AST_BIT_AND: txt = "&"; }
if (0) { case AST_BIT_OR: txt = "|"; }
if (0) { case AST_BIT_XOR: txt = "^"; }