def __get_ports(interconnect: Interconnect, bit_width, predicate): interface = interconnect.interface() result = [] for port_name in interface: port = interconnect.ports[port_name] port_type = port.base_type() node = interface[port_name] if node.width != bit_width: continue if predicate(port_type): result.append(node) return result
def __get_interface_name(interconnect: Interconnect): result = {} interface = interconnect.interface() for port_name, port_node in interface.items(): result[port_node] = port_name return result