aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/ast.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-04-21 15:31:54 +0200
committerClifford Wolf <clifford@clifford.at>2016-04-21 15:31:54 +0200
commit5a09fa45535ffceae90359be727d2ff6e0ac2c58 (patch)
treed41d328e4dcf94154bbbec0124a94b0d2f8f3894 /frontends/ast/ast.cc
parentf38ca3e18fb27472595d59be8c0cea7ef50b7c4c (diff)
downloadyosys-5a09fa45535ffceae90359be727d2ff6e0ac2c58.tar.gz
yosys-5a09fa45535ffceae90359be727d2ff6e0ac2c58.tar.bz2
yosys-5a09fa45535ffceae90359be727d2ff6e0ac2c58.zip
Fixed handling of parameters and const functions in casex/casez pattern
Diffstat (limited to 'frontends/ast/ast.cc')
-rw-r--r--frontends/ast/ast.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc
index 834ee82ab..c49f29ce7 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");