Skip to content

Commit

Permalink
Making the grouper code robust against netlists with macros with no p…
Browse files Browse the repository at this point in the history
…ins.

PiperOrigin-RevId: 639836794
Change-Id: I426dbfa5ea453c0d35c7d3cb6c0689eecf9f2e3f
  • Loading branch information
esonghori authored and copybara-github committed Jun 3, 2024
1 parent b9b916d commit f1f88a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion circuit_training/grouping/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,17 @@ def setup_fixed_groups(self, logic_levels_to_traverse: int) -> None:
# Goes through each macro, put each macro's pins into a separate group.
for netlist_node in self._meta_netlist.node:
if netlist_node.type == mnds.Type.MACRO and not netlist_node.soft_macro:
has_pins = False
for pin_ind in netlist_node.output_indices:
self.set_node_group(pin_ind, group_index)
has_pins = True

for pin_ind in netlist_node.input_indices:
self.set_node_group(pin_ind, group_index)
group_index += 1
has_pins = True

if has_pins:
group_index += 1

# Goes through I/O's.
# Most netlists will not have side constraints for ports, infer from the
Expand Down

0 comments on commit f1f88a1

Please sign in to comment.