Add read_verilog $changed support
authorDan Gisselquist <zipcpu@gmail.com>
Mon, 1 Oct 2018 17:41:35 +0000 (19:41 +0200)
committerJim Lawson <ucbjrl@berkeley.edu>
Mon, 8 Oct 2018 18:38:10 +0000 (11:38 -0700)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
frontends/ast/simplify.cc

index aa3b982d81b3985f883b12f6da31ba17b1291e15..71eba547c33068e3114daa2a648e0466e68d31fa 100644 (file)
@@ -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);