Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1ae9f9b
inital push for cocotb
Feb 11, 2025
714a50d
update make file with cocotb targets
Feb 12, 2025
e634170
set frigate inside dependencies
Feb 12, 2025
7fd05fd
add ci to test make setup
kareefardi Feb 12, 2025
763d2ef
run internal make setup
kareefardi Feb 12, 2025
ebd078d
use ssh for frigate-os-dev
kareefardi Feb 13, 2025
46cdc11
use open source frigate
Feb 16, 2025
6cf337c
run make setup
kareefardi Feb 16, 2025
b679e56
change frigate branch to main
kareefardi Feb 16, 2025
432f853
test ci
kareefardi Feb 17, 2025
5867d33
some renames
Feb 19, 2025
dcb6117
run rtl Verification
kareefardi Feb 19, 2025
7fabe53
print log
kareefardi Feb 19, 2025
5453965
export GITHUB_TOKEN for volare
kareefardi Feb 19, 2025
2e07a7f
Add CI to caravel_cocotb command to run in CI using makefile
Feb 19, 2025
f8c984e
Merge branch 'cocotb' of github.com:efabless/frigate-upw-example into…
Feb 19, 2025
0937730
setup cache
kareefardi Feb 19, 2025
f7012a2
updates
kareefardi Feb 19, 2025
64099be
make from FRIGATE_ROOT
kareefardi Feb 19, 2025
7c59d36
fixes
kareefardi Feb 19, 2025
5e56c21
export GITHUB_TOKEN
kareefardi Feb 19, 2025
9cee49c
pass GITHUB_TOKEN as input
kareefardi Feb 19, 2025
a0b6d68
optimizations
kareefardi Feb 19, 2025
f31602f
remove uneeded commands
kareefardi Feb 19, 2025
e9f29d8
install nix and run openlane
kareefardi Feb 19, 2025
60f2868
specify version
kareefardi Feb 19, 2025
ae98c45
install the manual way
kareefardi Feb 19, 2025
f735d2a
Add user_proj_tests_gl.yaml and point to gen_default script
Feb 19, 2025
d4d1a15
tmp disable ci
kareefardi Feb 19, 2025
c57c4c4
Merge branch 'main' into cocotb
passant5 Feb 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/actions/setup-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: 'Setup Dependencies'
description: 'Manage Common Dependencies Installation'
inputs:
cache-only:
required: false
type: boolean
default: false
github-token:
type: string
runs:
using: "composite"
steps:
- name: Set env
shell: bash
run: |
echo "BASE_DIR=$GITHUB_WORKSPACE" >> "$GITHUB_ENV"
echo "FRIGATE_ROOT=$(make echo-var VAR=FRIGATE_ROOT)" >> $GITHUB_ENV
echo "MGMT_ROOT=$(make echo-var VAR=MGMT_ROOT)" >> $GITHUB_ENV
echo "PDK_ROOT=$(make echo-var VAR=PDK_ROOT)" >> $GITHUB_ENV
echo "PDK=sky130A" >> $GITHUB_ENV
echo "FRIGATE_BRANCH=$(make echo-var VAR=FRIGATE_BRANCH)" >> $GITHUB_ENV
echo "MGMT_BRANCH=$(make echo-var VAR=MGMT_BRANCH)" >> $GITHUB_ENV
echo "OPEN_PDKS_COMMIT=$(make echo-var VAR=OPEN_PDKS_COMMIT)" >> $GITHUB_ENV
- name: Cache FRIGATE
id: cache-FRIGATE
uses: actions/cache/restore@v4
with:
path: ${{env.FRIGATE_ROOT}}
key: FRIGATE-${{env.FRIGATE_BRANCH}}
enableCrossOsArchive: "true"
- name: Cache mgmt
id: cache-mgmt
uses: actions/cache/restore@v4
with:
path: ${{env.MGMT_ROOT}}
key: mgmt-${{env.MGMT_BRANCH}}
enableCrossOsArchive: "true"
- name: Cache PDK
id: cache-pdk
uses: actions/cache/restore@v4
with:
path: ${{env.PDK_ROOT}}
key: pdk-${{env.OPEN_PDKS_COMMIT}}
enableCrossOsArchive: "true"
- name: Download FRIGATE
shell: bash
if: ${{ steps.cache-FRIGATE.outputs.cache-hit != 'true' && inputs.cache-only != 'true' }}
run: |
make install-frigate
- name: Download mgmt
shell: bash
if: ${{ steps.cache-mgmt.outputs.cache-hit != 'true' && inputs.cache-only != 'true' }}
run: |
make -C ${{ env.FRIGATE_ROOT }} install-mcw
- name: Download PDK
shell: bash
if: ${{ steps.cache-pdk.outputs.cache-hit != 'true' && inputs.cache-only != 'true' }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
mkdir -p ${{ env.PDK_ROOT }}
make pdk-with-volare
cd ${{ env.PDK_ROOT }}
- name: Save Cache FRIGATE
if: ${{ steps.cache-FRIGATE.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ${{env.FRIGATE_ROOT}}
key: FRIGATE-${{env.FRIGATE_BRANCH}}
- name: Save Cache mgmt
if: ${{ steps.cache-mgmt.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ${{env.MGMT_ROOT}}
key: mgmt-${{env.MGMT_BRANCH}}
- name: Save Cache PDK
if: ${{ steps.cache-pdk.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ${{env.PDK_ROOT}}
key: pdk-${{env.OPEN_PDKS_COMMIT}}
35 changes: 35 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Run All
on:
push:
workflow_dispatch:

jobs:
Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-dependencies
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
# - name: Setup Dependencies
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# make setup
# - name: Run RTL Verification
# env:
# COCOTB_ARGS: "--CI -verbosity debug"
# run: |
# make cocotb-verify-all-rtl
# - name: Debug
# if: always()
# run: |
# cat ./verilog/dv/cocotb/sim/*/*/*.log
# - name: Install nix
# run: |
# curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm --extra-conf "
# extra-substituters = https://openlane.cachix.org
# extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
# "
# - name: Run OpenLane
# run: make user_project_wrapper
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
frigate/
venv/
venv-cocotb/
56 changes: 37 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#
# SPDX-License-Identifier: Apache-2.0
MAKEFLAGS+=--warn-undefined-variables
export FRIGATE_ROOT?=$(PWD)/frigate
export FRIGATE_ROOT?=$(PWD)/dependencies/frigate
export FRIGATE_REPO_URL?=https://github.com/efabless/frigate-os.git
export FRIGATE_BRANCH?=main
export MGMT_ROOT?=$(PWD)/dependencies/caravel_mgmt_soc
export MGMT_ROOT?=$(FRIGATE_ROOT)/dependencies/caravel_mgmt_soc
export MGMT_REPO_URL?=https://github.com/efabless/caravel_mgmt_soc_litex.git
export MGMT_BRANCH?=Add_newfill
export PDK_ROOT?=$(PWD)/dependencies/pdks
Expand All @@ -34,7 +34,8 @@ export PDK?=sky130A
export PDKPATH?=$(PDK_ROOT)/$(PDK)

.PHONY: setup
setup: check_dependencies install-mgmt install-frigate pdk-with-volare setup-cocotb
setup: check_dependencies install-frigate pdk-with-volare setup-cocotb


.PHONY: check_dependencies
check_dependencies:
Expand All @@ -58,34 +59,32 @@ install-volare:
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir pip
./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir volare

# Include mgmt
.PHONY: install-mgmt
install-mgmt:
if [ -d "$(MGMT_ROOT)" ]; then\
MAKE_DIR="$(PWD)"; \
echo "Updating $(MGMT_ROOT)"; \
cd $(MGMT_ROOT) && \
git checkout $(MGMT_BRANCH) && git pull; \
cd "$$MAKE_DIR"; \
else \
echo "Cloning $(MGMT_REPO_URL) -b $(MGMT_BRANCH)"; \
git clone -b $(MGMT_BRANCH) $(MGMT_REPO_URL) $(MGMT_ROOT) --depth=1 --single-branch; \
fi

# Include frigate
.PHONY: install-frigate
install-frigate:
if [ -d "$(FRIGATE_ROOT)" ]; then\
MAKE_DIR="$(PWD)"; \
echo "Updating $(FRIGATE_ROOT)"; \
cd $(FRIGATE_ROOT) && \
git checkout $(FRIGATE_BRANCH) && git pull; \
git checkout $(FRIGATE_BRANCH) && git pull && \
make install-repos; \
cd "$$MAKE_DIR"; \
else \
echo "Cloning $(FRIGATE_REPO_URL) -b $(FRIGATE_BRANCH)"; \
git clone -b $(FRIGATE_BRANCH) $(FRIGATE_REPO_URL) $(FRIGATE_ROOT) --depth=1 --single-branch; \
cd $(FRIGATE_ROOT) && \
make install-repos; \
cd "$$MAKE_DIR"; \
fi

dv_patterns=$(shell cd verilog/dv && find * -maxdepth 0 -type d)
cocotb-dv_patterns=$(shell cd verilog/dv/cocotb && find . -name "*.c" | sed -e 's|^.*/||' -e 's/.c//')
dv-targets-rtl=$(dv_patterns:%=verify-%-rtl)
cocotb-dv-targets-rtl=$(cocotb-dv_patterns:%=cocotb-verify-%-rtl)
dv-targets-gl=$(dv_patterns:%=verify-%-gl)
cocotb-dv-targets-gl=$(cocotb-dv_patterns:%=cocotb-verify-%-gl)
dv-targets-gl-sdf=$(dv_patterns:%=verify-%-gl-sdf)

.PHONY: install-caravel-cocotb
install-caravel-cocotb:
rm -rf ./venv-cocotb
Expand All @@ -97,6 +96,20 @@ install-caravel-cocotb:
setup-cocotb-env:
@(python3 $(PROJECT_ROOT)/verilog/dv/setup-cocotb.py $(FRIGATE_ROOT) $(MGMT_ROOT) $(PDK_ROOT) $(PDK) $(PROJECT_ROOT))

.PHONY: cocotb-verify-all-rtl
cocotb-verify-all-rtl:
@(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -tl user_proj_tests/user_proj_tests.yaml -gen_defaults_dir ./../../../dependencies/frigate $(COCOTB_ARGS) )

.PHONY: cocotb-verify-all-gl
cocotb-verify-all-gl:
@(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -tl user_proj_tests/user_proj_tests_gl.yaml -sim GL -gen_defaults_dir ./../../../dependencies/frigate $(COCOTB_ARGS))

$(cocotb-dv-targets-rtl): cocotb-verify-%-rtl:
@(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -t $* $(COCOTB_ARGS))

$(cocotb-dv-targets-gl): cocotb-verify-%-gl:
@(cd $(PROJECT_ROOT)/verilog/dv/cocotb && $(PROJECT_ROOT)/venv-cocotb/bin/caravel_cocotb -t $* -sim GL $(COCOTB_ARGS))

# Install cocotb docker
.PHONY: simenv-cocotb
simenv-cocotb:
Expand Down Expand Up @@ -206,4 +219,9 @@ $(designs) : % : $(PROJECT_ROOT)/openlane/%/config.yaml
sh $(PROJECT_ROOT)/openlane/copy_views.sh $(PROJECT_ROOT) $* $(OPENLANE2_RUN_TAG)

.PHONY: harden
harden: $(designs)
harden: $(designs)

.PHONY: clean
clean:
rm -rf dependencies
rm -rf $(FRIGATE_ROOT)
20 changes: 20 additions & 0 deletions verilog/dv/cocotb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
design_info.yaml
*.log
sim_build
sim
*.
./wb_models/housekeepingWB/__pycache__
*.xml
*.yml
*.hex*
*.elf
AN.DB
includes.v
*.lst

# Python
__pycache__
/build
/venv
/dist
/*.egg-info
1 change: 1 addition & 0 deletions verilog/dv/cocotb/cocotb_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from frigate_test.gpio_portA.gpio_portA import gpio_portA
Loading