Test DPI Examples #324
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test DPI Examples | |
on: | |
push: | |
paths-ignore: | |
- README.md | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
renode_git_repo: | |
description: Renode git repository address | |
required: true | |
default: https://github.com/renode/renode | |
renode_git_ref: | |
description: Reference to a Renode commit | |
required: true | |
default: master | |
verilator_git_ref: | |
description: Reference to a Verilator commit | |
required: true | |
type: string | |
jobs: | |
run-prebuilt-sample: | |
name: "Build Renode and run a prebuilt sample" | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- runner: ubuntu-20.04 | |
- runner: windows-latest | |
runs-on: ${{ matrix.config.runner }} | |
defaults: | |
run: | |
shell: bash | |
env: | |
RENODE_ARGS: -e "emulation RunFor \"20\"; quit" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: antmicro/renode-test-action@v4 | |
with: | |
renode-repository: ${{ inputs.renode_git_repo || 'https://github.com/renode/renode' }} | |
renode-revision: ${{ inputs.renode_git_ref || 'master' }} | |
- name: Run Renode | |
run: renode ${{ env.RENODE_ARGS }} samples/axi_fastvdma_prebuilt/platform.resc | |
build-verilator-linux: | |
uses: ./.github/workflows/build-verilator.yml | |
with: | |
runner: ubuntu-20.04 | |
# After changing Verilator version, the project README.md should also be updated. | |
verilator_git_ref: ${{ inputs.verilator_git_ref || 'v5.018' }} | |
build-verilator-windows: | |
uses: ./.github/workflows/build-verilator.yml | |
with: | |
runner: windows-latest | |
verilator_git_ref: ${{ inputs.verilator_git_ref || 'v5.018' }} | |
build-fastvdma-sample: | |
name: Build FastVDMA sample | |
strategy: | |
matrix: | |
bus_width: [8, 16, 32, 64] | |
runs-on: ubuntu-latest | |
env: | |
FASTVDMA_GIT_REF: 0172db9fb0e3873af418941ecc0151241666350a | |
FASTVDMA_DIR: ${{ github.workspace }}/fastvdma | |
SAMPLE_DIR: ${{ github.workspace }}/samples/axi_fastvdma | |
CUSTOM_SAMPLE_NAME: axi_fastvdma-${{ matrix.bus_width }} | |
CUSTOM_SAMPLE_DIR: ${{ github.workspace }}/samples/axi_fastvdma-${{ matrix.bus_width }} | |
steps: | |
- name: Checkout the renode-dpi-examples repository | |
uses: actions/checkout@v3 | |
- name: Clone the FastVDMA repository | |
uses: actions/checkout@v3 | |
with: | |
repository: antmicro/fastvdma | |
ref: ${{ env.FASTVDMA_GIT_REF }} | |
path: fastvdma | |
- name: Add the Scala SBT packages repository | |
run: | | |
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list | |
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list | |
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add | |
- name: Install dependencies | |
run: > | |
sudo apt update | |
&& sudo apt-get install -y --no-install-recommends | |
default-jdk | |
default-jre | |
sbt | |
- name: Build HDL | |
run: | | |
cp -R ${{ env.SAMPLE_DIR }} ${{ env.CUSTOM_SAMPLE_DIR}} | |
CONFIG_FILE=${{ env.CUSTOM_SAMPLE_DIR }}/config_${{ matrix.bus_width }}.json | |
jq --argjson width ${{ matrix.bus_width }} \ | |
'.readDataWidth = $width | .writeDataWidth = $width' \ | |
${{ env.SAMPLE_DIR }}/config_base.json > $CONFIG_FILE | |
cd ${{ env.FASTVDMA_DIR }} | |
make verilog CONFIG_FILE=$CONFIG_FILE | |
cp DMATop*.v ${{ env.CUSTOM_SAMPLE_DIR }}/DMATop.v | |
sed -i 's/DMATopAXI_AXIL_AXI/DMATop/' ${{ env.CUSTOM_SAMPLE_DIR }}/DMATop.v | |
- name: Clean up the custom sample dir | |
run: | | |
cd ${{ env.CUSTOM_SAMPLE_DIR }} | |
rm *_linux.* | |
rm config_base.json | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.CUSTOM_SAMPLE_NAME }} | |
path: ${{ env.CUSTOM_SAMPLE_DIR }} | |
run-sample: | |
name: Run sample | |
needs: [build-fastvdma-sample, build-verilator-linux, build-verilator-windows] | |
strategy: | |
fail-fast: false | |
matrix: | |
sample: | |
- directory_name: axi_ram | |
- directory_name: axi_ram | |
custom_cmake_args: -DAXI_DATA_WIDTH=64 | |
custom_robot_args: --variable=BUS_WIDTH:64 | |
- directory_name: axi_ram | |
custom_cmake_args: -DAXI_DATA_WIDTH=32 | |
custom_robot_args: --variable=BUS_WIDTH:32 | |
- directory_name: axi_ram | |
custom_cmake_args: -DAXI_DATA_WIDTH=16 | |
custom_robot_args: --variable=BUS_WIDTH:16 | |
- directory_name: axi_ram | |
custom_cmake_args: -DAXI_DATA_WIDTH=8 | |
custom_robot_args: --variable=BUS_WIDTH:8 | |
- directory_name: axi_fastvdma | |
- directory_name: axi_fastvdma-64 | |
custom_artifact: true | |
custom_cmake_args: -DAXI_DATA_WIDTH=64 | |
custom_robot_args: --variable=BUS_WIDTH:64 | |
- directory_name: axi_fastvdma-32 | |
custom_artifact: true | |
custom_cmake_args: -DAXI_DATA_WIDTH=32 | |
custom_robot_args: --variable=BUS_WIDTH:32 | |
- directory_name: axi_fastvdma-16 | |
custom_artifact: true | |
custom_cmake_args: -DAXI_DATA_WIDTH=16 | |
custom_robot_args: --variable=BUS_WIDTH:16 | |
- directory_name: axi_fastvdma-8 | |
custom_artifact: true | |
custom_cmake_args: -DAXI_DATA_WIDTH=8 | |
custom_robot_args: --variable=BUS_WIDTH:8 | |
- directory_name: apb3_completer_mem | |
- directory_name: apb3_requester_synth | |
- directory_name: apb3_standalone | |
- directory_name: ahb_mem | |
- directory_name: ahb_dma | |
- directory_name: ahb_simple_manager | |
- directory_name: gpio_repeater | |
config: | |
- runner: ubuntu-20.04 | |
verilator_artifact: ${{ needs.build-verilator-linux.outputs.verilator_artifact }} | |
- runner: windows-latest | |
verilator_artifact: ${{ needs.build-verilator-windows.outputs.verilator_artifact }} | |
uses: ./.github/workflows/run-sample.yml | |
with: | |
sample: ${{ matrix.sample.directory_name }} | |
custom_artifact: ${{ matrix.sample.custom_artifact || false }} | |
custom_cmake_args: ${{ matrix.sample.custom_cmake_args || '' }} | |
custom_robot_args: ${{ matrix.sample.custom_robot_args || '' }} | |
runner: ${{ matrix.config.runner }} | |
verilator_artifact: ${{ matrix.config.verilator_artifact }} | |
renode_git_repo: ${{ inputs.renode_git_repo || 'https://github.com/renode/renode' }} | |
renode_git_ref: ${{ inputs.renode_git_ref || 'master' }} |