├── .github ├── trigger.sh └── workflows │ ├── base.yml │ ├── bookworm.yml │ ├── cosim.yml │ ├── ext.yml │ ├── mirror.yml │ ├── test.yml │ └── vunit.yml ├── .todo ├── TODO.md ├── gh-pages.sh └── pack.sh ├── CONTRIBUTING.md ├── DEPRECATED.md ├── README.md ├── USE_CASES.md ├── broadway.sh ├── build_arch.dockerfile ├── build_debian.dockerfile ├── build_fedora.dockerfile ├── gui.dockerfile ├── logo.png ├── logo.svg ├── ls.dockerfile ├── ls_base.dockerfile ├── run.sh ├── run_debian.dockerfile ├── run_fedora.dockerfile ├── utils.sh └── vunit.dockerfile /.github/trigger.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | 5 | if [ -z $1 ]; then 6 | echo "Even type cannot be empty!" 7 | exit 1 8 | fi 9 | 10 | curl -X POST https://api.github.com/repos/ghdl/docker/dispatches \ 11 | -H "Content-Type: application/json" -H 'Accept: application/vnd.github.everest-preview+json' \ 12 | -H "Authorization: token ${GHDL_BOT_TOKEN}" \ 13 | --data "{\"event_type\": \"$1\"}" 14 | -------------------------------------------------------------------------------- /.github/workflows/base.yml: -------------------------------------------------------------------------------- 1 | name: 'base' 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'run.sh' 7 | - '.github/workflows/base.yml' 8 | - 'build_*.dockerfile' 9 | - 'run_*.dockerfile' 10 | - 'ls_base.dockerfile' 11 | workflow_dispatch: 12 | schedule: 13 | - cron: '0 0 1,16 * *' 14 | 15 | jobs: 16 | 17 | base: 18 | strategy: 19 | fail-fast: false 20 | matrix: 21 | include: [ 22 | { distro: arch, version: '' }, 23 | { distro: debian, version: buster }, 24 | { distro: debian, version: bullseye }, 25 | { distro: debian, version: bookworm }, 26 | { distro: fedora, version: 37 }, 27 | { distro: fedora, version: 38 }, 28 | { distro: ubuntu, version: 20 }, 29 | { distro: ubuntu, version: 22 }, 30 | { distro: ls, version: '' }, 31 | ] 32 | runs-on: ubuntu-latest 33 | steps: 34 | 35 | - uses: actions/checkout@v4 36 | 37 | - run: ./run.sh -c $DISTRIBUTION $VERSION 38 | env: 39 | DISTRIBUTION: ${{ matrix.distro }} 40 | VERSION: ${{ matrix.version }} 41 | 42 | - name: 'Build ghdl/debug:base' 43 | # We need to use 'buster' because 'gnat-gps' is not available on 'bullseye' or 'bookworm' 44 | if: (matrix.distro == 'debian') && (matrix.version == 'buster') 45 | run: | 46 | docker build -t ghdl/debug:base - <<-EOF 47 | FROM ghdl/build:buster-mcode 48 | RUN apt update -qq && apt install -y python3-pip gnat-gps graphviz gdb \ 49 | && ln -s /usr/bin/pip3 /usr/bin/pip 50 | EOF 51 | 52 | - name: 'Build ghdl/build:doc' 53 | if: (matrix.distro == 'debian') && (matrix.version == 'bookworm') 54 | run: | 55 | docker build -t ghdl/build:doc . -f- <<-'EOF' 56 | FROM ghdl/build:bookworm-mcode 57 | RUN apt update -qq && apt install -y python3-pip python3-venv graphviz 58 | ENV VIRTUAL_ENV=/opt/venv 59 | RUN python3 -m venv $VIRTUAL_ENV 60 | ENV PATH="$VIRTUAL_ENV/bin:$PATH" 61 | EOF 62 | 63 | - name: Deploy to DockerHub 64 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 65 | uses: pyTooling/Actions/with-post-step@r0 66 | with: 67 | main: | 68 | # Release 69 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 70 | ./run.sh base 71 | post: docker logout docker.io 72 | 73 | 74 | # FIXIT: ensure that branches different from 'master' do not trigger deploy steps! 75 | # FIXIT: ensure that PR's cannot access/use secrets! 76 | -------------------------------------------------------------------------------- /.github/workflows/bookworm.yml: -------------------------------------------------------------------------------- 1 | name: 'bookworm' 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'run.sh' 7 | - '.github/workflows/bookworm.yml' 8 | workflow_dispatch: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | 12 | jobs: 13 | 14 | build: 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | backend: 19 | - mcode 20 | - llvm-14 21 | - gcc-12.3.0 22 | runs-on: ubuntu-latest 23 | steps: 24 | 25 | - uses: actions/checkout@v4 26 | 27 | - name: Clone ghdl 28 | run: git clone https://github.com/ghdl/ghdl 29 | 30 | - name: Build 'ghdl' and 'pkg' images 31 | run: ./run.sh -b 32 | env: 33 | TASK: bookworm+${{ matrix.backend }} 34 | 35 | - name: Deploy to DockerHub 36 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 37 | uses: pyTooling/Actions/with-post-step@r0 38 | with: 39 | main: | 40 | # Release 41 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 42 | ./run.sh "" 43 | post: docker logout docker.io 44 | 45 | trigger: 46 | needs: [build] 47 | runs-on: ubuntu-latest 48 | steps: 49 | - uses: actions/checkout@v4 50 | - run: GHDL_BOT_TOKEN=${{ github.token }} ./.github/trigger.sh vunit 51 | -------------------------------------------------------------------------------- /.github/workflows/cosim.yml: -------------------------------------------------------------------------------- 1 | name: 'cosim' 2 | 3 | on: 4 | push: 5 | paths: 6 | - '.github/workflows/cosim.yml' 7 | workflow_dispatch: 8 | repository_dispatch: 9 | types: [ cosim ] 10 | schedule: 11 | - cron: '0 0 * * 5' 12 | 13 | env: 14 | DOCKER_BUILDKIT: 1 15 | 16 | jobs: 17 | 18 | 19 | base: 20 | strategy: 21 | fail-fast: false 22 | max-parallel: 1 23 | matrix: 24 | img: [ mcode, py, vunit-cocotb ] 25 | runs-on: ubuntu-latest 26 | env: 27 | IMG: ${{ matrix.img }} 28 | steps: 29 | 30 | - uses: actions/checkout@v4 31 | with: 32 | repository: ghdl/ghdl-cosim 33 | 34 | - name: Build image 35 | run: docker build -t ghdl/cosim:${IMG} - < docker/${IMG}.dockerfile 36 | 37 | - name: Deploy to DockerHub 38 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 39 | uses: pyTooling/Actions/with-post-step@r0 40 | with: 41 | main: | 42 | # Release 43 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 44 | docker push ghdl/cosim:${IMG} 45 | post: docker logout docker.io 46 | 47 | 48 | build: 49 | needs: base 50 | strategy: 51 | fail-fast: false 52 | matrix: 53 | img: [ matplotlib, xyce, octave ] 54 | runs-on: ubuntu-latest 55 | env: 56 | IMG: ${{ matrix.img }} 57 | steps: 58 | 59 | - uses: actions/checkout@v4 60 | with: 61 | repository: ghdl/ghdl-cosim 62 | 63 | - name: Build images 64 | run: | 65 | docker build -t ghdl/cosim:${IMG}-slim - < docker/${IMG}.dockerfile 66 | docker build -t ghdl/cosim:${IMG} --build-arg IMAGE="ghdl/cosim:${IMG}-slim" - < docker/vunit-cocotb.dockerfile 67 | 68 | - name: Deploy to DockerHub 69 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 70 | uses: pyTooling/Actions/with-post-step@r0 71 | with: 72 | main: | 73 | # Release 74 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 75 | docker push ghdl/cosim:${IMG}-slim 76 | docker push ghdl/cosim:${IMG} 77 | post: docker logout docker.io 78 | -------------------------------------------------------------------------------- /.github/workflows/ext.yml: -------------------------------------------------------------------------------- 1 | name: 'ext' 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'run.sh' 7 | - 'cli/*' 8 | - '.github/workflows/ext.yml' 9 | - 'ls*.dockerfile' 10 | - 'gui.dockerfile' 11 | workflow_dispatch: 12 | repository_dispatch: 13 | types: [ ext ] 14 | 15 | env: 16 | DOCKER_BUILDKIT: 1 17 | 18 | jobs: 19 | 20 | 21 | ls: 22 | runs-on: ubuntu-latest 23 | steps: 24 | 25 | - uses: actions/checkout@v4 26 | 27 | - name: Build images 28 | run: ./run.sh -l 29 | 30 | - name: Deploy to DockerHub 31 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 32 | uses: pyTooling/Actions/with-post-step@r0 33 | with: 34 | main: | 35 | # Release 36 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 37 | ./run.sh ext 38 | post: docker logout docker.io 39 | 40 | 41 | gui: 42 | needs: [ls] 43 | strategy: 44 | fail-fast: false 45 | runs-on: ubuntu-latest 46 | steps: 47 | 48 | - uses: actions/checkout@v4 49 | 50 | - name: Build images 51 | run: ./run.sh -e gui 52 | 53 | - name: Deploy to DockerHub 54 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 55 | uses: pyTooling/Actions/with-post-step@r0 56 | with: 57 | main: | 58 | # Release 59 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 60 | ./run.sh ext 61 | post: docker logout docker.io 62 | -------------------------------------------------------------------------------- /.github/workflows/mirror.yml: -------------------------------------------------------------------------------- 1 | name: 'mirror' 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'run.sh' 7 | - '.github/workflows/mirror.yml' 8 | workflow_dispatch: 9 | repository_dispatch: 10 | types: [ mirror ] 11 | schedule: 12 | - cron: '0 0 * * 5' 13 | 14 | jobs: 15 | 16 | mirror: 17 | runs-on: ubuntu-latest 18 | steps: 19 | 20 | - uses: actions/checkout@v4 21 | 22 | - name: Pull images 23 | run: | 24 | docker pull hdlc/nextpnr:latest 25 | docker pull hdlc/nextpnr:ice40 26 | docker pull hdlc/nextpnr:ecp5 27 | docker pull hdlc/prog:latest 28 | docker pull hdlc/prjtrellis:latest 29 | docker pull hdlc/icestorm:latest 30 | docker pull hdlc/yosys:latest 31 | docker pull hdlc/ghdl:yosys 32 | docker pull hdlc/formal:latest 33 | 34 | - name: Tag images 35 | run: | 36 | docker tag hdlc/nextpnr:latest ghdl/synth:nextpnr 37 | docker tag hdlc/nextpnr:ice40 ghdl/synth:nextpnr-ice40 38 | docker tag hdlc/nextpnr:ecp5 ghdl/synth:nextpnr-ecp5 39 | docker tag hdlc/prog:latest ghdl/synth:prog 40 | docker tag hdlc/prjtrellis:latest ghdl/synth:trellis 41 | docker tag hdlc/icestorm:latest ghdl/synth:icestorm 42 | docker tag hdlc/yosys:latest ghdl/synth:yosys 43 | docker tag hdlc/ghdl:yosys ghdl/synth:beta 44 | docker tag hdlc/formal:latest ghdl/synth:formal 45 | 46 | - name: Deploy to DockerHub 47 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 48 | uses: pyTooling/Actions/with-post-step@r0 49 | with: 50 | main: | 51 | # Release 52 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 53 | ./run.sh synth 54 | post: docker logout docker.io 55 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: 'test' 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'run.sh' 7 | - '.github/workflows/test.yml' 8 | workflow_dispatch: 9 | schedule: 10 | - cron: '0 0 * * 5' 11 | 12 | jobs: 13 | 14 | build: 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | include: [ 19 | { distro: buster, backend: mcode , args: "" }, 20 | { distro: bullseye, backend: mcode , args: "" }, 21 | { distro: bullseye, backend: mcode, args: "--gplcompat" }, 22 | { distro: bookworm, backend: mcode, args: "--gplcompat" }, 23 | { distro: ubuntu20, backend: mcode , args: "" }, 24 | { distro: ubuntu22, backend: mcode , args: "" }, 25 | { distro: fedora37, backend: mcode , args: "" }, 26 | { distro: fedora38, backend: mcode , args: "" }, 27 | { distro: bullseye, backend: llvm-11, args: "" }, 28 | { distro: ubuntu20, backend: llvm-10, args: "" }, 29 | { distro: ubuntu22, backend: llvm-11, args: "" }, 30 | { distro: fedora37, backend: llvm, args: "" }, 31 | { distro: fedora38, backend: llvm, args: "" }, 32 | { distro: bullseye, backend: gcc-9.4.0, args: "" }, 33 | { distro: fedora37, backend: gcc-10.3.0, args: "" }, 34 | { distro: fedora38, backend: gcc-11.3.0, args: "" }, 35 | ] 36 | runs-on: ubuntu-latest 37 | steps: 38 | 39 | - uses: actions/checkout@v4 40 | 41 | - name: Clone ghdl 42 | run: git clone https://github.com/ghdl/ghdl 43 | 44 | - name: Build 'ghdl' and 'pkg' images 45 | run: ./run.sh -b $TARGS 46 | env: 47 | TASK: ${{ matrix.distro }}+${{ matrix.backend }} 48 | TARGS: ${{ matrix.args }} 49 | 50 | - name: 'Build ghdl/debug' 51 | # We need to use 'buster' because 'gnat-gps' is not available on 'bullseye' or 'bookworm' 52 | if: matrix.backend == 'mcode' && matrix.distro == 'buster' 53 | run: | 54 | docker build -t ghdl/debug - <<-EOF 55 | FROM ghdl/debug:base 56 | COPY --from=ghdl/pkg:buster-mcode / /ghdl/usr/local/ 57 | EOF 58 | 59 | - name: Deploy to DockerHub 60 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 61 | uses: pyTooling/Actions/with-post-step@r0 62 | with: 63 | main: | 64 | # Release 65 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 66 | ./run.sh "" 67 | post: docker logout docker.io 68 | -------------------------------------------------------------------------------- /.github/workflows/vunit.yml: -------------------------------------------------------------------------------- 1 | name: 'vunit' 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'run.sh' 7 | - 'cli/*' 8 | - '.github/workflows/vunit.yml' 9 | - 'vunit.dockerfile' 10 | workflow_dispatch: 11 | repository_dispatch: 12 | types: [ vunit ] 13 | 14 | env: 15 | DOCKER_BUILDKIT: 1 16 | 17 | jobs: 18 | 19 | vunit: 20 | strategy: 21 | fail-fast: false 22 | runs-on: ubuntu-latest 23 | steps: 24 | 25 | - uses: actions/checkout@v4 26 | 27 | - name: Build images 28 | run: ./run.sh -e vunit 29 | 30 | - name: Deploy to DockerHub 31 | if: github.event_name != 'pull_request' && github.repository == 'ghdl/docker' 32 | uses: pyTooling/Actions/with-post-step@r0 33 | with: 34 | main: | 35 | # Release 36 | echo '${{ secrets.DOCKER_PASS }}' | docker login docker.io -u '${{ secrets.DOCKER_USER }}' --password-stdin 37 | ./run.sh vunit 38 | post: docker logout docker.io 39 | 40 | - run: GHDL_BOT_TOKEN=${{ github.token }} ./.github/trigger.sh ext 41 | -------------------------------------------------------------------------------- /.todo/TODO.md: -------------------------------------------------------------------------------- 1 | - `main` 2 | - Somehow tell which images to build through the commit message, instead of building all of them. 3 | - `test` 4 | - metainfo generated in both, the build and the test tasks 5 | - versions of the tools 6 | - date of the build/test 7 | - commit sha (build only) 8 | - checksum 9 | - add this info to the tarball? if so, se comment about where to put it (below) 10 | - `Pack artifacts` 11 | - [x] Pull all the `ghdl/pkg` images 12 | - [ ] Now `dockerfiles/run/*` are used. Somehow tell which to get. 13 | - [ ] Add metainfo to the packages/tarballs [[@tgingold 2017-02-14](https://github.com/tgingold/ghdl/issues/280#issuecomment-279595802)] 14 | - [ ] License 15 | - [ ] Readme 16 | - [ ] Add metainfo to `ghdl/ghdl` and `ghdl/pkg` images? If so, where (note that GHDL is preinstalled to `usr/local`)? 17 | - `ext` 18 | - Add color bash prompt 19 | - Better build gtkwave from sources because #442 20 | 21 | --- 22 | 23 | - [ ] Integration with play-with-docker (PWD) 24 | - [ ] eclipse/che demo in PWD: [eclipse/che#3595](https://github.com/eclipse/che/issues/3595#issuecomment-349852819) 25 | - [ ] Write dummy compose files and companion scripts to allow `play-with-docker.com/?stack=` 26 | - [ ] Image tagging 27 | - [ ] Add release tag to images when a tagged commit is pushed 28 | - [ ] Push both, the tagged image and the `latest` 29 | - [ ] Can docker images be removed programatically? 30 | - [ ] ARM cross-compilation. Ready-to-use Rpi3 docker-based SD imgs available. 31 | -------------------------------------------------------------------------------- /.todo/gh-pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit with nonzero exit code if anything fails 4 | 5 | TARGET_BRANCH="gh-pages" 6 | REPO=`git config remote.origin.url` 7 | 8 | getWiki() { 9 | printf "\n[GH-PAGES] Clone wiki\n" 10 | git clone "${REPO%.*}.wiki.git" content/wiki 11 | cd content/wiki 12 | rm -rf wip .git 13 | 14 | printf "\n[GH-PAGES] Adapt wiki pages\n" 15 | for f in *.md; do 16 | sed -i -r 's/\[\[(.*)\|(.*)\]\]/[\1]({{< relref "wiki\/\2.md" >}})/g' ./*.md 17 | #name="$`sed -e 's/-/ /g' <<< $f`" 18 | #printf -- "---\ntitle: \"%s\"\ndescription: \"%s\"\ndate: \"%s\"\nlastmod: \"%s\"\n---\n$(cat $f)" "${name%.*}" "${f%.*}" $(git log -1 --format="%ai" -- "$f" | cut -c1-10) $(date +%Y-%m-%d -r "$f") > $f 19 | done; 20 | } 21 | 22 | if [ "$DEPLOY" = "" ]; then 23 | curl -L https://raw.githubusercontent.com/buildthedocs/btd/master/btd.sh | sh -s build -d -n "GHDL" -v "builders,rtd2travis,ghdl-0.35" 24 | #"builders,v0.35,v0.34" 25 | mv ../btd_builds/html ghdl-io/static/doc/ 26 | 27 | # getWiki 28 | 29 | printf "\n[GH-PAGES] Clone the '$TARGET_BRANCH' to 'out' and clean existing contents\n" 30 | git clone -b "$TARGET_BRANCH" "$REPO" ../out 31 | rm -rf ../out/**/* || exit 0 32 | 33 | set +e 34 | docker run --rm -t \ 35 | -v /$(pwd):/src \ 36 | -w //src/ghdl-io \ 37 | btdi/hugo -DEF -d hugo_out 38 | set -e 39 | cp -r ghdl-io/hugo_out/. ../out 40 | 41 | rm -rf ghdl-io/static/doc 42 | else 43 | # Pull requests and commits to other branches shouldn't try to deploy, just build to verify 44 | if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 45 | printf "\nSkipping pages deploy\n" 46 | exit 0 47 | fi 48 | 49 | cd ../out 50 | 51 | git config user.name "Travis CI" 52 | git config user.email "travis@gh-pages" 53 | 54 | printf "\n[GH-PAGES] Add changes\n" 55 | git add . 56 | # If there are no changes to the compiled out (e.g. this is a README update) then just bail. 57 | if [ $(git status --porcelain | wc -l) -lt 1 ]; then 58 | echo "No changes to the output on this push; exiting." 59 | exit 0 60 | fi 61 | git commit -am "deploy to github pages: `git rev-parse --verify HEAD`" 62 | 63 | printf "\n[GH-PAGES] Get the deploy key \n" 64 | # by using Travis's stored variables to decrypt deploy_key.enc 65 | eval `ssh-agent -s` 66 | openssl aes-256-cbc -K $encrypted_0198ee37cbd2_key -iv $encrypted_0198ee37cbd2_iv -in ../ghdl/ghdl-io/deploy_key.enc -d | ssh-add - 67 | 68 | printf "\n[GH-PAGES] Push to $TARGET_BRANCH \n" 69 | # Now that we're all set up, we can push. 70 | git push `echo $REPO | sed -e 's/https:\/\/github.com\//git@github.com:/g'` $TARGET_BRANCH 71 | fi 72 | -------------------------------------------------------------------------------- /.todo/pack.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -e 4 | 5 | scriptdir=$(dirname $0) 6 | 7 | . "$scriptdir/travis/utils.sh" 8 | 9 | currentdir="${scriptdir}/dockerfiles/run" 10 | 11 | for f in `ls $currentdir`; do 12 | for tag in `grep -oP "FROM.*AS \K.*" ${currentdir}/$f`; do 13 | ftag="${f}-${tag}" 14 | gstart "$ftag" "$ANSI_BLUE[DOCKER pull] pkg : ${f} - ${tag}$ANSI_NOCOLOR" 15 | img="ghdl/pkg:$ftag" 16 | docker pull $img 17 | cat >> Dockerfile-from <<-EOF 18 | FROM $img AS $ftag 19 | EOF 20 | cat >> Dockerfile-copy <<-EOF 21 | COPY --from=$ftag ./* /$ftag/ 22 | EOF 23 | gend "$ftag" 24 | done 25 | done 26 | 27 | mkdir -pv tmp-pkg && cd tmp-pkg 28 | 29 | gstart "pkg_tmp" "$ANSI_BLUE[DOCKER build] pkg:tmp $ANSI_NOCOLOR" 30 | mv ../Dockerfile-from ./Dockerfile 31 | echo "FROM busybox" >> Dockerfile 32 | cat ../Dockerfile-copy >> Dockerfile 33 | rm ../Dockerfile-copy 34 | echo "Dockerfile:" 35 | cat Dockerfile 36 | echo "" 37 | docker build -t ghdl/pkg:tmp . 38 | gend "pkg_tmp" 39 | 40 | gstart "pkg_all" "$ANSI_BLUE[DOCKER build] pkg:all $ANSI_NOCOLOR" 41 | echo "FROM \"ghdl/pkg:tmp\" AS pkg-tmp" > Dockerfile 42 | echo "FROM busybox" >> Dockerfile 43 | echo "COPY --from=pkg-tmp ./* ./ghdl-pkgs/" >> Dockerfile 44 | docker build -t save_pkg . 45 | gend "pkg_all" 46 | 47 | docker rmi -f `docker images -q ghdl/pkg:*` 48 | docker tag save_pkg ghdl/pkg:all 49 | docker rmi save_pkg 50 | 51 | cd .. && rm -rf tmp-pkg 52 | 53 | docker images 54 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are welcome! 4 | 5 | ## Adding a new distro 6 | 7 | ### Add Dockerfiles 8 | 9 | Create `build_.dockerfile` and `run_.dockerfile` in the root directory. 10 | 11 | * Add one [stage](https://docs.docker.com/develop/develop-images/multistage-build/) 12 | for each (supported) backend: `mcode`, `llvm` and/or `gcc`. 13 | * Sometimes could be useful to add a `common` stage for shared resources 14 | (see `build_fedora.dockerfile` or `run_fedora.dockerfile`). 15 | On the other hand, can be situations where the same backend needs a different stage 16 | according to the OS versions (see `build_centos.dockerfile` or `run_centos.dockerfile`). 17 | * Images should contain the dependencies for building or installing GHDL only. 18 | Do not include the actual building/installation procedures in the dockerfiles. 19 | * In `run.sh`, add a new `case` inside of `create ()`. 20 | It must deal with the ``, its `` and the `` stages. 21 | 22 | > You can execute `./run.sh ` to locally build the containers. 23 | 24 | ### Continuous Integration (CI) 25 | 26 | * Add the desidered `` and its `` to the matrix of the `base.yml` CI workflow: 27 | ```yaml 28 | matrix: 29 | include: [ 30 | { distro: arch, version: '' }, 31 | { distro: debian, version: bullseye }, 32 | ... 33 | { distro: , version: }, 34 | ``` 35 | * Add the desidered `` and `` to the matrix of the `test.yml` CI workflow: 36 | ```yaml 37 | matrix: 38 | include: [ 39 | ... 40 | { distro: ubuntu20, backend: mcode , args: "" }, 41 | { distro: fedora32, backend: mcode , args: "" }, 42 | ... 43 | { distro: , backend: ``, args: "" }, 44 | ``` 45 | 46 | > **NOTE:** in some `` the `` of the backend (in case of `llvm` and `gcc`) 47 | > needs to be specified (something like `-`, see `test.yml`). 48 | -------------------------------------------------------------------------------- /DEPRECATED.md: -------------------------------------------------------------------------------- 1 | # Deprecated images 2 | 3 | Some images related to synthesis and PnR were moved to [hdl/containers](https://github.com/hdl/containers) and [hub.docker.com/u/hdlc](https://hub.docker.com/u/hdlc). Some of those are now mirrored to `ghdl/synth:*` for backwards compatibility, but are no longer built in this repository. See workflow [mirror](.github/workflows/mirror.yml). 4 | 5 | - `ghdl/synth:beta` includes GHDL along with ghdl-yosys-plugin built as a module for [YosysHQ/yosys](https://github.com/YosysHQ/yosys), and Yosys. 6 | - `ghdl/synth:formal` includes GHDL, ghdl-yosys-plugin, Yosys and Symbiyosys. 7 | - `ghdl/synth:icestorm`: includes [icestorm](https://github.com/cliffordwolf/icestorm) without `iceprog`. 8 | - `ghdl/synth:nextpnr-ice40`: includes [nextpnr](https://github.com/YosysHQ/nextpnr) with support for ICE40 devices only. 9 | - `ghdl/synth:nextpnr-ecp5`: includes [nextpnr](https://github.com/YosysHQ/nextpnr) with support for ECP5 devices only. 10 | - `ghdl/synth:nextpnr`: includes [nextpnr](https://github.com/YosysHQ/nextpnr) with support for all architectures (see [nextpnr: Additional notes for building nextpnr](https://github.com/YosysHQ/nextpnr#additional-notes-for-building-nextpnr)). 11 | - `ghdl/synth:prog`: includes `iceprog` from [icestorm](https://github.com/cliffordwolf/icestorm) and [openocd](http://openocd.org/). 12 | - `ghdl/synth:trellis`: includes [prjtrellis](https://github.com/SymbiFlow/prjtrellis). 13 | - `ghdl/synth:yosys`: includes [yosys](https://github.com/YosysHQ/yosys). 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 4 | 'base' workflow Status 6 | 'test' workflow Status 8 | 'bookworm' workflow Status 10 |

