aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast
diff options
context:
space:
mode:
authorJeff Wang <jjj11x@gmail.com>2020-01-16 15:23:03 -0500
committerJeff Wang <jeffrey.wang@ll.mit.edu>2020-01-16 18:13:14 -0500
commit41a0a93dcc489fbba2624006ef52a3d0f565ee25 (patch)
tree9f3ef036de3da8ab00cbff50112dd5446a8cf206 /frontends/ast
parentcaf35896da98225518f06ebcd57b010c958de652 (diff)
downloadyosys-41a0a93dcc489fbba2624006ef52a3d0f565ee25.tar.gz
yosys-41a0a93dcc489fbba2624006ef52a3d0f565ee25.tar.bz2
yosys-41a0a93dcc489fbba2624006ef52a3d0f565ee25.zip
allow enums to be declared at toplevel scope
Diffstat (limited to 'frontends/ast')
-rw-r--r--frontends/ast/simplify.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 9013ebe66..2e1b1e404 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -428,6 +428,13 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
if (node->type == AST_PARAMETER || node->type == AST_LOCALPARAM || node->type == AST_WIRE || node->type == AST_AUTOWIRE || node->type == AST_MEMORY || node->type == AST_TYPEDEF)
while (node->simplify(true, false, false, 1, -1, false, node->type == AST_PARAMETER || node->type == AST_LOCALPARAM))
did_something = true;
+ if (node->type == AST_ENUM) {
+ for (auto enode : node->children){
+ log_assert(enode->type==AST_ENUM_ITEM);
+ while (node->simplify(true, false, false, 1, -1, false, node->type == AST_ENUM_ITEM))
+ did_something = true;
+ }
+ }
}
}