Skip to content

Commit 5a375ea

Browse files
committed
Adding support for generating additional port
1 parent 0893366 commit 5a375ea

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

spydrnet_physical/util/ConnectPointList.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,11 @@ def print_port_stat(self, netlist, filename=None):
811811
fp.write("\n".join(output))
812812
return output
813813

814-
def show_stats(self, netlist):
814+
def show_stats(self, netlist, additional_ports=None):
815815
'''
816816
Extracts the connectivity statistics for port and connection creation
817817
'''
818-
mstat = {}
818+
mstat = additional_ports if additional_ports else {}
819819
for point in self._points:
820820

821821
if point.level in ["same", "down"]:
@@ -830,10 +830,9 @@ def show_stats(self, netlist):
830830
mstat[to_conn]["in"] = mstat[to_conn].get(
831831
"in", {"left": 0, "right": 0, "top": 0, "bottom": 0})
832832
mstat[to_conn]["in"][point.direction(reverse=False)] += 1
833-
834833
return OrderedDict((module, mstat[module]) for module in sorted(mstat))
835834

836-
def create_ft_ports(self, netlist: sdn.Netlist, port_name: str, cable: sdn.Cable):
835+
def create_ft_ports(self, netlist: sdn.Netlist, port_name: str, cable: sdn.Cable, additional_ports: None):
837836
'''
838837
Create feedthrough port on the given module
839838
@@ -842,7 +841,7 @@ def create_ft_ports(self, netlist: sdn.Netlist, port_name: str, cable: sdn.Cable
842841
port (str): port name on each module
843842
'''
844843

845-
for m_name, values in self.show_stats(netlist).items():
844+
for m_name, values in self.show_stats(netlist, additional_ports).items():
846845
if m_name == "top":
847846
continue
848847
# Get current module

0 commit comments

Comments
 (0)