changed precheck to private and seperated precheck with lvs and witho… #1366
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: CI | |
on: | |
# Runs on Every Push | |
push: | |
# Runs on Pull Requests | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
download_deps: | |
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: Setup Environment Variables | |
run: | | |
echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV | |
echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV | |
echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV | |
echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV | |
echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV | |
echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV | |
echo "MPW_TAG=main" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: | | |
sudo mkdir -p ${{ env.PDK_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} | |
make setup | |
cd ${{ env.MCW_ROOT }} | |
rm -rf gds maglef openlane spi LICENSE manifest docs litex lvs .git | |
cd ${{ env.CARAVEL_ROOT }} | |
rm -rf gds maglef openlane spi LICENSE manifest .git | |
- name: Tarball Caravel | |
run: | | |
tar -cf /tmp/caravel.tar -C ${{ env.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 ${{ env.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 | |
- name: Tarball openlane | |
run: | | |
tar -cf /tmp/openlane.tar -C ${{ env.OPENLANE_ROOT }} . | |
- name: Upload openlane Tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: openlane-tarball | |
path: /tmp/openlane.tar | |
- name: Tarball pdk | |
run: | | |
tar -cf /tmp/pdk.tar -C ${{ env.PDK_ROOT }} . | |
- name: Upload pdk Tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pdk-tarball | |
path: /tmp/pdk.tar | |
- name: Tarball timing_scripts | |
run: | | |
tar -cf /tmp/timing-scripts.tar -C ${{ env.TIMING_ROOT }} . | |
- name: Upload timing_scripts Tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: timing-scripts-tarball | |
path: /tmp/timing-scripts.tar | |
- name: Tarball precheck | |
run: | | |
tar -cf /tmp/precheck.tar -C ${{ env.PRECHECK_ROOT }} . | |
- name: Upload precheck Tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: precheck-tarball | |
path: /tmp/precheck.tar | |
hardening: | |
timeout-minutes: 720 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pdk: ["sky130A", "sky130B"] | |
needs: [download_deps] | |
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 ENVIRONMENT VARIABLES | |
run: | | |
echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV | |
echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV | |
echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV | |
echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV | |
echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV | |
echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV | |
echo "MPW_TAG=main" >> $GITHUB_ENV | |
- name: Download PDK Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: pdk-tarball | |
path: /tmp | |
- name: Unpack PDK Tarball | |
run: | | |
sudo mkdir -p ${{ env.PDK_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} | |
tar -xf /tmp/pdk.tar -C $PDK_ROOT . | |
- name: Download openlane Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: openlane-tarball | |
path: /tmp | |
- name: Unpack openlane Tarball | |
run: | | |
sudo mkdir -p ${{ env.OPENLANE_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.OPENLANE_ROOT }} | |
tar -xf /tmp/openlane.tar -C $OPENLANE_ROOT . | |
- name: Harden using Openlane | |
run: | | |
curl https://raw.githubusercontent.com/efabless/central_CI/main/tools.json > tool_versions.json | |
python3 $GITHUB_WORKSPACE/.github/scripts/get_designs.py --design $GITHUB_WORKSPACE | |
for word in $(cat harden_sequence.txt); do | |
echo "CURRENT_DESIGN=${word}" >> $GITHUB_ENV | |
DISABLE_VERSION_CHECK=1 make $word | |
done | |
rm -rf openlane/user_proj_example/runs openlane/user_project_wrapper/runs pdk openlane_src caravel mgmt_core_wrapper timing-scripts mpw_precheck | |
- name: Create reproducible | |
if: failure() | |
run: tar -cf $GITHUB_WORKSPACE/issue_reproducible.tar -C $GITHUB_WORKSPACE/openlane/${{ env.CURRENT_DESIGN }}/runs/${{ env.CURRENT_DESIGN }}/issue_reproducible . | |
- name: upload failure logs | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: openlane-issue-reproducible | |
path: | | |
$GITHUB_WORKSPACE/issue_reproducible.tar | |
- name: Tarball Design_${{ matrix.pdk }} | |
run: | | |
tar -cf /tmp/design_${{ matrix.pdk }}.tar -C $GITHUB_WORKSPACE . | |
- name: Upload Design_${{ matrix.pdk }} Tarball | |
uses: actions/upload-artifact@v2 | |
with: | |
name: design_${{ matrix.pdk }}-tarball | |
path: /tmp/design_${{ matrix.pdk }}.tar | |
RTL-verification: | |
timeout-minutes: 720 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pdk: ["sky130A", "sky130B"] | |
needs: [download_deps] | |
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 ENVIRONMENT VARIABLES | |
run: | | |
echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV | |
echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV | |
echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV | |
echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV | |
echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV | |
echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV | |
echo "MPW_TAG=main" >> $GITHUB_ENV | |
- name: Download PDK Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: pdk-tarball | |
path: /tmp | |
- name: Unpack PDK Tarball | |
run: | | |
sudo mkdir -p ${{ env.PDK_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} | |
tar -xf /tmp/pdk.tar -C $PDK_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: install cocotb | |
run: | | |
DISABLE_VERSION_CHECK=1 make setup-cocotb | |
- name: run RTL verification | |
run: | | |
cd $GITHUB_WORKSPACE/verilog/dv/cocotb && $GITHUB_WORKSPACE/venv-cocotb/bin/caravel_cocotb -tl user_proj_tests/user_proj_tests.yaml -verbosity debug --CI -tag rtl_verification | |
cnt=$(grep -c "failed" "$GITHUB_WORKSPACE/verilog/dv/cocotb/sim/rtl_verification/runs.log") | |
if ! [[ $cnt ]]; then cnt=0; fi | |
if [[ $cnt -eq 1 ]]; then exit 0; fi | |
exit 2 | |
precheck: | |
timeout-minutes: 720 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pdk: ["sky130A", "sky130B"] | |
needs: [hardening] | |
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 ENVIRONMENT VARIABLES | |
run: | | |
echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV | |
echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV | |
echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV | |
echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV | |
echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV | |
echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV | |
echo "MPW_TAG=main" >> $GITHUB_ENV | |
- name: Download PDK Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: pdk-tarball | |
path: /tmp | |
- name: Unpack PDK Tarball | |
run: | | |
sudo mkdir -p ${{ env.PDK_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} | |
tar -xf /tmp/pdk.tar -C $PDK_ROOT . | |
- name: Download precheck Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: precheck-tarball | |
path: /tmp | |
- name: Unpack precheck Tarball | |
run: | | |
sudo mkdir -p ${{ env.PRECHECK_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.PRECHECK_ROOT }} | |
tar -xf /tmp/precheck.tar -C $PRECHECK_ROOT . | |
- name: Download Design_${{ matrix.pdk }} Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: design_${{ matrix.pdk }}-tarball | |
path: /tmp | |
- name: Unpack Design_${{ matrix.pdk }} Tarball | |
run: | | |
sudo mkdir -p $GITHUB_WORKSPACE | |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE | |
tar -xf /tmp/design_${{ matrix.pdk }}.tar -C $GITHUB_WORKSPACE . | |
- name: Run Precheck | |
run: | | |
export INPUT_DIRECTORY=$GITHUB_WORKSPACE | |
export PRECHECK_ROOT=$INPUT_DIRECTORY/mpw_precheck | |
export OUTPUT_DIRECTORY=$INPUT_DIRECTORY/mpw_precheck_result | |
export OUTPUT=$OUTPUT_DIRECTORY/logs/precheck.log | |
export PDKPATH=$PDK_ROOT/sky130A | |
docker run -v "$PRECHECK_ROOT":"$PRECHECK_ROOT" -v "$INPUT_DIRECTORY":"$INPUT_DIRECTORY" -v "${{ env.PDK_ROOT }}":"${{ env.PDK_ROOT }}" -e INPUT_DIRECTORY="$INPUT_DIRECTORY" -e PDK_ROOT="${{ env.PDK_ROOT }}" -e PDKPATH="${{ env.PDKPATH }}" -u $(id -u "$USER"):$(id -g "$USER") efabless/mpw_precheck:latest bash -c "cd $PRECHECK_ROOT; python3 mpw_precheck.py --input_directory $INPUT_DIRECTORY --pdk_path ${{ env.PDKPATH }} --output_directory $OUTPUT_DIRECTORY license makefile consistency xor magic_drc klayout_beol klayout_feol klayout_met_min_ca_density klayout_offgrid klayout_pin_label_purposes_overlapping_drawing klayout_zeroarea lvs" | |
cnt=$(grep -c "All Checks Passed" "$OUTPUT") | |
if ! [[ $cnt ]]; then cnt=0; fi | |
if [[ $cnt -eq 1 ]]; then exit 0; fi | |
exit 2 | |
STA: | |
timeout-minutes: 720 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pdk: ["sky130A"] | |
needs: [hardening] | |
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 ENVIRONMENT VARIABLES | |
run: | | |
echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDKPATH=$GITHUB_WORKSPACE/pdk/${{ matrix.pdk }}" >> $GITHUB_ENV | |
echo "PDK_ROOT=$GITHUB_WORKSPACE/pdk" >> $GITHUB_ENV | |
echo "OPENLANE_ROOT=$GITHUB_WORKSPACE/openlane_src" >> $GITHUB_ENV | |
echo "CARAVEL_ROOT=$GITHUB_WORKSPACE/caravel" >> $GITHUB_ENV | |
echo "MCW_ROOT=$GITHUB_WORKSPACE/mgmt_core_wrapper" >> $GITHUB_ENV | |
echo "TIMING_ROOT=$GITHUB_WORKSPACE/timing-scripts" >> $GITHUB_ENV | |
echo "PRECHECK_ROOT=$GITHUB_WORKSPACE/mpw_precheck" >> $GITHUB_ENV | |
echo "MPW_TAG=main" >> $GITHUB_ENV | |
- name: Download PDK Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: pdk-tarball | |
path: /tmp | |
- name: Unpack PDK Tarball | |
run: | | |
sudo mkdir -p ${{ env.PDK_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }} | |
tar -xf /tmp/pdk.tar -C $PDK_ROOT . | |
- name: Download timing-scripts Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: timing-scripts-tarball | |
path: /tmp | |
- name: Unpack timing-scripts Tarball | |
run: | | |
sudo mkdir -p ${{ env.TIMING_ROOT }} | |
sudo chown -R $USER:$USER ${{ env.TIMING_ROOT }} | |
tar -xf /tmp/timing-scripts.tar -C $TIMING_ROOT . | |
- name: Download Design_${{ matrix.pdk }} Tarball | |
uses: actions/download-artifact@v2 | |
with: | |
name: design_${{ matrix.pdk }}-tarball | |
path: /tmp | |
- name: Unpack Design_${{ matrix.pdk }} Tarball | |
run: | | |
sudo mkdir -p $GITHUB_WORKSPACE | |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE | |
tar -xf /tmp/design_${{ matrix.pdk }}.tar -C $GITHUB_WORKSPACE . | |
- 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 ${{ env.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 ${{ env.MCW_ROOT }} . | |
- name: Run STA | |
run: | | |
curl https://raw.githubusercontent.com/efabless/central_CI/main/tools.json > tool_versions.json | |
export CUP_ROOT=$GITHUB_WORKSPACE | |
export PROJECT_ROOT=$GITHUB_WORKSPACE | |
cd $CUP_ROOT | |
DISABLE_VERSION_CHECK=1 make extract-parasitics | |
DISABLE_VERSION_CHECK=1 make create-spef-mapping | |
DISABLE_VERSION_CHECK=1 make caravel-sta | |
tar -cf /tmp/timing.tar $CUP_ROOT/signoff/caravel/openlane-signoff/timing | |
find $CUP_ROOT/signoff/caravel/openlane-signoff/timing/*/ -name "summary.log" | head -n1 \ | |
| xargs head -n5 | tail -n1 > $CUP_ROOT/signoff/caravel/openlane-signoff/timing/all-summary.rpt | |
find $CUP_ROOT/signoff/caravel/openlane-signoff/timing/*/ -name "summary.log" \ | |
| xargs -I {} bash -c "head -n7 {} | tail -n1" >> $CUP_ROOT/signoff/caravel/openlane-signoff/timing/all-summary.rpt | |
vio=$(grep -c "vio(" $CUP_ROOT/signoff/caravel/openlane-signoff/timing/all-summary.rpt || true) | |
if [[ $vio -gt 0 ]]; | |
then | |
echo "STA violation count: $vio" | |
exit 2 | |
else | |
echo "STA run passed" | |
exit 0 | |
fi |