Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
Merge branch 'up5k'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Oct 21, 2018
2 parents 006f354 + 07f6eaf commit 40e220b
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 43 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Toolchain-icestorm

[![Build Status](https://travis-ci.org/FPGAwars/toolchain-icestorm.svg?branch=v1.10.1)](https://travis-ci.org/FPGAwars/toolchain-icestorm)
[![Build Status](https://travis-ci.org/FPGAwars/toolchain-icestorm.svg)](https://travis-ci.org/FPGAwars/toolchain-icestorm)

## Introduction

Expand Down Expand Up @@ -41,6 +41,10 @@ NOTE: *libftdi1.a* and *libusb-1.0.a* files have been generated for each archite
* [Jesús Arroyo Torrens](https://github.com/Jesus89)
* [Juan González (Obijuan)](https://github.com/Obijuan)

## Collaborators

* [Miodrag Milanovic](https://github.com/mmicko)

## License

Licensed under a GPL v2 and [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/).
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Generate toolchain-icestorm-arch-ver.tar.gz from source code
# sources: http://www.clifford.at/icestorm/

VERSION=1.10.1
VERSION=1.11.0

# -- Target architectures
ARCH=$1
Expand Down
4 changes: 2 additions & 2 deletions scripts/build_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ if [ $ARCH == "windows_x86" ]; then
EXE=".exe"
CC="i686-w64-mingw32-gcc"
CXX="i686-w64-mingw32-g++"
ABC_ARCHFLAGS="-DWIN32 -DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -x c++ -fpermissive -w"
ABC_ARCHFLAGS="-DSIZEOF_VOID_P=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -D_POSIX_SOURCE -fpermissive -w"
fi

if [ $ARCH == "windows_amd64" ]; then
EXE=".exe"
CC="x86_64-w64-mingw32-gcc"
CXX="x86_64-w64-mingw32-g++"
ABC_ARCHFLAGS="-DWIN32 -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4 -DWIN32_NO_DLL -x c++ -fpermissive -w"
ABC_ARCHFLAGS="-DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DSIZEOF_INT=4 -DWIN32_NO_DLL -DHAVE_STRUCT_TIMESPEC -D_POSIX_SOURCE -fpermissive -w"
fi

if [ $ARCH == "darwin" ]; then
Expand Down
18 changes: 9 additions & 9 deletions scripts/compile_arachnepnr.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -- Compile Arachne PnR script

ARACHNE=arachne-pnr
COMMIT=840bdfdeb38809f9f6af4d89dd7b22959b176fdd
GIT_ARACHNE=https://github.com/cseed/arachne-pnr.git

# -- Setup
Expand All @@ -9,9 +10,9 @@ GIT_ARACHNE=https://github.com/cseed/arachne-pnr.git
cd $UPSTREAM_DIR

# -- Clone the sources from github
test -e $ARACHNE || git clone --depth=1 $GIT_ARACHNE $ARACHNE
test -e $ARACHNE || git clone $GIT_ARACHNE $ARACHNE
git -C $ARACHNE pull
echo ""
git -C $ARACHNE checkout $COMMIT
git -C $ARACHNE log -1

# -- Copy the upstream sources into the build directory
Expand All @@ -29,18 +30,17 @@ fi

if [ $ARCH != "darwin" ]; then
# -- Test the generated executables
test_bin bin/arachne-pnr
test -e share/$ARACHNE/chipdb-1k.bin || exit 1
test -e share/$ARACHNE/chipdb-5k.bin || exit 1
test -e share/$ARACHNE/chipdb-8k.bin || exit 1
test -e share/$ARACHNE/chipdb-384.bin || exit 1
test -e share/$ARACHNE/chipdb-lm4k.bin || exit 1
test_bin bin/arachne-pnr
fi

# -- Copy the executable to the bin dir
cp bin/arachne-pnr $PACKAGE_DIR/$NAME/bin/arachne-pnr$EXE

# -- Copy the chipdb*.bin data files
if [ ${ARCH:0:7} == "windows" ]; then
cp -r share/$ARACHNE/chipdb*.bin $PACKAGE_DIR/$NAME/bin
else
mkdir -p $PACKAGE_DIR/$NAME/share/$ARACHNE
cp -r share/$ARACHNE/chipdb*.bin $PACKAGE_DIR/$NAME/share/$ARACHNE
fi
mkdir -p $PACKAGE_DIR/$NAME/share/$ARACHNE
cp -r share/$ARACHNE/chipdb*.bin $PACKAGE_DIR/$NAME/share/$ARACHNE
7 changes: 4 additions & 3 deletions scripts/compile_icestorm.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -- Compile Icestorm script

ICESTORM=icestorm
COMMIT=5ab07ed32a768d484284f1d0e58f61c2ef9d398a
GIT_ICESTORM=https://github.com/cliffordwolf/icestorm.git

# -- Setup
Expand All @@ -9,10 +10,10 @@ GIT_ICESTORM=https://github.com/cliffordwolf/icestorm.git
cd $UPSTREAM_DIR

# -- Clone the sources from github
test -e $ICESTORM || git clone --depth=1 $GIT_ICESTORM $ICESTORM
test -e $ICESTORM || git clone $GIT_ICESTORM $ICESTORM
git -C $ICESTORM pull
echo ""
git -C $ARACHNE log -1
git -C $ICESTORM checkout $COMMIT
git -C $ICESTORM log -1

# -- Copy the upstream sources into the build directory
rsync -a $ICESTORM $BUILD_DIR --exclude .git
Expand Down
2 changes: 1 addition & 1 deletion scripts/compile_icotools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cd $UPSTREAM_DIR
test -e $ICOTOOLS || git clone --depth=1 $GIT_ICOTOOLS $ICOTOOLS
git -C $ICOTOOLS pull
echo ""
git -C $ARACHNE log -1
git -C $ICOTOOLS log -1

# -- Copy the upstream sources into the build directory
rsync -a $ICOTOOLS $BUILD_DIR --exclude .git
Expand Down
55 changes: 29 additions & 26 deletions scripts/compile_yosys.sh
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
# -- Compile Yosys script

VER=0.7
REL=1 # 1: load from release tag. 0: load from source code

VER=0.8
YOSYS=yosys-yosys-$VER
TAR_YOSYS=yosys-$VER.tar.gz
REL_YOSYS=https://github.com/cliffordwolf/yosys/archive/$TAR_YOSYS
GIT_YOSYS=https://github.com/cliffordwolf/yosys.git

# -- Setup
. $WORK_DIR/scripts/build_setup.sh

cd $UPSTREAM_DIR

# -- Check and download the release
test -e $TAR_YOSYS || wget $REL_YOSYS

# -- Unpack the release
tar zxf $TAR_YOSYS
if [ $REL -eq 1 ]; then
# -- Check and download the release
test -e $TAR_YOSYS || wget $REL_YOSYS
# -- Unpack the release
tar zxf $TAR_YOSYS
else
# -- Clone the sources from github
git clone --depth=1 $GIT_YOSYS $YOSYS
git -C $YOSYS pull
echo ""
git -C $YOSYS log -1
fi

# -- Copy the upstream sources into the build directory
rsync -a $YOSYS $BUILD_DIR --exclude .git

cd $BUILD_DIR/$YOSYS

# -- Yosys patch: https://github.com/cliffordwolf/yosys/pull/318
# --- required for windows_amd64

if [ $ARCH != "darwin" ]; then
sed -i "s/else if (pos >= arg1.bits.size())/else if (pos >= BigInteger(int(arg1.bits.size())))/;" kernel/calc.cc
sed -i "s/if (pos < 0 || pos >= arg1.bits.size())/if (pos < 0 || pos >= BigInteger(int(arg1.bits.size())))/;" kernel/calc.cc
fi

# -- Compile it

if [ $ARCH == "darwin" ]; then
make config-clang
gsed -i "s/-Wall -Wextra -ggdb/-w/;" Makefile
make -j$J YOSYS_VER="0.7 (Apio build)" \
make -j$J YOSYS_VER="$VER (Apio build)" \
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0
ABCMKARGS="CC=\"$CC\" CXX=\"$CXX\" OPTFLAGS=\"-O\" \
ARCHFLAGS=\"$ABC_ARCHFLAGS\" ABC_USE_NO_READLINE=1"
Expand All @@ -47,19 +49,18 @@ elif [ ${ARCH:0:7} == "windows" ]; then
sed -i "s/CXX = gcc$/CXX = $CC/;" Makefile
sed -i "s/LDLIBS += -lrt/LDLIBS +=/;" Makefile
sed -i "s/LDFLAGS += -rdynamic/LDFLAGS +=/;" Makefile
CXXFLAGS="-D_POSIX_SOURCE -D_WIN32"
make -j$J YOSYS_VER="0.7 (Apio build)" \
make -j$J YOSYS_VER="$VER (Apio build)" CPPFLAGS="-DYOSYS_WIN32_UNIX_DIR" \
LDLIBS="-static -lstdc++ -lm" \
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0 \
ABCMKARGS="CC=\"$CC\" CXX=\"$CXX\" LIBS=\"-static -lm\" OPTFLAGS=\"-O\" \
ARCHFLAGS=\"$ABC_ARCHFLAGS\" ABC_USE_NO_READLINE=1 ABC_USE_NO_PTHREADS=1"
ARCHFLAGS=\"$ABC_ARCHFLAGS\" ABC_USE_NO_READLINE=1 ABC_USE_NO_PTHREADS=1 ABC_USE_LIBSTDCXX=1"
else
make config-gcc
sed -i "s/-Wall -Wextra -ggdb/-w/;" Makefile
sed -i "s/LD = gcc$/LD = $CC/;" Makefile
sed -i "s/CXX = gcc$/CXX = $CC/;" Makefile
sed -i "s/LDFLAGS += -rdynamic/LDFLAGS +=/;" Makefile
make -j$J YOSYS_VER="0.7 (Apio build)" \
make -j$J YOSYS_VER="$VER (Apio build)" \
LDLIBS="-static -lstdc++ -lm" \
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0 \
ABCMKARGS="CC=\"$CC\" CXX=\"$CXX\" LIBS=\"-static -lm -ldl -pthread\" OPTFLAGS=\"-O\" \
Expand All @@ -70,16 +71,18 @@ if [ $ARCH != "darwin" ]; then
# -- Test the generated executables
test_bin yosys
test_bin yosys-abc
test_bin yosys-config
test_bin yosys-filterlib
test_bin yosys-smtbmc
fi

# -- Copy the executable file
# -- Copy the executable files
cp yosys $PACKAGE_DIR/$NAME/bin/yosys$EXE
cp yosys-abc $PACKAGE_DIR/$NAME/bin/yosys-abc$EXE
cp yosys-config $PACKAGE_DIR/$NAME/bin/yosys-config$EXE
cp yosys-filterlib $PACKAGE_DIR/$NAME/bin/yosys-filterlib$EXE
cp yosys-smtbmc $PACKAGE_DIR/$NAME/bin/yosys-smtbmc$EXE

# -- Copy the share folder to the package folder
if [ ${ARCH:0:7} == "windows" ]; then
cp -r share/* $PACKAGE_DIR/$NAME/share
else
mkdir -p $PACKAGE_DIR/$NAME/share/yosys
cp -r share/* $PACKAGE_DIR/$NAME/share/yosys
fi
mkdir -p $PACKAGE_DIR/$NAME/share/yosys
cp -r share/* $PACKAGE_DIR/$NAME/share/yosys
1 change: 1 addition & 0 deletions scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ if [ $ARCH == "darwin" ]; then
pkg-config python3 libusb libftdi gnu-sed wget"
brew update
brew install --force $DEPS
brew upgrade python
brew unlink $DEPS && brew link --force $DEPS
fi

0 comments on commit 40e220b

Please sign in to comment.