def print_db_nets(stmt, db, pos): print() print(stmt, end="") netnames = set() for entry in db: if entry[1] in ("routing", "buffer"): if icebox.pos_has_net(pos[0], entry[2]): netnames.add(entry[2]) if icebox.pos_has_net(pos[0], entry[3]): netnames.add(entry[3]) last_prefix = "" for net in sorted(netnames, icebox.cmp_netnames): match = re.match(r"(.*?)(\d+)$", net) if match: if last_prefix == match.group(1): print(",%s" % match.group(2), end="") else: print() print(net, end="") last_prefix = match.group(1) else: print() print(net, end="") last_prefix = "*" print()