aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2015-08-22 09:36:28 +0200
committerClifford Wolf <clifford@clifford.at>2015-08-22 09:42:57 +0200
commitf6f96a26e036e56577ad5a1bfec78fd06f419ca0 (patch)
treeb8a29bb84723e0ab31b127b89ee51cbad2948969
parentd094abca1c1c2d21b2b92dc743e2d5e767a97153 (diff)
downloadicestorm-f6f96a26e036e56577ad5a1bfec78fd06f419ca0.tar.gz
icestorm-f6f96a26e036e56577ad5a1bfec78fd06f419ca0.tar.bz2
icestorm-f6f96a26e036e56577ad5a1bfec78fd06f419ca0.zip
icefuzz: python 3
-rw-r--r--icefuzz/Makefile12
-rw-r--r--icefuzz/convert_ram8k.py28
-rw-r--r--icefuzz/database.py6
-rw-r--r--icefuzz/export.py5
-rw-r--r--icefuzz/extract.py4
-rw-r--r--icefuzz/glbmapbits.py5
-rw-r--r--icefuzz/make_binop.py4
-rw-r--r--icefuzz/make_cluster.py4
-rw-r--r--icefuzz/make_fanout.py4
-rw-r--r--icefuzz/make_fflogic.py4
-rw-r--r--icefuzz/make_gbio.py6
-rw-r--r--icefuzz/make_gbio2.py6
-rw-r--r--icefuzz/make_io.py6
-rw-r--r--icefuzz/make_iopack.py4
-rw-r--r--icefuzz/make_logic.py4
-rw-r--r--icefuzz/make_mesh.py4
-rw-r--r--icefuzz/make_pin2pin.py4
-rw-r--r--icefuzz/make_pll.py4
-rw-r--r--icefuzz/make_prim.py4
-rw-r--r--icefuzz/make_ram40.py4
-rw-r--r--icefuzz/pinloc/pinloc-1k-tq144.sh2
-rw-r--r--icefuzz/pinloc/pinloc-8k-ct256.sh2
-rw-r--r--icefuzz/pinloc/pinlocdb.py5
-rw-r--r--icefuzz/tests/colbuf.py2
-rw-r--r--icefuzz/tests/colbuf.sh2
-rw-r--r--icefuzz/tests/colbuf_8k.sh2
-rw-r--r--icefuzz/tests/ioctrl.py2
-rw-r--r--icefuzz/tests/ioctrl.sh2
-rw-r--r--icefuzz/tests/test_pio.sh2
29 files changed, 37 insertions, 106 deletions
diff --git a/icefuzz/Makefile b/icefuzz/Makefile
index 3620e10..030eb35 100644
--- a/icefuzz/Makefile
+++ b/icefuzz/Makefile
@@ -27,8 +27,8 @@ else
cp cached_ramb_8k.txt bitdata_ramb_8k.txt
cp cached_ramt_8k.txt bitdata_ramt_8k.txt
endif
- $(PYTHON) database.py
- $(PYTHON) export.py
+ python3 database.py
+ python3 export.py
diff -U0 cached_io.txt bitdata_io.txt || cp -v bitdata_io.txt cached_io.txt
diff -U0 cached_logic.txt bitdata_logic.txt || cp -v bitdata_logic.txt cached_logic.txt
diff -U0 cached_ramb.txt bitdata_ramb.txt || cp -v bitdata_ramb.txt cached_ramb.txt
@@ -63,13 +63,13 @@ datafiles: $(addprefix data_,$(addsuffix .txt,$(TESTS)))
define data_template
data_$(1).txt: make_$(1).py ../icepack/icepack
ifeq ($(EIGTHK),_8k)
- ICE8KPINS=1 $(PYTHON) make_$(1).py
+ ICE8KPINS=1 python3 make_$(1).py
ICEDEV=hx8k-ct256 $(MAKE) -C work_$(1)
- $(PYTHON) extract.py -8 work_$(1)/*.glb > $$@
+ python3 extract.py -8 work_$(1)/*.glb > $$@
else
- $(PYTHON) make_$(1).py
+ python3 make_$(1).py
$(MAKE) -C work_$(1)
- $(PYTHON) extract.py work_$(1)/*.glb > $$@
+ python3 extract.py work_$(1)/*.glb > $$@
endif
endef
diff --git a/icefuzz/convert_ram8k.py b/icefuzz/convert_ram8k.py
deleted file mode 100644
index 551f9e3..0000000
--- a/icefuzz/convert_ram8k.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python2
-# convert 1k ramb/ramt to 8k ramb/ramt and vice versa
-
-subst_rules = [
- ["/RE", "/WE" ],
- ["/RCLK", "/WCLK" ],
- ["/RCLKE", "/WCLKE"],
- ["DATA_8", "DATA_7"],
- ["DATA_9", "DATA_6"],
- ["DATA_10", "DATA_5"],
- ["DATA_11", "DATA_4"],
- ["DATA_12", "DATA_3"],
- ["DATA_13", "DATA_2"],
- ["DATA_14", "DATA_1"],
- ["DATA_15", "DATA_0"],
-]
-
-import fileinput
-for line in fileinput.input():
- line = line.strip()
- for r in subst_rules:
- if line.endswith(r[0]):
- line = line[:-len(r[0])] + r[1]
- break
- if line.endswith(r[1]):
- line = line[:-len(r[1])] + r[0]
- break
- print(line)
diff --git a/icefuzz/database.py b/icefuzz/database.py
index 3af772d..7720ce2 100644
--- a/icefuzz/database.py
+++ b/icefuzz/database.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
import re, sys, os
def cmp_bits(a, b):
@@ -92,7 +90,7 @@ def read_database(filename, tile_type):
func_to_bits.setdefault(entry[1], set()).add(entry[0])
bit_groups = dict()
- for func, bits in func_to_bits.items():
+ for func, bits in list(func_to_bits.items()):
for bit in bits:
bit_groups[bit] = bit_groups.setdefault(bit, set()).union(bits)
diff --git a/icefuzz/export.py b/icefuzz/export.py
index 7f4e66f..ae14997 100644
--- a/icefuzz/export.py
+++ b/icefuzz/export.py
@@ -1,7 +1,4 @@
-#!/usr/bin/python2
-
-from __future__ import division
-from __future__ import print_function
+#!/usr/bin/env python3
with open("../icebox/iceboxdb.py", "w") as f:
for i in [ "database_io", "database_logic", "database_ramb", "database_ramt", "database_ramb_8k", "database_ramt_8k" ]:
diff --git a/icefuzz/extract.py b/icefuzz/extract.py
index ac35e22..3da4b40 100644
--- a/icefuzz/extract.py
+++ b/icefuzz/extract.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
import sys, re
db = set()
diff --git a/icefuzz/glbmapbits.py b/icefuzz/glbmapbits.py
index e284211..5e7add8 100644
--- a/icefuzz/glbmapbits.py
+++ b/icefuzz/glbmapbits.py
@@ -1,7 +1,4 @@
-#!/usr/bin/python2
-
-from __future__ import division
-from __future__ import print_function
+#!/usr/bin/env python3
import re
import fileinput
diff --git a/icefuzz/make_binop.py b/icefuzz/make_binop.py
index b2a113e..b84ee7d 100644
--- a/icefuzz/make_binop.py
+++ b/icefuzz/make_binop.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_cluster.py b/icefuzz/make_cluster.py
index 7b5194d..0188de3 100644
--- a/icefuzz/make_cluster.py
+++ b/icefuzz/make_cluster.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_fanout.py b/icefuzz/make_fanout.py
index a6c0435..9df56c7 100644
--- a/icefuzz/make_fanout.py
+++ b/icefuzz/make_fanout.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_fflogic.py b/icefuzz/make_fflogic.py
index b2df1ca..bcd7111 100644
--- a/icefuzz/make_fflogic.py
+++ b/icefuzz/make_fflogic.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_gbio.py b/icefuzz/make_gbio.py
index 740b48f..ce7131c 100644
--- a/icefuzz/make_gbio.py
+++ b/icefuzz/make_gbio.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
@@ -11,7 +9,7 @@ os.mkdir("work_gbio")
for idx in range(num):
with open("work_gbio/gbio_%02d.v" % idx, "w") as f:
- glbs = np.random.permutation(range(8))
+ glbs = np.random.permutation(list(range(8)))
print("""
module top (
inout [7:0] pin,
diff --git a/icefuzz/make_gbio2.py b/icefuzz/make_gbio2.py
index 7ffebfa..6cb6339 100644
--- a/icefuzz/make_gbio2.py
+++ b/icefuzz/make_gbio2.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
@@ -11,7 +9,7 @@ os.mkdir("work_gbio2")
for idx in range(num):
with open("work_gbio2/gbio2_%02d.v" % idx, "w") as f:
- glbs = np.random.permutation(range(8))
+ glbs = np.random.permutation(list(range(8)))
print("""
module top (
inout [7:0] pin,
diff --git a/icefuzz/make_io.py b/icefuzz/make_io.py
index 91299f8..89d8f22 100644
--- a/icefuzz/make_io.py
+++ b/icefuzz/make_io.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
@@ -11,7 +9,7 @@ os.mkdir("work_io")
for idx in range(num):
with open("work_io/io_%02d.v" % idx, "w") as f:
- glbs = np.random.permutation(range(8))
+ glbs = np.random.permutation(list(range(8)))
print("""
module top (
inout [3:0] pin,
diff --git a/icefuzz/make_iopack.py b/icefuzz/make_iopack.py
index 5bc3c01..bc13416 100644
--- a/icefuzz/make_iopack.py
+++ b/icefuzz/make_iopack.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_logic.py b/icefuzz/make_logic.py
index 3e7f54b..846647d 100644
--- a/icefuzz/make_logic.py
+++ b/icefuzz/make_logic.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_mesh.py b/icefuzz/make_mesh.py
index 5fc0d2e..96e6044 100644
--- a/icefuzz/make_mesh.py
+++ b/icefuzz/make_mesh.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_pin2pin.py b/icefuzz/make_pin2pin.py
index 34615a1..1dfe60e 100644
--- a/icefuzz/make_pin2pin.py
+++ b/icefuzz/make_pin2pin.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_pll.py b/icefuzz/make_pll.py
index fc1dd75..7db509a 100644
--- a/icefuzz/make_pll.py
+++ b/icefuzz/make_pll.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
import numpy as np
import os
diff --git a/icefuzz/make_prim.py b/icefuzz/make_prim.py
index 168d388..130feec 100644
--- a/icefuzz/make_prim.py
+++ b/icefuzz/make_prim.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/make_ram40.py b/icefuzz/make_ram40.py
index 0b88d2e..a97d0bc 100644
--- a/icefuzz/make_ram40.py
+++ b/icefuzz/make_ram40.py
@@ -1,7 +1,5 @@
-#!/usr/bin/python2
+#!/usr/bin/env python3
-from __future__ import division
-from __future__ import print_function
from fuzzconfig import *
import numpy as np
import os
diff --git a/icefuzz/pinloc/pinloc-1k-tq144.sh b/icefuzz/pinloc/pinloc-1k-tq144.sh
index 909ecfe..463e052 100644
--- a/icefuzz/pinloc/pinloc-1k-tq144.sh
+++ b/icefuzz/pinloc/pinloc-1k-tq144.sh
@@ -29,5 +29,5 @@ pins="
set -ex
make -f pinloc-1k-tq144.mk -j4
-python2 pinlocdb.py pinloc-1k-tq144_*.exp > pinloc-1k-tq144.txt
+python3 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
index 321c031..d8da2dc 100644
--- a/icefuzz/pinloc/pinloc-8k-ct256.sh
+++ b/icefuzz/pinloc/pinloc-8k-ct256.sh
@@ -41,4 +41,4 @@ pins="
set -ex
make -f pinloc-8k-ct256.mk -j4
-python2 pinlocdb.py pinloc-8k-ct256_*.exp > pinloc-8k-ct256.txt
+python3 pinlocdb.py pinloc-8k-ct256_*.exp > pinloc-8k-ct256.txt
diff --git a/icefuzz/pinloc/pinlocdb.py b/icefuzz/pinloc/pinlocdb.py
index 31c6476..9a3fc1e 100644
--- a/icefuzz/pinloc/pinlocdb.py
+++ b/icefuzz/pinloc/pinlocdb.py
@@ -1,7 +1,4 @@
-#!/usr/bin/python
-
-from __future__ import division
-from __future__ import print_function
+#!/usr/bin/env python3
import re
from sys import argv
diff --git a/icefuzz/tests/colbuf.py b/icefuzz/tests/colbuf.py
index 7b080b1..fcf0340 100644
--- a/icefuzz/tests/colbuf.py
+++ b/icefuzz/tests/colbuf.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
import fileinput
diff --git a/icefuzz/tests/colbuf.sh b/icefuzz/tests/colbuf.sh
index c565015..85c68ec 100644
--- a/icefuzz/tests/colbuf.sh
+++ b/icefuzz/tests/colbuf.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# for f in colbuf_io.work/*.exp colbuf_logic.work/*.exp colbuf_ram.work/*.exp; do
-# python2 colbuf.py $f
+# python3 colbuf.py $f
# done | sort -u > colbuf.txt
get_colbuf_data()
diff --git a/icefuzz/tests/colbuf_8k.sh b/icefuzz/tests/colbuf_8k.sh
index aabcb0c..ae1cc51 100644
--- a/icefuzz/tests/colbuf_8k.sh
+++ b/icefuzz/tests/colbuf_8k.sh
@@ -2,7 +2,7 @@
for f in colbuf_io_8k.work/*.exp colbuf_logic_8k.work/*.exp colbuf_ram_8k.work/*.exp; do
echo $f >&2
- python2 colbuf.py $f
+ python3 colbuf.py $f
done | sort -u > colbuf_8k.txt
get_colbuf_data()
diff --git a/icefuzz/tests/ioctrl.py b/icefuzz/tests/ioctrl.py
index 6d09bad..67c0c6d 100644
--- a/icefuzz/tests/ioctrl.py
+++ b/icefuzz/tests/ioctrl.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
import fileinput
diff --git a/icefuzz/tests/ioctrl.sh b/icefuzz/tests/ioctrl.sh
index 84523fc..d1acfe8 100644
--- a/icefuzz/tests/ioctrl.sh
+++ b/icefuzz/tests/ioctrl.sh
@@ -24,7 +24,7 @@ done
set +x
echo "--snip--"
for pin in $pins; do
- python2 ../ioctrl.py ioctrl_${pin}.exp
+ python3 ../ioctrl.py ioctrl_${pin}.exp
done | tee ioctrl_db.txt
echo "--snap--"
diff --git a/icefuzz/tests/test_pio.sh b/icefuzz/tests/test_pio.sh
index 0e50860..b6fd2b9 100644
--- a/icefuzz/tests/test_pio.sh
+++ b/icefuzz/tests/test_pio.sh
@@ -49,7 +49,7 @@ for OUTTYPE in 0000 0110 1010 1110 0101 1001 1101 \
EOT
bash ../../icecube.sh ${pf}.v > ${pf}.log 2>&1
fi
- python2 ../../../icebox/icebox_vlog.py -P ${pf}.psb ${pf}.txt > ${pf}_out.v
+ python3 ../../../icebox/icebox_vlog.py -P ${pf}.psb ${pf}.txt > ${pf}_out.v
iverilog -D"VCDFILE=\"${pf}_tb.vcd\"" -DINTYPE=${INTYPE} -o ${pf}_tb \
-s testbench ../test_pio_tb.v ${pf}.v ${pf}_out.v $lattice_simlib 2> /dev/null
./${pf}_tb > ${pf}_tb.txt