From 4a4a91a1b63a8a1bfcad1f88c8319250746dfa74 Mon Sep 17 00:00:00 2001 From: John McMaster Date: Wed, 17 Oct 2018 21:17:56 -0700 Subject: [PATCH] 011-ffconfig: use gen_sites() Signed-off-by: John McMaster --- fuzzers/011-ffconfig/top.py | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/fuzzers/011-ffconfig/top.py b/fuzzers/011-ffconfig/top.py index 5cd402fd..717f2bbf 100644 --- a/fuzzers/011-ffconfig/top.py +++ b/fuzzers/011-ffconfig/top.py @@ -2,28 +2,11 @@ import random random.seed(0) import os import re +from prjxray import util from prims import * - -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)) - - CLBN = 600 -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)) f = open("top.txt", "w") @@ -31,9 +14,9 @@ f.write("i,prim,loc,bel,init\n") 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 * 4