11 | 12 |

13 | 14 |

15 | 16 |

17 | 'vunit' workflow Status 19 | 'ext' workflow Status 21 | 'cosim' workflow Status 23 | 'mirror' workflow Status 25 |

26 | 27 | This repository contains scripts and YAML workflows for GitHub Actions (GHA) to build and to deploy the container images that are used and/or published by the [GHDL GitHub organization](https://github.com/ghdl). All of them are pushed to [hub.docker.com/u/ghdl](https://cloud.docker.com/u/ghdl/repository/list). 28 | 29 | ---- 30 | 31 | **ATTENTION: Some images related to synthesis and PnR were moved to [hdl/containers](https://github.com/hdl/containers) and [hub.docker.com/u/hdlc](https://hub.docker.com/u/hdlc)**. See [DEPRECATED](DEPRECATED.md). 32 | 33 | ---- 34 | 35 | Images for development (i.e., building and/or testing ghdl): 36 | 37 | - [![ghdl/build Docker pulls](https://img.shields.io/docker/pulls/ghdl/build?label=ghdl%2Fbuild&style=flat-square)](https://hub.docker.com/r/ghdl/build) images include development/build depedendencies for [ghdl](https://github.com/ghdl/ghdl). 38 | - [![ghdl/run Docker pulls](https://img.shields.io/docker/pulls/ghdl/run?label=ghdl%2Frun&style=flat-square)](https://hub.docker.com/r/ghdl/run) images include runtime dependencies for [ghdl](https://github.com/ghdl/ghdl). 39 | - [![ghdl/pkg Docker pulls](https://img.shields.io/docker/pulls/ghdl/pkg?label=ghdl%2Fpkg&style=flat-square)](https://hub.docker.com/r/ghdl/pkg) images include the content of [ghdl](https://github.com/ghdl/ghdl) tarballs built in [ghdl/build](https://hub.docker.com/r/ghdl/build/tags) images. 40 | - [![ghdl/debug Docker pulls](https://img.shields.io/docker/pulls/ghdl/debug?label=ghdl%2Fdebug&style=flat-square)](https://hub.docker.com/r/ghdl/debug) image is based on `ghdl/build:buster-mcode` and `ghdl/pkg:buster-mcode`; includes Python pip, GNAT GPS, Graphviz and GDB. 41 | 42 | Ready-to-use images: 43 | 44 | - [![ghdl/ghdl Docker pulls](https://img.shields.io/docker/pulls/ghdl/ghdl?label=ghdl%2Fghdl&style=flat-square)](https://hub.docker.com/r/ghdl/ghdl) images, which are based on correponding [ghdl/run](https://hub.docker.com/r/ghdl/run/tags) images, include [ghdl](https://github.com/ghdl/ghdl) along with minimum runtime dependencies. 45 | - [![ghdl/vunit Docker pulls](https://img.shields.io/docker/pulls/ghdl/vunit?label=ghdl%2Fvunit&style=flat-square)](https://hub.docker.com/r/ghdl/vunit) images, which are based on [`ghdl/ghdl:bookworm-*`](https://hub.docker.com/r/ghdl/ghdl/tags) images, include [ghdl](https://github.com/ghdl/ghdl) along with [VUnit](https://vunit.github.io/). 46 | - `*-master` variants include latest VUnit (master branch), while others include the latest stable release (installed through pip). 47 | - [![ghdl/ext Docker pulls](https://img.shields.io/docker/pulls/ghdl/ext?label=ghdl%2Fext&style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) GHDL and complements ([ghdl-language-server](https://github.com/ghdl/ghdl-language-server), [GtkWave](http://gtkwave.sourceforge.net/), [VUnit](https://vunit.github.io/), etc.). 48 | - [![ghdl/cosim Docker pulls](https://img.shields.io/docker/pulls/ghdl/cosim?label=ghdl%2Fcosim&style=flat-square)](https://hub.docker.com/r/ghdl/cosim/tags) GHDL and other tools for co-simulation such as [SciPy](https://www.scipy.org/), [Xyce](https://xyce.sandia.gov/) or [GNU Octave](https://www.gnu.org/software/octave/). 49 | 50 | See [USE_CASES.md](./USE_CASES.md) if you are looking for usage examples from a user perspective. 51 | 52 | ## GHA workflows 53 | 54 | ### · [base](.github/workflows/base.yml) 55 | 56 | Build and push all the `ghdl/build:*` and `ghdl/run:*` docker images. : 57 | 58 | - A pair of images is created in one job for `[ ls ]`. 59 | - One job is created for each of `[ fedora (37 | 38), debian (buster | bullseye | bookworm), ubuntu (20 | 22)]`, and six images are created in each job; two (`ghdl/build:*`, `ghdl/run:*`) for each supported backend `[ mcode, llvm*, gcc ]`. 60 | - `ghdl/debug:base` is created in the `debian buster` job. 61 | - `ghdl/build:doc` is created in the `debian bookworm` job. 62 | 63 | ### · [test](.github/workflows/test.yml) 64 | 65 | Build and push almost all the `ghdl/ghdl:*` and `ghdl/pkg:*` images. A pair of images is created in one job for each combination of: 66 | 67 | - `[ fedora: [37, 38], debian: [bullseye], ubuntu: [20, 22] ]` and `[mcode, llvm*]`. 68 | - `[ fedora: [37, 38], debian: [bullseye] ]` and `[gcc*]`. 69 | - For Debian only, `[bullseye, bookworm]` and `[mcode]` and `[--gpl]`. 70 | - For Debian Buster, only `[mcode]`. 71 | - `ghdl/debug` is created in this job. 72 | 73 | The procedure in each job is as follows: 74 | 75 | - Repo [ghdl/ghdl](https://github.com/ghdl/ghdl) is cloned. 76 | - ghdl is built in the corresponding `ghdl/build:*` image. 77 | - A `ghdl/ghdl:*` image is created based on the corresponding `ghdl/run:*` image. 78 | - The testsuite is executed inside the `ghdl/ghdl:*` image created in the previous step. 79 | - If successful, a `ghdl/pkg:*` image is created from `scratch`, with the content of the tarball built in the first step. 80 | - `ghdl/ghdl:*` and `ghdl/pkg:*` images are pushed to [hub.docker.com/u/ghdl](https://cloud.docker.com/u/ghdl/repository/list). 81 | 82 | > NOTE: images with GCC backend include `lcov` for code coverage analysis. 83 | 84 | ### · [bookworm](.github/workflows/bookworm.yml) [scheduled daily] 85 | 86 | Complement of `ghdl.yml`, to be run after each successful run of the main workflow in ghdl/ghdl. One job is scheduled for each combination of `[ bookworm ]` and `[ mcode, llvm-14 , gcc-12.3.0 ]`. 87 | 88 | ### · [vunit](.github/workflows/vunit.yml) [triggered after workflow 'bookworm'] 89 | 90 | Build and push all the `ghdl/vunit:*` images, which are based on the ones created in the 'bookworm' workflow. 91 | - Two versions are published for each backend: one with latest stable VUnit (from PyPI) and one with the latest `master` (from Git). 92 | - Images with GCC backend include `lcov` and `gcovr` for code coverage analysis. 93 | 94 | ### · [ext](.github/workflows/ext.yml) [triggered after workflow 'vunit'] 95 | 96 | Build and push all the `ghdl/ext:*` images: 97 | 98 | - `ls`: **ghdl/ext:ls-debian** and **ghdl/ext:ls-ubuntu** (a job for each of them). These include [ghdl/ghdl](https://github.com/ghdl/ghdl), the [ghdl/ghdl-language-server](https://github.com/ghdl/ghdl-language-server) backend and the vscode-client (precompiled but not preinstalled). 99 | - `gui`: 100 | - **ghdl/ext:gtkwave**: includes [GtkWave](http://gtkwave.sourceforge.net/) (gtk3) on top of *ghdl/vunit:llvm-master*. 101 | - **ghdl/ext:broadway**: adds a script to *ghdl/ext:gtkwave* in order to launch a [Broadway](https://developer.gnome.org/gtk3/stable/gtk-broadway.html) server that allows to use GtkWave from a web browser. 102 | - **ghdl/ext:ls-vunit**: includes VUnit (`master`) on top of *ghdl/ext:ls-debian*. 103 | - **ghdl/ext:latest**: includes [GtkWave](http://gtkwave.sourceforge.net/) on top of `ghdl/ext:ls-vunit`. 104 | 105 | ### · [cosim](.github/workflows/cosim.yml) 106 | 107 | See [ghdl/ghdl-cosim: docker](https://github.com/ghdl/ghdl-cosim/tree/master/docker) and [ghdl.github.io/ghdl-cosim/vhpidirect/examples/vffi_user](https://ghdl.github.io/ghdl-cosim/vhpidirect/examples/vffi_user.html). 108 | 109 | - **ghdl/cosim:mcode**: based on *ghdl/ghdl:bookworm-mcode*, includes GCC. 110 | - **ghdl/cosim:py**: based on *ghdl/ghdl:bookworm-llvm-7*, includes Python. 111 | - **ghdl/cosim:vunit-cocotb**: based on *ghdl/cosim:py*, includes [VUnit](https://vunit.github.io/), [cocotb](https://docs.cocotb.org/) and `g++` (required by cocotb). 112 | - **ghdl/cosim:matplotlib**: based on *ghdl/cosim:vunit-cocotb*, includes `pytest`, `matplotlib`, `numpy` and Imagemagick. 113 | - **ghdl/cosim:octave**: based on *ghdl/cosim:vunit-cocotb*, includes [GNU Octave](https://www.gnu.org/software/octave/). 114 | - **ghdl/cosim:xyce**: based on *ghdl/cosim:vunit-cocotb*, includes [Xyce](https://xyce.sandia.gov/). 115 | 116 | NOTE: `*-slim` variants of `matplotlib`, `octave` and `xyce` images are provided too. Those are based on *ghdl/cosim:py*, instead of *ghdl/cosim:vunit-cocotb*. 117 | 118 | ## Packaging 119 | 120 | Multiple artifacts of GHDL are generated in these workflows. For example, each job in `test.yml` generates a tarball that is then installed in a `ghdl/ghdl:*` image, and the content is published in a `ghdl/pkg:*` image. These resources might be useful for users/developers who: 121 | 122 | - Want to use a base image which is compatible but different from the ones we use. E.g., use `python:3-slim-bookworm` instead of `debian:bookworm-slim`. 123 | - Do not want to build and test GHDL every time. 124 | 125 | However, it is discouraged to use these pre-built artifacts to install GHDL on host systems. 126 | 127 | 130 | -------------------------------------------------------------------------------- /USE_CASES.md: -------------------------------------------------------------------------------- 1 | # Ready-to-use demo 2 | 3 | Thanks to [play-with-docker (PWD)](https://labs.play-with-docker.com/), any user can try GHDL without installing anything. Shall local execution be preferred, installation/removal is as simple as pulling/removing a docker image. 4 | 5 | # Portable environment 6 | 7 | The same image can be used in GNU/Linux, macOS and windows. This allows developers to forget about library version collisions, different locations of resources, unsynchronized updates, etc. 8 | 9 | This same feature is useful in CI environment. E.g. run a script in travis to compile and test a VHDL design: 10 | 11 | ``` bash 12 | docker run --rm -t \ 13 | -v /$(pwd):/src \ 14 | -w //src \ 15 | ghdl/ghdl:bullseye-mcode \ 16 | bash -c "$(cat myscript.sh)" 17 | ``` 18 | 19 | # Testable/reproducible issues 20 | 21 | On the one hand, the ['Bug report' issue template in ghdl/ghdl](https://github.com/ghdl/ghdl/issues/new?template=bug_report.md) provides an example of how to use [1138-4EB/issue-runner](https://github.com/1138-4EB/issue-runner) in order to allow developers and contributors to share executable Minimal Working Examples (MWEs). This allows to test the code in any of the available [![`ghdl/ghdl`](https://img.shields.io/badge/ghdl/ghdl-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ghdl/tags) or [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ghdl-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ghdl/tags) docker images, to ensure that i) the possible bug is not already fixed, and ii) the problem is not related to the user's setup/environment. 22 | 23 | # Nightly builds / rolling release 24 | 25 | Travis-GitHub integration for releases is not really meant for nightly builds. There are external tools, such as [nightlies](https://nightli.es/), to achieve it, but they require quite many permissions on the repository. However, docker images are *rolling releases* by default, and, if wanted, specific versions can be fixed by tagging them. Then, the names of images used all along this document refer to rolling/latest/nightly versions and are updated periodically (through CRON jobs). 26 | 27 | 28 | # Let's have some fun! 29 | 30 | As explained in [ghdl/ghdl#489](https://github.com/ghdl/ghdl/pull/489), [![`ghdl/build`](https://img.shields.io/badge/ghdl/build-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/build/tags) and [![`ghdl/run`](https://img.shields.io/badge/ghdl/run-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/run/tags) images are only meant to be used during the build process. The ready-to-use artifacts are [![`ghdl/ghdl`](https://img.shields.io/badge/ghdl/ghdl-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ghdl/tags) images. Note that each `llvm` image corresponds to a different platform and library version: 31 | 32 | - `ubuntu14-llvm-3.8` 33 | - `ubuntu16-llvm-3.9` 34 | - `fedora26-llvm` [4.0] 35 | - `ubuntu18-llvm-5.0` 36 | 37 | You need docker installed and the daemon running. If you don't, you can try the images in any of these playgrounds: 38 | 39 | - [play-with-docker](https://labs.play-with-docker.com/) (requires Docker ID) 40 | - The public demo of [Portainer](https://github.com/portainer/portainer) (see user and pass in the readme) 41 | 42 | We may use any of the images. I will take the smallest image (75MB), [![`ghdl/ghdl`](https://img.shields.io/badge/ghdl/ghdl-bullseye--mcode-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ghdl/tags), and start a container with a shell prompt: 43 | 44 | ``` bash 45 | $(command -v winpty) docker run --rm -it ghdl/ghdl:bullseye-mcode bash 46 | ``` 47 | 48 | > NOTE: `winpty` is required on windows (MSYS2) only. 49 | 50 | Then, in the prompt inside the container, we check the version: 51 | 52 | ``` bash 53 | ghdl --version 54 | ``` 55 | 56 | Now, we will execute the examples of [VUnit/vunit](https://github.com/VUnit/vunit). Since the image contains minimum runtime dependencies for GHDL, we need to install python and git (or curl, wget...). This is debian, so: 57 | 58 | ``` bash 59 | apt-get install -y git python3-pip 60 | pip3 install vunit_hdl 61 | git clone https://github.com/VUnit/vunit/ 62 | ``` 63 | 64 | Ready to go! 65 | 66 | ``` bash 67 | for f in $(find vunit/examples/vhdl/ -name 'run.py'); do python3 $f; done 68 | ``` 69 | 70 | --- 71 | 72 | ![ghdl_pwd_demo_shell](https://user-images.githubusercontent.com/6628437/33694969-2e7b7030-dafb-11e7-9eba-fb3abae1a161.gif) 73 | 74 | # Extended images 75 | 76 | A reduced number of carefully crafted images is built on top of [![`ghdl/ghdl`](https://img.shields.io/badge/ghdl/ghdl-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ghdl/tags) images. These are meant to let users make the best of GHDL by adding companion tools, such as [VUnit](https://vunit.github.io/) or [gtkwave](https://gtkwave.sourceforge.net/). In order to make the first contact easier for them, these are all based on `debian:bullseye`. Right now, these are available: 77 | 78 | - [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-vunit-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) 79 | - BASED ON `ghdl/ghdl:bullseye-mcode` 80 | - python3 81 | - pip3 install vunit_hdl 82 | - apt-get install -y curl 83 | 84 | - [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-vunit--gtkwave-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) 85 | - BASED ON `ghdl/ext:vunit` 86 | - gtkwave 87 | - X11 libraries 88 | 89 | - [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-broadway-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) 90 | - BASED ON `ghdl/ext:vunit-gtkwave` 91 | - Companion script to launch a [GTK+ Broadway](https://developer.gnome.org/gtk3/stable/gtk-broadway.html) server that allows to access GUI applications in the container through a web browser. 92 | 93 | Please, let us know if you think that `llvm` and `gcc` variants are requied for [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-*-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) images. It is also possible for two (or more) GHDL installations (each one built with a compiler) to somehow coexist in the same machine/container (see [ghdl/ghdl#445](https://github.com/ghdl/ghdl/issues/445)). 94 | 95 | --- 96 | 97 | ## Non-GUI environments 98 | 99 | Since [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-vunit-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) is equivalent to [![`ghdl/ghdl`](https://img.shields.io/badge/ghdl/ghdl-bullseye--mcode-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ghdl/tags) + VUnit, the exercise above can be reduced to: 100 | 101 | ``` bash 102 | # Start a container with option `--interactive` 103 | $(command -v winpty) docker run --rm -it ghdl/ext:vunit bash 104 | # In the prompt inside the container: 105 | ghdl --version 106 | mkdir vunit 107 | curl -L https://github.com/VUnit/vunit/archive/v2.2.0.tar.gz | tar xz -C vunit --strip-components=1 108 | for f in $(find vunit/examples/vhdl/ -name 'run.py'); do python3 $f; done 109 | ``` 110 | 111 | Note that, instead of `git`, `curl` was used to download the VUnit repo. 112 | 113 | ## Environments with GUIs 114 | 115 | Let's try [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-vunit--gtkwave-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) now. We will execute the [full_adder](http://ghdl.readthedocs.io/en/latest/using/QuickStartGuide.html#a-full-adder) example from the docs, which are hosted in [1138-4EB/hwd-ide](https://github.com/1138-4EB/hwd-ide). 116 | 117 | > NOTE: [x11docker](https://github.com/mviereck/x11docker) is a helper script to enable GUI apps inside the container to use a X server on the host. If running the example on Windows, [VcXsrv](https://sourceforge.net/projects/vcxsrv/) or [Cygwin/X](https://x.cygwin.com/) are required (see [MSYS2, Cygwin and WSL on MS Windows](https://github.com/mviereck/x11docker#msys2-cygwin-and-wsl-on-ms-windows)). 118 | > When required, `x11docker` use `winpty` under the hood, so it is not required to set it. 119 | 120 | ``` bash 121 | # Start a container with option `--interactive` 122 | x11docker -i ghdl/ext:vunit-gtkwave bash 123 | # In the prompt inside the container: 124 | mkdir hwd-ide 125 | curl -L https://github.com/1138-4EB/hwd-ide/archive/develop.tar.gz | tar xz -C hwd-ide --strip-components=1 126 | ./hwd-ide/examples/full_adder/test.sh 127 | ls -la 128 | gtkwave adder.vcd 129 | ``` 130 | 131 | ![ghdl_vunit-gtkwave](https://user-images.githubusercontent.com/6628437/33923787-6178e760-dfd3-11e7-9183-808c85c43f65.gif) 132 | 133 | As an alternative to using an X server on the host, a [GTK+ Broadway](https://developer.gnome.org/gtk3/stable/gtk-broadway.html) server can be started. This is a backend for displaying GTK+ applications in a web browser. Precisely, [![`ghdl/ext`](https://img.shields.io/badge/ghdl/ext-broadway-blue.svg?style=flat-square)](https://hub.docker.com/r/ghdl/ext/tags) includes a script that checks if the environment variable `BROADWAY` is not empty, to start it on port `$((8080 + $BROADWAY))`. For example: 134 | 135 | ``` bash 136 | # Start a container with either `x11docker` or `docker run`: 137 | $(command -v winpty) docker run -it \ 138 | -e BROADWAY=5 -p 8085:8085 -- ghdl/ext:broadway bash 139 | # or 140 | x11docker -it -- \ 141 | -e BROADWAY=5 -p 8085:8085 -- ghdl/ext:broadway bash 142 | ``` 143 | 144 | Then, browse `localhost:8085`. An empty white page should be loaded, which means that the server is running, but no GUI app is started yet. Start a GUI app, say `gtkwave`, from the prompt in the container and it will be shown. 145 | -------------------------------------------------------------------------------- /broadway.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Example execution command: 4 | # x11docker -it -- -e BROADWAY=5 -p 8085:8085 -- ghdl/ext:broadway bash 5 | 6 | set -e 7 | 8 | if [ "$BROADWAY" != "" ]; then 9 | export BROADWAY_DISPLAY=":$BROADWAY" 10 | if [ "$GDK_BACKEND" = "" ]; then 11 | export GDK_BACKEND="broadway" 12 | else 13 | if [ "$(echo "$GDK_BACKEND" | grep "broadway")" == "" ]; then 14 | export GDK_BACKEND="$GDK_BACKEND,broadway" 15 | fi 16 | fi 17 | # Check if an instance of broadwayd is already running in the same port 18 | #if [ "$(lsof -Pi :$((8080 + $BROADWAY)) -sTCP:LISTEN -Fc | grep broadwayd)" == "" ]; then 19 | set +e; curl localhost:$((8080 + $BROADWAY)) > /dev/null 2>&1; err="$?"; set -e 20 | if [ "$err" != "0" ]; then 21 | echo "BROADWAY_DISPLAY: $BROADWAY_DISPLAY" 22 | echo "GDK_BACKEND: $GDK_BACKEND" 23 | # Start broadway server 24 | broadwayd "$BROADWAY_DISPLAY" & 25 | fi 26 | fi 27 | 28 | set +e 29 | -------------------------------------------------------------------------------- /build_arch.dockerfile: -------------------------------------------------------------------------------- 1 | FROM archlinux 2 | 3 | RUN pacman -Syu --noconfirm --noprogressbar --needed grep base-devel 4 | -------------------------------------------------------------------------------- /build_debian.dockerfile: -------------------------------------------------------------------------------- 1 | # [build] Debian or Ubuntu 2 | 3 | ARG IMAGE="debian:bookworm-slim" 4 | ARG LLVM_VER="14" 5 | ARG GNAT_VER="12" 6 | 7 | #--- 8 | 9 | FROM $IMAGE AS mcode 10 | 11 | ARG GNAT_VER 12 | 13 | RUN apt-get update -qq \ 14 | && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ 15 | ca-certificates \ 16 | gcc \ 17 | gnat-$GNAT_VER \ 18 | cargo \ 19 | make \ 20 | zlib1g-dev \ 21 | && apt-get autoclean && apt-get clean && apt-get -y autoremove \ 22 | && update-ca-certificates \ 23 | && rm -rf /var/lib/apt/lists/* 24 | 25 | #--- 26 | 27 | FROM mcode AS llvm 28 | 29 | ARG LLVM_VER 30 | 31 | RUN apt-get update -qq \ 32 | && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ 33 | clang-$LLVM_VER \ 34 | llvm-$LLVM_VER-dev \ 35 | && apt-get autoclean && apt-get clean && apt-get -y autoremove \ 36 | && rm -rf /var/lib/apt/lists/* 37 | 38 | #--- 39 | 40 | FROM mcode AS gcc 41 | 42 | RUN apt-get update -qq \ 43 | && DEBIAN_FRONTEND=noninteractive apt-get -y install curl \ 44 | && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ 45 | autogen \ 46 | bzip2 \ 47 | dejagnu \ 48 | flex \ 49 | g++ \ 50 | lbzip2 \ 51 | texinfo \ 52 | wget \ 53 | libgmp-dev \ 54 | libmpfr-dev \ 55 | libmpc-dev \ 56 | && apt-get autoclean && apt-get clean && apt-get -y autoremove \ 57 | && rm -rf /var/lib/apt/lists/* 58 | -------------------------------------------------------------------------------- /build_fedora.dockerfile: -------------------------------------------------------------------------------- 1 | # [build] Fedora 2 | 3 | ARG IMAGE="fedora:38" 4 | 5 | #--- 6 | 7 | FROM $IMAGE AS mcode 8 | 9 | RUN dnf --nodocs -y install \ 10 | diffutils \ 11 | gcc-gnat \ 12 | make \ 13 | rust cargo \ 14 | zlib-devel \ 15 | && dnf clean all --enablerepo=\* 16 | 17 | #--- 18 | 19 | FROM mcode as common 20 | 21 | RUN dnf --nodocs -y install \ 22 | gcc-c++ \ 23 | && dnf clean all --enablerepo=\* 24 | 25 | #--- 26 | 27 | FROM common AS llvm 28 | 29 | RUN dnf --nodocs -y install \ 30 | clang \ 31 | llvm-devel \ 32 | && dnf clean all --enablerepo=\* 33 | 34 | #--- 35 | 36 | FROM common AS gcc 37 | 38 | RUN dnf --nodocs -y --allowerasing install \ 39 | autogen \ 40 | bzip2 \ 41 | dejagnu \ 42 | flex \ 43 | gcc \ 44 | lbzip2 \ 45 | texinfo \ 46 | wget \ 47 | mpfr-devel \ 48 | gmp-devel \ 49 | libmpc-devel \ 50 | && dnf clean all 51 | -------------------------------------------------------------------------------- /gui.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:experimental 2 | 3 | FROM ghdl/vunit:llvm-master AS gtkwave 4 | COPY --from=hdlc/pkg:gtkwave /gtkwave / 5 | RUN apt-get update -qq \ 6 | && apt-get -y install graphviz libgtk-3-bin libtcl8.6 libtk8.6 xdot \ 7 | && apt-get autoclean -y && apt-get clean -y && apt-get autoremove -y \ 8 | && rm -rf /var/lib/apt/lists/* 9 | 10 | #--- 11 | 12 | FROM gtkwave AS broadway 13 | COPY broadway.sh /etc/broadway.sh 14 | RUN printf "\nsource /etc/broadway.sh\n" >> /etc/bash.bashrc 15 | 16 | #--- 17 | 18 | FROM alpine as get-master 19 | RUN apk add --no-cache --update git && git clone --recurse-submodules https://github.com/VUnit/vunit /tmp/vunit 20 | 21 | FROM ghdl/ext:ls AS ls-vunit 22 | RUN --mount=type=cache,from=get-master,src=/tmp/vunit,target=/tmp/ \ 23 | cd /tmp \ 24 | && pip3 install . \ 25 | && rm -rf .cache 26 | 27 | #--- 28 | 29 | FROM ls-vunit AS latest 30 | COPY --from=hdlc/pkg:gtkwave /gtkwave / 31 | RUN apt-get update -qq \ 32 | && apt-get -y install graphviz libgtk-3-bin libtcl8.6 libtk8.6 xdot \ 33 | && apt-get autoclean -y && apt-get clean -y && apt-get autoremove -y \ 34 | && rm -rf /var/lib/apt/lists/* 35 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ghdl/docker/6f9c182cdf3ffd9c1feaeac3871c281bb53ff88b/logo.png -------------------------------------------------------------------------------- /logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 16 | 38 | 40 | 41 | 43 | image/svg+xml 44 | 46 | 47 | 48 | 49 | 50 | 52 | 54 | 58 | 59 | 61 | 65 | 66 | 68 | 72 | 73 | 75 | 79 | 80 | 82 | 86 | 87 | 89 | 93 | 94 | 96 | 100 | 101 | 102 | 109 | 116 | 123 | 130 | 137 | 144 | 151 | 158 | 165 | 172 | 179 | 186 | 193 | 200 | 207 | 214 | 221 | 228 | 235 | 244 | 253 | 262 | 271 | 278 | 285 | 292 | 299 | 300 | -------------------------------------------------------------------------------- /ls.dockerfile: -------------------------------------------------------------------------------- 1 | # syntax=docker/dockerfile:experimental 2 | 3 | ARG LLVM_VER="7" 4 | 5 | #--- 6 | 7 | FROM ghdl/build:ls AS build 8 | 9 | ARG LLVM_VER 10 | 11 | RUN mkdir /tmp/ghdl-dist \ 12 | && mkdir -p /tmp/ghdl && cd /tmp/ghdl \ 13 | && curl -fsSL https://codeload.github.com/ghdl/ghdl/tar.gz/master | tar xzf - --strip-components=1 \ 14 | && CONFIG_OPTS="--default-pic" ./scripts/ci-run.sh -b llvm-$LLVM_VER -p ghdl-llvm-fPIC build 15 | 16 | RUN mkdir -p /tmp/vscode-repo && cd /tmp/vscode-repo \ 17 | && curl -fsSL https://codeload.github.com/ghdl/ghdl-language-server/tar.gz/master | tar xzf - --strip-components=2 ghdl-language-server-master/vscode-client \ 18 | && npm install \ 19 | && vsce package \ 20 | && mv $(ls vhdl-lsp-*.vsix) /tmp/ghdl/ 21 | 22 | #--- 23 | 24 | FROM ghdl/run:ls AS run 25 | 26 | RUN --mount=type=cache,from=build,src=/tmp/ghdl,target=/tmp/ghdl \ 27 | tar -xzf /tmp/ghdl/ghdl-llvm-fPIC.tgz -C /usr/local \ 28 | && cd /tmp/ghdl/ \ 29 | && pip3 install . \ 30 | && mkdir -p /opt/ghdl \ 31 | && cd /opt/ghdl \ 32 | && cp $(ls /tmp/ghdl/vhdl-lsp-*.vsix) ./ \ 33 | && printf "%s\n" \ 34 | 'cd $(dirname $0)' \ 35 | 'vsix_file="$(ls vhdl-lsp-*.vsix)"' \ 36 | 'vsc_exts="$HOME/.vscode-server/extensions"' \ 37 | 'mkdir -p $vsc_exts' \ 38 | 'unzip "$vsix_file"' \ 39 | 'rm [Content_Types].xml' \ 40 | 'mv extension.vsixmanifest extension/.vsixmanifest' \ 41 | 'mv extension "$vsc_exts/tgingold.${vsix_file%.*}"' \ 42 | > install_vsix.sh \ 43 | && chmod +x install_vsix.sh \ 44 | && mkdir -p /tmp/files \ 45 | && curl -fsSL https://codeload.github.com/ghdl/ghdl-language-server/tar.gz/master | tar xzf - -C /tmp/files --strip-components=4 ghdl-language-server-master/ghdl-ls/tests/files 46 | -------------------------------------------------------------------------------- /ls_base.dockerfile: -------------------------------------------------------------------------------- 1 | ARG LLVM_VER="14" 2 | ARG GNAT_VER="12" 3 | 4 | #--- 5 | 6 | FROM python:3-slim-bookworm AS base 7 | 8 | RUN apt-get update -qq \ 9 | && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ 10 | ca-certificates \ 11 | curl \ 12 | gcc \ 13 | make \ 14 | zlib1g-dev \ 15 | && apt-get autoclean && apt-get clean && apt-get -y autoremove \ 16 | && update-ca-certificates \ 17 | && rm -rf /var/lib/apt/lists/* \ 18 | && pip3 install setuptools wheel 19 | 20 | #--- 21 | 22 | FROM base AS build 23 | 24 | ARG LLVM_VER 25 | ARG GNAT_VER 26 | 27 | RUN apt-get update -qq \ 28 | && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ 29 | clang-$LLVM_VER \ 30 | gnat-$GNAT_VER \ 31 | llvm-$LLVM_VER-dev \ 32 | npm \ 33 | && apt-get autoclean && apt-get clean && apt-get -y autoremove \ 34 | && rm -rf /var/lib/apt/lists/* \ 35 | && npm install -g vsce@1.103.1 36 | 37 | #--- 38 | 39 | FROM base AS run 40 | 41 | ARG LLVM_VER 42 | ARG GNAT_VER 43 | 44 | RUN apt-get update -qq \ 45 | && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ 46 | libgnat-$GNAT_VER \ 47 | libllvm$LLVM_VER \ 48 | unzip \ 49 | && apt-get autoclean && apt-get clean && apt-get -y autoremove \ 50 | && rm -rf /var/lib/apt/lists/* 51 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -e 4 | 5 | cd $(dirname $0) 6 | 7 | . ./utils.sh 8 | 9 | export DOCKER_BUILDKIT=1 10 | 11 | #SKIP_BUILD=true 12 | #SKIP_DEPLOY=true 13 | 14 | #-- 15 | 16 | case "$TRAVIS_COMMIT_MESSAGE" in 17 | *'[skip]'*) 18 | SKIP_BUILD=true 19 | ;; 20 | esac 21 | echo "SKIP_BUILD: $SKIP_BUILD" 22 | 23 | #-- 24 | 25 | build_img () { 26 | gstart "[DOCKER build] $DREPO : ${DTAG}" 27 | DCTX="-" 28 | case "$1" in 29 | "--ctx"*) 30 | DCTX="-f- $(echo $1 | sed 's/--ctx=//g')" 31 | shift 32 | ;; 33 | esac 34 | printf "· ${ANSI_CYAN}File: ${ANSI_NOCOLOR}" 35 | echo "$DFILE" 36 | printf "· ${ANSI_CYAN}Ctx: ${ANSI_NOCOLOR}" 37 | echo "$DCTX" 38 | printf "· ${ANSI_CYAN}Args: ${ANSI_NOCOLOR}" 39 | echo "$@" 40 | if [ "x$SKIP_BUILD" = "xtrue" ]; then 41 | printf "${ANSI_YELLOW}SKIP_BUILD...$ANSI_NOCOLOR\n" 42 | else 43 | docker build -t "ghdl/${DREPO}:$DTAG" "$@" $DCTX < "${DFILE}".dockerfile 44 | fi 45 | gend 46 | } 47 | 48 | build_debian_images () { 49 | for tag in mcode llvm gcc; do 50 | i="${ITAG}-$tag" 51 | if [ "x$tag" = "xllvm" ]; then i="$i-$LLVM_VER"; fi 52 | TAG="$d-$i" \ 53 | DREPO="$d" \ 54 | DTAG="$i" \ 55 | DFILE="${d}_debian" \ 56 | build_img \ 57 | --target="$tag" \ 58 | "$@" 59 | done 60 | } 61 | 62 | #-- 63 | 64 | create () { 65 | TASK="$1" 66 | VERSION="$2" 67 | case $TASK in 68 | arch) 69 | DREPO="build" DTAG="archlinux" DFILE="build_arch" build_img 70 | ;; 71 | 72 | ls) 73 | for img in build run; do 74 | DREPO="$img" \ 75 | DTAG="ls" \ 76 | DFILE=ls_base \ 77 | build_img \ 78 | --target="$img" \ 79 | --build-arg LLVM_VER="14" \ 80 | --build-arg GNAT_VER="12" 81 | done 82 | ;; 83 | 84 | *) 85 | for d in build run; do 86 | case $TASK in 87 | 88 | "debian") 89 | case $VERSION in 90 | *stretch*) 91 | LLVM_VER="4.0" 92 | GNAT_VER="6" 93 | ;; 94 | *buster*) 95 | LLVM_VER="7" 96 | GNAT_VER="8" 97 | ;; 98 | *bullseye*) 99 | LLVM_VER="11" 100 | GNAT_VER="9" 101 | ;; 102 | *bookworm*) 103 | LLVM_VER="14" 104 | GNAT_VER="12" 105 | ;; 106 | esac 107 | ITAG="$VERSION" 108 | build_debian_images \ 109 | --build-arg IMAGE="$TASK:$VERSION-slim" \ 110 | --build-arg LLVM_VER="$LLVM_VER" \ 111 | --build-arg GNAT_VER="$GNAT_VER" 112 | ;; 113 | 114 | "ubuntu") 115 | case $VERSION in 116 | 14) #trusty 117 | LLVM_VER="3.8" 118 | GNAT_VER="4.6" 119 | ;; 120 | 16) #xenial 121 | LLVM_VER="3.9" 122 | GNAT_VER="4.9" 123 | ;; 124 | 20) #focal 125 | LLVM_VER="10" 126 | GNAT_VER="9" 127 | ;; 128 | 22) #jammy 129 | LLVM_VER="11" 130 | GNAT_VER="10" 131 | ;; 132 | esac 133 | ITAG="ubuntu$VERSION" 134 | build_debian_images \ 135 | --build-arg IMAGE="$TASK:$VERSION.04" \ 136 | --build-arg LLVM_VER="$LLVM_VER" \ 137 | --build-arg GNAT_VER="$GNAT_VER" 138 | ;; 139 | 140 | "fedora") 141 | for tgt in mcode llvm gcc; do 142 | i="fedora${VERSION}-$tgt" 143 | TAG="$d-$i" DREPO="$d" DTAG="$i" DFILE="${d}_fedora" build_img --target="$tgt" --build-arg IMAGE="fedora:${VERSION}" 144 | done 145 | ;; 146 | 147 | esac 148 | done 149 | ;; 150 | esac 151 | } 152 | 153 | #-- 154 | 155 | extended() { 156 | case "$1" in 157 | vunit) 158 | for fulltag in bookworm-mcode bookworm-llvm-14 bookworm-gcc-12.3.0; do 159 | TAG="$(echo $fulltag | sed 's/bookworm-\(.*\)/\1/g' | sed 's/-.*//g' )" 160 | for version in stable master; do 161 | PY_PACKAGES="" 162 | if [ "x$TAG" = "xgcc" ]; then 163 | PY_PACKAGES="gcovr" 164 | fi 165 | if [ "x$version" = "xmaster" ]; then 166 | TAG="$TAG-master" 167 | fi 168 | DREPO=vunit \ 169 | DTAG="$TAG" \ 170 | DFILE=vunit \ 171 | build_img \ 172 | --target="$version" \ 173 | --build-arg TAG="$fulltag" \ 174 | --build-arg PY_PACKAGES="$PY_PACKAGES" 175 | # Sanity check that the VUnit package works 176 | docker run --rm ghdl/vunit:$TAG python3 -c "import vunit; print(vunit.__version__)" 177 | done 178 | done 179 | ;; 180 | gui) 181 | for TAG in ls-vunit latest; do 182 | DREPO=ext DTAG="$TAG" DFILE=gui build_img --target="$TAG" 183 | done 184 | TAG="broadway" DREPO=ext DTAG="broadway" DFILE=gui build_img --ctx=. --target="broadway" 185 | ;; 186 | *) 187 | printf "${ANSI_RED}ext: unknown task $1!$ANSI_NOCOLOR\n" 188 | exit 1 189 | ;; 190 | esac 191 | } 192 | 193 | #-- 194 | 195 | language_server() { 196 | DREPO="ext" DTAG="ls" DFILE=ls build_img --build-arg LLVM_VER='14' 197 | } 198 | 199 | #-- 200 | 201 | deploy () { 202 | case $1 in 203 | "") 204 | FILTER="/ghdl /pkg";; 205 | "base") 206 | FILTER="/build /run /debug";; 207 | "ext") 208 | FILTER="/ext";; 209 | "synth") 210 | FILTER="/synth";; 211 | "vunit") 212 | FILTER="/vunit";; 213 | "pkg") 214 | FILTER="/pkg:all";; 215 | *) 216 | FILTER="/";; 217 | esac 218 | 219 | echo "IMAGES: $FILTER" 220 | docker images 221 | 222 | for key in $FILTER; do 223 | for tag in `echo $(docker images "ghdl$key*" | awk -F ' ' '{print $1 ":" $2}') | cut -d ' ' -f2-`; do 224 | if [ "$tag" = "REPOSITORY:TAG" ]; then break; fi 225 | i="`echo $tag | grep -oP 'ghdl/\K.*' | sed 's#:#-#g'`" 226 | gstart "[DOCKER push] ${tag}" "$ANSI_YELLOW" 227 | if [ "x$SKIP_DEPLOY" = "xtrue" ]; then 228 | printf "${ANSI_YELLOW}SKIP_DEPLOY...$ANSI_NOCOLOR\n" 229 | else 230 | docker push $tag 231 | fi 232 | gend 233 | done 234 | done 235 | } 236 | 237 | #-- 238 | 239 | build () { 240 | CONFIG_OPTS="--default-pic " ./scripts/ci-run.sh -c --docker "$@" 241 | 242 | if [ "$GITHUB_OS" != "macOS" ] && [ -f testsuite/test_ok ]; then 243 | IMAGE_TAG="$(docker images "ghdl/ghdl:*" | head -n2 | tail -n1 | awk -F ' ' '{print $2}')" 244 | if echo $IMAGE_TAG | grep '\-synth'; then 245 | BASE_TAG="$IMAGE_TAG" 246 | IMAGE_TAG="$(echo $BASE_TAG | sed 's/-synth//g')" 247 | docker tag ghdl/ghdl:$BASE_TAG ghdl/ghdl:$IMAGE_TAG 248 | docker rmi ghdl/ghdl:$BASE_TAG 249 | fi 250 | gstart "[CI] Docker build ghdl/pkg:${IMAGE_TAG}" 251 | docker build -t "ghdl/pkg:$IMAGE_TAG" . -f-<