aboutsummaryrefslogtreecommitdiffstats
path: root/icefuzz/pinloc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-07-18 13:10:40 +0200
committerClifford Wolf <clifford@clifford.at>2015-07-18 13:10:40 +0200
commit48154cb6f452d3bdb4da36cc267b4b6c45588dc9 (patch)
tree3ec3be9ef7e8db1fb7c764ed8202e0215a8eb7c7 /icefuzz/pinloc
parent13e63e6b65e044e348356731b55610d02cb308b9 (diff)
downloadicestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.tar.gz
icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.tar.bz2
icestorm-48154cb6f452d3bdb4da36cc267b4b6c45588dc9.zip
Imported full dev sources
Diffstat (limited to 'icefuzz/pinloc')
-rw-r--r--icefuzz/pinloc/pinloc-1k-tq144.sh33
-rw-r--r--icefuzz/pinloc/pinloc-8k-ct256.sh44
-rw-r--r--icefuzz/pinloc/pinlocdb.py46
3 files changed, 123 insertions, 0 deletions
diff --git a/icefuzz/pinloc/pinloc-1k-tq144.sh b/icefuzz/pinloc/pinloc-1k-tq144.sh
new file mode 100644
index 0000000..64f9f69
--- /dev/null
+++ b/icefuzz/pinloc/pinloc-1k-tq144.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+pins="
+ 1 2 3 4 7 8 9 10 11 12 19 20 21 22 23 24 25 26 28 29 31 32 33 34
+ 37 38 39 41 42 43 44 45 47 48 49 50 52 56 58 60 61 62 63 64 67 68 70 71
+ 73 74 75 76 78 79 80 81 87 88 90 91 93 94 95 96 97 98 99 101 102 104 105 106 107
+ 112 113 114 115 116 117 118 119 120 121 122 128 129 134 135 136 137 138 139 141 142 143 144
+"
+
+{
+ echo -n "all:"
+ for pin in $pins; do
+ id="pinloc-1k-tq144_${pin}"
+ echo -n " ${id}.exp"
+ done
+ echo
+
+ for pin in $pins; do
+ id="pinloc-1k-tq144_${pin}"
+ echo "module top(output y); assign y = 0; endmodule" > ${id}.v
+ echo "set_io y ${pin}" >> ${id}.pcf
+ echo; echo "${id}.exp:"
+ echo " ICEDEV=hx1k-tq144 bash ../icecube.sh ${id} > ${id}.log 2>&1"
+ echo " ../../icebox/icebox_explain.py ${id}.txt > ${id}.exp.new"
+ echo " rm -rf ${id}.tmp"
+ echo " mv ${id}.exp.new ${id}.exp"
+ done
+} > pinloc-1k-tq144.mk
+
+set -ex
+make -f pinloc-1k-tq144.mk -j4
+python pinlocdb.py pinloc-1k-tq144_*.exp > pinloc-1k-tq144.txt
+
diff --git a/icefuzz/pinloc/pinloc-8k-ct256.sh b/icefuzz/pinloc/pinloc-8k-ct256.sh
new file mode 100644
index 0000000..d3cf419
--- /dev/null
+++ b/icefuzz/pinloc/pinloc-8k-ct256.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+pins="
+ A1 A2 A5 A6 A7 A9 A10 A11 A15 A16
+ B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B16
+ C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C16
+ D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D13 D14 D15 D16
+ E2 E3 E4 E5 E6 E9 E10 E11 E13 E14 E16
+ F1 F2 F3 F4 F5 F7 F9 F11 F12 F13 F14 F15 F16
+ G1 G2 G3 G4 G5 G10 G11 G12 G13 G14 G15 G16
+ H1 H2 H3 H4 H5 H6 H11 H12 H13 H14 H16
+ J1 J2 J3 J4 J5 J10 J11 J12 J13 J14 J15 J16
+ K1 K3 K4 K5 K9 K11 K12 K13 K14 K15 K16
+ L1 L3 L4 L5 L6 L7 L9 L10 L11 L12 L13 L14 L16
+ M1 M2 M3 M4 M5 M6 M7 M8 M9 M11 M12 M13 M14 M15 M16
+ N2 N3 N4 N5 N6 N7 N9 N10 N12 N16
+ P1 P2 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16
+ R1 R2 R3 R4 R5 R6 R9 R10 R11 R12 R14 R15 R16
+ T1 T2 T3 T5 T6 T7 T8 T9 T10 T11 T13 T14 T15 T16
+"
+
+{
+ echo -n "all:"
+ for pin in $pins; do
+ id="pinloc-8k-ct256_${pin}"
+ echo -n " ${id}.exp"
+ done
+ echo
+
+ for pin in $pins; do
+ id="pinloc-8k-ct256_${pin}"
+ echo "module top(output y); assign y = 0; endmodule" > ${id}.v
+ echo "set_io y ${pin}" >> ${id}.pcf
+ echo; echo "${id}.exp:"
+ echo " ICEDEV=hx8k-ct256 bash ../icecube.sh ${id} > ${id}.log 2>&1"
+ echo " ../../icebox/icebox_explain.py ${id}.txt > ${id}.exp.new"
+ echo " rm -rf ${id}.tmp"
+ echo " mv ${id}.exp.new ${id}.exp"
+ done
+} > pinloc-8k-ct256.mk
+
+set -ex
+make -f pinloc-8k-ct256.mk -j4
+python pinlocdb.py pinloc-8k-ct256_*.exp > pinloc-8k-ct256.txt
diff --git a/icefuzz/pinloc/pinlocdb.py b/icefuzz/pinloc/pinlocdb.py
new file mode 100644
index 0000000..31c6476
--- /dev/null
+++ b/icefuzz/pinloc/pinlocdb.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+
+from __future__ import division
+from __future__ import print_function
+
+import re
+from sys import argv
+
+ieren_db = [ ]
+pinloc_db = [ ]
+
+for arg in argv[1:]:
+ pin = re.search(r"_([^.]*)", arg).group(1)
+ with open(arg, "r") as f:
+ tile = [0, 0]
+ iob = [0, 0, 0]
+ ioctrl = [0, 0, 0]
+
+ for line in f:
+ match = re.match(r"^\.io_tile (\d+) (\d+)", line)
+ if match:
+ tile = [int(match.group(1)), int(match.group(2))]
+
+ match = re.match(r"^IOB_(\d+)", line)
+ if match:
+ iob = tile + [int(match.group(1))]
+
+ match = re.match(r"^IoCtrl REN_(\d+)", line)
+ if match:
+ ioctrl = tile + [int(match.group(1))]
+
+ ieren_db.append(tuple(iob + ioctrl))
+ pinloc_db.append(tuple(['"' + pin + '"'] + iob))
+
+print()
+print("# ieren_db")
+for entry in sorted(ieren_db):
+ print("(%2d, %2d, %d, %2d, %2d, %d)," % entry)
+
+print()
+print("# pinloc_db")
+for entry in sorted(pinloc_db):
+ print("(%5s, %2d, %2d, %d)," % entry)
+
+print()
+