aboutsummaryrefslogtreecommitdiffstats
path: root/icefuzz
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2017-11-24 15:50:16 +0000
committerDavid Shah <davey1576@gmail.com>2017-11-24 15:50:16 +0000
commitdb87f484660dab833ea534e7d37c9c55417d5239 (patch)
tree9fdc63720c437f2a6959423d0d074160032f32a9 /icefuzz
parent6b2d196cb1b871eb333a7491fe725442a923bd13 (diff)
downloadicestorm-db87f484660dab833ea534e7d37c9c55417d5239.tar.gz
icestorm-db87f484660dab833ea534e7d37c9c55417d5239.tar.bz2
icestorm-db87f484660dab833ea534e7d37c9c55417d5239.zip
Documented I2C/SPI/LEDDA_IP
Diffstat (limited to 'icefuzz')
-rwxr-xr-xicefuzz/tests/ip/make_html_table.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/icefuzz/tests/ip/make_html_table.py b/icefuzz/tests/ip/make_html_table.py
new file mode 100755
index 0000000..3d8cb70
--- /dev/null
+++ b/icefuzz/tests/ip/make_html_table.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python3
+import ast, sys
+
+data = ""
+with open(sys.argv[1], 'r') as f:
+ data = f.read()
+
+ip_dat = ast.literal_eval("{\n" + data + "}")
+
+def is_cbit(ident):
+ if "_ENABLE" in ident or "DELAYED" in ident:
+ return True
+ else:
+ return False
+
+def is_bus(ident):
+ return ident.startswith("SB")
+
+ips = sorted(ip_dat)
+print ("<table class=\"cstab\">\n<tr><th>Signal</th>", end='')
+for ip in ips:
+ t, loc = ip
+ x, y, z = loc
+ print("<th>%s<br/>(%d, %d, %d)</th>" % (t, x, y, z), end='')
+print ("</tr>")
+
+# TODO: could group busses?
+for print_t in ["SB", "G", "CBIT"]:
+ for n in sorted(ip_dat[ips[0]]):
+ if is_bus(n) != (print_t == "SB"):
+ continue
+ if is_cbit(n) != (print_t == "CBIT"):
+ continue
+ print("<tr>", end='')
+ em_o = ""
+ em_c = ""
+ if is_cbit(n):
+ em_o = "<em>"
+ em_c = "</em>"
+ print("<td>%s%s%s</td>" % (em_o, n, em_c), end='')
+ for ip in ips:
+ entry = ip_dat[ip][n]
+ x, y, name = entry
+ print("<td>%s(%d, %d, %s)%s</td>" % (em_o, x, y, name, em_c), end='')
+ print("</tr>")
+print ("</table>") \ No newline at end of file