Skip to content

Commit

Permalink
optimize memory and performance of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy committed Aug 13, 2023
1 parent a2fa088 commit f5ebf9f
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 10 deletions.
104 changes: 98 additions & 6 deletions .github/workflows/user_project_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,67 @@ jobs:
name: pdk-tarball
path: /tmp/pdk.tar

- name: Tarball OpenLane
run: |
tar -cf /tmp/openlane.tar -C $OPENLANE_ROOT .
- name: Upload OpenLane Tarball
uses: actions/upload-artifact@v2
with:
name: openlane-tarball
path: /tmp/openlane.tar

dependencies:
timeout-minutes: 720
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Export env variables
run: |
echo "CARAVEL_ROOT=/home/runner/work/caravel_user_project/caravel" >> $GITHUB_ENV
echo "MCW_ROOT=/home/runner/work/caravel_user_project/mgmt_core_wrapper" >> $GITHUB_ENV
- name: Install dependencies
run: |
make install
make install_mcw
make install-cocotb
make simenv
- name: Tarball caravel
run: |
tar -cf /tmp/caravel.tar -C $CARAVEL_ROOT .
- name: Upload caravel Tarball
uses: actions/upload-artifact@v2
with:
name: caravel-tarball
path: /tmp/caravel.tar

- name: Tarball mgmt_core_wrapper
run: |
tar -cf /tmp/mgmt_core_wrapper.tar -C $MCW_ROOT .
- name: Upload mgmt_core_wrapper Tarball
uses: actions/upload-artifact@v2
with:
name: mgmt_core_wrapper-tarball
path: /tmp/mgmt_core_wrapper.tar

user_project_flow:
timeout-minutes: 720
runs-on: ubuntu-latest
strategy:
matrix:
pdk: ["sky130A", "sky130B"]
needs: [pdk]
needs: [pdk, dependencies]
steps:
- uses: actions/checkout@v2

Expand All @@ -68,6 +122,11 @@ jobs:
- name: Export OPENLANE ROOT
run: echo "OPENLANE_ROOT=/home/runner/work/caravel_user_project/openlane" >> $GITHUB_ENV

- name: Export env variables
run: |
echo "CARAVEL_ROOT=/home/runner/work/caravel_user_project/caravel" >> $GITHUB_ENV
echo "MCW_ROOT=/home/runner/work/caravel_user_project/mgmt_core_wrapper" >> $GITHUB_ENV
- name: Download PDK Tarball
uses: actions/download-artifact@v2
with:
Expand All @@ -80,12 +139,41 @@ jobs:
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
tar -xf /tmp/pdk.tar -C $PDK_ROOT .
- name: Install dependencies
- name: Download OpenLane Tarball
uses: actions/download-artifact@v2
with:
name: openlane-tarball
path: /tmp

- name: Unpack OpenLane Tarball
run: |
make install
make install_mcw
make openlane
make setup-cocotb
sudo mkdir -p ${{ env.OPENLANE_ROOT }}
sudo chown -R $USER:$USER ${{ env.OPENLANE_ROOT }}
tar -xf /tmp/openlane.tar -C $OPENLANE_ROOT .
- name: Download caravel Tarball
uses: actions/download-artifact@v2
with:
name: caravel-tarball
path: /tmp

- name: Unpack caravel Tarball
run: |
sudo mkdir -p ${{ env.CARAVEL_ROOT }}
sudo chown -R $USER:$USER ${{ env.CARAVEL_ROOT }}
tar -xf /tmp/caravel.tar -C $CARAVEL_ROOT .
- name: Download mgmt_core_wrapper Tarball
uses: actions/download-artifact@v2
with:
name: mgmt_core_wrapper-tarball
path: /tmp

- name: Unpack mgmt_core_wrapper Tarball
run: |
sudo mkdir -p ${{ env.MCW_ROOT }}
sudo chown -R $USER:$USER ${{ env.MCW_ROOT }}
tar -xf /tmp/mgmt_core_wrapper.tar -C $MCW_ROOT .
- name: Harden using Openlane
run: |
Expand Down Expand Up @@ -117,6 +205,10 @@ jobs:
path: |
/home/runner/work/caravel_user_project/caravel_user_project/mpw_precheck_result/logs/*
- name: setup cocotb environment
run: |
make setup-cocotb-env
- name: Run DV RTL tests
run: |
make cocotb-verify-all-rtl
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ install:
.PHONY: simenv
simenv:
docker pull efabless/dv:latest
docker pull efabless/dv:cocotb

.PHONY: setup
setup: check_dependencies install check-env install_mcw openlane pdk-with-volare setup-timing-scripts setup-cocotb
Expand Down Expand Up @@ -321,12 +322,16 @@ setup-timing-scripts: $(TIMING_ROOT)
@( cd $(TIMING_ROOT) && git pull )
@#( cd $(TIMING_ROOT) && git fetch && git checkout $(MPW_TAG); )

.PHONY: setup-cocotb
setup-cocotb:
.PHONY: install-cocotb
install-cocotb:
@pip install caravel-cocotb==1.0.0

.PHONY: setup-cocotb-env
setup-cocotb-env:
@(python3 $(PROJECT_ROOT)/verilog/dv/setup-cocotb.py $(CARAVEL_ROOT) $(MCW_ROOT) $(PDK_ROOT) $(PDK) $(PROJECT_ROOT))
@docker pull efabless/dv:latest
@docker pull efabless/dv:cocotb

.PHONY: setup-cocotb
setup-cocotb: install-cocotb setup-cocotb-env simenv

.PHONY: cocotb-verify-all-rtl
cocotb-verify-all-rtl:
Expand Down

0 comments on commit f5ebf9f

Please sign in to comment.