diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-02-26 18:47:39 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-02-26 18:47:39 +0100 |
commit | 1f1deda888ea32ade2478fca9fcb510ada477606 (patch) | |
tree | bf21e5e60e970745af2d4652addfbe383f6b4187 /frontends/ast/simplify.cc | |
parent | b005eedf369bc60ce5f7cba9a0db4694f22a360f (diff) | |
download | yosys-1f1deda888ea32ade2478fca9fcb510ada477606.tar.gz yosys-1f1deda888ea32ade2478fca9fcb510ada477606.tar.bz2 yosys-1f1deda888ea32ade2478fca9fcb510ada477606.zip |
Added non-std verilog assume() statement
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r-- | frontends/ast/simplify.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 404dab4e8..a65d2dbb1 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1211,7 +1211,7 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, } skip_dynamic_range_lvalue_expansion:; - if (stage > 1 && type == AST_ASSERT && current_block != NULL) + if (stage > 1 && (type == AST_ASSERT || type == AST_ASSUME) && current_block != NULL) { std::stringstream sstr; sstr << "$assert$" << filename << ":" << linenum << "$" << (autoidx++); @@ -1255,7 +1255,7 @@ skip_dynamic_range_lvalue_expansion:; newNode->children.push_back(assign_check); newNode->children.push_back(assign_en); - AstNode *assertnode = new AstNode(AST_ASSERT); + AstNode *assertnode = new AstNode(type); assertnode->children.push_back(new AstNode(AST_IDENTIFIER)); assertnode->children.push_back(new AstNode(AST_IDENTIFIER)); assertnode->children[0]->str = id_check; @@ -1266,9 +1266,8 @@ skip_dynamic_range_lvalue_expansion:; goto apply_newNode; } - if (stage > 1 && type == AST_ASSERT && children.size() == 1) + if (stage > 1 && (type == AST_ASSERT || type == AST_ASSUME) && children.size() == 1) { - children[0] = new AstNode(AST_REDUCE_BOOL, children[0]->clone()); children.push_back(mkconst_int(1, false, 1)); did_something = true; } |