diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index b0eccaa7e..1e6b1b9ce 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -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-caravel-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 @@ -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: @@ -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 simenv + 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: | @@ -117,18 +205,14 @@ 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 verify-io_ports-rtl - make verify-la_test1-rtl - make verify-la_test2-rtl - make verify-mprj_stimulus-rtl - make verify-wb_port-rtl - - # - name: Run DV GL tests - # run: | - # make verify-io_ports-gl - # make verify-la_test1-gl - # make verify-la_test2-gl - # make verify-mprj_stimulus-gl - # make verify-wb_port-gl + make cocotb-verify-all-rtl + + - name: Run DV GL tests + run: | + make cocotb-verify-all-gl diff --git a/Makefile b/Makefile index 16dba0dc5..3559fbc1f 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,8 @@ export PDK?=sky130A #export PDK?=gf180mcuC export PDKPATH?=$(PDK_ROOT)/$(PDK) +PYTHON_BIN ?= python3 + ROOTLESS ?= 0 USER_ARGS = -u $$(id -u $$USER):$$(id -g $$USER) ifeq ($(ROOTLESS), 1) @@ -106,6 +108,11 @@ install: simenv: docker pull efabless/dv:latest +# Install cocotb docker +.PHONY: simenv-cocotb +simenv-cocotb: + docker pull efabless/dv:cocotb + .PHONY: setup setup: check_dependencies install check-env install_mcw openlane pdk-with-volare setup-timing-scripts setup-cocotb precheck @@ -116,8 +123,12 @@ $(blocks): % : $(MAKE) -C openlane $* 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//') +$(info VAR1 is $(cocotb-dv_patterns)) 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) TARGET_PATH=$(shell pwd) @@ -322,20 +333,33 @@ 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 +.PHONY: install-caravel-cocotb +install-caravel-cocotb: + rm -rf ./venv + $(PYTHON_BIN) -m venv ./venv + ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir pip + ./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir caravel-cocotb + +.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: cocotb-verify-rtl -cocotb-verify-rtl: - @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl counter_tests/counter_tests.yaml -v ) +.PHONY: setup-cocotb +setup-cocotb: install-caravel-cocotb setup-cocotb-env simenv-cocotb + +.PHONY: cocotb-verify-all-rtl +cocotb-verify-all-rtl: + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl user_proj_tests/user_proj_tests.yaml ) + +.PHONY: cocotb-verify-all-gl +cocotb-verify-all-gl: + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl user_proj_tests/user_proj_tests_gl.yaml -verbosity quiet) + +$(cocotb-dv-targets-rtl): cocotb-verify-%-rtl: + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -t $* ) -.PHONY: cocotb-verify-gl -cocotb-verify-gl: - @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl counter_tests/counter_tests_gl.yaml -v -verbosity quiet) +$(cocotb-dv-targets-gl): cocotb-verify-%-gl: + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -t $* -verbosity quiet) ./verilog/gl/user_project_wrapper.v: $(error you don't have $@) diff --git a/docs/source/index.rst b/docs/source/index.rst index 090774539..0eaace1e3 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -96,12 +96,12 @@ Starting your project make setup -* This command will setup your environment by installing the following + * This command will setup your environment by installing the following - - caravel_lite (a lite version of caravel) - - management core for simulation - - openlane to harden your design - - pdk + - caravel_lite (a lite version of caravel) + - management core for simulation + - openlane to harden your design + - pdk #. Now you can start hardening your design @@ -148,6 +148,30 @@ Starting your project # for example make verify-io_ports-rtl +#. Run cocotb simulation on your design + + * You need to include your rtl/gl/gl+sdf files in ``verilog/includes/includes..caravel_user_project`` + + * To make sure the cocotb flow works, run the following commands for testing the counter example + + .. code:: bash + # To run all tests in user_project_tests list found at ``verilog/dv/cocotb/user_project_tests/user_project_tests.yaml`` + # RTL tests + make cocotb-verify-all-rtl + + # OR GL simulation using + make cocotb-verify-all-gl + + # To run any test under ``verilog/dv/cocotb/*`` + # RTL + make cocotb-verify--rtl + # GL + make cocotb-verify--gl + + * To run cocotb tests on your design, Follow the steps below + * Add cocotb tests under ``verilog/dv/cocotb`` follow steps at `Adding_cocotb_test `_ + * Run cocotb tests using ``caravel_cocotb`` command steps at `Running_cocotb_tests `_ + #. Run opensta on your design * Extract spefs for ``user_project_wrapper`` and macros inside it: @@ -168,7 +192,7 @@ Starting your project make caravel-sta - **NOTE:** To update timing scripts run ``make setup-timing-scripts`` + **NOTE:** To update timing scripts run ``make setup-timing-scripts`` #. Run standalone LVS @@ -176,7 +200,7 @@ Starting your project make lvs- # macro is the name of the macro you want to run LVS on - **NOTE:** You have to create a new config file for each macro under ``lvs//lvs_config.json`` + **NOTE:** You have to create a new config file for each macro under ``lvs//lvs_config.json`` #. Run the precheck locally diff --git a/verilog/dv/cocotb/cocotb_tests.py b/verilog/dv/cocotb/cocotb_tests.py index 4c676ec58..1a6d5b1a8 100644 --- a/verilog/dv/cocotb/cocotb_tests.py +++ b/verilog/dv/cocotb/cocotb_tests.py @@ -1,7 +1,23 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + from hello_world.hello_world import hello_world from hello_world_uart.hello_world_uart import hello_world_uart -from counter_tests.counter_wb.counter_wb import counter_wb -from counter_tests.counter_la.counter_la import counter_la -from counter_tests.counter_la_reset.counter_la_reset import counter_la_reset -from counter_tests.counter_la_clk.counter_la_clk import counter_la_clk +from user_proj_tests.counter_wb.counter_wb import counter_wb +from user_proj_tests.counter_la.counter_la import counter_la +from user_proj_tests.counter_la_reset.counter_la_reset import counter_la_reset +from user_proj_tests.counter_la_clk.counter_la_clk import counter_la_clk from gpio_test.gpio_test import gpio_test diff --git a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml b/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml deleted file mode 100644 index ad7732660..000000000 --- a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# Yalm file contain general design information that would mostly need to be updated in the first run only - -Tests: - - {name: counter_la, sim: RTL} - - diff --git a/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.yaml b/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.yaml deleted file mode 100644 index 9efc3831c..000000000 --- a/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Yalm file contain general design information that would mostly need to be updated in the first run only -Tests: - - {name: counter_la_clk, sim: RTL} - - diff --git a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.yaml b/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.yaml deleted file mode 100644 index 08be1c56b..000000000 --- a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Yalm file contain general design information that would mostly need to be updated in the first run only -Tests: - - {name: counter_la_reset, sim: RTL} - - diff --git a/verilog/dv/cocotb/counter_tests/counter_tests.yaml b/verilog/dv/cocotb/counter_tests/counter_tests.yaml deleted file mode 100644 index 9ef25837f..000000000 --- a/verilog/dv/cocotb/counter_tests/counter_tests.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# yaml file contain general design information that would mostly need to be updated in the first run only -includes: - - counter_la/counter_la.yaml - - counter_wb/counter_wb.yaml - - counter_la_reset/counter_la_reset.yaml - - counter_la_clk/counter_la_clk.yaml - - diff --git a/verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml b/verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml deleted file mode 100644 index 4019756d0..000000000 --- a/verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# yaml file contain general design information that would mostly need to be updated in the first run only -Tests: - - {name: counter_wb, sim: GL} - - {name: counter_la, sim: GL} - - {name: counter_la_reset, sim: GL} - - {name: counter_la_clk, sim: GL} - diff --git a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml b/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml deleted file mode 100644 index 705fba77d..000000000 --- a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Yalm file contain general design information that would mostly need to be updated in the first run only -Tests: - - {name: counter_wb, sim: RTL} - - diff --git a/verilog/dv/cocotb/design_info.yaml b/verilog/dv/cocotb/design_info.yaml index b4abb868f..e4ff57bde 100644 --- a/verilog/dv/cocotb/design_info.yaml +++ b/verilog/dv/cocotb/design_info.yaml @@ -1,3 +1,20 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + # yaml file contain general design information that would mostly need to be updated in the first run only #eg CARAVEL_ROOT: "/usr/Desktop/caravel_project/caravel/" diff --git a/verilog/dv/cocotb/gpio_test/gpio_test.c b/verilog/dv/cocotb/gpio_test/gpio_test.c index 0f0f073d1..4f7bd6a1f 100644 --- a/verilog/dv/cocotb/gpio_test/gpio_test.c +++ b/verilog/dv/cocotb/gpio_test/gpio_test.c @@ -1,3 +1,22 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 + + + + #include // include required APIs void main(){ // Enable managment gpio as output to use as indicator for finishing configuration diff --git a/verilog/dv/cocotb/gpio_test/gpio_test.py b/verilog/dv/cocotb/gpio_test/gpio_test.py index 7ca15952c..d0d46abb1 100644 --- a/verilog/dv/cocotb/gpio_test/gpio_test.py +++ b/verilog/dv/cocotb/gpio_test/gpio_test.py @@ -1,3 +1,21 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + from caravel_cocotb.caravel_interfaces import * # import python APIs import cocotb diff --git a/verilog/dv/cocotb/hello_world/hello_world.c b/verilog/dv/cocotb/hello_world/hello_world.c index c6526b824..68d1a30af 100644 --- a/verilog/dv/cocotb/hello_world/hello_world.c +++ b/verilog/dv/cocotb/hello_world/hello_world.c @@ -1,3 +1,21 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 + + + #include void main(){ return; diff --git a/verilog/dv/cocotb/hello_world/hello_world.py b/verilog/dv/cocotb/hello_world/hello_world.py index 3618d49c0..63cae38fe 100644 --- a/verilog/dv/cocotb/hello_world/hello_world.py +++ b/verilog/dv/cocotb/hello_world/hello_world.py @@ -1,3 +1,21 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + from caravel_cocotb.caravel_interfaces import test_configure from caravel_cocotb.caravel_interfaces import report_test import cocotb diff --git a/verilog/dv/cocotb/hello_world/hello_world.yaml b/verilog/dv/cocotb/hello_world/hello_world.yaml index bd6165dc2..2d81a3593 100644 --- a/verilog/dv/cocotb/hello_world/hello_world.yaml +++ b/verilog/dv/cocotb/hello_world/hello_world.yaml @@ -1,4 +1,22 @@ ---- +# --- +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + # Yalm file contain general design information that would mostly need to be updated in the first run only # example ## tests: [debug,clock_redirect] diff --git a/verilog/dv/cocotb/hello_world_uart/hello_world_uart.c b/verilog/dv/cocotb/hello_world_uart/hello_world_uart.c index 098a6d7da..4d370580c 100644 --- a/verilog/dv/cocotb/hello_world_uart/hello_world_uart.c +++ b/verilog/dv/cocotb/hello_world_uart/hello_world_uart.c @@ -1,3 +1,21 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 + + + #include void main(){ diff --git a/verilog/dv/cocotb/hello_world_uart/hello_world_uart.py b/verilog/dv/cocotb/hello_world_uart/hello_world_uart.py index 66ab6d88b..baabca1d9 100644 --- a/verilog/dv/cocotb/hello_world_uart/hello_world_uart.py +++ b/verilog/dv/cocotb/hello_world_uart/hello_world_uart.py @@ -1,3 +1,21 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + from caravel_cocotb.caravel_interfaces import test_configure from caravel_cocotb.caravel_interfaces import report_test import cocotb diff --git a/verilog/dv/cocotb/hello_world_uart/hello_world_uart.yaml b/verilog/dv/cocotb/hello_world_uart/hello_world_uart.yaml index 37d5fd1c2..b231d9b40 100644 --- a/verilog/dv/cocotb/hello_world_uart/hello_world_uart.yaml +++ b/verilog/dv/cocotb/hello_world_uart/hello_world_uart.yaml @@ -1,4 +1,21 @@ ---- +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + # Yalm file contain general design information that would mostly need to be updated in the first run only Tests: diff --git a/verilog/dv/cocotb/counter_tests/README.md b/verilog/dv/cocotb/user_proj_tests/README.md similarity index 100% rename from verilog/dv/cocotb/counter_tests/README.md rename to verilog/dv/cocotb/user_proj_tests/README.md diff --git a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.c b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.c similarity index 62% rename from verilog/dv/cocotb/counter_tests/counter_la/counter_la.c rename to verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.c index 2bcab5b89..f43164dc6 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.c +++ b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.c @@ -1,3 +1,19 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 + #include void main(){ diff --git a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.py b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.py similarity index 72% rename from verilog/dv/cocotb/counter_tests/counter_la/counter_la.py rename to verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.py index f9e94db45..19c567ffb 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.py +++ b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.py @@ -1,3 +1,19 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + from caravel_cocotb.caravel_interfaces import test_configure from caravel_cocotb.caravel_interfaces import report_test import cocotb diff --git a/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.yaml b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.yaml new file mode 100644 index 000000000..ab86628c2 --- /dev/null +++ b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.yaml @@ -0,0 +1,22 @@ +--- +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 +# Yalm file contain general design information that would mostly need to be updated in the first run only + +Tests: + - {name: counter_la, sim: RTL} + + diff --git a/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.c b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.c similarity index 66% rename from verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.c rename to verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.c index 3b7be61a8..2991ec3bb 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.c +++ b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.c @@ -1,3 +1,18 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 #include void main(){ diff --git a/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.py b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.py similarity index 66% rename from verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.py rename to verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.py index f3b50e2e6..8fd853527 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.py +++ b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.py @@ -1,3 +1,18 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 from caravel_cocotb.caravel_interfaces import test_configure from caravel_cocotb.caravel_interfaces import report_test import cocotb diff --git a/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.yaml b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.yaml new file mode 100644 index 000000000..2c2278f60 --- /dev/null +++ b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.yaml @@ -0,0 +1,21 @@ +--- +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 +# Yalm file contain general design information that would mostly need to be updated in the first run only +Tests: + - {name: counter_la_clk, sim: RTL} + + diff --git a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.c b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.c similarity index 64% rename from verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.c rename to verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.c index 220aa0724..7a58c3cf4 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.c +++ b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.c @@ -1,3 +1,18 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 #include void main(){ diff --git a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.py b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.py similarity index 75% rename from verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.py rename to verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.py index 5ec0a0b97..cfe8a5838 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.py +++ b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.py @@ -1,3 +1,19 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + from caravel_cocotb.caravel_interfaces import test_configure from caravel_cocotb.caravel_interfaces import report_test import cocotb diff --git a/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.yaml b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.yaml new file mode 100644 index 000000000..38110352b --- /dev/null +++ b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.yaml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + +# Yalm file contain general design information that would mostly need to be updated in the first run only +Tests: + - {name: counter_la_reset, sim: RTL} + + diff --git a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.c b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.c similarity index 57% rename from verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.c rename to verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.c index 536527ebc..280c7e21b 100644 --- a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.c +++ b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.c @@ -1,3 +1,21 @@ +// SPDX-FileCopyrightText: 2023 Efabless Corporation + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 + +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// SPDX-License-Identifier: Apache-2.0 + + + #include void main(){ diff --git a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.py b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.py similarity index 80% rename from verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.py rename to verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.py index 636adeba0..f2efa5865 100644 --- a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.py +++ b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.py @@ -1,3 +1,23 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + + + from caravel_cocotb.caravel_interfaces import test_configure from caravel_cocotb.caravel_interfaces import report_test import cocotb diff --git a/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.yaml b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.yaml new file mode 100644 index 000000000..894e0a338 --- /dev/null +++ b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.yaml @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + +# Yalm file contain general design information that would mostly need to be updated in the first run only +Tests: + - {name: counter_wb, sim: RTL} + + diff --git a/verilog/dv/cocotb/user_proj_tests/user_proj_tests.yaml b/verilog/dv/cocotb/user_proj_tests/user_proj_tests.yaml new file mode 100644 index 000000000..06c03308d --- /dev/null +++ b/verilog/dv/cocotb/user_proj_tests/user_proj_tests.yaml @@ -0,0 +1,25 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + + +# yaml file contain general design information that would mostly need to be updated in the first run only +Tests: + - {name: counter_wb, sim: RTL} + - {name: counter_la, sim: RTL} + - {name: counter_la_reset, sim: RTL} + - {name: counter_la_clk, sim: RTL} diff --git a/verilog/dv/cocotb/user_proj_tests/user_proj_tests_gl.yaml b/verilog/dv/cocotb/user_proj_tests/user_proj_tests_gl.yaml new file mode 100644 index 000000000..8b00b9323 --- /dev/null +++ b/verilog/dv/cocotb/user_proj_tests/user_proj_tests_gl.yaml @@ -0,0 +1,26 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + + + + +# yaml file contain general design information that would mostly need to be updated in the first run only +Tests: + - {name: counter_wb, sim: GL} + - {name: counter_la, sim: GL} + - {name: counter_la_reset, sim: GL} + - {name: counter_la_clk, sim: GL} + diff --git a/verilog/dv/setup-cocotb.py b/verilog/dv/setup-cocotb.py index cb35e2cfb..79941e783 100644 --- a/verilog/dv/setup-cocotb.py +++ b/verilog/dv/setup-cocotb.py @@ -1,3 +1,19 @@ +# SPDX-FileCopyrightText: 2023 Efabless Corporation + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# SPDX-License-Identifier: Apache-2.0 + import click import yaml