Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 1 | .. raw:: html |
| 2 | |
| 3 | <!--- |
| 4 | # SPDX-FileCopyrightText: 2020 Efabless Corporation |
| 5 | # |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | --> |
| 20 | |
Marwan Abbas | 3f39010 | 2022-02-21 11:59:43 +0200 | [diff] [blame] | 21 | Quick start for caravel_user_project |
| 22 | ==================================== |
Marwan Abbas | 54c22d5 | 2022-02-22 12:27:50 +0200 | [diff] [blame] | 23 | |
Marwan Abbas | 90262c4 | 2022-02-22 12:34:29 +0200 | [diff] [blame] | 24 | ------------ |
| 25 | Dependencies |
| 26 | ------------ |
| 27 | |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 28 | - Docker: `Linux <https://hub.docker.com/search?q=&type=edition&offering=community&operating_system=linux&utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header>`_ || `Windows <https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header>`_ || `Mac with Intel Chip <https://desktop.docker.com/mac/main/amd64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header>`_ || `Mac with M1 Chip <https://desktop.docker.com/mac/main/arm64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header>`_ |
Marwan Abbas | 90262c4 | 2022-02-22 12:34:29 +0200 | [diff] [blame] | 29 | |
| 30 | =============================================================================================================================================================== |
| 31 | |
| 32 | --------------------- |
| 33 | Starting your project |
| 34 | --------------------- |
| 35 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 36 | |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 37 | #. To start the project you need to first create an empty Git project on Github and make sure your repo is public and includes a README |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 38 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 39 | #. Open your Terminal. Create an empty folder to use as your Caravel workspace, and navigate to it. |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 40 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 41 | .. code:: bash |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 42 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 43 | # Create a directory and call it anything you want |
| 44 | mkdir -p caravel_tutorial |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 45 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 46 | # navigate into the directory |
| 47 | cd caravel_tutorial |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 48 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 49 | #. Clone caravel_user_project and setup the git environment as follows |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 50 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 51 | .. code:: bash |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 52 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 53 | # Make sure that "caravel_example" matches the empty github repo name in step 1 |
Marwan Abbas | 1aa7841 | 2022-02-24 19:52:19 +0200 | [diff] [blame] | 54 | git clone -b mpw-5c https://github.com/efabless/caravel_user_project caravel_example |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 55 | cd caravel_example |
| 56 | git remote rename origin upstream |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 57 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 58 | # You need to put your empty github repo URL from step 1 |
| 59 | git remote add origin <your github repo URL> |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 60 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 61 | # Create a new branch, you can name it anything |
| 62 | git checkout -b <my_branch> |
| 63 | git push -u origin <my_branch> |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 64 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 65 | #. Now that your git environment is setup, it's time to setup your local environment by running. |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 66 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 67 | .. code:: bash |
Marwan Abbas | 0588de6 | 2022-02-24 19:48:38 +0200 | [diff] [blame] | 68 | |
| 69 | # make sure to change <directory_name> with the directory you created in step 2 |
| 70 | # in this case it is caravel_tutorial |
| 71 | export OPENLANE_ROOT=~/<directory_name>/openlane # you need to export this whenever you start a new shell |
| 72 | |
| 73 | export PDK_ROOT=~/<directory_name>/pdks # you need to export this whenever you start a new shell |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 74 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 75 | make setup |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 76 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 77 | * This command will setup your environment by installing the following: |
| 78 | |
| 79 | - caravel_lite (a lite version of caravel) |
| 80 | - management core for simulation |
| 81 | - openlane to harden your design |
| 82 | - pdk |
| 83 | |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 84 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 85 | #. Now you can start hardening your design |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 86 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 87 | * To start hardening you project you need |
| 88 | - RTL verilog model for your design for OpenLane to harden |
| 89 | - A subdirectory for each macro in your project under ``openlane/`` directory, each subdirectory should include openlane configuration files for the macro |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 90 | |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 91 | .. code:: bash |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 92 | |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 93 | make <module_name> |
| 94 | .. |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 95 | |
Marwan Abbas | 7566d6d | 2022-02-28 18:28:14 +0200 | [diff] [blame] | 96 | For an example of hardening a project please refer to `user_project_example <https://github.com/efabless/caravel_user_project/blob/main/docs/source/index.rst#hardening-the-user-project-using-openlane>`_ |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 97 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 98 | #. Integrate modules into the user_project_wrapper |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 99 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 100 | * Change the environment variables ``VERILOG_FILES_BLACKBOX``, ``EXTRA_LEFS`` and ``EXTRA_GDS_FILES`` in ``openlane/user_project_wrapper/config.tcl`` to point to your module |
| 101 | * Instantiate your module(s) in ``verilog/rtl/user_project_wrapper.v`` |
| 102 | * Harden the user_project_wrapper including your module(s), using this command: |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 103 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 104 | .. code:: bash |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 105 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 106 | make user_project_wrapper |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 107 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 108 | #. Run simulation on your design |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame] | 109 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 110 | * You need to include your rtl/gl/gl+sdf files in ``verilog/includes/includes.<rtl/gl/gl+sdf>.caravel_user_project`` |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 111 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 112 | **NOTE:** You shouldn't include the files inside the verilog code |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 113 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 114 | .. code:: bash |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 115 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 116 | # you can then run RTL simulations using |
| 117 | make verify-<testbench-name>-rtl |
| 118 | |
| 119 | # OR GL simulation using |
| 120 | make verify-<testbench-name>-gl |
| 121 | |
| 122 | # for example |
| 123 | make verify-io_ports-rtl |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 124 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 125 | #. Run the precheck locally |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 126 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 127 | .. code:: bash |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 128 | |
Kareem Farid | e07f662 | 2022-02-23 16:29:31 +0200 | [diff] [blame] | 129 | make precheck |
| 130 | make run-precheck |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 131 | |
Marwan Abbas | 7ccab9c | 2022-02-23 14:30:41 +0200 | [diff] [blame] | 132 | #. You are done! now go to www.efabless.com to submit your project! |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 133 | |
| 134 | |
| 135 | .. |License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg |
| 136 | :target: https://opensource.org/licenses/Apache-2.0 |
| 137 | .. |User CI| image:: https://github.com/efabless/caravel_project_example/actions/workflows/user_project_ci.yml/badge.svg |
| 138 | :target: https://github.com/efabless/caravel_project_example/actions/workflows/user_project_ci.yml |
| 139 | .. |Caravel Build| image:: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_build.yml/badge.svg |
| 140 | :target: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_build.yml |