From dbfd8460a9f1d24d1c8893dfae7dd272d17a7b6f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 29 Sep 2017 11:56:43 +0200 Subject: [PATCH] Allow $size and $bits in verilog mode, actually check test case --- frontends/ast/simplify.cc | 2 +- tests/{simple/functions01.sv => sat/sizebits.sv} | 0 tests/sat/sizebits.ys | 2 ++ 3 files changed, 3 insertions(+), 1 deletion(-) rename tests/{simple/functions01.sv => sat/sizebits.sv} (100%) create mode 100644 tests/sat/sizebits.ys diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 678951850..cd2120b8c 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -1870,7 +1870,7 @@ skip_dynamic_range_lvalue_expansion:; goto apply_newNode; } - if (VERILOG_FRONTEND::sv_mode && (str == "\\$size" || str == "\\$bits")) + if (str == "\\$size" || str == "\\$bits") { if (str == "\\$bits" && children.size() != 1) log_error("System function %s got %d arguments, expected 1 at %s:%d.\n", diff --git a/tests/simple/functions01.sv b/tests/sat/sizebits.sv similarity index 100% rename from tests/simple/functions01.sv rename to tests/sat/sizebits.sv diff --git a/tests/sat/sizebits.ys b/tests/sat/sizebits.ys new file mode 100644 index 000000000..689227a41 --- /dev/null +++ b/tests/sat/sizebits.ys @@ -0,0 +1,2 @@ +read_verilog -sv sizebits.sv +prep; sat -verify -prove-asserts -- 2.30.2