aboutsummaryrefslogtreecommitdiffstats
path: root/icefuzz/database.py
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2017-11-08 16:05:42 +0000
committerDavid Shah <davey1576@gmail.com>2017-11-08 16:05:42 +0000
commit629621642f4dd2d857edc914384b78161c438327 (patch)
tree5591833b846ec740b3a15a71dc24917c1dc4f08d /icefuzz/database.py
parentc69b87d59340d37de4c389791e4b8e1cc5cad713 (diff)
downloadicestorm-629621642f4dd2d857edc914384b78161c438327.tar.gz
icestorm-629621642f4dd2d857edc914384b78161c438327.tar.bz2
icestorm-629621642f4dd2d857edc914384b78161c438327.zip
Preparations for DSP and IpCon fuzzing
Diffstat (limited to 'icefuzz/database.py')
-rw-r--r--icefuzz/database.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/icefuzz/database.py b/icefuzz/database.py
index 8cb81d8..f8f3ccf 100644
--- a/icefuzz/database.py
+++ b/icefuzz/database.py
@@ -28,6 +28,9 @@ def read_database(filename, tile_type):
line = re.sub(r"^Ram config bit:", "RamConfig", line)
line = re.sub(r"^PLL config bit:", "PLL", line)
line = re.sub(r"^Icegate Enable bit:", "Icegate", line)
+ line = re.sub(r"^MAC16 functional bit:", "DspConfig", line)
+ line = re.sub(r"^Hard IP config bit:", "IpConfig", line)
+
line = line.split()
if line[0] == "routing":
if line[3] == "wire_gbuf/in": line[3] = "fabout"
@@ -61,7 +64,7 @@ def read_database(filename, tile_type):
line[1] = re.sub(r"glb_netwk_", "1k_glb_netwk_", line[1])
raw_db.append((bit, (line[0], line[1])))
elif line[0] == "Cascade":
- match = re.match("LH_LC0(\d)_inmux02_5", line[1])
+ match = re.match("(MULT\d|LH)_LC0(\d)_inmux02_5", line[1])
if match:
raw_db.append((bit, ("buffer", "wire_logic_cluster/lc_%d/lout" % (int(match.group(1))-1), "input_2_%s" % match.group(1))))
else:
@@ -87,6 +90,11 @@ def read_database(filename, tile_type):
raw_db.append((bit, (line[0],)))
elif line[0] == "Carry_In_Mux":
continue
+ elif line[0] == "DspConfig":
+ line[1] = re.sub(r"MULT\d_bram_cbit_", "CBIT_", line[1])
+ elif line[0] == "IpConfig":
+ line[1] = re.sub(r"MULT\d_bram_cbit_", "CBIT_", line[1]) #not a typo, sometimes IP config bits are in DSP tiles and use a MULT prefix...
+ line[1] = re.sub(r"IPCON_bram_cbit_", "CBIT_", line[1])
else:
print("unsupported statement: %s: %s" % (bit, line))
assert False
@@ -149,3 +157,11 @@ for device_class in ["5k", "8k"]:
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)
+if device_class == "5k":
+ for dsp_idx in range(4):
+ with open("database_dsp%d_5k.txt" % (dsp_idx, ), "w") as f:
+ for entry in read_database("bitdata_dsp%d_5k.txt" % (dsp_idx, ), "dsp%d_5" % (dsp_idx, )):
+ print("\t".join(entry), file=f)
+ with open("database_ipcon.txt", "w") as f:
+ for entry in read_database("bitdata_ipcon.txt", "ipcon"):
+ print("\t".join(entry), file=f) \ No newline at end of file