From b6f97c150e6f83f57aa1efef3849529ea566bf93 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:25:02 +0200 Subject: [PATCH 01/29] test ci Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 153 ++++++++++++++++++++++++++++++++ .github/workflows/uvm_ci.yaml | 52 +++++------ README.md | 1 - 3 files changed, 179 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/bus-wrap.yaml diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml new file mode 100644 index 0000000..465d93b --- /dev/null +++ b/.github/workflows/bus-wrap.yaml @@ -0,0 +1,153 @@ +name: CI + +on: + push: # This now triggers on pushes to any branch +permissions: + pull-requests: write + contents: write + +jobs: + Bus-Wrap: + runs-on: ubuntu-latest + name: Generate + steps: + - name: Set variables + run: | + github_repo=${{ github.repository }} + github_repo=${github_repo#*/} + echo "BUSWRAP_PATH=./bus-wrap" >> $GITHUB_ENV + echo "BUSWRAP_REPO=efabless/BusWrap" >> $GITHUB_ENV + echo "BUSWRAP_REF=main" >> $GITHUB_ENV + echo "IP_PATH=./ip" >> $GITHUB_ENV + echo "IP_NAME=${github_repo}" >> $GITHUB_ENV + - name: Install iverilog + run: | + sudo apt-get update -qq + sudo apt-get install -y iverilog + - name: Install dependencies + shell: bash + run: | + sudo apt-get -y install --no-install-recommends git python3 python3-click python3-unidiff + - name: Install Verible + uses: chipsalliance/verible-actions-common/install-verible@main + - uses: actions/checkout@v4 + name: Checkout ${{ env.BUSWRAP_REPO }} + with: + repository: ${{ env.BUSWRAP_REPO }} + path: ${{ env.BUSWRAP_PATH }} + ref: ${{ env.BUSWRAP_REF }} + - uses: actions/checkout@v4 + name: Checkout ${{ github.repository }} + with: + path: ${{ env.IP_PATH }} + - name: Generate Wrapper + run: | + set -x + ip_dir=${{ env.IP_PATH }} + ip_name=${{ env.IP_NAME }} + bus_wrap_dir=${{ env.BUSWRAP_PATH }} + rm -rf ${ip_dir}/hdl/rtl/bus_wrappers + git -C ${{ env.IP_PATH }} status + mkdir -p ${ip_dir}/hdl/rtl/bus_wrappers/dft + + # wrapper + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -apb > ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -apb -dft > ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -wb > ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -wb -dft > ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl > ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl -dft > ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.dev.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v + # add line between timescale and default_nettype + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v + + - name: Generate Docs + run: | + set -x + ip_dir=${{ env.IP_PATH }} + ip_name=${{ env.IP_NAME }} + bus_wrap_dir=${{ env.BUSWRAP_PATH }} + rm -rf ${ip_dir}/README.md + rm -rf ${ip_dir}/verify/README.md + git -C ${{ env.IP_PATH }} status + # doc + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl -md | head -n -18 > ${ip_dir}/README.md + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl -md | tail -n 18 > ${ip_dir}/verify/README.md + + - name: Generate FW + run: | + set -x + ip_dir=${{ env.IP_PATH }} + ip_name=${{ env.IP_NAME }} + bus_wrap_dir=${{ env.BUSWRAP_PATH }} + rm -rf ${ip_dir}/fw/${ip_name}_regs.h + git -C ${{ env.IP_PATH }} status + # fw + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ch > ${ip_dir}/fw/${ip_name}_regs.h + + - name: Set Variables + id: vars + run: | + diffs_log=diffs.log + echo "diffs_log=$diffs_log" >> $GITHUB_OUTPUT + echo "buswrap_head_commit=$(git -C ${{ env.BUSWRAP_PATH }} rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + echo "ip_head_commit=$(git -C ${{ env.IP_PATH }} rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + echo "ip_branch_name=${{ github.head_ref || github.ref_name }}" >> "$GITHUB_OUTPUT" + + - name: Check Diff + id: check_diff + run: | + if [ -n "$(git -C ${{ env.IP_PATH }} status --porcelain)" ]; then + echo "changed=true" >> $GITHUB_OUTPUT + else + echo "changed=false" >> $GITHUB_OUTPUT + fi + git -C ${{ env.IP_PATH }} status + - name: Create PR + if: ${{ steps.check_diff.outputs.changed == 'true' }} + run: | + branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" + echo "there are changes pushing to $branch" + cd ${{ env.IP_PATH }} + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b $branch + git add . + git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" + git push -f --set-upstream origin $branch + GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} gh pr create -B ${{steps.vars.outputs.ip_branch_name}} -H $branch --title 'ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' --body 'Created by CI Github action' + - name: Not Push to branch + if: ${{ steps.check_diff.outputs.changed == 'false' }} + run: | + branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" + echo "there are changes pushing to $branch" + - name: Check Context + shell: bash + if: always() + run: | + cat << 'EOF' + "${{ toJSON(steps) }}" + "${{ toJSON(inputs) }}" + EOF diff --git a/.github/workflows/uvm_ci.yaml b/.github/workflows/uvm_ci.yaml index b7253e4..18e114a 100644 --- a/.github/workflows/uvm_ci.yaml +++ b/.github/workflows/uvm_ci.yaml @@ -1,26 +1,26 @@ -name: Run UVM tests - -on: - push: # This now triggers on pushes to any branch - pull_request: # This now triggers on pull requests to any branch - -jobs: - Extract-Buses: - runs-on: ubuntu-latest - outputs: - IPs: ${{ steps.set-IPs-matrix.outputs.IPs }} - buses: ${{ steps.extract_buses.outputs.buses }} - steps: - - name: Extract Supported Buses - id: extract_buses - uses: efabless/EF_UVM/.github/actions/get-bus@main - - name: Check Output - run: echo ${{ steps.extract_buses.outputs.buses }} - Run-IP-Tests: - uses: efabless/EF_UVM/.github/workflows/run_IP.yaml@main - needs: [Extract-Buses] - with: - test-names: "all_tests" - name: ${{ github.event.repository.name }} - buses: ${{ needs.Extract-Buses.outputs.buses }} - is-ip: true \ No newline at end of file +#name: Run UVM tests +# +#on: +# push: # This now triggers on pushes to any branch +# pull_request: # This now triggers on pull requests to any branch +# +#jobs: +# Extract-Buses: +# runs-on: ubuntu-latest +# outputs: +# IPs: ${{ steps.set-IPs-matrix.outputs.IPs }} +# buses: ${{ steps.extract_buses.outputs.buses }} +# steps: +# - name: Extract Supported Buses +# id: extract_buses +# uses: efabless/EF_UVM/.github/actions/get-bus@main +# - name: Check Output +# run: echo ${{ steps.extract_buses.outputs.buses }} +# Run-IP-Tests: +# uses: efabless/EF_UVM/.github/workflows/run_IP.yaml@main +# needs: [Extract-Buses] +# with: +# test-names: "all_tests" +# name: ${{ github.event.repository.name }} +# buses: ${{ needs.Extract-Buses.outputs.buses }} +# is-ip: true diff --git a/README.md b/README.md index e8a15db..096d868 100644 --- a/README.md +++ b/README.md @@ -280,5 +280,4 @@ You can install the IP either by cloning this repository or by using [IPM](https |tx_level|output|FAW|TX FIFO data level.| |ss|input|1|None| |enable|input|1|enable for spi master pulse generation| -|done|output|1|spi done flag.| |busy|output|1|spi busy flag.| From 6e7ec0ca35e56a2681e8fa303c9c7d3c7ad6bfae Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:29:42 +0200 Subject: [PATCH 02/29] test same pr Signed-off-by: Kareem Farid From 6ed7025eb3bc4177e329b7dc99f8368542168e2e Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:39:53 +0200 Subject: [PATCH 03/29] don't create pr if exits Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 13 ++++++++++++- hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index 465d93b..37634ea 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -137,7 +137,18 @@ jobs: git add . git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch - GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} gh pr create -B ${{steps.vars.outputs.ip_branch_name}} -H $branch --title 'ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' --body 'Created by CI Github action' + title='ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' + pr="$(gh pr list --search '$title' --state open)" + if [[ -n "${PR_URL}" ]]; then + echo "PR already exists -> ${PR_URL}" + exit 0 + else + GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} gh pr create \ + -B ${{steps.vars.outputs.ip_branch_name}}\ + -H $branch\ + --title $title\ + --body 'Created by CI Github action' + fi - name: Not Push to branch if: ${{ steps.check_diff.outputs.changed == 'false' }} run: | diff --git a/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v b/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v index 21d591a..edbc9ef 100644 --- a/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v +++ b/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v @@ -256,6 +256,5 @@ module EF_SPI_AHBL #( assign RXDATA_WIRE = datao; assign rd = (ahbl_re & (last_HADDR[`AHBL_AW-1:0] == RXDATA_REG_OFFSET)); - assign datai = HWDATA; assign wr = (ahbl_we & (last_HADDR[`AHBL_AW-1:0] == TXDATA_REG_OFFSET)); endmodule From dbc89dc4ccf09bf2b61b778b4c950f3d2e81f422 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:41:59 +0200 Subject: [PATCH 04/29] set GH_TOKEN Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index 37634ea..cfe7ba9 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -127,6 +127,9 @@ jobs: git -C ${{ env.IP_PATH }} status - name: Create PR if: ${{ steps.check_diff.outputs.changed == 'true' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" echo "there are changes pushing to $branch" @@ -140,10 +143,10 @@ jobs: title='ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' pr="$(gh pr list --search '$title' --state open)" if [[ -n "${PR_URL}" ]]; then - echo "PR already exists -> ${PR_URL}" + echo "PR '$title' already exists" exit 0 else - GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} gh pr create \ + gh pr create \ -B ${{steps.vars.outputs.ip_branch_name}}\ -H $branch\ --title $title\ From af46326ac12f2fb2d452e3abcbe76d7831fcd91d Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:43:22 +0200 Subject: [PATCH 05/29] debug and add double quotes Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index cfe7ba9..65ed261 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -131,6 +131,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + set -x branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" echo "there are changes pushing to $branch" cd ${{ env.IP_PATH }} @@ -141,7 +142,7 @@ jobs: git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch title='ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' - pr="$(gh pr list --search '$title' --state open)" + pr="$(gh pr list --search \"$title\" --state open)" if [[ -n "${PR_URL}" ]]; then echo "PR '$title' already exists" exit 0 From 66a4f3cd73e370b798ab8705c6e6c7f1343b1c5c Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:45:16 +0200 Subject: [PATCH 06/29] titles again Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index 65ed261..92f84ac 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -141,7 +141,7 @@ jobs: git add . git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch - title='ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' + title="ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}" pr="$(gh pr list --search \"$title\" --state open)" if [[ -n "${PR_URL}" ]]; then echo "PR '$title' already exists" @@ -150,8 +150,8 @@ jobs: gh pr create \ -B ${{steps.vars.outputs.ip_branch_name}}\ -H $branch\ - --title $title\ - --body 'Created by CI Github action' + --title "$title"\ + --body "Created by CI Github action" fi - name: Not Push to branch if: ${{ steps.check_diff.outputs.changed == 'false' }} From b05d67ecc63ff609312c933bfb6086dfaf3d98ff Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:47:23 +0200 Subject: [PATCH 07/29] ?? Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index 92f84ac..67141d1 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -142,7 +142,7 @@ jobs: git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch title="ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}" - pr="$(gh pr list --search \"$title\" --state open)" + pr="$(gh pr list --search $title --state open)" if [[ -n "${PR_URL}" ]]; then echo "PR '$title' already exists" exit 0 From d9aab394b4d9833ad07934159308db6202daa192 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:49:25 +0200 Subject: [PATCH 08/29] ?? Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index 67141d1..71b5c43 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -142,8 +142,8 @@ jobs: git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch title="ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}" - pr="$(gh pr list --search $title --state open)" - if [[ -n "${PR_URL}" ]]; then + pr="$(gh pr list --search \"${title}\" --state open)" + if [[ -n "${pr}" ]]; then echo "PR '$title' already exists" exit 0 else From 54d18ab519132f6bd518b6b41f7cdd68101ccf50 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 15:59:05 +0200 Subject: [PATCH 09/29] bash ??? Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index 71b5c43..e6b8eac 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -142,7 +142,7 @@ jobs: git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch title="ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}" - pr="$(gh pr list --search \"${title}\" --state open)" + pr=$(gh pr list --search "${title}" --state open) if [[ -n "${pr}" ]]; then echo "PR '$title' already exists" exit 0 From 0f4c1efb053efeafc1f8e81bf331b59b4425c702 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 16 Feb 2025 13:59:48 +0000 Subject: [PATCH 10/29] run bus_wrap(9e2b21b) on 54d18ab --- README.md | 1 + hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 096d868..e8a15db 100644 --- a/README.md +++ b/README.md @@ -280,4 +280,5 @@ You can install the IP either by cloning this repository or by using [IPM](https |tx_level|output|FAW|TX FIFO data level.| |ss|input|1|None| |enable|input|1|enable for spi master pulse generation| +|done|output|1|spi done flag.| |busy|output|1|spi busy flag.| diff --git a/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v b/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v index edbc9ef..21d591a 100644 --- a/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v +++ b/hdl/rtl/bus_wrappers/EF_SPI_AHBL.dev.v @@ -256,5 +256,6 @@ module EF_SPI_AHBL #( assign RXDATA_WIRE = datao; assign rd = (ahbl_re & (last_HADDR[`AHBL_AW-1:0] == RXDATA_REG_OFFSET)); + assign datai = HWDATA; assign wr = (ahbl_we & (last_HADDR[`AHBL_AW-1:0] == TXDATA_REG_OFFSET)); endmodule From 75629ab10c83fcf7856746f09c1b5a3511ca1aa3 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Sun, 16 Feb 2025 16:03:56 +0200 Subject: [PATCH 11/29] testagain Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap.yaml | 2 +- README.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml index e6b8eac..2471fe8 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml @@ -157,7 +157,7 @@ jobs: if: ${{ steps.check_diff.outputs.changed == 'false' }} run: | branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" - echo "there are changes pushing to $branch" + echo "there are no changes not pushing to $branch" - name: Check Context shell: bash if: always() diff --git a/README.md b/README.md index e8a15db..26220c3 100644 --- a/README.md +++ b/README.md @@ -269,7 +269,6 @@ You can install the IP either by cloning this repository or by using [IPM](https |rx_flush|input|1|Flush the RX FIFO.| |rx_threshold|input|FAW|RX FIFO level threshold.| |rx_empty|output|1|RX FIFO is empty.| -|rx_full|output|1|RX FIFO is full.| |rx_level_above|output|1|RX FIFO level is above the threshold.| |rx_level|output|FAW|RX FIFO data level.| |tx_flush|input|1|Flush the TX FIFO.| From af0586ad106fc6599eadcf368dbdb31f6e2f5066 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 16 Feb 2025 14:04:35 +0000 Subject: [PATCH 12/29] run bus_wrap(9e2b21b) on 75629ab --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 26220c3..e8a15db 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,7 @@ You can install the IP either by cloning this repository or by using [IPM](https |rx_flush|input|1|Flush the RX FIFO.| |rx_threshold|input|FAW|RX FIFO level threshold.| |rx_empty|output|1|RX FIFO is empty.| +|rx_full|output|1|RX FIFO is full.| |rx_level_above|output|1|RX FIFO level is above the threshold.| |rx_level|output|FAW|RX FIFO data level.| |tx_flush|input|1|Flush the TX FIFO.| From 2e0d83f717a054d22ca50a410046faaad2826387 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:12:46 +0200 Subject: [PATCH 13/29] test reusable workflow Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap-new.yaml | 23 +++ .../{bus-wrap.yaml => bus-wrap.yaml.bk} | 19 +- .github/workflows/run_ip.yaml | 195 ++++++++++++++++++ README.md | 1 - 4 files changed, 220 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/bus-wrap-new.yaml rename .github/workflows/{bus-wrap.yaml => bus-wrap.yaml.bk} (92%) create mode 100644 .github/workflows/run_ip.yaml diff --git a/.github/workflows/bus-wrap-new.yaml b/.github/workflows/bus-wrap-new.yaml new file mode 100644 index 0000000..10876b6 --- /dev/null +++ b/.github/workflows/bus-wrap-new.yaml @@ -0,0 +1,23 @@ +name: CI New + +on: + push: # This now triggers on pushes to any branch +permissions: + pull-requests: write + contents: write + +jobs: + Run: + uses: ./.github/workflows/run_ip.yaml + secrets: inherit + with: + repo: ${{ github.repository }} + name: EF_UART + fw: true + docs: true + bus_wrapper: true + pr_base: ${{ github.head_ref || github.ref_name }} + pr_branch: "ci-ip:BUSWRAP_COMMIT" + #pr_branch: "ci-ip-buswrap:BUSWRAP_COMMIT" + pr_title: "ci(ip): run bus_wrap BUSWRAP_COMMIT on IP_COMMIT" + commit_msg: "run bus_wrap(BUSWRAP_COMMIT) on IP_COMMIT" diff --git a/.github/workflows/bus-wrap.yaml b/.github/workflows/bus-wrap.yaml.bk similarity index 92% rename from .github/workflows/bus-wrap.yaml rename to .github/workflows/bus-wrap.yaml.bk index 2471fe8..465d93b 100644 --- a/.github/workflows/bus-wrap.yaml +++ b/.github/workflows/bus-wrap.yaml.bk @@ -127,11 +127,7 @@ jobs: git -C ${{ env.IP_PATH }} status - name: Create PR if: ${{ steps.check_diff.outputs.changed == 'true' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - set -x branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" echo "there are changes pushing to $branch" cd ${{ env.IP_PATH }} @@ -141,23 +137,12 @@ jobs: git add . git commit -m "run bus_wrap(${{steps.vars.outputs.buswrap_head_commit}}) on ${{ steps.vars.outputs.ip_head_commit }}" git push -f --set-upstream origin $branch - title="ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}" - pr=$(gh pr list --search "${title}" --state open) - if [[ -n "${pr}" ]]; then - echo "PR '$title' already exists" - exit 0 - else - gh pr create \ - -B ${{steps.vars.outputs.ip_branch_name}}\ - -H $branch\ - --title "$title"\ - --body "Created by CI Github action" - fi + GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} gh pr create -B ${{steps.vars.outputs.ip_branch_name}} -H $branch --title 'ci: run bus_wrap on ${{steps.vars.outputs.ip_branch_name}}' --body 'Created by CI Github action' - name: Not Push to branch if: ${{ steps.check_diff.outputs.changed == 'false' }} run: | branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" - echo "there are no changes not pushing to $branch" + echo "there are changes pushing to $branch" - name: Check Context shell: bash if: always() diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml new file mode 100644 index 0000000..29182c1 --- /dev/null +++ b/.github/workflows/run_ip.yaml @@ -0,0 +1,195 @@ +name: Run IP + +permissions: + pull-requests: write + contents: write +on: + workflow_call: + inputs: + repo: + type: string + name: + type: string + fw: + type: string + default: "true" + docs: + type: string + default: "true" + bus_wrapper: + type: string + default: "true" + pr_base: + type: string + commit_msg: + type: string + pr_branch: + type: string + pr_title: + type: string + +jobs: + Main: + runs-on: ubuntu-latest + name: Run BusWarp on ${{ inputs.name }} + steps: + - name: Set variables + run: | + echo "BUSWRAP_PATH=./bus-wrap" >> $GITHUB_ENV + echo "BUSWRAP_REPO=efabless/BusWrap" >> $GITHUB_ENV + echo "BUSWRAP_REF=main" >> $GITHUB_ENV + echo "IP_PATH=./${{ inputs.ip_name }}" >> $GITHUB_ENV + - name: Install iverilog + run: | + sudo apt-get update -qq + sudo apt-get install -y iverilog + - name: Install dependencies + shell: bash + run: | + sudo apt-get -y install --no-install-recommends git python3 python3-click python3-unidiff + - name: Install Verible + uses: chipsalliance/verible-actions-common/install-verible@main + - uses: actions/checkout@v4 + name: Checkout ${{ env.BUSWRAP_REPO }} + with: + repository: ${{ env.BUSWRAP_REPO }} + path: ${{ env.BUSWRAP_PATH }} + ref: ${{ env.BUSWRAP_REF }} + - uses: actions/checkout@v4 + name: Checkout ${{ inputs.ip_repo }} + with: + path: ${{ env.IP_PATH }} + - name: Generate Wrapper + if: ${{ inputs.bus_wrapper == 'true' }} + run: | + set -x + ip_dir=${{ env.IP_PATH }} + ip_name=${{ inputs.ip_name }} + bus_wrap_dir=${{ env.BUSWRAP_PATH }} + rm -rf ${ip_dir}/hdl/rtl/bus_wrappers + git -C ${{ env.IP_PATH }} status + mkdir -p ${ip_dir}/hdl/rtl/bus_wrappers/dft + + # wrapper + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -apb > ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -apb -dft > ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -wb > ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -wb -dft > ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl > ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.dev.v + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl -dft > ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.dev.v + iverilog -E -I$bus_wrap_dir/includes/rtl -o ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.dev.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v + verible-verilog-format --inplace ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v + sed -i '/^$/N;/^\n$/D' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v + # add line between timescale and default_nettype + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_APB.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_APB_DFT.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_WB.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_WB_DFT.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/${ip_name}_AHBL.v + sed -i 's/`timescale 1ns \/ 1ps `default_nettype none/`timescale 1ns \/ 1ps\n`default_nettype none/' ${ip_dir}/hdl/rtl/bus_wrappers/dft/${ip_name}_AHBL_DFT.v + - name: Generate Docs + if: ${{ inputs.docs == 'true' }} + run: | + set -x + ip_dir=${{ env.IP_PATH }} + ip_name=${{ inputs.IP_NAME }} + bus_wrap_dir=${{ env.BUSWRAP_PATH }} + rm -rf ${ip_dir}/README.md + rm -rf ${ip_dir}/verify/README.md + git -C ${{ env.IP_PATH }} status + # doc + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl -md | head -n -18 > ${ip_dir}/README.md + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ahbl -md | tail -n 18 > ${ip_dir}/verify/README.md + - name: Generate FW + if: ${{ inputs.fw == 'true' }} + run: | + set -x + ip_dir=${{ env.IP_PATH }} + ip_name=${{ inputs.IP_NAME }} + bus_wrap_dir=${{ env.BUSWRAP_PATH }} + rm -rf ${ip_dir}/fw/${ip_name}_regs.h + git -C ${{ env.IP_PATH }} status + # fw + python3 $bus_wrap_dir/scripts/bus_wrap.py ${ip_dir}/${ip_name}.yaml -ch > ${ip_dir}/fw/${ip_name}_regs.h + - name: Check Diff + id: check_diff + run: | + if [ -n "$(git -C ${{ env.IP_PATH }} status --porcelain)" ]; then + echo "changed=true" >> $GITHUB_OUTPUT + else + echo "changed=false" >> $GITHUB_OUTPUT + fi + git -C ${{ env.IP_PATH }} status + - name: Set Variables + if: ${{ steps.check_diff.outputs.changed == 'true' }} + id: vars + run: | + diffs_log=diffs.log + echo "diffs_log=$diffs_log" >> $GITHUB_OUTPUT + echo "buswrap_head_commit=$(git -C ${{ env.BUSWRAP_PATH }} rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + echo "ip_head_commit=$(git -C ${{ env.IP_PATH }} rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" + - name: Create PR + if: ${{ steps.check_diff.outputs.changed == 'true' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -x + ip_head_commit=${{steps.vars.outputs.ip_head_commit}} + buswrap_head_commit=${{steps.vars.outputs.buswrap_head_commit}} + branch="${{inputs.pr_branch}}" + branch="${branch/IP_COMMIT/"$ip_head_commit"}" + branch="${branch/BUSWRAP_COMMIT/"$buswrap_head_commit"}" + title="${{inputs.pr_title}}" + title="${title/IP_COMMIT/"$ip_head_commit"}" + title="${title/BUSWRAP_COMMIT/"$buswrap_head_commit"}" + msg="${{inputs.commit_msg}}" + msg="${msg/IP_COMMIT/"$ip_head_commit"}" + msg="${msg/BUSWRAP_COMMIT/"$buswrap_head_commit"}" + echo "there are changes pushing to $branch" + cd ${{ env.IP_PATH }} + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git checkout -b $branch + git add . + git commit -m "$msg" + git push -f --set-upstream origin $branch + pr=$(gh pr list --search "${title}" --state open) + if [[ -n "${pr}" ]]; then + echo "PR '$title' already exists" + exit 0 + else + gh pr create \ + -B ${{steps.vars.outputs.ip_branch_name}}\ + -H $branch\ + --title "$title"\ + --body "Created by CI Github action" + fi + - name: Not Push to branch + if: ${{ steps.check_diff.outputs.changed == 'false' }} + run: | + branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" + echo "there are no changes not pushing to $branch" + - name: Check Context + shell: bash + if: always() + run: | + cat << 'EOF' + "${{ toJSON(steps) }}" + "${{ toJSON(inputs) }}" + EOF diff --git a/README.md b/README.md index e8a15db..5580aa5 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,5 @@ You can install the IP either by cloning this repository or by using [IPM](https |tx_level_below|output|1|TX FIFO level is below trhe threshold.| |tx_level|output|FAW|TX FIFO data level.| |ss|input|1|None| -|enable|input|1|enable for spi master pulse generation| |done|output|1|spi done flag.| |busy|output|1|spi busy flag.| From 1c861b0076c683d1cc0ccf3e42926e33e2556a52 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:14:51 +0200 Subject: [PATCH 14/29] fix variable reference Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index 29182c1..bf635bf 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -38,7 +38,7 @@ jobs: echo "BUSWRAP_PATH=./bus-wrap" >> $GITHUB_ENV echo "BUSWRAP_REPO=efabless/BusWrap" >> $GITHUB_ENV echo "BUSWRAP_REF=main" >> $GITHUB_ENV - echo "IP_PATH=./${{ inputs.ip_name }}" >> $GITHUB_ENV + echo "IP_PATH=./${{ inputs.name }}" >> $GITHUB_ENV - name: Install iverilog run: | sudo apt-get update -qq @@ -64,7 +64,7 @@ jobs: run: | set -x ip_dir=${{ env.IP_PATH }} - ip_name=${{ inputs.ip_name }} + ip_name=${{ inputs.name }} bus_wrap_dir=${{ env.BUSWRAP_PATH }} rm -rf ${ip_dir}/hdl/rtl/bus_wrappers git -C ${{ env.IP_PATH }} status From bd9fc80295a8c0662394354558a6161cc9bd2cd9 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:17:13 +0200 Subject: [PATCH 15/29] rename IP_PATH Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index bf635bf..bb72c1f 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -38,7 +38,7 @@ jobs: echo "BUSWRAP_PATH=./bus-wrap" >> $GITHUB_ENV echo "BUSWRAP_REPO=efabless/BusWrap" >> $GITHUB_ENV echo "BUSWRAP_REF=main" >> $GITHUB_ENV - echo "IP_PATH=./${{ inputs.name }}" >> $GITHUB_ENV + echo "IP_PATH=./ip" >> $GITHUB_ENV - name: Install iverilog run: | sudo apt-get update -qq From fcf5334f59336decdcecf49052db5b0e3d9cb0b8 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:18:25 +0200 Subject: [PATCH 16/29] fix name Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap-new.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bus-wrap-new.yaml b/.github/workflows/bus-wrap-new.yaml index 10876b6..fa84862 100644 --- a/.github/workflows/bus-wrap-new.yaml +++ b/.github/workflows/bus-wrap-new.yaml @@ -12,7 +12,7 @@ jobs: secrets: inherit with: repo: ${{ github.repository }} - name: EF_UART + name: EF_SPI fw: true docs: true bus_wrapper: true From c958ad0d343b4d1d5dc363ca5f35aa6d1afebaf9 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:22:29 +0200 Subject: [PATCH 17/29] fix variable reference Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index bb72c1f..c838df5 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -120,7 +120,7 @@ jobs: run: | set -x ip_dir=${{ env.IP_PATH }} - ip_name=${{ inputs.IP_NAME }} + ip_name=${{ inputs.name }} bus_wrap_dir=${{ env.BUSWRAP_PATH }} rm -rf ${ip_dir}/fw/${ip_name}_regs.h git -C ${{ env.IP_PATH }} status From 0b94a60119eb70a34300291d99354ef565732a11 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:25:11 +0200 Subject: [PATCH 18/29] rename branch to remove collon Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap-new.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bus-wrap-new.yaml b/.github/workflows/bus-wrap-new.yaml index fa84862..992538f 100644 --- a/.github/workflows/bus-wrap-new.yaml +++ b/.github/workflows/bus-wrap-new.yaml @@ -17,7 +17,7 @@ jobs: docs: true bus_wrapper: true pr_base: ${{ github.head_ref || github.ref_name }} - pr_branch: "ci-ip:BUSWRAP_COMMIT" + pr_branch: "ci-ip-BUSWRAP_COMMIT" #pr_branch: "ci-ip-buswrap:BUSWRAP_COMMIT" pr_title: "ci(ip): run bus_wrap BUSWRAP_COMMIT on IP_COMMIT" commit_msg: "run bus_wrap(BUSWRAP_COMMIT) on IP_COMMIT" From ef0cbff30de376f112a09b97f71a59d0ec743961 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:27:11 +0200 Subject: [PATCH 19/29] add quotes + fix variable reference Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index c838df5..2a6815c 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -107,7 +107,7 @@ jobs: run: | set -x ip_dir=${{ env.IP_PATH }} - ip_name=${{ inputs.IP_NAME }} + ip_name=${{ inputs.name }} bus_wrap_dir=${{ env.BUSWRAP_PATH }} rm -rf ${ip_dir}/README.md rm -rf ${ip_dir}/verify/README.md @@ -175,8 +175,8 @@ jobs: exit 0 else gh pr create \ - -B ${{steps.vars.outputs.ip_branch_name}}\ - -H $branch\ + -B "${{steps.vars.outputs.ip_branch_name}}"\ + -H "$branch"\ --title "$title"\ --body "Created by CI Github action" fi From fac7b0f02b965b33b69e11e456d6a9cef39a0bd8 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:29:56 +0200 Subject: [PATCH 20/29] fix base branch Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index 2a6815c..e97347f 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -175,7 +175,7 @@ jobs: exit 0 else gh pr create \ - -B "${{steps.vars.outputs.ip_branch_name}}"\ + -B "${{inputs.pr_base}}"\ -H "$branch"\ --title "$title"\ --body "Created by CI Github action" From db35a39234452ca9b2a13c7ab0ca69061b1272dc Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:40:11 +0200 Subject: [PATCH 21/29] renames for msg title and branch use variable for input name Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap-new.yaml | 6 +++--- .github/workflows/run_ip.yaml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bus-wrap-new.yaml b/.github/workflows/bus-wrap-new.yaml index 992538f..5cb4d47 100644 --- a/.github/workflows/bus-wrap-new.yaml +++ b/.github/workflows/bus-wrap-new.yaml @@ -12,12 +12,12 @@ jobs: secrets: inherit with: repo: ${{ github.repository }} - name: EF_SPI + name: ${{ github.event.repository.name }} fw: true docs: true bus_wrapper: true pr_base: ${{ github.head_ref || github.ref_name }} pr_branch: "ci-ip-BUSWRAP_COMMIT" #pr_branch: "ci-ip-buswrap:BUSWRAP_COMMIT" - pr_title: "ci(ip): run bus_wrap BUSWRAP_COMMIT on IP_COMMIT" - commit_msg: "run bus_wrap(BUSWRAP_COMMIT) on IP_COMMIT" + pr_title: "ci[ip]: run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_COMMIT)" + commit_msg: "run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_COMMIT)" diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index e97347f..3fc65ec 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -150,6 +150,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -x + ip_name=${{ inputs.name }} ip_head_commit=${{steps.vars.outputs.ip_head_commit}} buswrap_head_commit=${{steps.vars.outputs.buswrap_head_commit}} branch="${{inputs.pr_branch}}" @@ -158,9 +159,11 @@ jobs: title="${{inputs.pr_title}}" title="${title/IP_COMMIT/"$ip_head_commit"}" title="${title/BUSWRAP_COMMIT/"$buswrap_head_commit"}" + title="${title/IP_NAME/"$ip_name"}" msg="${{inputs.commit_msg}}" msg="${msg/IP_COMMIT/"$ip_head_commit"}" msg="${msg/BUSWRAP_COMMIT/"$buswrap_head_commit"}" + msg="${msg/IP_NAME/"$ip_name"}" echo "there are changes pushing to $branch" cd ${{ env.IP_PATH }} git config --local user.name "github-actions[bot]" From d2a9b77272671f1b463ee7d26e5549843ff4cc8f Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:43:52 +0200 Subject: [PATCH 22/29] test fail Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index 3fc65ec..7333dcc 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -62,7 +62,8 @@ jobs: - name: Generate Wrapper if: ${{ inputs.bus_wrapper == 'true' }} run: | - set -x + set -ex + set -o pipefail ip_dir=${{ env.IP_PATH }} ip_name=${{ inputs.name }} bus_wrap_dir=${{ env.BUSWRAP_PATH }} @@ -105,9 +106,10 @@ jobs: - name: Generate Docs if: ${{ inputs.docs == 'true' }} run: | - set -x + set -ex + set -o pipefail ip_dir=${{ env.IP_PATH }} - ip_name=${{ inputs.name }} + ip_name=garbage bus_wrap_dir=${{ env.BUSWRAP_PATH }} rm -rf ${ip_dir}/README.md rm -rf ${ip_dir}/verify/README.md @@ -118,7 +120,8 @@ jobs: - name: Generate FW if: ${{ inputs.fw == 'true' }} run: | - set -x + set -ex + set -o pipefail ip_dir=${{ env.IP_PATH }} ip_name=${{ inputs.name }} bus_wrap_dir=${{ env.BUSWRAP_PATH }} From 75b03439581675bba39c6f763c5bb411aaccaf73 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:45:06 +0200 Subject: [PATCH 23/29] restore working docs flow Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index 7333dcc..89bffe0 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -109,7 +109,7 @@ jobs: set -ex set -o pipefail ip_dir=${{ env.IP_PATH }} - ip_name=garbage + ip_name=${{ inputs.name }} bus_wrap_dir=${{ env.BUSWRAP_PATH }} rm -rf ${ip_dir}/README.md rm -rf ${ip_dir}/verify/README.md From 079fd42e7e57aa4c75c3dee49361df4899088b33 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:49:30 +0200 Subject: [PATCH 24/29] fix ref for ip checkout Signed-off-by: Kareem Farid --- .github/workflows/run_ip.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index 89bffe0..8e58b8f 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -59,6 +59,7 @@ jobs: name: Checkout ${{ inputs.ip_repo }} with: path: ${{ env.IP_PATH }} + ref: ${{ inputs.pr_base }} - name: Generate Wrapper if: ${{ inputs.bus_wrapper == 'true' }} run: | @@ -189,8 +190,7 @@ jobs: - name: Not Push to branch if: ${{ steps.check_diff.outputs.changed == 'false' }} run: | - branch="ci-${{steps.vars.outputs.buswrap_head_commit}}-${{steps.vars.outputs.ip_branch_name}}" - echo "there are no changes not pushing to $branch" + echo "there are no changes not pushing" - name: Check Context shell: bash if: always() From d65f6fe618b63cca4638cc36491bff54dcbc32bd Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:56:27 +0200 Subject: [PATCH 25/29] add IP_BRANCH to pr_branch name and pr_title Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap-new.yaml | 4 ++-- .github/workflows/run_ip.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bus-wrap-new.yaml b/.github/workflows/bus-wrap-new.yaml index 5cb4d47..137917c 100644 --- a/.github/workflows/bus-wrap-new.yaml +++ b/.github/workflows/bus-wrap-new.yaml @@ -17,7 +17,7 @@ jobs: docs: true bus_wrapper: true pr_base: ${{ github.head_ref || github.ref_name }} - pr_branch: "ci-ip-BUSWRAP_COMMIT" + pr_branch: "ci-ip-IP_BRANCH-BUSWRAP_COMMIT" #pr_branch: "ci-ip-buswrap:BUSWRAP_COMMIT" - pr_title: "ci[ip]: run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_COMMIT)" + pr_title: "ci[ip]: run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_BRANCH)" commit_msg: "run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_COMMIT)" diff --git a/.github/workflows/run_ip.yaml b/.github/workflows/run_ip.yaml index 8e58b8f..c134591 100644 --- a/.github/workflows/run_ip.yaml +++ b/.github/workflows/run_ip.yaml @@ -157,17 +157,21 @@ jobs: ip_name=${{ inputs.name }} ip_head_commit=${{steps.vars.outputs.ip_head_commit}} buswrap_head_commit=${{steps.vars.outputs.buswrap_head_commit}} + ip_branch=${{inputs.pr_base}} branch="${{inputs.pr_branch}}" branch="${branch/IP_COMMIT/"$ip_head_commit"}" branch="${branch/BUSWRAP_COMMIT/"$buswrap_head_commit"}" + branch="${branch/IP_BRANCH/"$ip_branch"}" title="${{inputs.pr_title}}" title="${title/IP_COMMIT/"$ip_head_commit"}" title="${title/BUSWRAP_COMMIT/"$buswrap_head_commit"}" title="${title/IP_NAME/"$ip_name"}" + title="${title/IP_BRANCH/"$ip_branch"}" msg="${{inputs.commit_msg}}" msg="${msg/IP_COMMIT/"$ip_head_commit"}" msg="${msg/BUSWRAP_COMMIT/"$buswrap_head_commit"}" msg="${msg/IP_NAME/"$ip_name"}" + msg="${msg/IP_BRANCH/"$ip_branch"}" echo "there are changes pushing to $branch" cd ${{ env.IP_PATH }} git config --local user.name "github-actions[bot]" From d63ce3a6c79e02cda91c4f2dc93e41712be10541 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 18 Feb 2025 13:57:34 +0200 Subject: [PATCH 26/29] test Signed-off-by: Kareem Farid From e8b5ad8d5c18c9633663603867f8bb6d7cd257c5 Mon Sep 17 00:00:00 2001 From: ef-staff Date: Wed, 19 Feb 2025 13:47:34 +0000 Subject: [PATCH 27/29] run bus_wrap(3f2d6d1) on EF_SPI(33584f0) --- verify/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify/README.md b/verify/README.md index 303ccf1..1cb2ffb 100644 --- a/verify/README.md +++ b/verify/README.md @@ -1,4 +1,4 @@ -## Run cocotb UVM Testbench: +## Run cocotb UVM Testbench2: In IP directory run: ```shell cd verify/uvm-python/ From 2a0d022559ae4fb349bfa6c40570510ec1274484 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Wed, 19 Feb 2025 11:22:00 +0200 Subject: [PATCH 28/29] use workflow from other repo Signed-off-by: Kareem Farid --- .github/workflows/bus-wrap-new.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/bus-wrap-new.yaml b/.github/workflows/bus-wrap-new.yaml index 137917c..f7a0dea 100644 --- a/.github/workflows/bus-wrap-new.yaml +++ b/.github/workflows/bus-wrap-new.yaml @@ -8,7 +8,7 @@ permissions: jobs: Run: - uses: ./.github/workflows/run_ip.yaml + uses: efabless/BusWrap/.github/workflows/run_ip.yaml@test-ci secrets: inherit with: repo: ${{ github.repository }} @@ -18,6 +18,5 @@ jobs: bus_wrapper: true pr_base: ${{ github.head_ref || github.ref_name }} pr_branch: "ci-ip-IP_BRANCH-BUSWRAP_COMMIT" - #pr_branch: "ci-ip-buswrap:BUSWRAP_COMMIT" pr_title: "ci[ip]: run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_BRANCH)" commit_msg: "run bus_wrap(BUSWRAP_COMMIT) on IP_NAME(IP_COMMIT)" From bbcfbcb9c73cc96f48b2c603dde347041e3844cc Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Wed, 19 Feb 2025 16:41:21 +0200 Subject: [PATCH 29/29] trigger ci Signed-off-by: Kareem Farid