Skip to content

Commit

Permalink
Adding support for generating additional port
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshgore committed Sep 24, 2024
1 parent 0893366 commit 5a375ea
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions spydrnet_physical/util/ConnectPointList.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,11 @@ def print_port_stat(self, netlist, filename=None):
fp.write("\n".join(output))
return output

def show_stats(self, netlist):
def show_stats(self, netlist, additional_ports=None):
'''
Extracts the connectivity statistics for port and connection creation
'''
mstat = {}
mstat = additional_ports if additional_ports else {}
for point in self._points:

if point.level in ["same", "down"]:
Expand All @@ -830,10 +830,9 @@ def show_stats(self, netlist):
mstat[to_conn]["in"] = mstat[to_conn].get(
"in", {"left": 0, "right": 0, "top": 0, "bottom": 0})
mstat[to_conn]["in"][point.direction(reverse=False)] += 1

return OrderedDict((module, mstat[module]) for module in sorted(mstat))

def create_ft_ports(self, netlist: sdn.Netlist, port_name: str, cable: sdn.Cable):
def create_ft_ports(self, netlist: sdn.Netlist, port_name: str, cable: sdn.Cable, additional_ports: None):
'''
Create feedthrough port on the given module
Expand All @@ -842,7 +841,7 @@ def create_ft_ports(self, netlist: sdn.Netlist, port_name: str, cable: sdn.Cable
port (str): port name on each module
'''

for m_name, values in self.show_stats(netlist).items():
for m_name, values in self.show_stats(netlist, additional_ports).items():
if m_name == "top":
continue
# Get current module
Expand Down

0 comments on commit 5a375ea

Please sign in to comment.