aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/ast.cc
diff options
context:
space:
mode:
authorAndrew Zonenberg <azonenberg@drawersteak.com>2016-04-22 19:07:55 -0700
committerAndrew Zonenberg <azonenberg@drawersteak.com>2016-04-22 19:07:55 -0700
commitab11f2aa701f4ff7a8df98d2a4158ea1f661a205 (patch)
treed2c8e2b82b7cca57127bd9dd54d3eb40386a88f7 /frontends/ast/ast.cc
parentd90c1e952256dc00d070863835e061d73e4bc6b3 (diff)
parent7311be4028a9caad5a0fac1a3433220b4233ef84 (diff)
downloadyosys-ab11f2aa701f4ff7a8df98d2a4158ea1f661a205.tar.gz
yosys-ab11f2aa701f4ff7a8df98d2a4158ea1f661a205.tar.bz2
yosys-ab11f2aa701f4ff7a8df98d2a4158ea1f661a205.zip
Merge https://github.com/cliffordwolf/yosys
Diffstat (limited to 'frontends/ast/ast.cc')
-rw-r--r--frontends/ast/ast.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc
index 834ee82ab..64fd0a49c 100644
--- a/frontends/ast/ast.cc
+++ b/frontends/ast/ast.cc
@@ -146,6 +146,8 @@ std::string AST::type2str(AstNodeType type)
X(AST_ASSIGN_LE)
X(AST_CASE)
X(AST_COND)
+ X(AST_CONDX)
+ X(AST_CONDZ)
X(AST_DEFAULT)
X(AST_FOR)
X(AST_WHILE)
@@ -501,7 +503,12 @@ void AstNode::dumpVlog(FILE *f, std::string indent)
break;
case AST_CASE:
- fprintf(f, "%s" "case (", indent.c_str());
+ if (!children.empty() && children[0]->type == AST_CONDX)
+ fprintf(f, "%s" "casex (", indent.c_str());
+ else if (!children.empty() && children[0]->type == AST_CONDZ)
+ fprintf(f, "%s" "casez (", indent.c_str());
+ else
+ fprintf(f, "%s" "case (", indent.c_str());
children[0]->dumpVlog(f, "");
fprintf(f, ")\n");
for (size_t i = 1; i < children.size(); i++) {
@@ -512,6 +519,8 @@ void AstNode::dumpVlog(FILE *f, std::string indent)
break;
case AST_COND:
+ case AST_CONDX:
+ case AST_CONDZ:
for (auto child : children) {
if (child->type == AST_BLOCK) {
fprintf(f, ":\n");
@@ -1033,7 +1042,7 @@ RTLIL::IdString AstModule::derive(RTLIL::Design *design, dict<RTLIL::IdString, R
if (stripped_name.substr(0, 9) == "$abstract")
stripped_name = stripped_name.substr(9);
- log_header("Executing AST frontend in derive mode using pre-parsed AST for module `%s'.\n", stripped_name.c_str());
+ log_header(design, "Executing AST frontend in derive mode using pre-parsed AST for module `%s'.\n", stripped_name.c_str());
current_ast = NULL;
flag_dump_ast1 = false;