diff options
Diffstat (limited to 'icefuzz/database.py')
-rw-r--r-- | icefuzz/database.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/icefuzz/database.py b/icefuzz/database.py index e32b771..8cb81d8 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) @@ -38,6 +40,9 @@ def read_database(filename, tile_type): if bit == "B9[3]" and line == ['IoCtrl', 'IE_1']: continue if bit == "B1[3]" and line == ['IoCtrl', 'REN_0']: continue if bit == "B6[2]" and line == ['IoCtrl', 'REN_1']: continue + # Ignore some additional configuration bits that sneaked in via ice5k fuzzing + if line[0] == "IoCtrl" and line[1].startswith("cf_bit_"): continue + if line[0] == "IoCtrl" and line[1].startswith("extra_padeb_test_"): continue raw_db.append((bit, (line[0], line[1]))) elif line[0] in ("IOB_0", "IOB_1"): if line[1] != "IO": @@ -136,11 +141,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) +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_%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) |