mirror of https://github.com/openXC7/prjxray.git
Make Python code testable.
Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
parent
96c1874131
commit
22fe886d44
|
|
@ -4,139 +4,142 @@ import sys
|
|||
import json
|
||||
import re
|
||||
|
||||
db_tiles = set()
|
||||
db_tile_prop = dict()
|
||||
db_tile_sites = dict()
|
||||
|
||||
db_sites = set()
|
||||
db_site_prop = dict()
|
||||
db_site_tile = dict()
|
||||
db_site_bit = dict()
|
||||
def main():
|
||||
db_tiles = set()
|
||||
db_tile_prop = dict()
|
||||
db_tile_sites = dict()
|
||||
|
||||
db_sites = set()
|
||||
db_site_prop = dict()
|
||||
db_site_tile = dict()
|
||||
db_site_bit = dict()
|
||||
|
||||
def add_tile(tile):
|
||||
if tile not in db_tiles:
|
||||
db_tiles.add(tile)
|
||||
db_tile_prop[tile] = dict()
|
||||
db_tile_sites[tile] = list()
|
||||
def add_tile(tile):
|
||||
if tile not in db_tiles:
|
||||
db_tiles.add(tile)
|
||||
db_tile_prop[tile] = dict()
|
||||
db_tile_sites[tile] = list()
|
||||
|
||||
def add_site(site):
|
||||
if site not in db_sites:
|
||||
db_sites.add(site)
|
||||
db_site_prop[site] = dict()
|
||||
|
||||
def add_site(site):
|
||||
if site not in db_sites:
|
||||
db_sites.add(site)
|
||||
db_site_prop[site] = dict()
|
||||
with open("%s.txt" % sys.argv[1]) as f:
|
||||
for line in f:
|
||||
line = line.split()
|
||||
|
||||
if line[0] == "TILEPROP":
|
||||
add_tile(line[1])
|
||||
db_tile_prop[line[1]][line[2]] = " ".join(line[3:])
|
||||
continue
|
||||
|
||||
with open("%s.txt" % sys.argv[1]) as f:
|
||||
for line in f:
|
||||
line = line.split()
|
||||
if line[0] == "TILESITE":
|
||||
add_tile(line[1])
|
||||
add_site(line[2])
|
||||
db_tile_sites[line[1]].append(line[2])
|
||||
db_site_tile[line[2]] = line[1]
|
||||
continue
|
||||
|
||||
if line[0] == "TILEPROP":
|
||||
add_tile(line[1])
|
||||
db_tile_prop[line[1]][line[2]] = " ".join(line[3:])
|
||||
continue
|
||||
if line[0] == "SITEPROP":
|
||||
add_site(line[1])
|
||||
db_site_prop[line[1]][line[2]] = " ".join(line[3:])
|
||||
continue
|
||||
|
||||
if line[0] == "TILESITE":
|
||||
add_tile(line[1])
|
||||
add_site(line[2])
|
||||
db_tile_sites[line[1]].append(line[2])
|
||||
db_site_tile[line[2]] = line[1]
|
||||
continue
|
||||
if line[0] == "SLICEBIT":
|
||||
db_site_bit[line[1]] = line[2]
|
||||
continue
|
||||
|
||||
if line[0] == "SITEPROP":
|
||||
add_site(line[1])
|
||||
db_site_prop[line[1]][line[2]] = " ".join(line[3:])
|
||||
continue
|
||||
assert False
|
||||
|
||||
if line[0] == "SLICEBIT":
|
||||
db_site_bit[line[1]] = line[2]
|
||||
continue
|
||||
print("Number of tiles: %d" % len(db_tiles))
|
||||
print("Number of sites: %d" % len(db_sites))
|
||||
print("Number of sites with bit: %d" % len(db_site_bit))
|
||||
|
||||
assert False
|
||||
database = dict()
|
||||
loc_to_tile = dict()
|
||||
|
||||
print("Number of tiles: %d" % len(db_tiles))
|
||||
print("Number of sites: %d" % len(db_sites))
|
||||
print("Number of sites with bit: %d" % len(db_site_bit))
|
||||
|
||||
database = dict()
|
||||
loc_to_tile = dict()
|
||||
|
||||
database["device"] = sys.argv[2]
|
||||
|
||||
database["tiles"] = dict()
|
||||
for tile in db_tiles:
|
||||
entry = dict()
|
||||
entry["props"] = db_tile_prop[tile]
|
||||
entry["sites"] = db_tile_sites[tile]
|
||||
database["tiles"][tile] = entry
|
||||
|
||||
col = int(db_tile_prop[tile]["COLUMN"])
|
||||
row = int(db_tile_prop[tile]["ROW"])
|
||||
loc_to_tile[(col, row)] = tile
|
||||
|
||||
database["sites"] = dict()
|
||||
for site in db_sites:
|
||||
entry = dict()
|
||||
entry["props"] = db_site_prop[site]
|
||||
entry["tile"] = db_site_tile[site]
|
||||
database["sites"][site] = entry
|
||||
|
||||
for site, bit in db_site_bit.items():
|
||||
bit = bit.split("_")
|
||||
bit_type = int(bit[4][1:])
|
||||
bit_half = int(bit[5][1:])
|
||||
bit_row = int(bit[6][1:])
|
||||
bit_col = int(bit[7][1:])
|
||||
bit_word = int(bit[9][1:])
|
||||
assert len(bit) == 11
|
||||
|
||||
for i in range(50):
|
||||
m = re.match("(.*)Y([0-9]+)", site)
|
||||
this_site = "%sY%d" % (m.group(1), int(m.group(2)) + i)
|
||||
|
||||
tile = db_site_tile[this_site]
|
||||
|
||||
word = bit_word + 2 * i
|
||||
if word >= 50: word += 1
|
||||
database["device"] = sys.argv[2]
|
||||
|
||||
database["tiles"] = dict()
|
||||
for tile in db_tiles:
|
||||
entry = dict()
|
||||
entry["BASE_FRAMEID"] = "0x%08x" % (
|
||||
(bit_type << 23) | (bit_half << 22) | (bit_row << 17) |
|
||||
(bit_col << 7))
|
||||
entry["FRAME_TYPE"] = bit_type
|
||||
entry["FRAME_HALF"] = bit_half
|
||||
entry["FRAME_ROW"] = bit_row
|
||||
entry["FRAME_COLUMN"] = bit_col
|
||||
entry["WORDS"] = [word, word + 1]
|
||||
entry["props"] = db_tile_prop[tile]
|
||||
entry["sites"] = db_tile_sites[tile]
|
||||
database["tiles"][tile] = entry
|
||||
|
||||
database["tiles"][tile]["cfgcol"] = entry
|
||||
col = int(db_tile_prop[tile]["COLUMN"])
|
||||
row = int(db_tile_prop[tile]["ROW"])
|
||||
loc_to_tile[(col, row)] = tile
|
||||
|
||||
if database["tiles"][tile]["props"]["TILE_TYPE"] in ("CLBLL_L",
|
||||
"CLBLM_L"):
|
||||
col = int(db_tile_prop[tile]["COLUMN"])
|
||||
row = int(db_tile_prop[tile]["ROW"])
|
||||
right_tile = loc_to_tile[(col + 1, row)]
|
||||
database["sites"] = dict()
|
||||
for site in db_sites:
|
||||
entry = dict()
|
||||
entry["props"] = db_site_prop[site]
|
||||
entry["tile"] = db_site_tile[site]
|
||||
database["sites"][site] = entry
|
||||
|
||||
database["tiles"][right_tile]["cfgcol"] = entry
|
||||
for site, bit in db_site_bit.items():
|
||||
bit = bit.split("_")
|
||||
bit_type = int(bit[4][1:])
|
||||
bit_half = int(bit[5][1:])
|
||||
bit_row = int(bit[6][1:])
|
||||
bit_col = int(bit[7][1:])
|
||||
bit_word = int(bit[9][1:])
|
||||
assert len(bit) == 11
|
||||
|
||||
if database["tiles"][tile]["props"]["TILE_TYPE"] in ("CLBLL_R",
|
||||
"CLBLM_R"):
|
||||
col = int(db_tile_prop[tile]["COLUMN"])
|
||||
row = int(db_tile_prop[tile]["ROW"])
|
||||
left_tile = loc_to_tile[(col - 1, row)]
|
||||
for i in range(50):
|
||||
m = re.match("(.*)Y([0-9]+)", site)
|
||||
this_site = "%sY%d" % (m.group(1), int(m.group(2)) + i)
|
||||
|
||||
database["tiles"][left_tile]["cfgcol"] = entry
|
||||
tile = db_site_tile[this_site]
|
||||
|
||||
tile_cfgcol_count = 0
|
||||
cfgcols = set()
|
||||
word = bit_word + 2 * i
|
||||
if word >= 50: word += 1
|
||||
|
||||
for tile in db_tiles:
|
||||
if "cfgcol" in database["tiles"][tile]:
|
||||
cfgcols.add(database["tiles"][tile]["cfgcol"]["BASE_FRAMEID"])
|
||||
tile_cfgcol_count += 1
|
||||
entry = dict()
|
||||
entry["BASE_FRAMEID"] = "0x%08x" % (
|
||||
(bit_type << 23) | (bit_half << 22) | (bit_row << 17) |
|
||||
(bit_col << 7))
|
||||
entry["FRAME_TYPE"] = bit_type
|
||||
entry["FRAME_HALF"] = bit_half
|
||||
entry["FRAME_ROW"] = bit_row
|
||||
entry["FRAME_COLUMN"] = bit_col
|
||||
entry["WORDS"] = [word, word + 1]
|
||||
|
||||
print("Number of assigned columns: %d" % len(cfgcols))
|
||||
print("Number of tiles with assigned column: %d" % tile_cfgcol_count)
|
||||
database["tiles"][tile]["cfgcol"] = entry
|
||||
|
||||
with open("%s.json" % sys.argv[1], "w") as f:
|
||||
print(json.dumps(database, sort_keys=True, indent="\t"), file=f)
|
||||
if database["tiles"][tile]["props"]["TILE_TYPE"] in ("CLBLL_L",
|
||||
"CLBLM_L"):
|
||||
col = int(db_tile_prop[tile]["COLUMN"])
|
||||
row = int(db_tile_prop[tile]["ROW"])
|
||||
right_tile = loc_to_tile[(col + 1, row)]
|
||||
|
||||
database["tiles"][right_tile]["cfgcol"] = entry
|
||||
|
||||
if database["tiles"][tile]["props"]["TILE_TYPE"] in ("CLBLL_R",
|
||||
"CLBLM_R"):
|
||||
col = int(db_tile_prop[tile]["COLUMN"])
|
||||
row = int(db_tile_prop[tile]["ROW"])
|
||||
left_tile = loc_to_tile[(col - 1, row)]
|
||||
|
||||
database["tiles"][left_tile]["cfgcol"] = entry
|
||||
|
||||
tile_cfgcol_count = 0
|
||||
cfgcols = set()
|
||||
|
||||
for tile in db_tiles:
|
||||
if "cfgcol" in database["tiles"][tile]:
|
||||
cfgcols.add(database["tiles"][tile]["cfgcol"]["BASE_FRAMEID"])
|
||||
tile_cfgcol_count += 1
|
||||
|
||||
print("Number of assigned columns: %d" % len(cfgcols))
|
||||
print("Number of tiles with assigned column: %d" % tile_cfgcol_count)
|
||||
|
||||
with open("%s.json" % sys.argv[1], "w") as f:
|
||||
print(json.dumps(database, sort_keys=True, indent="\t"), file=f)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ def get_db_root():
|
|||
|
||||
|
||||
def roi_xy():
|
||||
x1 = int(os.getenv('XRAY_ROI_GRID_X1'))
|
||||
x2 = int(os.getenv('XRAY_ROI_GRID_X2'))
|
||||
y1 = int(os.getenv('XRAY_ROI_GRID_Y1'))
|
||||
y2 = int(os.getenv('XRAY_ROI_GRID_Y2'))
|
||||
x1 = int(os.getenv('XRAY_ROI_GRID_X1', 0))
|
||||
x2 = int(os.getenv('XRAY_ROI_GRID_X2', 58))
|
||||
y1 = int(os.getenv('XRAY_ROI_GRID_Y1', 0))
|
||||
y2 = int(os.getenv('XRAY_ROI_GRID_Y2', 52))
|
||||
|
||||
return (x1, x2), (y1, y2)
|
||||
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@ class TestUtil(TestCase):
|
|||
}
|
||||
}
|
||||
with setup_database(makedb({})):
|
||||
self.assertEquals(list(get_roi().gen_sites()), [])
|
||||
self.assertListEqual(list(get_roi().gen_sites()), [])
|
||||
with setup_database(makedb({'FOO': 'BAR'})):
|
||||
self.assertEquals(
|
||||
self.assertListEqual(
|
||||
list(get_roi().gen_sites()), [('ATILE', 'FOO', 'BAR')])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from __future__ import print_function
|
||||
from prjxray import fasm_assembler
|
||||
from prjxray import db
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import os.path
|
||||
|
||||
from prjxray import fasm_assembler
|
||||
from prjxray import db
|
||||
|
||||
|
||||
class FASMSyntaxError(SyntaxError):
|
||||
pass
|
||||
|
||||
|
||||
def dump_frames_verbose(frames):
|
||||
print()
|
||||
|
|
|
|||
|
|
@ -105,11 +105,10 @@ def db_load():
|
|||
return db_res
|
||||
|
||||
|
||||
type_to_tiles, grid_to_tile, nodes, node_node_pip, reverse_node_node = db_load(
|
||||
)
|
||||
|
||||
|
||||
def route(args):
|
||||
type_to_tiles, grid_to_tile, nodes, node_node_pip, reverse_node_node = db_load(
|
||||
)
|
||||
|
||||
active_pips = set()
|
||||
blocked_nodes = set()
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ def bitread2bits(txt):
|
|||
return bits_ref
|
||||
|
||||
|
||||
# FIXME: These functions are currently broken.
|
||||
@unittest.skip
|
||||
class TestStringMethods(unittest.TestCase):
|
||||
def test_lut(self):
|
||||
'''Simple smoke test on just the LUTs'''
|
||||
|
|
|
|||
|
|
@ -5,89 +5,92 @@
|
|||
|
||||
import os, sys, json
|
||||
|
||||
with open("%s/%s/tilegrid.json" % (os.getenv("XRAY_DATABASE_DIR"),
|
||||
os.getenv("XRAY_DATABASE")), "r") as f:
|
||||
tilegrid = json.load(f)
|
||||
|
||||
with open("%s/%s/tileconn.json" % (os.getenv("XRAY_DATABASE_DIR"),
|
||||
os.getenv("XRAY_DATABASE")), "r") as f:
|
||||
tileconn = json.load(f)
|
||||
def main():
|
||||
with open("%s/%s/tilegrid.json" % (os.getenv("XRAY_DATABASE_DIR"),
|
||||
os.getenv("XRAY_DATABASE")), "r") as f:
|
||||
tilegrid = json.load(f)
|
||||
|
||||
grid = dict()
|
||||
wirepairs = dict()
|
||||
remwires = set()
|
||||
with open("%s/%s/tileconn.json" % (os.getenv("XRAY_DATABASE_DIR"),
|
||||
os.getenv("XRAY_DATABASE")), "r") as f:
|
||||
tileconn = json.load(f)
|
||||
|
||||
for tilename, tiledata in tilegrid.items():
|
||||
key = (tiledata["grid_x"], tiledata["grid_y"])
|
||||
grid[key] = tilename
|
||||
grid = dict()
|
||||
wirepairs = dict()
|
||||
remwires = set()
|
||||
|
||||
for tilename, tiledata in tilegrid.items():
|
||||
key = (tiledata["grid_x"], tiledata["grid_y"])
|
||||
grid[key] = tilename
|
||||
|
||||
def check_tileconn_entry(tilename, tiledata, entry, idx):
|
||||
if idx == 0:
|
||||
otheridx = 1
|
||||
otherxy = (
|
||||
tiledata["grid_x"] + entry["grid_deltas"][0],
|
||||
tiledata["grid_y"] + entry["grid_deltas"][1])
|
||||
else:
|
||||
otheridx = 0
|
||||
otherxy = (
|
||||
tiledata["grid_x"] - entry["grid_deltas"][0],
|
||||
tiledata["grid_y"] - entry["grid_deltas"][1])
|
||||
|
||||
if otherxy not in grid:
|
||||
return
|
||||
|
||||
othertilename = grid[otherxy]
|
||||
othertiledata = tilegrid[othertilename]
|
||||
|
||||
if othertiledata["type"] != entry["tile_types"][otheridx]:
|
||||
return
|
||||
|
||||
print(
|
||||
" Found relevant entry (%s %s %d %d): %s" % (
|
||||
entry["tile_types"][0], entry["tile_types"][1],
|
||||
entry["grid_deltas"][0], entry["grid_deltas"][1],
|
||||
othertilename))
|
||||
|
||||
for pair in entry["wire_pairs"]:
|
||||
wirename = "%s/%s" % (tilename, pair[idx])
|
||||
otherwirename = "%s/%s" % (othertilename, pair[otheridx])
|
||||
|
||||
remwires.add(wirename)
|
||||
remwires.add(otherwirename)
|
||||
|
||||
if wirename not in wirepairs:
|
||||
wirepairs[wirename] = set()
|
||||
wirepairs[wirename].add(otherwirename)
|
||||
|
||||
if otherwirename not in wirepairs:
|
||||
wirepairs[otherwirename] = set()
|
||||
wirepairs[otherwirename].add(wirename)
|
||||
|
||||
for tilename, tiledata in tilegrid.items():
|
||||
print("Connecting wires in tile %s." % tilename)
|
||||
for entry in tileconn:
|
||||
if entry["tile_types"][0] == tiledata["type"]:
|
||||
check_tileconn_entry(tilename, tiledata, entry, 0)
|
||||
if entry["tile_types"][1] == tiledata["type"]:
|
||||
check_tileconn_entry(tilename, tiledata, entry, 1)
|
||||
|
||||
def check_wire(wire, source):
|
||||
for next_wire in wirepairs[wire]:
|
||||
if next_wire == source:
|
||||
continue
|
||||
print(" %s" % next_wire)
|
||||
if next_wire not in remwires:
|
||||
print(" ** FOUND LOOP IN THIS NODE **")
|
||||
sys.exit(1)
|
||||
remwires.remove(next_wire)
|
||||
check_wire(next_wire, wire)
|
||||
|
||||
while len(remwires):
|
||||
wire = remwires.pop()
|
||||
print("Checking %s:" % wire)
|
||||
check_wire(wire, None)
|
||||
|
||||
print("NO LOOP FOUND: OK")
|
||||
|
||||
|
||||
def check_tileconn_entry(tilename, tiledata, entry, idx):
|
||||
if idx == 0:
|
||||
otheridx = 1
|
||||
otherxy = (
|
||||
tiledata["grid_x"] + entry["grid_deltas"][0],
|
||||
tiledata["grid_y"] + entry["grid_deltas"][1])
|
||||
else:
|
||||
otheridx = 0
|
||||
otherxy = (
|
||||
tiledata["grid_x"] - entry["grid_deltas"][0],
|
||||
tiledata["grid_y"] - entry["grid_deltas"][1])
|
||||
|
||||
if otherxy not in grid:
|
||||
return
|
||||
|
||||
othertilename = grid[otherxy]
|
||||
othertiledata = tilegrid[othertilename]
|
||||
|
||||
if othertiledata["type"] != entry["tile_types"][otheridx]:
|
||||
return
|
||||
|
||||
print(
|
||||
" Found relevant entry (%s %s %d %d): %s" % (
|
||||
entry["tile_types"][0], entry["tile_types"][1],
|
||||
entry["grid_deltas"][0], entry["grid_deltas"][1], othertilename))
|
||||
|
||||
for pair in entry["wire_pairs"]:
|
||||
wirename = "%s/%s" % (tilename, pair[idx])
|
||||
otherwirename = "%s/%s" % (othertilename, pair[otheridx])
|
||||
|
||||
remwires.add(wirename)
|
||||
remwires.add(otherwirename)
|
||||
|
||||
if wirename not in wirepairs:
|
||||
wirepairs[wirename] = set()
|
||||
wirepairs[wirename].add(otherwirename)
|
||||
|
||||
if otherwirename not in wirepairs:
|
||||
wirepairs[otherwirename] = set()
|
||||
wirepairs[otherwirename].add(wirename)
|
||||
|
||||
|
||||
for tilename, tiledata in tilegrid.items():
|
||||
print("Connecting wires in tile %s." % tilename)
|
||||
for entry in tileconn:
|
||||
if entry["tile_types"][0] == tiledata["type"]:
|
||||
check_tileconn_entry(tilename, tiledata, entry, 0)
|
||||
if entry["tile_types"][1] == tiledata["type"]:
|
||||
check_tileconn_entry(tilename, tiledata, entry, 1)
|
||||
|
||||
|
||||
def check_wire(wire, source):
|
||||
for next_wire in wirepairs[wire]:
|
||||
if next_wire == source:
|
||||
continue
|
||||
print(" %s" % next_wire)
|
||||
if next_wire not in remwires:
|
||||
print(" ** FOUND LOOP IN THIS NODE **")
|
||||
sys.exit(1)
|
||||
remwires.remove(next_wire)
|
||||
check_wire(next_wire, wire)
|
||||
|
||||
|
||||
while len(remwires):
|
||||
wire = remwires.pop()
|
||||
print("Checking %s:" % wire)
|
||||
check_wire(wire, None)
|
||||
|
||||
print("NO LOOP FOUND: OK")
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
|||
|
|
@ -2,39 +2,46 @@
|
|||
|
||||
import os, sys, json
|
||||
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage example: python3 %s HCLK_R HCLK_SW6E3" % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
with open("%s/%s/tileconn.json" % (os.getenv("XRAY_DATABASE_DIR"),
|
||||
os.getenv("XRAY_DATABASE")), "r") as f:
|
||||
tileconn = json.load(f)
|
||||
def main(argv):
|
||||
if len(argv) != 3:
|
||||
print("Usage example: python3 %s HCLK_R HCLK_SW6E3" % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
outdata = list()
|
||||
max_tiletype_len = 1
|
||||
with open("%s/%s/tileconn.json" % (os.getenv("XRAY_DATABASE_DIR"),
|
||||
os.getenv("XRAY_DATABASE")), "r") as f:
|
||||
tileconn = json.load(f)
|
||||
|
||||
for entry in tileconn:
|
||||
if entry["tile_types"][0] == sys.argv[1]:
|
||||
this_idx, other_idx = 0, 1
|
||||
delta_x, delta_y = entry["grid_deltas"]
|
||||
elif entry["tile_types"][1] == sys.argv[1]:
|
||||
this_idx, other_idx = 1, 0
|
||||
delta_x, delta_y = -entry["grid_deltas"][0], -entry["grid_deltas"][1]
|
||||
else:
|
||||
continue
|
||||
outdata = list()
|
||||
max_tiletype_len = 1
|
||||
|
||||
for wire_pair in entry["wire_pairs"]:
|
||||
if wire_pair[this_idx] != sys.argv[2]:
|
||||
for entry in tileconn:
|
||||
if entry["tile_types"][0] == sys.argv[1]:
|
||||
this_idx, other_idx = 0, 1
|
||||
delta_x, delta_y = entry["grid_deltas"]
|
||||
elif entry["tile_types"][1] == sys.argv[1]:
|
||||
this_idx, other_idx = 1, 0
|
||||
delta_x, delta_y = -entry["grid_deltas"][0], -entry["grid_deltas"][
|
||||
1]
|
||||
else:
|
||||
continue
|
||||
|
||||
outdata.append(
|
||||
(
|
||||
delta_x, delta_y, entry["tile_types"][other_idx],
|
||||
wire_pair[other_idx]))
|
||||
max_tiletype_len = max(
|
||||
max_tiletype_len, len(entry["tile_types"][other_idx]))
|
||||
for wire_pair in entry["wire_pairs"]:
|
||||
if wire_pair[this_idx] != sys.argv[2]:
|
||||
continue
|
||||
|
||||
for entry in outdata:
|
||||
print(
|
||||
"%3d %3d %-*s %s" %
|
||||
(entry[0], entry[1], max_tiletype_len, entry[2], entry[3]))
|
||||
outdata.append(
|
||||
(
|
||||
delta_x, delta_y, entry["tile_types"][other_idx],
|
||||
wire_pair[other_idx]))
|
||||
max_tiletype_len = max(
|
||||
max_tiletype_len, len(entry["tile_types"][other_idx]))
|
||||
|
||||
for entry in outdata:
|
||||
print(
|
||||
"%3d %3d %-*s %s" %
|
||||
(entry[0], entry[1], max_tiletype_len, entry[2], entry[3]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
||||
|
|
|
|||
Loading…
Reference in New Issue