aboutsummaryrefslogtreecommitdiffstats
path: root/icebox
diff options
context:
space:
mode:
authorhermitsoft <hermisu@mail.com>2017-03-06 23:24:52 +0100
committerhermitsoft <hermisu@mail.com>2017-03-06 23:24:52 +0100
commit0a5d4340098c0d5dff5adfa6c6feaafe201889a3 (patch)
treec6625a8384e7d14524278c70ea8ec320ad5652b8 /icebox
parent4d4738beea12f3f0e9e6fbf7cc433a42c8ea51e6 (diff)
downloadicestorm-0a5d4340098c0d5dff5adfa6c6feaafe201889a3.tar.gz
icestorm-0a5d4340098c0d5dff5adfa6c6feaafe201889a3.tar.bz2
icestorm-0a5d4340098c0d5dff5adfa6c6feaafe201889a3.zip
Work started for LP384 chipdb.
Diffstat (limited to 'icebox')
-rw-r--r--icebox/.gitignore1
-rw-r--r--icebox/Makefile10
-rw-r--r--icebox/icebox.py56
-rwxr-xr-xicebox/icebox_chipdb.py10
4 files changed, 71 insertions, 6 deletions
diff --git a/icebox/.gitignore b/icebox/.gitignore
index 2106076..14a9fb4 100644
--- a/icebox/.gitignore
+++ b/icebox/.gitignore
@@ -1,3 +1,4 @@
chipdb-1k.txt
chipdb-8k.txt
+chipdb-384.txt
__pycache__
diff --git a/icebox/Makefile b/icebox/Makefile
index 3db1a50..446fb18 100644
--- a/icebox/Makefile
+++ b/icebox/Makefile
@@ -1,6 +1,10 @@
include ../config.mk
-all: chipdb-1k.txt chipdb-8k.txt
+all: chipdb-384.txt chipdb-1k.txt chipdb-8k.txt
+
+chipdb-384.txt: icebox.py iceboxdb.py icebox_chipdb.py
+ python3 icebox_chipdb.py -3 > chipdb-384.new
+ mv chipdb-384.new chipdb-384.txt
chipdb-1k.txt: icebox.py iceboxdb.py icebox_chipdb.py
python3 icebox_chipdb.py > chipdb-1k.new
@@ -11,12 +15,13 @@ chipdb-8k.txt: icebox.py iceboxdb.py icebox_chipdb.py
mv chipdb-8k.new chipdb-8k.txt
clean:
- rm -f chipdb-1k.txt chipdb-8k.txt
+ rm -f chipdb-1k.txt chipdb-8k.txt chipdb-384.txt
rm -f icebox.pyc iceboxdb.pyc
install: all
mkdir -p $(DESTDIR)$(PREFIX)/share/icebox
mkdir -p $(DESTDIR)$(PREFIX)/bin
+ cp chipdb-384.txt $(DESTDIR)$(PREFIX)/share/icebox/
cp chipdb-1k.txt $(DESTDIR)$(PREFIX)/share/icebox/
cp chipdb-8k.txt $(DESTDIR)$(PREFIX)/share/icebox/
cp icebox.py $(DESTDIR)$(PREFIX)/bin/icebox.py
@@ -41,6 +46,7 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/icebox_maps
rm -f $(DESTDIR)$(PREFIX)/bin/icebox_vlog
rm -f $(DESTDIR)$(PREFIX)/bin/icebox_stat
+ rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-384.txt
rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-1k.txt
rm -f $(DESTDIR)$(PREFIX)/share/icebox/chipdb-8k.txt
-rmdir $(DESTDIR)$(PREFIX)/share/icebox
diff --git a/icebox/icebox.py b/icebox/icebox.py
index 86119df..c3796a9 100644
--- a/icebox/icebox.py
+++ b/icebox/icebox.py
@@ -34,6 +34,24 @@ class iceconfig:
self.extra_bits = set()
self.symbols = dict()
+ def setup_empty_384(self):
+ self.clear()
+ self.device = "384"
+ self.max_x = 7
+ self.max_y = 9
+
+ for x in range(1, self.max_x):
+ for y in range(1, self.max_y):
+ self.logic_tiles[(x, y)] = ["0" * 54 for i in range(16)]
+
+ for x in range(1, self.max_x):
+ self.io_tiles[(x, 0)] = ["0" * 18 for i in range(16)]
+ self.io_tiles[(x, self.max_y)] = ["0" * 18 for i in range(16)]
+
+ for y in range(1, self.max_y):
+ self.io_tiles[(0, y)] = ["0" * 18 for i in range(16)]
+ self.io_tiles[(self.max_x, y)] = ["0" * 18 for i in range(16)]
+
def setup_empty_1k(self):
self.clear()
self.device = "1k"
@@ -96,6 +114,7 @@ class iceconfig:
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 == "8k": return pinloc_db["8k-ct256"]
assert False
@@ -120,6 +139,7 @@ class iceconfig:
return ["1k"]
if self.device == "8k":
return ["8k_0", "8k_1"]
+#384?
assert False
def colbuf_db(self):
@@ -148,7 +168,7 @@ class iceconfig:
if 25 <= y <= 33: src_y = 25
entries.append((x, src_y, x, y))
return entries
-
+#384?
assert False
def tile_db(self, x, y):
@@ -164,6 +184,8 @@ class iceconfig:
if (x, y) in self.logic_tiles: return logictile_8k_db
if (x, y) in self.ramb_tiles: return rambtile_8k_db
if (x, y) in self.ramt_tiles: return ramttile_8k_db
+ if self.device == "384":
+ if (x, y) in self.logic_tiles: return logictile_384_db
assert False
def tile_type(self, x, y):
@@ -259,6 +281,7 @@ class iceconfig:
return (nx, ny, "ram/RDATA_%d" % func)
elif self.device == "8k":
return (nx, ny, "ram/RDATA_%d" % (15-func))
+#384?
else:
assert False
if (nx, ny) in self.ramt_tiles:
@@ -266,6 +289,7 @@ class iceconfig:
return (nx, ny, "ram/RDATA_%d" % (8+func))
elif self.device == "8k":
return (nx, ny, "ram/RDATA_%d" % (7-func))
+#384?
else:
assert False
@@ -306,6 +330,7 @@ class iceconfig:
funcnets |= self.follow_funcnet(x, y, int(match.group(1)) % 8)
elif self.device == "8k":
funcnets |= self.follow_funcnet(x, y, 7 - int(match.group(1)) % 8)
+#384?
else:
assert False
@@ -441,6 +466,8 @@ class iceconfig:
add_seed_segments(idx, tile, logictile_db)
elif self.device == "8k":
add_seed_segments(idx, tile, logictile_8k_db)
+ elif self.device == "384":
+ add_seed_segments(idx, tile, logictile_384_db)
else:
assert False
@@ -449,6 +476,7 @@ class iceconfig:
add_seed_segments(idx, tile, rambtile_db)
elif self.device == "8k":
add_seed_segments(idx, tile, rambtile_8k_db)
+#384?
else:
assert False
@@ -457,6 +485,7 @@ class iceconfig:
add_seed_segments(idx, tile, ramttile_db)
elif self.device == "8k":
add_seed_segments(idx, tile, ramttile_8k_db)
+#384?
else:
assert False
@@ -574,7 +603,7 @@ class iceconfig:
self.extra_bits.add((int(line[1]), int(line[2]), int(line[3])))
continue
if line[0] == ".device":
- assert line[1] in ["1k", "8k"]
+ assert line[1] in ["1k", "8k", "384"]
self.device = line[1]
continue
if line[0] == ".sym":
@@ -734,6 +763,7 @@ def sp12v_normalize(netname, edge=""):
return netname
def netname_normalize(netname, edge="", ramb=False, ramt=False, ramb_8k=False, ramt_8k=False):
+#384?
if netname.startswith("sp4_v_"): return sp4v_normalize(netname, edge)
if netname.startswith("sp4_h_"): return sp4h_normalize(netname, edge)
if netname.startswith("sp12_v_"): return sp12v_normalize(netname, edge)
@@ -948,6 +978,7 @@ def run_checks_neigh():
ic = iceconfig()
ic.setup_empty_1k()
# ic.setup_empty_8k()
+#384?
all_segments = set()
@@ -983,19 +1014,26 @@ def run_checks_neigh():
def run_checks():
run_checks_neigh()
-def parse_db(text, grep_8k=False):
+def parse_db(text, grep_8k=False, grep_384=False):
db = list()
for line in text.split("\n"):
+ line_384 = line.replace("384_glb_netwk_", "glb_netwk_")
line_1k = line.replace("1k_glb_netwk_", "glb_netwk_")
line_8k = line.replace("8k_glb_netwk_", "glb_netwk_")
if line_1k != line:
if grep_8k:
continue
+ if grep_384:
+ continue
line = line_1k
elif line_8k != line:
if not grep_8k:
continue
line = line_8k
+ elif line_384 != line:
+ if not grep_384:
+ continue
+ line = line_384
line = line.split("\t")
if len(line) == 0 or line[0] == "":
continue
@@ -1024,6 +1062,7 @@ extra_bits_db = {
(0, 870, 271): ("padin_glb_netwk", "6"),
(0, 871, 271): ("padin_glb_netwk", "7"),
}
+#384?
}
gbufin_db = {
@@ -1047,6 +1086,7 @@ gbufin_db = {
(16, 0, 5),
(16, 33, 4),
]
+#384?
}
iolatch_db = {
@@ -1062,6 +1102,7 @@ iolatch_db = {
(18, 0),
(15, 33),
],
+#384?
}
warmbootinfo_db = {
@@ -1075,6 +1116,7 @@ warmbootinfo_db = {
"S0": ( 33, 1, "fabout" ),
"S1": ( 33, 2, "fabout" ),
}
+#384?
}
noplls_db = {
@@ -1087,6 +1129,7 @@ noplls_db = {
"1k-cb81": [ "1k" ],
"1k-cb121": [ "1k" ],
"1k-vq100": [ "1k" ],
+ "384-qn32": [ "384" ],
}
pllinfo_db = {
@@ -1369,6 +1412,7 @@ pllinfo_db = {
"SDI": ( 22, 33, "fabout"),
"SCLK": ( 21, 33, "fabout"),
},
+#384?
}
padin_pio_db = {
@@ -1392,6 +1436,7 @@ padin_pio_db = {
(16, 0, 1),
(16, 33, 1),
]
+#384?
}
ieren_db = {
@@ -1719,6 +1764,7 @@ ieren_db = {
(33, 30, 1, 33, 30, 1),
(33, 31, 0, 33, 31, 0),
]
+#384?
}
pinloc_db = {
@@ -3636,11 +3682,13 @@ pinloc_db = {
("T15", 22, 0, 1),
("T16", 27, 0, 0),
]
+#384?
}
iotile_full_db = parse_db(iceboxdb.database_io_txt)
logictile_db = parse_db(iceboxdb.database_logic_txt)
logictile_8k_db = parse_db(iceboxdb.database_logic_txt, True)
+logictile_384_db = parse_db(iceboxdb.database_logic_txt, False, True)
rambtile_db = parse_db(iceboxdb.database_ramb_txt)
ramttile_db = parse_db(iceboxdb.database_ramt_txt)
rambtile_8k_db = parse_db(iceboxdb.database_ramb_8k_txt, True)
@@ -3680,6 +3728,8 @@ logictile_db.append([["B1[50]"], "CarryInSet"])
logictile_8k_db.append([["B1[49]"], "buffer", "carry_in", "carry_in_mux"])
logictile_8k_db.append([["B1[50]"], "CarryInSet"])
+#384?
+
for db in [iotile_l_db, iotile_r_db, iotile_t_db, iotile_b_db, logictile_db, logictile_8k_db, rambtile_db, ramttile_db, rambtile_8k_db, ramttile_8k_db]:
for entry in db:
if entry[1] in ("buffer", "routing"):
diff --git a/icebox/icebox_chipdb.py b/icebox/icebox_chipdb.py
index 157d3e1..299ce5c 100755
--- a/icebox/icebox_chipdb.py
+++ b/icebox/icebox_chipdb.py
@@ -18,31 +18,39 @@
import icebox
import getopt, sys, re
+mode_384 = False
mode_8k = False
def usage():
print("""
Usage: icebox_chipdb [options] [bitmap.asc]
+ -3
+ create chipdb for 384 device
+
-8
create chipdb for 8k device
""")
sys.exit(0)
try:
- opts, args = getopt.getopt(sys.argv[1:], "8")
+ opts, args = getopt.getopt(sys.argv[1:], "38")
except:
usage()
for o, a in opts:
if o == "-8":
mode_8k = True
+ elif o == "-3":
+ mode_384 = True
else:
usage()
ic = icebox.iceconfig()
if mode_8k:
ic.setup_empty_8k()
+elif mode_384:
+ ic.setup_empty_384()
else:
ic.setup_empty_1k()