Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# EBMC 5.9

* SystemVerilog: fix for type parameters
* SMV: word constants
* SMV: IVAR declarations
* SMV: bit selection operator
Expand Down
4 changes: 2 additions & 2 deletions regression/verilog/modules/type_parameters1.desc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
CORE
type_parameters1.sv

^\[main\.p1\] always \$bits\(main\.T1\) == 1: PROVED .*$
^\[main\.p2\] always \$bits\(main\.T2\) == 32: PROVED .*$
^\[main\.p1\] always \$bits\(bool\) == 1: PROVED .*$
^\[main\.p2\] always \$bits\(\[31:0\]\) == 32: PROVED .*$
^EXIT=0$
^SIGNAL=0$
--
Expand Down
7 changes: 7 additions & 0 deletions regression/verilog/modules/type_parameters2.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
type_parameters2.sv

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
9 changes: 9 additions & 0 deletions regression/verilog/modules/type_parameters2.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module main;

parameter type T1 = bit [31:0];

T1 some_data;

initial assert ($bits(some_data) == 32);

endmodule
6 changes: 5 additions & 1 deletion src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,11 @@ type_assignment: param_identifier '=' data_type
auto base_name = stack_expr($1).id();
stack_expr($$).set(ID_identifier, base_name);
stack_expr($$).set(ID_base_name, base_name);
addswap($$, ID_type, $3); }
addswap($$, ID_type, $3);

// add to the scope as a type name
PARSER.scopes.add_name(base_name, "", verilog_scopet::TYPEDEF);
}
;

data_type_or_implicit:
Expand Down
Loading