mirror of https://github.com/openXC7/prjxray.git
013-clbncy0: use gen_sites()
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
parent
4a4a91a1b6
commit
5ae13d9cd8
|
|
@ -2,33 +2,16 @@ import random
|
|||
random.seed(0)
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
def slice_xy():
|
||||
'''Return (X1, X2), (Y1, Y2) from XRAY_ROI, exclusive end (for xrange)'''
|
||||
# SLICE_X12Y100:SLICE_X27Y149
|
||||
# Note XRAY_ROI_GRID_* is something else
|
||||
m = re.match(
|
||||
r'SLICE_X([0-9]*)Y([0-9]*):SLICE_X([0-9]*)Y([0-9]*)',
|
||||
os.getenv('XRAY_ROI'))
|
||||
ms = [int(m.group(i + 1)) for i in range(4)]
|
||||
return ((ms[0], ms[2] + 1), (ms[1], ms[3] + 1))
|
||||
|
||||
from prjxray import util
|
||||
|
||||
CLBN = 400
|
||||
SLICEX, SLICEY = slice_xy()
|
||||
# 800
|
||||
SLICEN = (SLICEY[1] - SLICEY[0]) * (SLICEX[1] - SLICEX[0])
|
||||
print('//SLICEX: %s' % str(SLICEX))
|
||||
print('//SLICEY: %s' % str(SLICEY))
|
||||
print('//SLICEN: %s' % str(SLICEN))
|
||||
print('//Requested CLBs: %s' % str(CLBN))
|
||||
|
||||
|
||||
def gen_slices():
|
||||
for slicey in range(*SLICEY):
|
||||
for slicex in range(*SLICEX):
|
||||
yield "SLICE_X%dY%d" % (slicex, slicey)
|
||||
for _tile_name, site_name, _site_type in util.gen_sites(['SLICEL',
|
||||
'SLICEM']):
|
||||
yield site_name
|
||||
|
||||
|
||||
DIN_N = CLBN * 8
|
||||
|
|
|
|||
Loading…
Reference in New Issue