-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Better matrix attempt * Remove uses * Fix indentation * Fix indent * Only run alt * Fix matrix input * Fix test matrix * Array to string * fromJSON ? * Use single string * Matrix value * ?? * Syntax error * Checkout * Naming * typo * Better names * Fix old script name * More typos and renames * Debug * Fix wrong output name * Attempt to run GL sims * Include action folder * Cannot have runs-on * Run openlane smoke-test in setup Pull Container before running test Fix passing CLI arguments to nix run * Add shell * Move things around size maximizing Fix openlane config path * Checkout because we are using custom file * Change run dir for GL and RTL * Separat GL and RTL Sims * Only setup openlane for GL sims * Single quotes * update ci test set with supported buses * ~ Adjust matrices to pass bus * ~ Set BUS_TYPE ~ Rename artifacts to use bus type * correct bus type syntax * Declare env variables * Add commit-hashes to the other Artifact upload * Always tar * Add extra space in job name --------- Co-authored-by: M0stafaRady <[email protected]> Co-authored-by: Mostafa Rady <[email protected]>
- Loading branch information
1 parent
7a60229
commit d9a2492
Showing
8 changed files
with
227 additions
and
139 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Setup OpenLane' | ||
description: 'Install Nix and Setup OpenLane cachix' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
with: | ||
remove-dotnet: "true" | ||
remove-android: "true" | ||
remove-haskell: "true" | ||
remove-codeql: "true" | ||
remove-docker-images: "true" | ||
root-reserve-mb: 20480 | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
with: | ||
extra-conf: | | ||
extra-substituters = https://openlane.cachix.org | ||
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E= | ||
- name: Run OpenLane Smoke Test | ||
shell: bash | ||
run: nix run github:efabless/openlane2 -- --smoke-test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import yaml | ||
import json | ||
|
||
|
||
def main(): | ||
test_set_yaml = ".github/test_set.yaml" | ||
output_matrix = {"IPs": []} | ||
test_set_stream = open(test_set_yaml) | ||
data = yaml.load(test_set_stream, Loader=yaml.Loader) | ||
for item in data: | ||
tests = item["tests"] | ||
name = item["name"] | ||
url = item["url"] | ||
bus = item["bus"] | ||
output_matrix["IPs"].append( | ||
{ | ||
"name": name, | ||
"url": url, | ||
"test-names": ",".join(tests), | ||
"buses": " ".join(bus), | ||
} | ||
) | ||
|
||
print(json.dumps(output_matrix)) | ||
test_set_stream.close() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,38 @@ | ||
- name: EF_GPIO8 | ||
url: https://github.com/efabless/EF_GPIO8.git | ||
tests: | ||
- gpio8_all_out_test gpio8_all_in_test | ||
- gpio8_all_out_test gpio8_all_in_test | ||
bus: | ||
- APB | ||
- AHB | ||
- WISHBONE | ||
- name: EF_UART | ||
url: https://github.com/efabless/EF_UART.git | ||
tests: | ||
- TX_StressTest RX_StressTest LoopbackTest PrescalarStressTest | ||
- LengthParityTXStressTest LengthParityRXStressTest WriteReadRegsTest | ||
- TX_StressTest RX_StressTest LoopbackTest PrescalarStressTest | ||
- LengthParityTXStressTest LengthParityRXStressTest WriteReadRegsTest | ||
bus: | ||
- APB | ||
- AHB | ||
- WISHBONE | ||
- name: EF_TMR32 | ||
url: https://github.com/efabless/EF_TMR32.git | ||
tests: | ||
- pwm_actions_test time_vary_test | ||
- pwm_pr_test pwm_tmr_test | ||
- pwm_actions_test time_vary_test | ||
- pwm_pr_test pwm_tmr_test | ||
bus: | ||
- APB | ||
- AHB | ||
- WISHBONE | ||
- name: MS_QSPI_XIP_CACHE | ||
url: https://github.com/efabless/MS_QSPI_XIP_CACHE.git | ||
tests: | ||
- flashReadTest flashResetTest flashRdWrTest | ||
- flashReadTest flashResetTest flashRdWrTest | ||
bus: | ||
- AHB | ||
- name: OL-DFFRAM | ||
url: https://github.com/efabless/OL-DFFRAM.git | ||
tests: | ||
- dffram_wr_rd_test dffram_corners_test | ||
- dffram_wr_rd_test dffram_corners_test | ||
bus: | ||
- AHB |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,27 @@ | ||
name: Test IPs | ||
name: Run Tests for IPs | ||
on: [push] | ||
jobs: | ||
Prepare-Tests-Matrix: | ||
Prepare-IPs-Matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
test: ${{ steps.set-tests-matrix.outputs.test }} | ||
IPs: ${{ steps.set-IPs-matrix.outputs.IPs }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Set Tests Matrix | ||
id: set-tests-matrix | ||
run: echo "test=$(python3 ./.github/scripts/get_tests_matrix.py)" >> "$GITHUB_OUTPUT" | ||
|
||
Test1: | ||
runs-on: ubuntu-latest | ||
needs: [Prepare-Tests-Matrix] | ||
name: ${{ matrix.tests.name }}/${{ matrix.tests.test-names }} | ||
- name: Set IPs Matrix | ||
id: set-IPs-matrix | ||
run: | | ||
python3 ./.github/scripts/get_IPs_matrix.py | ||
echo "IPs=$(python3 ./.github/scripts/get_IPs_matrix.py)" >> "$GITHUB_OUTPUT" | ||
IPs: | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.Prepare-Tests-Matrix.outputs.test) }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Run Test | ||
uses: ./.github/actions/run-test | ||
with: | ||
url: ${{ matrix.tests.url }} | ||
test-names: ${{ matrix.tests.test-names }} | ||
name: ${{ matrix.tests.name }} | ||
# Test2: | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: ${{ fromJSON(needs.Prepare-Tests-Matrix.outputs.test) }} | ||
# needs: [Prepare-Tests-Matrix] | ||
# name: Run Test (Separate workflow) | ||
# uses: ./.github/workflows/run_test.yaml | ||
# with: | ||
# url: ${{ matrix.tests.url }} | ||
# test-names: ${{ matrix.tests.test-names }} | ||
# name: ${{ matrix.tests.name }} | ||
matrix: ${{ fromJSON(needs.Prepare-IPs-Matrix.outputs.IPs) }} | ||
needs: [Prepare-IPs-Matrix] | ||
name: ${{ matrix.IPs.name }} | ||
uses: ./.github/workflows/run_IP.yaml | ||
with: | ||
url: ${{ matrix.IPs.url }} | ||
test-names: "${{ matrix.IPs.test-names }}" | ||
name: ${{ matrix.IPs.name }} | ||
buses: ${{ matrix.IPs.buses }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: 'Run IP' | ||
on: | ||
workflow_call: | ||
inputs: | ||
url: | ||
description: 'IP Repo URL' | ||
required: true | ||
type: string | ||
test-names: | ||
description: 'Test Names' | ||
required: true | ||
type: string | ||
name: | ||
description: 'IP Name' | ||
required: true | ||
type: string | ||
buses: | ||
description: 'Bus Types' | ||
required: true | ||
type: string | ||
jobs: | ||
Prepare-Tests-Matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tests: ${{ steps.set-tests-matrix.outputs.tests }} | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Set Tests Matrix | ||
id: set-tests-matrix | ||
run: echo "tests=$(python3 ./.github/scripts/get_tests_matrix.py --tests ${{ inputs.test-names }} --buses ${{ inputs.buses }})" >> "$GITHUB_OUTPUT" | ||
|
||
Run-IP: | ||
needs: [Prepare-Tests-Matrix] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.Prepare-Tests-Matrix.outputs.tests) }} | ||
name: ${{ matrix.tests.bus }} / ${{ matrix.tests.test }} | ||
steps: | ||
- name: Set Env Variables | ||
shell: bash | ||
run: | | ||
echo "WORKING_DIRECTORY=/home/runner/work/${{ inputs.name }}/verify/uvm-python" >> $GITHUB_ENV | ||
echo "SIM_DIRECTORY=/home/runner/work/${{ inputs.name }}/verify/uvm-python/sim" >> $GITHUB_ENV | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Setup OpenLane | ||
if: ${{ matrix.tests.tag == 'GL' }} | ||
uses: ./.github/actions/setup-openlane-nix | ||
- name: Clone IP | ||
shell: bash | ||
run: git clone ${{ inputs.url }} /home/runner/work/${{ inputs.name }} | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- name: Copy EF_UVM to verify/uvm-python (workaround) | ||
shell: bash | ||
run: cp -r $(pwd) ${{ env.WORKING_DIRECTORY }} | ||
- name: Install Docker Image | ||
run: docker pull efabless/dv:cocotb | ||
- name: Run Test | ||
shell: bash | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: | | ||
for test in ${{ matrix.tests.test }}; do | ||
echo "Running Test $test" | ||
make run_$test SIM_TAG=${{ matrix.tests.tag }} BUS_TYPE=${{ matrix.tests.bus }} | ||
done | ||
- name: Check Test Results | ||
shell: bash | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: | | ||
passed_count=$(find ${{ env.SIM_DIRECTORY }}/* -type f -name 'passed' | wc -l) | ||
failed_count=$(find ${{ env.SIM_DIRECTORY }}/* -type f -name 'failed' | wc -l) | ||
unknown_count=$(find ${{ env.SIM_DIRECTORY }}/* -type f -name 'unknown' | wc -l) | ||
echo "Passed: $passed_count" | ||
echo "Failed: $failed_count" | ||
echo "Unknown: $unknown_count" | ||
if [ "$passed_count" -eq 0 ]; then | ||
echo "Error: No passed test results found" | ||
exit 1 | ||
elif [ "$failed_count" -ne 0 ] || [ "$unknown_count" -ne 0 ]; then | ||
echo "Error: There are failed or unknown test results" | ||
exit 1 | ||
else | ||
echo "All tests passed successfully" | ||
fi | ||
- name: Save IP Commit Hash | ||
if: always() | ||
shell: bash | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: git rev-parse --verify HEAD > ${{ env.SIM_DIRECTORY }}/ip-commit-hash.txt | ||
- name: Save EF_UVM Commit Hash | ||
if: always() | ||
shell: bash | ||
run: git rev-parse --verify HEAD > ${{ env.SIM_DIRECTORY }}/EF_UVM-commit-hash.txt | ||
- name: Tar Sim Directory | ||
if: always() | ||
shell: bash | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: tar -czf sim.tar.gz sim | ||
- name: Upload Logs and Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ${{ inputs.name }}-${{ matrix.tests.bus }}-${{ matrix.tests.test }}-sim | ||
path: ${{ env.WORKING_DIRECTORY }}/*.tar.gz | ||
|
||
|
||
|
||
|
Oops, something went wrong.