aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--icebox/Makefile5
-rw-r--r--icebox/icebox.py4
-rwxr-xr-xicebox/icebox_chipdb.py15
-rwxr-xr-xicebox/icebox_colbuf.py5
-rwxr-xr-xicebox/icebox_diff.py7
-rwxr-xr-xicebox/icebox_explain.py5
-rwxr-xr-xicebox/icebox_html.py17
-rwxr-xr-xicebox/icebox_maps.py5
-rwxr-xr-xicebox/icebox_vlog.py11
10 files changed, 25 insertions, 50 deletions
diff --git a/Makefile b/Makefile
index 3892dcd..435641e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,3 @@
-PYTHON ?= python2
CXX ?= clang
all:
diff --git a/icebox/Makefile b/icebox/Makefile
index cd92235..1cf40da 100644
--- a/icebox/Makefile
+++ b/icebox/Makefile
@@ -1,14 +1,13 @@
-PYTHON ?= python2
DESTDIR = /usr/local
all: chipdb-1k.txt chipdb-8k.txt
chipdb-1k.txt: icebox.py iceboxdb.py icebox_chipdb.py
- $(PYTHON) icebox_chipdb.py > chipdb-1k.new
+ python3 icebox_chipdb.py > chipdb-1k.new
mv chipdb-1k.new chipdb-1k.txt
chipdb-8k.txt: icebox.py iceboxdb.py icebox_chipdb.py
- $(PYTHON) icebox_chipdb.py -8 > chipdb-8k.new
+ python3 icebox_chipdb.py -8 > chipdb-8k.new
mv chipdb-8k.new chipdb-8k.txt
clean:
diff --git a/icebox/icebox.py b/icebox/icebox.py
index 2473506..88a9ba9 100644
--- a/icebox/icebox.py
+++ b/icebox/icebox.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,8 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
import iceboxdb
import re, sys
diff --git a/icebox/icebox_chipdb.py b/icebox/icebox_chipdb.py
index bf7db26..f36dd91 100755
--- a/icebox/icebox_chipdb.py
+++ b/icebox/icebox_chipdb.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import getopt, sys, re
@@ -175,7 +172,7 @@ all_group_segments = ic.group_segments(all_tiles, connect_gb=False)
print(".device %s %d %d %d" % (ic.device, ic.max_x+1, ic.max_y+1, len(all_group_segments)))
print()
-for key in icebox.pinloc_db.keys():
+for key in list(icebox.pinloc_db.keys()):
key_dev, key_package = key.split("-")
if key_dev == ic.device:
print(".pins %s" % (key_package))
@@ -247,10 +244,10 @@ def print_tile_nonrouting_bits(tile_type, idx):
print(" ".join([x] + function_bits[x]))
print()
-print_tile_nonrouting_bits("logic", ic.logic_tiles.keys()[0])
-print_tile_nonrouting_bits("io", ic.io_tiles.keys()[0])
-print_tile_nonrouting_bits("ramb", ic.ramb_tiles.keys()[0])
-print_tile_nonrouting_bits("ramt", ic.ramt_tiles.keys()[0])
+print_tile_nonrouting_bits("logic", list(ic.logic_tiles.keys())[0])
+print_tile_nonrouting_bits("io", list(ic.io_tiles.keys())[0])
+print_tile_nonrouting_bits("ramb", list(ic.ramb_tiles.keys())[0])
+print_tile_nonrouting_bits("ramt", list(ic.ramt_tiles.keys())[0])
print(".extra_cell 0 0 WARMBOOT")
for key in sorted(icebox.warmbootinfo_db[ic.device]):
diff --git a/icebox/icebox_colbuf.py b/icebox/icebox_colbuf.py
index 6267bc6..b9044c4 100755
--- a/icebox/icebox_colbuf.py
+++ b/icebox/icebox_colbuf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import getopt, sys, re
diff --git a/icebox/icebox_diff.py b/icebox/icebox_diff.py
index b9d552b..33ac401 100755
--- a/icebox/icebox_diff.py
+++ b/icebox/icebox_diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import sys
import re
@@ -64,7 +61,7 @@ def explained_bits(db, tile):
return text
def diff_tiles(stmt, tiles1, tiles2):
- for i in sorted(set(tiles1.keys() + tiles2.keys())):
+ for i in sorted(set(list(tiles1.keys()) + list(tiles2.keys()))):
if not i in tiles1:
print("+ %s %d %d" % (stmt, i[0], i[1]))
for line in tiles2[i]:
diff --git a/icebox/icebox_explain.py b/icebox/icebox_explain.py
index 9d72faa..27757d1 100755
--- a/icebox/icebox_explain.py
+++ b/icebox/icebox_explain.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import getopt, sys, re
diff --git a/icebox/icebox_html.py b/icebox/icebox_html.py
index 7684632..ea27028 100755
--- a/icebox/icebox_html.py
+++ b/icebox/icebox_html.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import getopt, sys, os, re
@@ -64,15 +61,15 @@ mktiles = set()
if mode8k:
ic.setup_empty_8k()
- for x in range(1, 3) + range(8-2, 8+3) + range(15, 19) + range(25-2, 25+3) + range(33-2, 33):
+ for x in list(range(1, 3)) + list(range(8-2, 8+3)) + list(range(15, 19)) + list(range(25-2, 25+3)) + list(range(33-2, 33)):
mktiles.add((x, 0))
mktiles.add((x, 33))
- for x in range(0, 3) + range(8-1, 8+2) + range(25-1, 25+2) + range(33-2, 34):
+ for x in list(range(0, 3)) + list(range(8-1, 8+2)) + list(range(25-1, 25+2)) + list(range(33-2, 34)):
mktiles.add((x, 1))
mktiles.add((x, 32))
- for x in range(0, 2) + range(8-1, 8+2) + range(25-1, 25+2) + range(34-2, 34):
+ for x in list(range(0, 2)) + list(range(8-1, 8+2)) + list(range(25-1, 25+2)) + list(range(34-2, 34)):
mktiles.add((x, 2))
mktiles.add((x, 31))
@@ -93,11 +90,11 @@ else:
mktiles.add((x, 0))
mktiles.add((x, 17))
- for x in range(0, 6) + range(8, 14):
+ for x in list(range(0, 6)) + list(range(8, 14)):
mktiles.add((x, 1))
mktiles.add((x, 16))
- for x in range(0, 5) + range(9, 14):
+ for x in list(range(0, 5)) + list(range(9, 14)):
mktiles.add((x, 2))
mktiles.add((x, 15))
@@ -566,7 +563,7 @@ if outdir is not None:
print_tile(x, y)
print("Writing %s/%s..." % (outdir, chipdbfile), file=stdout)
- os.system("python2 icebox_chipdb.py > %s/%s" % (outdir, chipdbfile))
+ os.system("python3 icebox_chipdb.py > %s/%s" % (outdir, chipdbfile))
sys.stdout = stdout
diff --git a/icebox/icebox_maps.py b/icebox/icebox_maps.py
index 2a74400..49f2638 100755
--- a/icebox/icebox_maps.py
+++ b/icebox/icebox_maps.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import getopt, sys, re
diff --git a/icebox/icebox_vlog.py b/icebox/icebox_vlog.py
index 9d27db6..c3f6df3 100755
--- a/icebox/icebox_vlog.py
+++ b/icebox/icebox_vlog.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
#
# Copyright (C) 2015 Clifford Wolf <clifford@clifford.at>
#
@@ -15,9 +15,6 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-from __future__ import division
-from __future__ import print_function
-
import icebox
import getopt, sys, re
@@ -211,7 +208,7 @@ for bit in ic.extra_bits:
s2 = (pin_entry[0], pin_entry[1], "padin_%d" % pin_entry[2])
extra_connections.append((s1, s2))
-for idx, tile in ic.io_tiles.items():
+for idx, tile in list(ic.io_tiles.items()):
tc = icebox.tileconfig(tile)
iocells_type[(idx[0], idx[1], 0)] = ["0" for i in range(6)]
iocells_type[(idx[0], idx[1], 1)] = ["0" for i in range(6)]
@@ -834,7 +831,7 @@ if do_collect:
vec_ports_dir[match.group(2)] = match.group(1)
else:
new_text_ports.add(port)
- for port, direct in vec_ports_dir.items():
+ for port, direct in list(vec_ports_dir.items()):
min_idx = vec_ports_min[port]
max_idx = vec_ports_max[port]
new_text_ports.add("%s [%d:%d] %s " % (direct, max_idx, min_idx, port))
@@ -874,7 +871,7 @@ if strip_comments:
print()
if do_collect:
- for port, direct in vec_ports_dir.items():
+ for port, direct in list(vec_ports_dir.items()):
min_idx = vec_ports_min[port]
max_idx = vec_ports_max[port]
for i in range(min_idx, max_idx+1):