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 | |
| 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 Apple Chip <https://desktop.docker.com/mac/main/arm64/Docker.dmg?utm_source=docker&utm_medium=webreferral&utm_campaign=dd-smartbutton&utm_location=header>`_ |
| 29 | |
| 30 | =============================================================================================================================================================== |
| 31 | |
| 32 | --------------------- |
| 33 | Starting your project |
| 34 | --------------------- |
| 35 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 36 | |
| 37 | 1. 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 |
| 38 | |
| 39 | 2. Open your Terminal. Create an empty folder to use as your Caravel workspace, and navigate to it. |
| 40 | |
| 41 | .. code:: bash |
| 42 | |
| 43 | # Create a directory and call it anything you want |
| 44 | mkdir -p caravel_tutorial |
| 45 | |
| 46 | # navigate into the directory |
| 47 | cd caravel_tutorial |
| 48 | |
| 49 | 3. Clone caravel_user_project and setup the git environment as follows |
| 50 | |
| 51 | .. code:: bash |
| 52 | |
| 53 | # Make sure that ``caravel_example`` matches the empty github repo name in step 1 |
Marwan Abbas | ceb0445 | 2022-02-20 21:26:07 +0200 | [diff] [blame] | 54 | git clone -b mpw-5b https://github.com/efabless/caravel_user_project caravel_example |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 55 | cd caravel_example |
| 56 | git remote rename origin upstream |
| 57 | |
| 58 | # You need to put your empty github repo URL from step 1 |
| 59 | git remote add origin <your github repo URL> |
| 60 | |
| 61 | # Create a new branch, you can name it anything |
| 62 | git checkout -b <my_branch> |
| 63 | git push -u origin <my_branch> |
| 64 | |
Marwan Abbas | 54c22d5 | 2022-02-22 12:27:50 +0200 | [diff] [blame] | 65 | 4. Now that your git environment is setup, it's time to setup your local environment. |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 66 | |
| 67 | .. code:: bash |
| 68 | |
| 69 | # to install caravel-lite into your caravel_user_project |
| 70 | # you can install full caravel (not recommended) use ``export CARAVEL_LITE=0`` |
| 71 | make install |
kareem | b104c94 | 2022-02-15 06:05:35 -0800 | [diff] [blame] | 72 | |
kareem | b104c94 | 2022-02-15 06:05:35 -0800 | [diff] [blame] | 73 | # To install the management core for simulation |
| 74 | make install_mcw |
| 75 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 76 | # Install openlane for hardening your project |
Marwan Abbas | b579e00 | 2022-02-17 10:13:24 +0200 | [diff] [blame] | 77 | # make sure to change <directory_name> with the directory you created in step 2 (In this case it's caravel_tutorial) |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 78 | # in this case it is caravel_tutorial |
| 79 | export OPENLANE_ROOT=~/<directory_name>/openlane # you need to export this whenever you start a new shell |
| 80 | make openlane |
| 81 | |
| 82 | # Build the pdk |
| 83 | # make sure to change <directory_name> with the directory you created in step 1 |
| 84 | # in this case it is caravel_tutorial |
Marwan Abbas | 75ba573 | 2022-02-11 16:50:50 +0200 | [diff] [blame] | 85 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 86 | export PDK_ROOT=~/<directory_name>/pdks # you need to export this whenever you start a new shell |
| 87 | make pdk |
| 88 | |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame^] | 89 | 5. Now you can start hardening your design |
| 90 | |
| 91 | To start hardening you project you need to have a RTL verilog model for your design for OpenLane to harden. You should then have a subdirectory for each module in your project under ``openlane/`` directory, this subdirectory should include your configuration files. Then you can harden using this command |
| 92 | |
| 93 | .. code:: bash |
| 94 | |
| 95 | make <module_name> |
| 96 | |
| 97 | 6. Example of a user project can be found by the name of ``user_proj_example``, the RTL can be found at ``verilog/rtl/user_proj_example.v`` and the configuration files can be found at ``openlane/user_proj_example``. And can be hardened using this command |
| 98 | |
| 99 | **THIS IS JUST AN EXAMPLE** |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 100 | |
| 101 | .. code:: bash |
| 102 | |
| 103 | make user_proj_example |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame^] | 104 | |
| 105 | 7. You then need to integrate your modules into the user_project_wrapper. Then you can harden user_project_wrapper using this command |
| 106 | |
| 107 | .. code:: bash |
| 108 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 109 | make user_project_wrapper |
| 110 | |
| 111 | 6. To run simulation on your design |
| 112 | |
Marwan Abbas | fdff858 | 2022-02-22 17:05:31 +0200 | [diff] [blame^] | 113 | You need to include your rtl files in ``verilog/includes/includes.<rtl/gl/gl+sdf>.caravel_user_project``. Then run the simulation using these commands |
| 114 | |
| 115 | **NOTE:** You shouldn't include the files inside the verilog code |
| 116 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 117 | .. code:: bash |
| 118 | |
| 119 | make simenv |
| 120 | # you can run RTL/GL simulations by using |
| 121 | export SIM=RTL |
| 122 | # OR |
| 123 | export SIM=GL |
| 124 | |
| 125 | # you can then run the simulations using |
| 126 | make verify-<testbench-name> |
| 127 | |
Marwan Abbas | fa8d7ec | 2022-02-03 09:50:05 -0800 | [diff] [blame] | 128 | # for example |
| 129 | make verify-io_ports |
| 130 | |
| 131 | 7. To run the precheck locally |
| 132 | |
| 133 | .. code:: bash |
| 134 | |
| 135 | make precheck |
| 136 | make run-precheck |
| 137 | |
| 138 | 17. You are done! now go to www.efabless.com to submit your project! |
| 139 | |
| 140 | |
| 141 | .. |License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg |
| 142 | :target: https://opensource.org/licenses/Apache-2.0 |
| 143 | .. |User CI| image:: https://github.com/efabless/caravel_project_example/actions/workflows/user_project_ci.yml/badge.svg |
| 144 | :target: https://github.com/efabless/caravel_project_example/actions/workflows/user_project_ci.yml |
| 145 | .. |Caravel Build| image:: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_build.yml/badge.svg |
| 146 | :target: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_build.yml |