From c475deec6c69d509ac828cca437e2b9502f7b0c3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 22 Aug 2015 09:59:25 +0200 Subject: Switched to Python 3 --- README | 2 +- techlibs/ice40/Makefile.inc | 2 +- techlibs/ice40/brams_init.py | 5 +---- techlibs/xilinx/Makefile.inc | 2 +- techlibs/xilinx/brams_init.py | 5 +---- tests/bram/generate.py | 5 +---- tests/bram/run-test.sh | 2 +- tests/fsm/generate.py | 5 +---- tests/fsm/run-test.sh | 2 +- tests/realmath/generate.py | 5 +---- tests/realmath/run-test.sh | 2 +- tests/share/generate.py | 5 +---- tests/share/run-test.sh | 2 +- tests/tools/txt2tikztiming.py | 5 +---- 14 files changed, 14 insertions(+), 35 deletions(-) diff --git a/README b/README index 5e89922c..0a1c2068 100644 --- a/README +++ b/README @@ -56,7 +56,7 @@ For example on Ubuntu Linux 14.04 LTS the following commands will install all prerequisites for building yosys: $ yosys_deps="build-essential clang bison flex libreadline-dev gawk - tcl-dev libffi-dev git mercurial graphviz xdot pkg-config python" + tcl-dev libffi-dev git mercurial graphviz xdot pkg-config python3" $ sudo apt-get install $yosys_deps There are also pre-compiled Yosys binary packages for Ubuntu and Win32 as well diff --git a/techlibs/ice40/Makefile.inc b/techlibs/ice40/Makefile.inc index ed495519..63d6086a 100644 --- a/techlibs/ice40/Makefile.inc +++ b/techlibs/ice40/Makefile.inc @@ -12,7 +12,7 @@ EXTRA_OBJS += techlibs/ice40/brams_init.mk techlibs/ice40/brams_init.mk: techlibs/ice40/brams_init.py $(Q) mkdir -p techlibs/ice40 - $(P) python $< + $(P) python3 $< $(Q) touch techlibs/ice40/brams_init.mk techlibs/ice40/brams_init1.vh: techlibs/ice40/brams_init.mk diff --git a/techlibs/ice40/brams_init.py b/techlibs/ice40/brams_init.py index 93eb9846..4a148511 100644 --- a/techlibs/ice40/brams_init.py +++ b/techlibs/ice40/brams_init.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 def write_init_vh(filename, initbits): with open(filename, "w") as f: diff --git a/techlibs/xilinx/Makefile.inc b/techlibs/xilinx/Makefile.inc index cca41f91..ccf88ec7 100644 --- a/techlibs/xilinx/Makefile.inc +++ b/techlibs/xilinx/Makefile.inc @@ -11,7 +11,7 @@ EXTRA_OBJS += techlibs/xilinx/brams_init.mk techlibs/xilinx/brams_init.mk: techlibs/xilinx/brams_init.py $(Q) mkdir -p techlibs/xilinx - $(P) python $< + $(P) python3 $< $(Q) touch $@ techlibs/xilinx/brams_init_36.vh: techlibs/xilinx/brams_init.mk diff --git a/techlibs/xilinx/brams_init.py b/techlibs/xilinx/brams_init.py index eac829dd..e787b1f7 100644 --- a/techlibs/xilinx/brams_init.py +++ b/techlibs/xilinx/brams_init.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 with open("techlibs/xilinx/brams_init_18.vh", "w") as f: for i in range(8): diff --git a/tests/bram/generate.py b/tests/bram/generate.py index 766157eb..05a7ed02 100644 --- a/tests/bram/generate.py +++ b/tests/bram/generate.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 import os import sys diff --git a/tests/bram/run-test.sh b/tests/bram/run-test.sh index d617187e..f0bf0131 100755 --- a/tests/bram/run-test.sh +++ b/tests/bram/run-test.sh @@ -8,7 +8,7 @@ rm -rf temp mkdir -p temp echo "generating tests.." -python generate.py +python3 generate.py { echo -n "all:" diff --git a/tests/fsm/generate.py b/tests/fsm/generate.py index fb5695ff..8757d474 100644 --- a/tests/fsm/generate.py +++ b/tests/fsm/generate.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 import sys import random diff --git a/tests/fsm/run-test.sh b/tests/fsm/run-test.sh index 57c2a5b1..42389233 100755 --- a/tests/fsm/run-test.sh +++ b/tests/fsm/run-test.sh @@ -8,7 +8,7 @@ set -e rm -rf temp mkdir -p temp echo "generating tests.." -python generate.py +python3 generate.py { all_targets="all_targets:" diff --git a/tests/realmath/generate.py b/tests/realmath/generate.py index aee21118..19d01c7c 100644 --- a/tests/realmath/generate.py +++ b/tests/realmath/generate.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 import sys import random diff --git a/tests/realmath/run-test.sh b/tests/realmath/run-test.sh index 8419688c..f1ec5476 100755 --- a/tests/realmath/run-test.sh +++ b/tests/realmath/run-test.sh @@ -4,7 +4,7 @@ set -e rm -rf temp mkdir -p temp echo "generating tests.." -python generate.py +python3 generate.py cd temp echo "running tests.." diff --git a/tests/share/generate.py b/tests/share/generate.py index 271dd9c4..01a19a8d 100644 --- a/tests/share/generate.py +++ b/tests/share/generate.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 import sys import random diff --git a/tests/share/run-test.sh b/tests/share/run-test.sh index 6e880677..18dbbc27 100755 --- a/tests/share/run-test.sh +++ b/tests/share/run-test.sh @@ -8,7 +8,7 @@ set -e rm -rf temp mkdir -p temp echo "generating tests.." -python generate.py +python3 generate.py echo "running tests.." for i in $( ls temp/*.ys | sed 's,[^0-9],,g; s,^0*\(.\),\1,g;' ); do diff --git a/tests/tools/txt2tikztiming.py b/tests/tools/txt2tikztiming.py index cfefe339..9c6cd3a1 100755 --- a/tests/tools/txt2tikztiming.py +++ b/tests/tools/txt2tikztiming.py @@ -1,7 +1,4 @@ -#!/usr/bin/python - -from __future__ import division -from __future__ import print_function +#!/usr/bin/env python3 import argparse import fileinput -- cgit v1.2.3