diff --git a/.github/impl.dockerfile b/.github/impl.dockerfile new file mode 100644 index 000000000..83a5b2813 --- /dev/null +++ b/.github/impl.dockerfile @@ -0,0 +1,3 @@ +FROM gcr.io/hdl-containers/debian/buster/impl + +ENV GHDL_PLUGIN_MODULE=ghdl diff --git a/.github/sim.dockerfile b/.github/sim.dockerfile new file mode 100644 index 000000000..2b25cfb92 --- /dev/null +++ b/.github/sim.dockerfile @@ -0,0 +1,16 @@ +FROM gcr.io/hdl-containers/debian/buster/sim/osvb + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + g++ \ + git \ + make \ + time \ + && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /opt/riscv \ + && curl -fsSL https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz | \ + tar -xzf - -C /opt/riscv \ + && ls -al /opt/riscv + +ENV PATH $PATH:/opt/riscv/bin diff --git a/.github/workflows/Containers.yml b/.github/workflows/Containers.yml new file mode 100644 index 000000000..dd0e505b0 --- /dev/null +++ b/.github/workflows/Containers.yml @@ -0,0 +1,40 @@ +name: Containers + +on: + push: + paths: + - '.github/*.dockerfile' + schedule: + - cron: '0 0 * * 5' + workflow_dispatch: + +jobs: + + Container: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: + - impl + - sim + name: '๐Ÿ›ณ๏ธ ${{ matrix.image }}' + + steps: + + - name: '๐Ÿงฐ Repository Checkout' + uses: actions/checkout@v2 + + - name: 'โ›ด๏ธ Build neorv32/${{ matrix.image }}' + run: docker build -t ghcr.io/stnolting/neorv32/${{ matrix.image }} - < .github/${{ matrix.image }}.dockerfile + + - name: '๐Ÿ”‘ Login to ghcr.io' + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: gha + password: ${{ github.token }} + + - name: '๐Ÿ›ฐ๏ธ Push image to ghcr.io' + run: docker push ghcr.io/stnolting/neorv32/${{ matrix.image }} diff --git a/.github/workflows/Implementation.yml b/.github/workflows/Implementation.yml index ced820ba7..8f44f608f 100644 --- a/.github/workflows/Implementation.yml +++ b/.github/workflows/Implementation.yml @@ -39,16 +39,14 @@ jobs: matrix: include: ${{ fromJson(needs.Matrix.outputs.matrix) }} name: '๐Ÿ›ณ๏ธ All-in-one | ${{ matrix.board }} ยท ${{ matrix.design }}' - env: - GHDL_PLUGIN_MODULE: ghdl steps: - name: '๐Ÿงฐ Repository Checkout' uses: actions/checkout@v2 - - name: 'โš™๏ธ Generate ${{ matrix.board }} ${{ matrix.design }} bitstream' - uses: docker://ghcr.io/hdl/debian-buster/impl + - name: '๐Ÿšง Generate ${{ matrix.board }} ${{ matrix.design }} bitstream' + uses: docker://ghcr.io/stnolting/neorv32/impl with: args: make -C setups/examples BOARD=${{ matrix.board }} ${{ matrix.design }} diff --git a/.github/workflows/Processor.yml b/.github/workflows/Processor.yml index f4008a418..cfb5e6383 100644 --- a/.github/workflows/Processor.yml +++ b/.github/workflows/Processor.yml @@ -31,28 +31,15 @@ jobs: - name: '๐Ÿงฐ Repository Checkout' uses: actions/checkout@v2 - - name: '๐Ÿ”ง Setup Environment Variables' - run: | - echo "$GITHUB_WORKSPACE/riscv/bin" >> $GITHUB_PATH - echo $GITHUB_WORKSPACE - - - name: 'โš™๏ธ Setup RISC-V GCC' - run: | - mkdir riscv - curl -fsSL https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz | \ - tar -xzf - -C riscv - ls -al riscv - - - name: 'โš™๏ธ Setup GHDL Simulator' - uses: ghdl/setup-ghdl-ci@nightly - with: - backend: llvm - - name: '๐Ÿšง Run Software Framework Tests' - run: ./sw/example/processor_check/check.sh + uses: docker://ghcr.io/stnolting/neorv32/sim + with: + args: ./sw/example/processor_check/check.sh - name: '๐Ÿšง Run Processor Hardware Tests with shell script' - run: ./sim/ghdl.sh + uses: docker://ghcr.io/stnolting/neorv32/sim + with: + args: ./sim/ghdl.sh VUnit-Container: @@ -64,27 +51,17 @@ jobs: - name: '๐Ÿงฐ Repository Checkout' uses: actions/checkout@v2 - - name: '๐Ÿ”ง Setup Environment Variables' - run: | - echo "$GITHUB_WORKSPACE/riscv/bin" >> $GITHUB_PATH - echo $GITHUB_WORKSPACE - - - name: 'โš™๏ธ Setup RISC-V GCC' - run: | - mkdir riscv - curl -fsSL https://github.com/stnolting/riscv-gcc-prebuilt/releases/download/rv32i-2.0.0/riscv32-unknown-elf.gcc-10.2.0.rv32i.ilp32.newlib.tar.gz | \ - tar -xzf - -C riscv - ls -al riscv - - name: 'โš™๏ธ Build and install Processor Check software' - run: | - make -C sw/example/processor_check \ - clean_all \ - USER_FLAGS+=-DRUN_CHECK \ - USER_FLAGS+=-DUART0_SIM_MODE \ - USER_FLAGS+=-DSUPPRESS_OPTIONAL_UART_PRINT \ - MARCH=-march=rv32imac \ - info \ + uses: docker://ghcr.io/stnolting/neorv32/sim + with: + args: >- + make -C sw/example/processor_check + clean_all + USER_FLAGS+=-DRUN_CHECK + USER_FLAGS+=-DUART0_SIM_MODE + USER_FLAGS+=-DSUPPRESS_OPTIONAL_UART_PRINT + MARCH=-march=rv32imac + info all - name: '๐Ÿ“ค Archive Processor Check application image' @@ -96,4 +73,5 @@ jobs: - name: '๐Ÿšง Run Processor Hardware Tests with VUnit' uses: VUnit/vunit_action@master with: + image: ghcr.io/stnolting/neorv32/sim cmd: ./sim/run.py --ci-mode -v