aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2017-10-10 15:16:45 +0200
committerClifford Wolf <clifford@clifford.at>2017-10-10 15:16:45 +0200
commit12c10892e6783e0a1ef52776c232dd342745543f (patch)
tree52482dfe8d609403b743698116e889599a5f19db /frontends
parentc10e96c9ec8c4e56935ba796af0fa3d1f22b2a71 (diff)
parent7c57d8fbb44cdc466f4e384528109ada7e52b4c1 (diff)
downloadyosys-12c10892e6783e0a1ef52776c232dd342745543f.tar.gz
yosys-12c10892e6783e0a1ef52776c232dd342745543f.tar.bz2
yosys-12c10892e6783e0a1ef52776c232dd342745543f.zip
Merge branch 'master' of github.com:cliffordwolf/yosys
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/simplify.cc21
1 files changed, 5 insertions, 16 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index cd2120b8c..74e7b4675 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -405,9 +405,13 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage,
current_always_clocked = false;
if (type == AST_ALWAYS)
- for (auto child : children)
+ for (auto child : children) {
if (child->type == AST_POSEDGE || child->type == AST_NEGEDGE)
current_always_clocked = true;
+ if (child->type == AST_EDGE && GetSize(child->children) == 1 &&
+ child->children[0]->type == AST_IDENTIFIER && child->children[0]->str == "\\$global_clock")
+ current_always_clocked = true;
+ }
}
int backup_width_hint = width_hint;
@@ -1824,21 +1828,6 @@ skip_dynamic_range_lvalue_expansion:;
goto apply_newNode;
}
- if (str == "\\$rose" || str == "\\$fell")
- {
- if (GetSize(children) != 1)
- log_error("System function %s got %d arguments, expected 1 at %s:%d.\n",
- RTLIL::unescape_id(str).c_str(), int(children.size()), filename.c_str(), linenum);
-
- if (!current_always_clocked)
- log_error("System function %s is only allowed in clocked blocks at %s:%d.\n",
- RTLIL::unescape_id(str).c_str(), filename.c_str(), linenum);
-
- newNode = new AstNode(AST_EQ, children.at(0)->clone(), clone());
- newNode->children.at(1)->str = "\\$past";
- goto apply_newNode;
- }
-
// $anyconst and $anyseq are mapped in AstNode::genRTLIL()
if (str == "\\$anyconst" || str == "\\$anyseq") {
recursion_counter--;