aboutsummaryrefslogtreecommitdiffstats
path: root/icebox
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-05-30 11:24:40 +0200
committerDavid Shah <davey1576@gmail.com>2018-05-30 11:24:40 +0200
commiteee9aac2e1ae238cb9a16c50fb0d6c16173ada72 (patch)
treefe165bf2d22b23ccb7e611c8dd51640488e12a9f /icebox
parent816c47ce83e330d0b293cd5e0a2e82885fb9f74e (diff)
downloadicestorm-eee9aac2e1ae238cb9a16c50fb0d6c16173ada72.tar.gz
icestorm-eee9aac2e1ae238cb9a16c50fb0d6c16173ada72.tar.bz2
icestorm-eee9aac2e1ae238cb9a16c50fb0d6c16173ada72.zip
icebox: Allow selecting package in icebox_vlog
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'icebox')
-rw-r--r--icebox/icebox.py15
-rwxr-xr-xicebox/icebox_vlog.py11
2 files changed, 18 insertions, 8 deletions
diff --git a/icebox/icebox.py b/icebox/icebox.py
index 36572c0..27bd243 100644
--- a/icebox/icebox.py
+++ b/icebox/icebox.py
@@ -174,12 +174,15 @@ class iceconfig:
if (x, y) in self.ipcon_tiles: return self.ipcon_tiles[(x, y)]
return None
- def pinloc_db(self):
- if self.device == "384": return pinloc_db["384-qn32"]
- if self.device == "1k": return pinloc_db["1k-tq144"]
- if self.device == "lm4k": return pinloc_db["lm4k-cm49"]
- if self.device == "5k": return pinloc_db["5k-sg48"]
- if self.device == "8k": return pinloc_db["8k-ct256"]
+ def pinloc_db(self, package = None):
+ if package is None:
+ if self.device == "384": return pinloc_db["384-qn32"]
+ if self.device == "1k": return pinloc_db["1k-tq144"]
+ if self.device == "lm4k": return pinloc_db["lm4k-cm49"]
+ if self.device == "5k": return pinloc_db["5k-sg48"]
+ if self.device == "8k": return pinloc_db["8k-ct256"]
+ else:
+ return pinloc_db[self.device + "-" + package]
assert False
def gbufin_db(self):
diff --git a/icebox/icebox_vlog.py b/icebox/icebox_vlog.py
index 873e4b2..5736011 100755
--- a/icebox/icebox_vlog.py
+++ b/icebox/icebox_vlog.py
@@ -25,6 +25,7 @@ check_ieren = False
check_driver = False
lookup_symbols = False
do_collect = False
+package = None
pcf_data = dict()
portnames = set()
unmatched_ports = set()
@@ -56,6 +57,10 @@ Usage: icebox_vlog [options] [bitmap.asc]
like -p, enable some hacks for pcf files created
by the iCEcube2 placer.
+ -d <package>
+ use the given package to obtain chip pin numbers,
+ rather than the default for a device
+
-c
collect multi-bit ports
@@ -68,7 +73,7 @@ Usage: icebox_vlog [options] [bitmap.asc]
sys.exit(0)
try:
- opts, args = getopt.getopt(sys.argv[1:], "sSlLap:P:n:cRD")
+ opts, args = getopt.getopt(sys.argv[1:], "sSlLap:P:n:d:cRD")
except:
usage()
@@ -111,6 +116,8 @@ for o, a in opts:
else:
pinloc = (line[2],)
pcf_data[pinloc] = p
+ elif o == "-d":
+ package = a
elif o == "-c":
do_collect = True
elif o == "-R":
@@ -285,7 +292,7 @@ for segs in sorted(ic.group_segments(extra_connections=extra_connections, extra_
idx = (s[0], s[1], int(match.group(1)))
p = "io_%d_%d_%d" % idx
if lookup_pins or pcf_data:
- for entry in ic.pinloc_db():
+ for entry in ic.pinloc_db(package):
if idx[0] == entry[1] and idx[1] == entry[2] and idx[2] == entry[3]:
if (entry[0],) in pcf_data:
p = pcf_data[(entry[0],)]