File tree Expand file tree Collapse file tree 3 files changed +30
-8
lines changed
regression/verilog/primitive_gates Expand file tree Collapse file tree 3 files changed +30
-8
lines changed Original file line number Diff line number Diff line change
1
+ CORE
2
+ not1.sv
3
+ --bound 0
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ --
7
+ ^warning: ignoring
Original file line number Diff line number Diff line change
1
+ module main (input not_in);
2
+
3
+ wire not_out1, not_out2;
4
+
5
+ not not_gate (not_out1, not_out2, not_in);
6
+
7
+ // should pass
8
+ not_out1_ok : assert final (not_out1 == ! not_in);
9
+ not_out2_ok : assert final (not_out2 == ! not_in);
10
+
11
+ endmodule
Original file line number Diff line number Diff line change @@ -1586,17 +1586,21 @@ void verilog_synthesist::synth_module_instance_builtin(
1586
1586
{
1587
1587
assert (instance.connections ().size () >= 2 );
1588
1588
1589
- for (unsigned i = 0 ; i < instance.connections ().size () - 1 ; i++)
1590
- {
1591
- exprt op (ID_not, instance.type ());
1592
- op.add_to_operands (instance.connections ()[i]);
1589
+ // May have multiple outputs. The input is the last connection.
1590
+ auto &input = instance.connections ().back ();
1591
+ exprt rhs;
1593
1592
1594
- if (instance.type ().id ()!=ID_bool)
1595
- op.id (" bit" +op.id_string ());
1593
+ if (input.type ().id () == ID_bool)
1594
+ rhs = not_exprt{input};
1595
+ else
1596
+ rhs = bitnot_exprt{input};
1596
1597
1597
- equal_exprt constraint{op, instance. connections (). back ()} ;
1598
+ rhs. add_source_location () = module_item. source_location () ;
1598
1599
1599
- assert (trans.operands ().size ()==3 );
1600
+ for (std::size_t i = 0 ; i < instance.connections ().size () - 1 ; i++)
1601
+ {
1602
+ auto &lhs = instance.connections ()[i];
1603
+ auto constraint = equal_exprt{lhs, rhs};
1600
1604
trans.invar ().add_to_operands (std::move (constraint));
1601
1605
}
1602
1606
}
You can’t perform that action at this time.
0 commit comments