Skip to content
This repository was archived by the owner on Nov 4, 2021. It is now read-only.

Commit 81227d6

Browse files
authored
Merge pull request #36 from open-tool-forge/bugfix/33-yosys-ver
make yosys version string compatible with nmigen
2 parents 2a44e10 + a4f7775 commit 81227d6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

scripts/compile_yosys.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ test -e $YOSYS || git clone $GIT_YOSYS $YOSYS
1616
git -C $YOSYS pull
1717
git -C $YOSYS checkout $VER
1818
git -C $YOSYS log -1
19+
GIT_REV=$(git -C $YOSYS rev-parse --short HEAD 2> /dev/null || echo UNKNOWN)
1920

2021
# edbordin: it would be better to avoid running anything in the upstream folder but
2122
# this just makes life much easier...
2223
pushd $YOSYS
2324
if [ $ARCH == "darwin" ]; then
2425
OLDPATH=$PATH
25-
# bumpversion needs GNU sed and wc
26-
export PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
27-
$MAKE bumpversion
26+
# use GNU sed so we can reuse the same pattern
27+
export PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
2828
sed -r -i 's/^(YOSYS_VER := [0-9]+\.[0-9]+\+[0-9]+).*$/\1 \(open-tool-forge build\)/;' Makefile
2929
export PATH=$OLDPATH
3030
else
31-
$MAKE bumpversion
3231
sed -r -i 's/^(YOSYS_VER := [0-9]+\.[0-9]+\+[0-9]+).*$/\1 \(open-tool-forge build\)/;' Makefile
3332
fi
3433
popd
@@ -66,7 +65,7 @@ if [ $ARCH == "darwin" ]; then
6665
echo "$MAKEFILE_CONF_GHDL" >> Makefile.conf
6766
sed -i "" "s/-Wall -Wextra -ggdb/-w/;" Makefile
6867
CXXFLAGS="-std=c++11 $CXXFLAGS" make \
69-
-j$J PRETTY=0 \
68+
-j$J GIT_REV="${GIT_REV}" PRETTY=0 \
7069
LDLIBS="-lm $PACKAGE_DIR/$NAME/lib/libghdl.a $(tr -s '\n' ' ' < $PACKAGE_DIR/$NAME/lib/libghdl.link)" \
7170
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0 ENABLE_ZLIB=0 ENABLE_ABC=1 \
7271
ABCMKARGS="CC=\"$CC\" CXX=\"$CXX\" OPTFLAGS=\"-O\" \
@@ -76,7 +75,7 @@ if [ $ARCH == "darwin" ]; then
7675
elif [ ${ARCH:0:7} == "windows" ]; then
7776
$MAKE config-msys2-64
7877
echo "$MAKEFILE_CONF_GHDL" >> Makefile.conf
79-
$MAKE -j$J PRETTY=0 \
78+
$MAKE -j$J GIT_REV="${GIT_REV}" PRETTY=0 \
8079
LDLIBS="-static -lstdc++ -lm $(cygpath -m -a $PACKAGE_DIR/$NAME/lib/libghdl.a) $((tr -s '\n' ' ' | tr -s '\\' '/') < $PACKAGE_DIR/$NAME/lib/libghdl.link)" \
8180
ABCMKARGS="CC=\"$CC\" CXX=\"$CXX\" LIBS=\"-static -lm\" OPTFLAGS=\"-O\" \
8281
ARCHFLAGS=\"$ABC_ARCHFLAGS\" \
@@ -93,7 +92,7 @@ else
9392
# sed -i "s/LD = gcc$/LD = $CC/;" Makefile
9493
# sed -i "s/CXX = gcc$/CXX = $CC/;" Makefile
9594
# sed -i "s/LDFLAGS += -rdynamic/LDFLAGS +=/;" Makefile
96-
$MAKE -j$J PRETTY=0 \
95+
$MAKE -j$J GIT_REV="${GIT_REV}" PRETTY=0 \
9796
LDLIBS="-static -lstdc++ -lm $PACKAGE_DIR/$NAME/lib/libghdl.a $(tr -s '\n' ' ' < $PACKAGE_DIR/$NAME/lib/libghdl.link) -ldl" \
9897
ENABLE_TCL=0 ENABLE_PLUGINS=0 ENABLE_READLINE=0 ENABLE_COVER=0 ENABLE_ZLIB=0 ENABLE_ABC=1 \
9998
ABCMKARGS="CC=\"$CC\" CXX=\"$CXX\" LIBS=\"-static -lm -ldl -pthread\" \

scripts/install_dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if [ $ARCH == "darwin" ]; then
9393
# yosys detects some of these tools if a homebrew version is installed
9494
# so we may not need to add all of them to PATH
9595
brew install automake pkg-config bison flex gawk libffi git graphviz xdot bash cmake boost boost-python3 eigen \
96-
libftdi libusb zlib libedit ncurses bzip2 gnu-sed coreutils
96+
libftdi libusb zlib libedit ncurses bzip2 gnu-sed
9797

9898
wget --progress=dot https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-MacOSX-x86_64.sh -O miniconda.sh
9999
bash miniconda.sh -b -p /tmp/conda

0 commit comments

Comments
 (0)