From 58a6110be198089d784b5ad3e2ecb611182bd5ea Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 22 Jun 2017 17:38:38 -0700 Subject: Add icefuzz support for the UP5K and rework underlying device specification for more flexibility. --- icefuzz/make_gbio.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'icefuzz/make_gbio.py') diff --git a/icefuzz/make_gbio.py b/icefuzz/make_gbio.py index 555d37d..bbc4ae9 100644 --- a/icefuzz/make_gbio.py +++ b/icefuzz/make_gbio.py @@ -7,14 +7,26 @@ import os os.system("rm -rf work_gbio") os.mkdir("work_gbio") -w = 4 if os.getenv('ICE384PINS') else 8 +device_class = os.getenv("ICEDEVICE") for p in gpins: if p in pins: pins.remove(p) +# We can either tickle every global buffer or we don't have enough pins to do +# the full logic for each one. +w = min(min((len(pins) - 8) // 4, len(gpins)), 8) + for idx in range(num): with open("work_gbio/gbio_%02d.v" % idx, "w") as f: glbs = np.random.permutation(list(range(8))) + + if w <= 4: + din_0 = (w - 2, w) + else: + din_0 = (4, "%d:4" % (w - 1,)) + din_0 = np.random.choice(["din_0", "{din_0[%d:0], din_0[%s]}" % din_0]) + din_1 = np.random.choice(["din_1", "{din_1[1:0], din_1[%d:2]}" % (w - 1,)]) + globals_0 = np.random.choice(["globals", "{globals[0], globals[%d:1]}" % (w - 1, )]) print(""" module top ( inout [%s:0] pin, @@ -64,12 +76,9 @@ for idx in range(num): np.random.choice(["oen", "globals", "din_0+din_1", "din_0^din_1"]), np.random.choice(["dout_1", "globals", "globals^dout_0", "din_0+din_1", "~din_0"]), np.random.choice(["dout_0", "globals", "globals^dout_1", "din_0+din_1", "~din_1"]), - np.random.choice(["din_0", "{din_0[2:0], din_0[3]}"]) if os.getenv('ICE384PINS') - else np.random.choice(["din_0", "{din_0[3:0], din_0[7:4]}"]) , - np.random.choice(["din_1", "{din_1[1:0], din_1[3:2]}"]) if os.getenv('ICE384PINS') - else np.random.choice(["din_1", "{din_1[1:0], din_1[7:2]}"]), - np.random.choice(["globals", "{globals[0], globals[3:1]}"]) if os.getenv('ICE384PINS') - else np.random.choice(["globals", "{globals[0], globals[7:1]}"]), + din_0, + din_1, + globals_0, glbs[0], glbs[1], glbs[1], glbs[2], glbs[3] ), file=f) with open("work_gbio/gbio_%02d.pcf" % idx, "w") as f: @@ -89,4 +98,3 @@ with open("work_gbio/Makefile", "w") as f: for i in range(num): print("gbio_%02d.bin:" % i, file=f) print("\t-bash ../icecube.sh gbio_%02d > gbio_%02d.log 2>&1 && rm -rf gbio_%02d.tmp || tail gbio_%02d.log" % (i, i, i, i), file=f) - -- cgit v1.2.3 From b00ffb1c091b65ed6c741dde74a4e7d5f709efd1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Sun, 2 Jul 2017 15:38:44 -0700 Subject: Introduce device class into fuxx workign directories and have glbcheck handle unsupported 5k tiles ok. --- icefuzz/make_gbio.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'icefuzz/make_gbio.py') diff --git a/icefuzz/make_gbio.py b/icefuzz/make_gbio.py index bbc4ae9..a12bea9 100644 --- a/icefuzz/make_gbio.py +++ b/icefuzz/make_gbio.py @@ -4,11 +4,13 @@ from fuzzconfig import * import numpy as np import os -os.system("rm -rf work_gbio") -os.mkdir("work_gbio") - device_class = os.getenv("ICEDEVICE") +working_dir = "work_%s_gbio" % (device_class, ) + +os.system("rm -rf " + working_dir) +os.mkdir(working_dir) + for p in gpins: if p in pins: pins.remove(p) @@ -17,7 +19,7 @@ for p in gpins: w = min(min((len(pins) - 8) // 4, len(gpins)), 8) for idx in range(num): - with open("work_gbio/gbio_%02d.v" % idx, "w") as f: + with open(working_dir + "/gbio_%02d.v" % idx, "w") as f: glbs = np.random.permutation(list(range(8))) if w <= 4: @@ -81,7 +83,7 @@ for idx in range(num): globals_0, glbs[0], glbs[1], glbs[1], glbs[2], glbs[3] ), file=f) - with open("work_gbio/gbio_%02d.pcf" % idx, "w") as f: + with open(working_dir + "/gbio_%02d.pcf" % idx, "w") as f: p = np.random.permutation(pins) g = np.random.permutation(gpins) for i in range(w): @@ -93,8 +95,5 @@ for idx in range(num): print("set_io %s %s" % (n, p[4*w+i]), file=f) print("set_io q %s" % (p[-1]), file=f) -with open("work_gbio/Makefile", "w") as f: - print("all: %s" % " ".join(["gbio_%02d.bin" % i for i in range(num)]), file=f) - for i in range(num): - print("gbio_%02d.bin:" % i, file=f) - print("\t-bash ../icecube.sh gbio_%02d > gbio_%02d.log 2>&1 && rm -rf gbio_%02d.tmp || tail gbio_%02d.log" % (i, i, i, i), file=f) + +output_makefile(working_dir, "gbio") -- cgit v1.2.3