From a994b8794991876bf66a63155e322da9710a37e5 Mon Sep 17 00:00:00 2001 From: Marwan Abbas <67271180+marwaneltoukhy@users.noreply.github.com> Date: Thu, 10 Aug 2023 11:12:00 +0300 Subject: [PATCH 01/17] Update index.rst --- docs/source/index.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index c8d84bb59..3927e79d0 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 @@ -168,7 +168,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 +176,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 From 8eb001d34268d08c37ff8c014719ffa1661ad395 Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Thu, 10 Aug 2023 11:24:24 +0300 Subject: [PATCH 02/17] Add cocotb quickrun documentation to the correct rst file --- docs/source/index.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/source/index.rst b/docs/source/index.rst index 3927e79d0..99339d8b7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -148,6 +148,23 @@ 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 + + # RTL tests + make cocotb-verify-rtl + + # OR GL simulation using + 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: From f9d23f6d3cd22713e75fba55caac1cb8a9adc5af Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Thu, 10 Aug 2023 12:27:24 +0300 Subject: [PATCH 03/17] add the SPDX-FileCopyrightText to cocotb files --- verilog/dv/cocotb/cocotb_tests.py | 16 +++++++++++++++ .../counter_tests/counter_la/counter_la.c | 16 +++++++++++++++ .../counter_tests/counter_la/counter_la.py | 16 +++++++++++++++ .../counter_tests/counter_la/counter_la.yaml | 15 ++++++++++++++ .../counter_la_clk/counter_la_clk.c | 15 ++++++++++++++ .../counter_la_clk/counter_la_clk.yaml | 15 ++++++++++++++ .../counter_la_reset/counter_la_reset.c | 15 ++++++++++++++ .../counter_la_reset/counter_la_reset.py | 16 +++++++++++++++ .../counter_la_reset/counter_la_reset.yaml | 17 +++++++++++++++- .../cocotb/counter_tests/counter_tests.yaml | 20 ++++++++++++++++++- .../counter_tests/counter_tests_gl.yaml | 20 ++++++++++++++++++- .../counter_tests/counter_wb/counter_wb.c | 18 +++++++++++++++++ .../counter_tests/counter_wb/counter_wb.py | 20 +++++++++++++++++++ .../counter_tests/counter_wb/counter_wb.yaml | 19 +++++++++++++++++- verilog/dv/cocotb/design_info.yaml | 17 ++++++++++++++++ verilog/dv/cocotb/gpio_test/gpio_test.c | 19 ++++++++++++++++++ verilog/dv/cocotb/gpio_test/gpio_test.py | 18 +++++++++++++++++ verilog/dv/cocotb/hello_world/hello_world.c | 18 +++++++++++++++++ verilog/dv/cocotb/hello_world/hello_world.py | 18 +++++++++++++++++ .../dv/cocotb/hello_world/hello_world.yaml | 20 ++++++++++++++++++- .../hello_world_uart/hello_world_uart.c | 18 +++++++++++++++++ .../hello_world_uart/hello_world_uart.py | 18 +++++++++++++++++ .../hello_world_uart/hello_world_uart.yaml | 19 +++++++++++++++++- verilog/dv/setup-cocotb.py | 16 +++++++++++++++ 24 files changed, 413 insertions(+), 6 deletions(-) diff --git a/verilog/dv/cocotb/cocotb_tests.py b/verilog/dv/cocotb/cocotb_tests.py index 4c676ec58..e33d52d89 100644 --- a/verilog/dv/cocotb/cocotb_tests.py +++ b/verilog/dv/cocotb/cocotb_tests.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 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 diff --git a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.c b/verilog/dv/cocotb/counter_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/counter_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/counter_tests/counter_la/counter_la.py index 485eb8dd9..ce78c95c8 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.py +++ b/verilog/dv/cocotb/counter_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/counter_tests/counter_la/counter_la.yaml b/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml index ad7732660..ab86628c2 100644 --- a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml +++ b/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml @@ -1,4 +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 # 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/counter_la_clk/counter_la_clk.c b/verilog/dv/cocotb/counter_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/counter_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.yaml b/verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.yaml index 9efc3831c..2c2278f60 100644 --- 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 @@ -1,4 +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 # 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/counter_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/counter_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/counter_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/counter_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/counter_tests/counter_la_reset/counter_la_reset.yaml b/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.yaml index 08be1c56b..38110352b 100644 --- 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 @@ -1,4 +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 + # 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 index 9ef25837f..13da5c21f 100644 --- a/verilog/dv/cocotb/counter_tests/counter_tests.yaml +++ b/verilog/dv/cocotb/counter_tests/counter_tests.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 + + + + # yaml file contain general design information that would mostly need to be updated in the first run only includes: - counter_la/counter_la.yaml diff --git a/verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml b/verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml index 4019756d0..8b00b9323 100644 --- a/verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml +++ b/verilog/dv/cocotb/counter_tests/counter_tests_gl.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 + + + + # yaml file contain general design information that would mostly need to be updated in the first run only Tests: - {name: counter_wb, sim: GL} diff --git a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.c b/verilog/dv/cocotb/counter_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/counter_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/counter_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/counter_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/counter_tests/counter_wb/counter_wb.yaml b/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml index 705fba77d..894e0a338 100644 --- a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml +++ b/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.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: - {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/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 From 587a12aeb95b55330ab42333474dbbee4243f368 Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Thu, 10 Aug 2023 14:39:24 +0300 Subject: [PATCH 04/17] Update commands cocotb-verify-rtl and cocotb-verify-gl to work with iverilog --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 23c19b465..226b3bca4 100644 --- a/Makefile +++ b/Makefile @@ -326,11 +326,11 @@ setup-cocotb: .PHONY: cocotb-verify-rtl cocotb-verify-rtl: - @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl counter_tests/counter_tests.yaml -v ) + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl counter_tests/counter_tests.yaml ) .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) + @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl counter_tests/counter_tests_gl.yaml -verbosity quiet) ./verilog/gl/user_project_wrapper.v: $(error you don't have $@) From 1b1f5ff8b6fe25d0401b0fbe83df3bdc8dad8953 Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Thu, 10 Aug 2023 16:39:26 +0300 Subject: [PATCH 05/17] update running cocotb tests from makefile and add cocotb to the CI and update documentation to run cocotb using makefile --- .github/workflows/user_project_ci.yml | 18 +++++---------- Makefile | 22 ++++++++++++++----- docs/source/index.rst | 15 +++++++++---- verilog/dv/cocotb/cocotb_tests.py | 8 +++---- .../README.md | 0 .../counter_la/counter_la.c | 0 .../counter_la/counter_la.py | 0 .../counter_la/counter_la.yaml | 0 .../counter_la_clk/counter_la_clk.c | 0 .../counter_la_clk/counter_la_clk.py | 15 +++++++++++++ .../counter_la_clk/counter_la_clk.yaml | 0 .../counter_la_reset/counter_la_reset.c | 0 .../counter_la_reset/counter_la_reset.py | 0 .../counter_la_reset/counter_la_reset.yaml | 0 .../counter_wb/counter_wb.c | 0 .../counter_wb/counter_wb.py | 0 .../counter_wb/counter_wb.yaml | 0 .../user_proj_tests.yaml} | 12 +++++----- .../user_proj_tests_gl.yaml} | 0 19 files changed, 56 insertions(+), 34 deletions(-) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/README.md (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la/counter_la.c (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la/counter_la.py (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la/counter_la.yaml (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la_clk/counter_la_clk.c (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la_clk/counter_la_clk.py (66%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la_clk/counter_la_clk.yaml (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la_reset/counter_la_reset.c (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la_reset/counter_la_reset.py (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_la_reset/counter_la_reset.yaml (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_wb/counter_wb.c (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_wb/counter_wb.py (100%) rename verilog/dv/cocotb/{counter_tests => user_proj_tests}/counter_wb/counter_wb.yaml (100%) rename verilog/dv/cocotb/{counter_tests/counter_tests.yaml => user_proj_tests/user_proj_tests.yaml} (81%) rename verilog/dv/cocotb/{counter_tests/counter_tests_gl.yaml => user_proj_tests/user_proj_tests_gl.yaml} (100%) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index b0eccaa7e..04a842df8 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -119,16 +119,8 @@ jobs: - 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 \ No newline at end of file diff --git a/Makefile b/Makefile index 226b3bca4..d07854b7c 100644 --- a/Makefile +++ b/Makefile @@ -116,8 +116,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) @@ -324,13 +328,19 @@ setup-cocotb: @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 ) +.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-gl -cocotb-verify-gl: - @(cd $(PROJECT_ROOT)/verilog/dv/cocotb && caravel_cocotb -tl counter_tests/counter_tests_gl.yaml -verbosity quiet) +.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 $* ) + +$(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 99339d8b7..164b1aef1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -155,12 +155,19 @@ Starting your 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 - # RTL tests - make cocotb-verify-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 - # OR GL simulation using - 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 `_ diff --git a/verilog/dv/cocotb/cocotb_tests.py b/verilog/dv/cocotb/cocotb_tests.py index e33d52d89..1a6d5b1a8 100644 --- a/verilog/dv/cocotb/cocotb_tests.py +++ b/verilog/dv/cocotb/cocotb_tests.py @@ -16,8 +16,8 @@ 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/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 100% 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 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 100% 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 diff --git a/verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml b/verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.yaml similarity index 100% rename from verilog/dv/cocotb/counter_tests/counter_la/counter_la.yaml rename to verilog/dv/cocotb/user_proj_tests/counter_la/counter_la.yaml 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 100% 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 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/counter_tests/counter_la_clk/counter_la_clk.yaml b/verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.yaml similarity index 100% rename from verilog/dv/cocotb/counter_tests/counter_la_clk/counter_la_clk.yaml rename to verilog/dv/cocotb/user_proj_tests/counter_la_clk/counter_la_clk.yaml 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 100% 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 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 100% 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 diff --git a/verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.yaml b/verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.yaml similarity index 100% rename from verilog/dv/cocotb/counter_tests/counter_la_reset/counter_la_reset.yaml rename to verilog/dv/cocotb/user_proj_tests/counter_la_reset/counter_la_reset.yaml 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 100% 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 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 100% 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 diff --git a/verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml b/verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.yaml similarity index 100% rename from verilog/dv/cocotb/counter_tests/counter_wb/counter_wb.yaml rename to verilog/dv/cocotb/user_proj_tests/counter_wb/counter_wb.yaml diff --git a/verilog/dv/cocotb/counter_tests/counter_tests.yaml b/verilog/dv/cocotb/user_proj_tests/user_proj_tests.yaml similarity index 81% rename from verilog/dv/cocotb/counter_tests/counter_tests.yaml rename to verilog/dv/cocotb/user_proj_tests/user_proj_tests.yaml index 13da5c21f..06c03308d 100644 --- a/verilog/dv/cocotb/counter_tests/counter_tests.yaml +++ b/verilog/dv/cocotb/user_proj_tests/user_proj_tests.yaml @@ -18,10 +18,8 @@ # 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 - - +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/counter_tests/counter_tests_gl.yaml b/verilog/dv/cocotb/user_proj_tests/user_proj_tests_gl.yaml similarity index 100% rename from verilog/dv/cocotb/counter_tests/counter_tests_gl.yaml rename to verilog/dv/cocotb/user_proj_tests/user_proj_tests_gl.yaml From 89a47503bee27274d75f330dfcbd0680b88aacda Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 09:39:48 +0300 Subject: [PATCH 06/17] updated ci --- .github/workflows/user_project_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index 04a842df8..b02741a2e 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -123,4 +123,4 @@ jobs: -name : Run DV GL tests run: | - make cocotb-verify-all-gl \ No newline at end of file + make cocotb-verify-all-gl From 4761351d532d1b03249ab06d1ed52b441aa34057 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 09:42:20 +0300 Subject: [PATCH 07/17] updated ci --- .github/workflows/user_project_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index b02741a2e..c3034edc7 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -119,8 +119,8 @@ jobs: - name: Run DV RTL tests run: | - make cocotb-verify-all-rtl + make cocotb-verify-all-rtl -name : Run DV GL tests run: | - make cocotb-verify-all-gl + make cocotb-verify-all-gl From 67140248912fcfae16ba58bc39ad0d147ed42751 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 09:45:23 +0300 Subject: [PATCH 08/17] updated ci --- .github/workflows/user_project_ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index c3034edc7..cc339a2a0 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -117,10 +117,10 @@ jobs: path: | /home/runner/work/caravel_user_project/caravel_user_project/mpw_precheck_result/logs/* - - name: Run DV RTL tests - run: | - make cocotb-verify-all-rtl + # - name: Run DV RTL tests + # run: | + # make cocotb-verify-all-rtl - -name : Run DV GL tests - run: | - make cocotb-verify-all-gl + # -name : Run DV GL tests + # run: | + # make cocotb-verify-all-gl From 99aadc162ca47f4dc85d7a42c18b539a5eb1a439 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 09:46:56 +0300 Subject: [PATCH 09/17] updated ci --- .github/workflows/user_project_ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index cc339a2a0..a47dbe88a 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -117,6 +117,10 @@ jobs: path: | /home/runner/work/caravel_user_project/caravel_user_project/mpw_precheck_result/logs/* + - name: Run DV RTL tests + run: | + make cocotb-verify-all-rtl + # - name: Run DV RTL tests # run: | # make cocotb-verify-all-rtl From 124eeda995406e72feaff0606aff92fe8e80043f Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 09:47:44 +0300 Subject: [PATCH 10/17] updated ci --- .github/workflows/user_project_ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index a47dbe88a..b054abd5f 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -121,10 +121,6 @@ jobs: run: | make cocotb-verify-all-rtl - # - name: Run DV RTL tests - # run: | - # make cocotb-verify-all-rtl - - # -name : Run DV GL tests - # run: | - # make cocotb-verify-all-gl + - name: Run DV GL tests + run: | + make cocotb-verify-all-gl From 8fd38a1aea76356e67bdb9b1f37776d94ac417f4 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 10:10:01 +0300 Subject: [PATCH 11/17] updated ci --- .github/workflows/user_project_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index b054abd5f..3c4b796c1 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -86,6 +86,7 @@ jobs: make install_mcw make openlane make simenv + make setup-cocotb - name: Harden using Openlane run: | From a2fa088a2041924883b85544bf24e5c13e325fb4 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 10:37:40 +0300 Subject: [PATCH 12/17] updated ci --- .github/workflows/user_project_ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index 3c4b796c1..cf1674228 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -85,7 +85,6 @@ jobs: make install make install_mcw make openlane - make simenv make setup-cocotb - name: Harden using Openlane From f5ebf9f329097df5be88e1e7201d7011412f1a68 Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 13 Aug 2023 11:16:36 +0300 Subject: [PATCH 13/17] optimize memory and performance of CI --- .github/workflows/user_project_ci.yml | 104 ++++++++++++++++++++++++-- Makefile | 13 +++- 2 files changed, 107 insertions(+), 10 deletions(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index cf1674228..86cd5228e 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-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 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: | @@ -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 diff --git a/Makefile b/Makefile index d07854b7c..3e7aa8609 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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: From fd649afcd265db164e2dce34d0015fb056697e35 Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Thu, 17 Aug 2023 12:31:25 +0300 Subject: [PATCH 14/17] update cocotb docker name in Makefile --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3e7aa8609..b2113a9e9 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,10 @@ install: .PHONY: simenv simenv: docker pull efabless/dv:latest + +# Install cocotb docker +.PHONY: simenv-cocotb +simenv-cocotb: docker pull efabless/dv:cocotb .PHONY: setup @@ -322,16 +326,16 @@ setup-timing-scripts: $(TIMING_ROOT) @( cd $(TIMING_ROOT) && git pull ) @#( cd $(TIMING_ROOT) && git fetch && git checkout $(MPW_TAG); ) -.PHONY: install-cocotb -install-cocotb: - @pip install caravel-cocotb==1.0.0 +.PHONY: install-caravel-cocotb +install-caravel-cocotb: + @pip install 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)) .PHONY: setup-cocotb -setup-cocotb: install-cocotb setup-cocotb-env simenv +setup-cocotb: install-caravel-cocotb setup-cocotb-env simenv-cocotb .PHONY: cocotb-verify-all-rtl cocotb-verify-all-rtl: From a02132e8a09d3436e7ba0d331b85baa155f945ce Mon Sep 17 00:00:00 2001 From: M0stafaRady Date: Thu, 17 Aug 2023 12:36:07 +0300 Subject: [PATCH 15/17] fix install dependency over pip in installing caravel-cocotb moved from PR https://github.com/efabless/caravel_user_project/pull/286 --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b2113a9e9..594c2cfa5 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) @@ -328,7 +330,7 @@ setup-timing-scripts: $(TIMING_ROOT) .PHONY: install-caravel-cocotb install-caravel-cocotb: - @pip install caravel-cocotb + @./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir caravel-cocotb .PHONY: setup-cocotb-env setup-cocotb-env: From c41f5fb18b45754a61065d874b13fdd665edc05a Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 20 Aug 2023 11:46:08 +0300 Subject: [PATCH 16/17] CI fix --- .github/workflows/user_project_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml index 86cd5228e..1e6b1b9ce 100644 --- a/.github/workflows/user_project_ci.yml +++ b/.github/workflows/user_project_ci.yml @@ -74,7 +74,7 @@ jobs: run: | make install make install_mcw - make install-cocotb + make install-caravel-cocotb make simenv - name: Tarball caravel From dd78feb02e0380ce4f87f875397dc820356aaffb Mon Sep 17 00:00:00 2001 From: marwaneltoukhy Date: Sun, 20 Aug 2023 11:51:07 +0300 Subject: [PATCH 17/17] CI fix --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 27ad9a9c4..d281be716 100644 --- a/Makefile +++ b/Makefile @@ -330,7 +330,10 @@ setup-timing-scripts: $(TIMING_ROOT) .PHONY: install-caravel-cocotb install-caravel-cocotb: - @./venv/bin/$(PYTHON_BIN) -m pip install --upgrade --no-cache-dir 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: