diff options
author | Clifford Wolf <clifford@clifford.at> | 2016-07-21 14:37:28 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2016-07-21 14:37:28 +0200 |
commit | 7fef5ff10436a51a91f57157f687345795f60e40 (patch) | |
tree | b31f52fc325639ad520715696a13563dc0ef8f8c /frontends | |
parent | 5c166e76e52cdaf6ea97952c17d3d79185a59f96 (diff) | |
download | yosys-7fef5ff10436a51a91f57157f687345795f60e40.tar.gz yosys-7fef5ff10436a51a91f57157f687345795f60e40.tar.bz2 yosys-7fef5ff10436a51a91f57157f687345795f60e40.zip |
Using $initstate in "initial assume" and "initial assert"
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/ast/simplify.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 4c64626f7..9f88cddc2 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1387,7 +1387,12 @@ skip_dynamic_range_lvalue_expansion:; assign_check = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), new AstNode(AST_REDUCE_BOOL, children[0]->clone())); assign_check->children[0]->str = id_check; - assign_en = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), mkconst_int(1, false, 1)); + if (current_always == nullptr || current_always->type != AST_INITIAL) { + assign_en = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), mkconst_int(1, false, 1)); + } else { + assign_en = new AstNode(AST_ASSIGN_LE, new AstNode(AST_IDENTIFIER), new AstNode(AST_FCALL)); + assign_en->children[1]->str = "\\$initstate"; + } assign_en->children[0]->str = id_en; newNode = new AstNode(AST_BLOCK); |