aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ast/simplify.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-01-04 16:03:04 +0100
committerClifford Wolf <clifford@clifford.at>2017-01-04 16:03:04 +0100
commit81a9ee2360740dd05e6fc8215abd0e30837f2cda (patch)
tree263e7cd9f2861761e5f9f7f95c5c7af51e0cfadd /frontends/ast/simplify.cc
parentb9ad91b93eb2863fb6b95c1ea3329156ae628837 (diff)
downloadyosys-81a9ee2360740dd05e6fc8215abd0e30837f2cda.tar.gz
yosys-81a9ee2360740dd05e6fc8215abd0e30837f2cda.tar.bz2
yosys-81a9ee2360740dd05e6fc8215abd0e30837f2cda.zip
Added handling of local memories and error for local decls in unnamed blocks
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r--frontends/ast/simplify.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index dd24ce988..0e77df611 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1083,6 +1083,15 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
did_something = true;
}
+ // check for local objects in unnamed block
+ if (type == AST_BLOCK && str.empty())
+ {
+ for (size_t i = 0; i < children.size(); i++)
+ if (children[i]->type == AST_WIRE || children[i]->type == AST_MEMORY || children[i]->type == AST_PARAMETER || children[i]->type == AST_LOCALPARAM)
+ log_error("Local declaration in unnamed block at %s:%d is an unsupported SystemVerilog feature!\n",
+ children[i]->filename.c_str(), children[i]->linenum);
+ }
+
// transform block with name
if (type == AST_BLOCK && !str.empty())
{
@@ -1091,7 +1100,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
std::vector<AstNode*> new_children;
for (size_t i = 0; i < children.size(); i++)
- if (children[i]->type == AST_WIRE || children[i]->type == AST_PARAMETER || children[i]->type == AST_LOCALPARAM) {
+ if (children[i]->type == AST_WIRE || children[i]->type == AST_MEMORY || children[i]->type == AST_PARAMETER || children[i]->type == AST_LOCALPARAM) {
children[i]->simplify(false, false, false, stage, -1, false, false);
current_ast_mod->children.push_back(children[i]);
current_scope[children[i]->str] = children[i];