Skip to content

Commit

Permalink
GHDL for darwin-x64
Browse files Browse the repository at this point in the history
  • Loading branch information
mmicko committed Sep 26, 2022
1 parent f032caf commit 5a5e83e
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 6 deletions.
79 changes: 78 additions & 1 deletion .github/workflows/darwin-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,79 @@ jobs:
tag: bucket-darwin-x64
artifacts: "darwin-x64-yosys.tgz"
token: ${{ secrets.GITHUB_TOKEN }}
darwin-x64-ghdl:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v2
with:
repository: 'yosyshq/oss-cad-suite-build'
- name: Cache sources
id: cache-sources
uses: actions/cache@v2
with:
path: _sources
key: cache-sources-ghdl
- name: Download previous build
run: |
URL="https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-ghdl.tgz"
if wget --spider "${URL}" 2>/dev/null; then
wget -qO- "${URL}" | tar xvfz -
else
echo "Previous version not found in bucket"
fi
- name: Build
run: ./builder.py build --arch=darwin-x64 --target=ghdl --single --tar
- uses: ncipollo/release-action@v1
if: hashFiles('darwin-x64-ghdl.tgz') != ''
with:
allowUpdates: True
prerelease: True
omitBody: True
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
tag: bucket-darwin-x64
artifacts: "darwin-x64-ghdl.tgz"
token: ${{ secrets.GITHUB_TOKEN }}
darwin-x64-ghdl-yosys-plugin:
runs-on: ubuntu-latest
continue-on-error: true
needs: [ darwin-x64-ghdl, darwin-x64-yosys ]
steps:
- uses: actions/checkout@v2
with:
repository: 'yosyshq/oss-cad-suite-build'
- name: Cache sources
id: cache-sources
uses: actions/cache@v2
with:
path: _sources
key: cache-sources-ghdl-yosys-plugin
- name: Download previous build
run: |
URL="https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-ghdl-yosys-plugin.tgz"
if wget --spider "${URL}" 2>/dev/null; then
wget -qO- "${URL}" | tar xvfz -
else
echo "Previous version not found in bucket"
fi
- name: Download darwin-x64-ghdl
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-ghdl.tgz" | tar xvfz -
- name: Download darwin-x64-yosys
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-yosys.tgz" | tar xvfz -
- name: Build
run: ./builder.py build --arch=darwin-x64 --target=ghdl-yosys-plugin --single --tar
- uses: ncipollo/release-action@v1
if: hashFiles('darwin-x64-ghdl-yosys-plugin.tgz') != ''
with:
allowUpdates: True
prerelease: True
omitBody: True
omitBodyDuringUpdate: True
omitNameDuringUpdate: True
tag: bucket-darwin-x64
artifacts: "darwin-x64-ghdl-yosys-plugin.tgz"
token: ${{ secrets.GITHUB_TOKEN }}
darwin-x64-nextpnr-generic:
runs-on: ubuntu-latest
continue-on-error: true
Expand Down Expand Up @@ -1657,7 +1730,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
darwin-x64-default:
runs-on: ubuntu-latest
needs: [ darwin-x64-aiger, darwin-x64-avy, darwin-x64-bitwuzla, darwin-x64-boolector, darwin-x64-cocotb, darwin-x64-cvc4, darwin-x64-cvc5, darwin-x64-dfu-util, darwin-x64-ecpdap, darwin-x64-ecpprog, darwin-x64-flask, darwin-x64-fujprog, darwin-x64-graphviz, darwin-x64-gtkwave, darwin-x64-iceprogduino, darwin-x64-icesprog, darwin-x64-icestorm, darwin-x64-iverilog, darwin-x64-mcy, darwin-x64-nextpnr-ecp5, darwin-x64-nextpnr-generic, darwin-x64-nextpnr-ice40, darwin-x64-nextpnr-machxo2, darwin-x64-nextpnr-nexus, darwin-x64-openfpgaloader, darwin-x64-openocd, darwin-x64-pono, darwin-x64-prjoxide, darwin-x64-prjtrellis, darwin-x64-pyhdl, darwin-x64-python-programmers, darwin-x64-python3, darwin-x64-sby, darwin-x64-sby-gui, darwin-x64-system-resources, darwin-x64-utils, darwin-x64-verilator, darwin-x64-xdot, darwin-x64-yices, darwin-x64-yosys, darwin-x64-z3 ]
needs: [ darwin-x64-aiger, darwin-x64-avy, darwin-x64-bitwuzla, darwin-x64-boolector, darwin-x64-cocotb, darwin-x64-cvc4, darwin-x64-cvc5, darwin-x64-dfu-util, darwin-x64-ecpdap, darwin-x64-ecpprog, darwin-x64-flask, darwin-x64-fujprog, darwin-x64-ghdl, darwin-x64-ghdl-yosys-plugin, darwin-x64-graphviz, darwin-x64-gtkwave, darwin-x64-iceprogduino, darwin-x64-icesprog, darwin-x64-icestorm, darwin-x64-iverilog, darwin-x64-mcy, darwin-x64-nextpnr-ecp5, darwin-x64-nextpnr-generic, darwin-x64-nextpnr-ice40, darwin-x64-nextpnr-machxo2, darwin-x64-nextpnr-nexus, darwin-x64-openfpgaloader, darwin-x64-openocd, darwin-x64-pono, darwin-x64-prjoxide, darwin-x64-prjtrellis, darwin-x64-pyhdl, darwin-x64-python-programmers, darwin-x64-python3, darwin-x64-sby, darwin-x64-sby-gui, darwin-x64-system-resources, darwin-x64-utils, darwin-x64-verilator, darwin-x64-xdot, darwin-x64-yices, darwin-x64-yosys, darwin-x64-z3 ]
steps:
- name: Get current date
id: date
Expand Down Expand Up @@ -1689,6 +1762,10 @@ jobs:
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-flask.tgz" | tar xvfz -
- name: Download darwin-x64-fujprog
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-fujprog.tgz" | tar xvfz -
- name: Download darwin-x64-ghdl
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-ghdl.tgz" | tar xvfz -
- name: Download darwin-x64-ghdl-yosys-plugin
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-ghdl-yosys-plugin.tgz" | tar xvfz -
- name: Download darwin-x64-graphviz
run: wget -qO- "https://github.com/yosyshq/oss-cad-suite-build/releases/download/bucket-darwin-x64/darwin-x64-graphviz.tgz" | tar xvfz -
- name: Download darwin-x64-gtkwave
Expand Down
2 changes: 1 addition & 1 deletion default/rules/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
Target(
name = 'ghdl',
sources = [ 'ghdl' ],
arch = [ 'linux-x64' ],
arch = [ 'linux-x64', 'darwin-x64' ],
)
2 changes: 1 addition & 1 deletion default/rules/yosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
name = 'ghdl-yosys-plugin',
sources = [ 'ghdl-yosys-plugin' ],
dependencies = [ 'ghdl', 'yosys' ],
arch = [ 'linux-x64' ],
arch = [ 'linux-x64', 'darwin-x64' ],
)

