mirror of https://github.com/openXC7/prjxray.git
Use create_xy_fun.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
parent
88b2fc6d35
commit
e7d32dadb4
|
|
@ -1,18 +1,13 @@
|
|||
import json
|
||||
import os
|
||||
import re
|
||||
import random
|
||||
random.seed(int(os.getenv("SEED"), 16))
|
||||
from prjxray import util
|
||||
from prjxray import verilog
|
||||
from prjxray.db import Database
|
||||
|
||||
XY_RE = re.compile('^BUFGCTRL_X([0-9]+)Y([0-9]+)$')
|
||||
|
||||
|
||||
def gen_sites():
|
||||
db = Database(util.get_db_root())
|
||||
grid = db.grid()
|
||||
xy_fun = util.create_xy_fun('BUFGCTRL_')
|
||||
db = Database(util.get_db_root())
|
||||
grid = db.grid()
|
||||
for tile_name in sorted(grid.tiles()):
|
||||
|
|
@ -24,10 +19,7 @@ def gen_sites():
|
|||
ys = []
|
||||
for site, site_type in gridinfo.sites.items():
|
||||
if site_type == 'BUFGCTRL':
|
||||
m = re.match(XY_RE, site)
|
||||
assert m, site
|
||||
x = int(m.group(1))
|
||||
y = int(m.group(2))
|
||||
x, y = xy_fun()
|
||||
xs.append(x)
|
||||
ys.append(y)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue