File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed
Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 22
33* Verilog: fix for four-valued | and &
44* Verilog: fix for typed parameter ports
5+ * Verilog: fix for the type of implicit nets for continous assignments
56* SystemVerilog: fix for type parameters
67* SystemVerilog: type parameter ports
78* SMV: word constants
Original file line number Diff line number Diff line change 1- KNOWNBUG
1+ CORE
22implicit_declaration1.sv
33
44^EXIT=0$
55^SIGNAL=0$
66--
77^warning: ignoring
88--
9- This gives the wrong answer.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ module main;
55 // implicit nets are allowed on the LHS of a continuous assignment
66 assign O = A & B ;
77
8- always assert final (O == (A & B ));
9- always assert final ($bits (O ) == 4 );
8+ always assert final (O == (A & B & 1'b1 ));
9+ always assert final ($bits (O ) == 1 );
1010
1111endmodule
Original file line number Diff line number Diff line change @@ -857,16 +857,18 @@ void verilog_typecheckt::convert_continuous_assign(
857857 exprt &rhs = to_binary_expr (*it).rhs ();
858858
859859 // IEEE 1800 2017 6.10 allows implicit declarations of nets when
860- // used as the LHS of a continuous assignment. The type is derived
861- // from the RHS, and hence, we convert that first.
862- convert_expr (rhs);
863-
860+ // used as the LHS of a continuous assignment. The type is _not_
861+ // derived from the RHS, but instead a "scalar net of default net type".
864862 if (lhs.id () == ID_verilog_identifier)
865- lhs =
866- convert_verilog_identifier (to_verilog_identifier_expr (lhs), rhs.type ());
863+ {
864+ lhs = convert_verilog_identifier (
865+ to_verilog_identifier_expr (lhs), unsignedbv_typet{1 });
866+ }
867867 else
868868 convert_expr (lhs);
869869
870+ convert_expr (rhs);
871+
870872 assignment_conversion (rhs, lhs.type ());
871873
872874 check_lhs (lhs, A_CONTINUOUS);
You can’t perform that action at this time.
0 commit comments