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/database.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'icefuzz/database.py') diff --git a/icefuzz/database.py b/icefuzz/database.py index e32b771..979b92b 100644 --- a/icefuzz/database.py +++ b/icefuzz/database.py @@ -2,6 +2,8 @@ import re, sys, os +device_class = os.getenv("ICEDEVICE") + def sort_bits_key(a): if a[0] == "!": a = a[1:] return re.sub(r"\d+", lambda m: "%02d" % int(m.group(0)), a) @@ -136,11 +138,11 @@ with open("database_ramt.txt", "w") as f: for entry in read_database("bitdata_ramt.txt", "ramt"): print("\t".join(entry), file=f) -with open("database_ramb_8k.txt", "w") as f: - for entry in read_database("bitdata_ramb_8k.txt", "ramb_8k"): - print("\t".join(entry), file=f) - -with open("database_ramt_8k.txt", "w") as f: - for entry in read_database("bitdata_ramt_8k.txt", "ramt_8k"): - print("\t".join(entry), file=f) +if device_class in ["5k", "8k"]: + with open("database_ramb_%s.txt" % (device_class, ), "w") as f: + for entry in read_database("bitdata_ramb_%s.txt" % (device_class, ), "ramb_" + device_class): + print("\t".join(entry), file=f) + with open("database_ramt_8k.txt", "w") as f: + for entry in read_database("bitdata_ramt_%s.txt" % (device_class, ), "ramt_" + device_class): + print("\t".join(entry), file=f) -- cgit v1.2.3 From a25c8679ac37df5219e1d7a8cdd932288cd596b1 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 23 Jun 2017 22:53:54 -0700 Subject: More work figuring out values in icebox.py --- icefuzz/database.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'icefuzz/database.py') diff --git a/icefuzz/database.py b/icefuzz/database.py index 979b92b..50a28fc 100644 --- a/icefuzz/database.py +++ b/icefuzz/database.py @@ -138,11 +138,11 @@ with open("database_ramt.txt", "w") as f: for entry in read_database("bitdata_ramt.txt", "ramt"): print("\t".join(entry), file=f) -if device_class in ["5k", "8k"]: +for device_class in ["5k", "8k"]: with open("database_ramb_%s.txt" % (device_class, ), "w") as f: for entry in read_database("bitdata_ramb_%s.txt" % (device_class, ), "ramb_" + device_class): print("\t".join(entry), file=f) - with open("database_ramt_8k.txt", "w") as f: + with open("database_ramt_%s.txt" % (device_class, ), "w") as f: for entry in read_database("bitdata_ramt_%s.txt" % (device_class, ), "ramt_" + device_class): print("\t".join(entry), file=f) -- cgit v1.2.3