-
Notifications
You must be signed in to change notification settings - Fork 88
/
get_tilegrid_all.py
executable file
·34 lines (26 loc) · 1.14 KB
/
get_tilegrid_all.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
"""
For each family and device, obtain a tilegrid and save it in the database
"""
import os
from os import path
import shutil
import extract_tilegrid
import diamond
import database
def main():
shutil.rmtree("work_tilegrid", ignore_errors=True)
os.mkdir("work_tilegrid")
shutil.copy(path.join(database.get_trellis_root(), "minitests", "wire", "wire.v"), "work_tilegrid/wire.v")
devices = database.get_devices()
for family in sorted(devices["families"].keys()):
for device in sorted(devices["families"][family]["devices"].keys()):
if devices["families"][family]["devices"][device]["fuzz"]:
diamond.run(device, "work_tilegrid/wire.v")
output_file = path.join(database.get_db_subdir(family, device), "tilegrid.json")
if family in ["ECP5", "MachXO"]:
extract_tilegrid.main(["extract_tilegrid", "work_tilegrid/wire.tmp/output.test", output_file])
else: # MachXO2
extract_tilegrid.main(["extract_tilegrid", "-m", "work_tilegrid/wire.tmp/output.test", output_file])
if __name__ == "__main__":
main()