Skip to content

Commit d31784d

Browse files
committed
Verilog: port connection values must be synthesized
This fixes the creation of constraints for module port connections; the given value expression is now synthesized.
1 parent 81e3778 commit d31784d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
KNOWNBUG
1+
CORE
22
ports4.v
33
--bound 0
44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
^warning: ignoring
88
--
9-
The parameter in the module instance port binding is not expanded.

src/verilog/verilog_synthesis.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,11 @@ void verilog_synthesist::instantiate_port(
964964
throw 0;
965965
}
966966

967+
auto value_synthesized = synth_expr(value, symbol_statet::SYMBOL);
968+
967969
trans.invar().add_to_operands(equal_exprt(
968-
typecast_exprt::conditional_cast(it->second, value.type()), value));
970+
typecast_exprt::conditional_cast(it->second, value_synthesized.type()),
971+
value_synthesized));
969972
}
970973

971974
/*******************************************************************\

0 commit comments

Comments
 (0)