ffprim experiment: tweaks

Signed-off-by: John McMaster <JohnDMcMaster@gmail.com>
Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
John McMaster 2017-11-15 14:30:02 -08:00 committed by Tim 'mithro' Ansell
parent 53cdc7d2d2
commit 8f770b3e6e
3 changed files with 16 additions and 7 deletions

View File

@ -40,7 +40,7 @@ print("Loading tags from design.txt")
with open("design.txt", "r") as f:
for line in f:
'''
puts $fp "$type $tile $grid_x $grid_y $ff $bel_type $used $usedstr"
puts $fp "$type $tile $grid_x $grid_y $ff $bel_type $used $usedstr"
CLBLM_L CLBLM_L_X10Y137 30 13 SLICE_X13Y137/AFF REG_INIT 1 FDRE
CLBLM_L CLBLM_L_X10Y137 30 13 SLICE_X12Y137/D5FF FF_INIT 0
@ -90,6 +90,7 @@ with open("design.txt", "r") as f:
CLB.SLICE_X0.FF_FDRE <9 candidates>
CLB.SLICE_X0.FF_FDCE <10 candidates>
'''
'''
if 1:
# If unused mark all primitives as not present
# Otherwise mark the primitive we are using
@ -98,12 +99,12 @@ with open("design.txt", "r") as f:
if ref_name == base:
for ffprim in ffprims:
segmk.addtag(site, "FF_DIFF_%s_%s" % (base, fprim, 0)
if 0:
for ffprim in ffprims:
segmk.addtag(site, "FF_%s" % ffprim, 0)
elif
segmk.addtag(site, "FF_%s" % ffprim, 1)
'''
# Compare '_1' negative edge clock to positive edge
if used:

View File

@ -10,7 +10,7 @@ python3 ../top.py >top.v
vivado -mode batch -source ../generate.tcl
for x in design*.bit; do
../../../tools/bitread -F $XRAY_ROI_FRAMES -o ${x}s -zy $x
../../../build/tools/bitread -F $XRAY_ROI_FRAMES -o ${x}s -z -y $x
done
python3 ../generate.py

View File

@ -1,5 +1,7 @@
import random
random.seed(0)
CLBN = 600
# SLICE_X12Y100
# SLICE_X27Y149
@ -19,7 +21,7 @@ def gen_slices():
DIN_N = CLBN * 4
DOUT_N = CLBN * 1
clbs = (
ffprims = (
'FD',
'FD_1',
'FDC',
@ -41,6 +43,12 @@ clbs = (
'FDSE',
'FDSE_1',
)
ffprims = (
'FDRE',
'FDSE',
'FDCE',
'FDPE',
)
ff_bels = (
'AFF',
'A5FF',
@ -85,13 +93,13 @@ endmodule
slices = gen_slices()
print('module roi(input clk, input [%d:0] din, output [%d:0] dout);' % (DIN_N - 1, DOUT_N - 1))
for i in range(CLBN):
clb = random.choice(clbs)
ffprim = random.choice(ffprims)
# clb_FD clb_FD (.clk(clk), .din(din[ 0 +: 4]), .dout(dout[ 0]));
# clb_FD_1 clb_FD_1 (.clk(clk), .din(din[ 4 +: 4]), .dout(dout[ 1]));
loc = next(slices)
#bel = random.choice(ff_bels)
bel = "AFF"
print(' clb_%s' % clb)
print(' clb_%s' % ffprim)
print(' #(.LOC("%s"), .BEL("%s"))' % (loc, bel))
print(' clb_%d (.clk(clk), .din(din[ %d +: 4]), .dout(dout[ %d]));' % (i, 4 * i, 1 * i))
print('''endmodule