diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-07-02 15:38:44 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-07-02 15:38:44 -0700 |
| commit | b00ffb1c091b65ed6c741dde74a4e7d5f709efd1 (patch) | |
| tree | 37504d253d295bb2487bb5753fb22f8a8ca09d17 /icefuzz/make_ram40.py | |
| parent | a25c8679ac37df5219e1d7a8cdd932288cd596b1 (diff) | |
Introduce device class into fuxx workign directories and have glbcheck handle unsupported 5k tiles ok.
Diffstat (limited to 'icefuzz/make_ram40.py')
| -rw-r--r-- | icefuzz/make_ram40.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/icefuzz/make_ram40.py b/icefuzz/make_ram40.py index b19d5e6..f4acb4e 100644 --- a/icefuzz/make_ram40.py +++ b/icefuzz/make_ram40.py @@ -4,11 +4,15 @@ from fuzzconfig import * import numpy as np import os -os.system("rm -rf work_ram40") -os.mkdir("work_ram40") +device_class = os.getenv("ICEDEVICE") + +working_dir = "work_%s_ram40" % (device_class, ) + +os.system("rm -rf " + working_dir) +os.mkdir(working_dir) for idx in range(num): - with open("work_ram40/ram40_%02d.v" % idx, "w") as f: + with open(working_dir + "/ram40_%02d.v" % idx, "w") as f: glbs = ["glb[%d]" % i for i in range(np.random.randint(8)+1)] glbs_choice = ["wa", "ra", "msk", "wd", "we", "wce", "wc", "re", "rce", "rc"] print(""" @@ -96,15 +100,12 @@ for idx in range(num): bits[k] = "rdata_%d[%d] ^ %s" % (i, k, bits[k]) print("assign out_pins = rdata_%d;" % i, file=f) print("endmodule", file=f) - with open("work_ram40/ram40_%02d.pcf" % idx, "w") as f: + with open(working_dir + "/ram40_%02d.pcf" % idx, "w") as f: p = list(np.random.permutation(pins)) for i in range(len(pins) - 16): print("set_io in_pins[%d] %s" % (i, p.pop()), file=f) for i in range(16): print("set_io out_pins[%d] %s" % (i, p.pop()), file=f) -with open("work_ram40/Makefile", "w") as f: - print("all: %s" % " ".join(["ram40_%02d.bin" % i for i in range(num)]), file=f) - for i in range(num): - print("ram40_%02d.bin:" % i, file=f) - print("\t-bash ../icecube.sh ram40_%02d > ram40_%02d.log 2>&1 && rm -rf ram40_%02d.tmp || tail ram40_%02d.log" % (i, i, i, i), file=f) + +output_makefile(working_dir, "ram40") |
