aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorDan Gisselquist <zipcpu@gmail.com>2018-10-01 19:41:35 +0200
committerClifford Wolf <clifford@clifford.at>2018-10-01 19:41:35 +0200
commit62424ef3de67dc8077a0ca03b302966f0284730f (patch)
tree6ba3ede3616b9c2d12c562ee5774121ab72802ed /frontends
parent4d2917447cc14c590b4fee5ba36948fb4ee6884b (diff)
downloadyosys-62424ef3de67dc8077a0ca03b302966f0284730f.tar.gz
yosys-62424ef3de67dc8077a0ca03b302966f0284730f.tar.bz2
yosys-62424ef3de67dc8077a0ca03b302966f0284730f.zip
Add read_verilog $changed support
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/simplify.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index aa3b982d8..71eba547c 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -1836,7 +1836,7 @@ skip_dynamic_range_lvalue_expansion:;
goto apply_newNode;
}
- if (str == "\\$stable" || str == "\\$rose" || str == "\\$fell")
+ if (str == "\\$stable" || str == "\\$rose" || str == "\\$fell" || str == "\\$changed")
{
if (GetSize(children) != 1)
log_file_error(filename, linenum, "System function %s got %d arguments, expected 1.\n",
@@ -1853,6 +1853,9 @@ skip_dynamic_range_lvalue_expansion:;
if (str == "\\$stable")
newNode = new AstNode(AST_EQ, past, present);
+ else if (str == "\\$changed")
+ newNode = new AstNode(AST_NE, past, present);
+
else if (str == "\\$rose")
newNode = new AstNode(AST_LOGIC_AND, new AstNode(AST_LOGIC_NOT, past), present);