Skip to content

Commit

Permalink
Merge branch 'main' into cocotb
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy authored Dec 11, 2024
2 parents f81d9f7 + 8a1fa21 commit 76a3f87
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 190 deletions.
187 changes: 97 additions & 90 deletions .github/workflows/user_project_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,100 @@ on:
workflow_dispatch:

jobs:
mpw_precheck_sky130A:
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 PDK ROOT
run: |
echo "PDK_ROOT=/home/runner/work/pdk" >> $GITHUB_ENV
- name: Export PDKPATH
run: echo "PDKPATH=/home/runner/work/pdk/sky130A" >> $GITHUB_ENV

- name: Download PDK
run: |
MPW_TAG=main CARAVEL_LITE=0 make install
make pdk-with-volare
- name: Run MPW-Precheck
run: |
export INPUT_DIRECTORY=$(pwd)
export PRECHECK_ROOT=$INPUT_DIRECTORY/mpw_precheck
export OUTPUT_DIRECTORY=$INPUT_DIRECTORY/mpw_precheck_result
export OUTPUT=$OUTPUT_DIRECTORY/logs/precheck.log
git clone --depth=1 -b mpw-7a https://github.com/efabless/mpw_precheck.git
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"
cnt=$(grep -c "All Checks Passed" "$OUTPUT")
if ! [[ $cnt ]]; then cnt=0; fi
if [[ $cnt -eq 1 ]]; then exit 0; fi
exit 2
- name: upload failure logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: error
path: |
/home/runner/work/caravel_user_project/caravel_user_project/mpw_precheck_result/logs/*
mpw_precheck_sky130B:
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 PDK ROOT
run: |
echo "PDK_ROOT=/home/runner/work/pdk" >> $GITHUB_ENV
- name: Export PDKPATH
run: echo "PDKPATH=/home/runner/work/pdk/sky130B" >> $GITHUB_ENV

- name: Download PDK
run: |
MPW_TAG=main CARAVEL_LITE=0 make install
make pdk-with-volare
- name: Run MPW-Precheck
run: |
export INPUT_DIRECTORY=$(pwd)
export PRECHECK_ROOT=$INPUT_DIRECTORY/mpw_precheck
export OUTPUT_DIRECTORY=$INPUT_DIRECTORY/mpw_precheck_result
export OUTPUT=$OUTPUT_DIRECTORY/logs/precheck.log
git clone --depth=1 -b mpw-7a https://github.com/efabless/mpw_precheck.git
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"
cnt=$(grep -c "All Checks Passed" "$OUTPUT")
if ! [[ $cnt ]]; then cnt=0; fi
if [[ $cnt -eq 1 ]]; then exit 0; fi
exit 2
- name: upload failure logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: error
path: |
/home/runner/work/caravel_user_project/caravel_user_project/mpw_precheck_result/logs/*
build-pdk:
runs-on: ubuntu-latest
name: Build and Cache PDK
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 "PDK_ROOT=/home/runner/work/pdk" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo mkdir -p ${{ env.PDK_ROOT }}
sudo chown -R $USER:$USER ${{ env.PDK_ROOT }}
make install
make pdk-with-volare
- name: Tarball PDK
run: |
tar -cf /tmp/pdk.tar -C $PDK_ROOT .
- name: Upload PDK Tarball
uses: actions/upload-artifact@v2
with:
name: pdk-tarball
path: /tmp/pdk.tar

user_project_flow:
timeout-minutes: 720
runs-on: ubuntu-latest
strategy:
matrix:
pdk: ["sky130A", "sky130B"]
needs: [build-pdk]
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 "PDK_ROOT=/home/runner/work/pdk" >> $GITHUB_ENV
echo "PDK=${{ matrix.pdk }}" >> $GITHUB_ENV
echo "PDKPATH=/home/runner/work/pdk/${{ matrix.pdk }}" >> $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: Install Dependencies
run: |
make install
make install_mcw
- name: Run Precheck
run: |
export INPUT_DIRECTORY=$(pwd)
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
git clone --depth=1 https://github.com/efabless/mpw_precheck.git
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
- name: Upload Failure Logs
if: failure()
uses: actions/upload-artifact@v2
with:
name: error
path: |
/home/runner/work/caravel_user_project_analog/caravel_user_project_analog/mpw_precheck_result/logs/*
29 changes: 26 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ PRECHECK_ROOT?=${HOME}/mpw_precheck
SIM ?= RTL
CUP_ROOT?=$(PWD)

export OPEN_PDKS_COMMIT?=e6f9c8876da77220403014b116761b0b2d79aab4
SKYWATER_COMMIT=f70d8ca46961ff92719d8870a18a076370b85f6c
export OPEN_PDKS_COMMIT?=6d4d11780c40b20ee63cc98e645307a9bf2b2ab8
export PDK?=sky130A
export PDKPATH?=$(PDK_ROOT)/$(PDK)
# Install lite version of caravel, (1): caravel-lite, (0): caravel
CARAVEL_LITE?=1

MPW_TAG ?= mpw-9d
MPW_TAG ?= 2024.09.12-1
export PDK_ROOT?=$(PWD)/dependencies/pdks

ifeq ($(CARAVEL_LITE),1)
CARAVEL_NAME := caravel-lite
Expand Down Expand Up @@ -72,6 +74,9 @@ BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d)
$(BLOCKS): %:
cd openlane && $(MAKE) $*

.PHONY: setup
setup: check_dependencies install check-env install_mcw pdk-with-volare setup-timing-scripts setup-cocotb

# Install caravel
.PHONY: install
install:
Expand Down Expand Up @@ -101,7 +106,7 @@ $(LVS_BLOCKS): lvs-% : ./lvs/%/lvs_config.json uncompress check-pdk check-preche
# Update Caravel
.PHONY: update_caravel
update_caravel: check-caravel
cd $(CARAVEL_ROOT)/ && git checkout $(CARAVEL_TAG) && git pull
cd $(CARAVEL_ROOT)/ && git checkout $(CARAVEL_TAG) && git pull origin $(CARAVEL_TAG)

# Uninstall Caravel
.PHONY: uninstall
Expand Down Expand Up @@ -176,3 +181,21 @@ check-pdk:
help:
cd $(CARAVEL_ROOT) && $(MAKE) help
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'

.PHONY: check_dependencies
check_dependencies:
@if [ ! -d "$(PWD)/dependencies" ]; then \
mkdir $(PWD)/dependencies; \
fi

.PHONY: setup-timing-scripts
setup-timing-scripts: $(TIMING_ROOT)
@( cd $(TIMING_ROOT) && git pull )
@#( cd $(TIMING_ROOT) && git fetch && git checkout $(MPW_TAG); )

.PHONY: setup-cocotb
setup-cocotb:
@pip install caravel-cocotb==1.0.0
@(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
62 changes: 32 additions & 30 deletions lvs/user_analog_project_wrapper/lvs_config.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
{
"TOP_SOURCE": "user_analog_project_wrapper",
"TOP_LAYOUT": "$TOP_SOURCE",
"EXTRACT_FLATGLOB": [
""
],
"EXTRACT_ABSTRACT": [
"*__fill_*",
"*__fakediode_*",
"*__tapvpwrvgnd_*"
],
"LVS_FLATTEN": [
""
],
"LVS_NOFLATTEN": [
""
],
"LVS_IGNORE": [
""
],
"LVS_SPICE_FILES": [
"$PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hd/spice/sky130_ef_sc_hd__decap_12.spice",
"$PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hd/spice/sky130_fd_sc_hd.spice",
"$PDK_ROOT/$PDK/libs.ref/sky130_fd_sc_hvl/spice/sky130_fd_sc_hvl.spice",
"$UPRJ_ROOT/xschem/user_analog_project_wrapper.spice"
],
"LVS_VERILOG_FILES": [
""
],
"LAYOUT_FILE": "$UPRJ_ROOT/gds/$TOP_LAYOUT.gds"
}
"STD_CELL_LIBRARY": "sky130_fd_sc_hvl",
"INCLUDE_CONFIGS": [
"$LVS_ROOT/tech/$PDK/lvs_config.base.json"
],
"TOP_SOURCE": "user_analog_project_wrapper",
"TOP_LAYOUT": "$TOP_SOURCE",
"EXTRACT_FLATGLOB": [
""
],
"EXTRACT_ABSTRACT": [
""
],
"LVS_FLATTEN": [
""
],
"LVS_NOFLATTEN": [
""
],
"LVS_IGNORE": [
""
],
"LVS_SPICE_FILES_TO_FIX": [
"$UPRJ_ROOT/xschem/user_analog_project_wrapper.spice"
],
"LVS_SPICE_FILES": [
""
],
"LVS_VERILOG_FILES": [
""
],
"LAYOUT_FILE": "$UPRJ_ROOT/gds/user_analog_project_wrapper.gds"
}
4 changes: 2 additions & 2 deletions verilog/dv/mprj_por/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ hex: ${PATTERN:=.hex}
%.vvp: %_tb.v %.hex
ifeq ($(SIM),RTL)
iverilog $(SIM_DEFINES) -I $(PDK_PATH) \
-I $(CARAVEL_BEHAVIOURAL_MODELS) -I $(CARAVEL_RTL_PATH) \
-I $(UPRJ_BEHAVIOURAL_MODELS) -I $(UPRJ_RTL_PATH) -I $(MCW_ROOT)/verilog/rtl \
-I $(CARAVEL_BEHAVIOURAL_MODELS) -I $(CARAVEL_RTL_PATH) -I $(MCW_ROOT)/verilog/rtl \
-I $(UPRJ_BEHAVIOURAL_MODELS) -I $(UPRJ_RTL_PATH) \
$< -o $@
else
iverilog $(SIM_DEFINES) -DGL -I $(PDK_PATH) \
Expand Down
Loading

0 comments on commit 76a3f87

Please sign in to comment.