SourceLocation(
Expand Down
7 changes: 6 additions & 1 deletion default/scripts/ghdl-yosys-plugin.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cd ghdl-yosys-plugin
sed -i 's,/yosyshq/share,/yosys/yosyshq/share,g' ../yosys/yosyshq/bin/yosys-config
make GHDL=../ghdl/yosyshq/bin/ghdl YOSYS_CONFIG=../yosys/yosyshq/bin/yosys-config CFLAGS="-I ../yosys/yosyshq/share/yosys/include"
if [ ${ARCH} == 'darwin-x64' ]; then
sed -i '11,13d' Makefile
make GHDL=../ghdl/yosyshq/bin/ghdl YOSYS_CONFIG=../yosys/yosyshq/bin/yosys-config CFLAGS="-I ../yosys/yosyshq/share/yosys/include" LIBGHDL_LIB="${BUILD_DIR}/ghdl${INSTALL_PREFIX}/lib/libghdl-3_0_0_dev.dylib" LIBGHDL_INC="${BUILD_DIR}/ghdl${INSTALL_PREFIX}/include/"
else
make GHDL=../ghdl/yosyshq/bin/ghdl YOSYS_CONFIG=../yosys/yosyshq/bin/yosys-config CFLAGS="-I ../yosys/yosyshq/share/yosys/include"
fi
mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}/share/yosys/plugins
cp -rf ghdl.so ${OUTPUT_DIR}${INSTALL_PREFIX}/share/yosys/plugins/.
9 changes: 7 additions & 2 deletions default/scripts/ghdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ if [ ${ARCH} == 'linux-arm' ] || [ ${ARCH} == 'linux-arm64' ] || [ ${ARCH} == 'l
param=--with-llvm-config='llvm-config'
LDFLAGS=-L/usr/lib/${CROSS_NAME}
elif [ ${ARCH} == 'darwin-x64' ]; then
export PATH="$PATH:/opt/gnat/bin"
export GNAT_LARGS="-static-libgcc"
wget https://github.com/ghdl/ghdl/releases/download/nightly/ghdl-macos-10.15-mcode.tgz
mkdir -p ${OUTPUT_DIR}${INSTALL_PREFIX}
tar xvfz ghdl-macos-10.15-mcode.tgz -C ${OUTPUT_DIR}${INSTALL_PREFIX}
install_name_tool -id @executable_path/../lib/libghdl-3_0_0_dev.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/libghdl-3_0_0_dev.dylib
wget https://github.com/mmicko/macos-resources/releases/download/v2/libgnat-2019.dylib
cp libgnat-2019.dylib ${OUTPUT_DIR}${INSTALL_PREFIX}/lib/.
exit 0
elif [ ${ARCH} == 'windows-x64' ]; then
sed -i 's,grt-all libs.vhdl.llvm all.vpi,grt-all all.vpi,g' Makefile.in
sed -i 's,install.llvm.program install.vhdllib,install.llvm.program ,g' Makefile.in
Expand Down
4 changes: 4 additions & 0 deletions scripts/package-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ for binfile in $(find lib -type f | xargs file | grep Mach-O | grep bundle | cut
echo $binfile
dylibbundler -of -b -x $binfile -p @executable_path/../lib -d ${OUTPUT_DIR}${INSTALL_PREFIX}/lib
done
for binfile in $(find share -type f | xargs file | grep Mach-O | grep shared | cut -f1 -d:); do
echo $binfile
dylibbundler -of -b -x $binfile -p @executable_path/../lib -d ${OUTPUT_DIR}${INSTALL_PREFIX}/lib
done
if [ ${PRELOAD} == 'True' ]; then
dylibbundler -of -b -x lib/libtabby.dylib -p @executable_path/../lib -d ${OUTPUT_DIR}${INSTALL_PREFIX}/lib
fi
Expand Down

0 comments on commit 5a5e83e

Please sign in to comment.