blob: 6fc01c5a666117088b4da497a5f4543581ed131b [file] [log] [blame]
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -08001.. 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 Abbas3f390102022-02-21 11:59:43 +020021Quick start for caravel_user_project
22====================================
Marwan Abbas54c22d52022-02-22 12:27:50 +020023
Marwan Abbas90262c42022-02-22 12:34:29 +020024------------
25Dependencies
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---------------------
33Starting your project
34---------------------
35
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080036
371. 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
392. 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
493. 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 Abbasceb04452022-02-20 21:26:07 +020054 git clone -b mpw-5b https://github.com/efabless/caravel_user_project caravel_example
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080055 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 Abbas54c22d52022-02-22 12:27:50 +0200654. Now that your git environment is setup, it's time to setup your local environment.
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080066
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
kareemb104c942022-02-15 06:05:35 -080072
kareemb104c942022-02-15 06:05:35 -080073 # To install the management core for simulation
74 make install_mcw
75
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080076 # Install openlane for hardening your project
Marwan Abbasb579e002022-02-17 10:13:24 +020077 # make sure to change <directory_name> with the directory you created in step 2 (In this case it's caravel_tutorial)
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080078 # 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 Abbas75ba5732022-02-11 16:50:50 +020085
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080086 export PDK_ROOT=~/<directory_name>/pdks # you need to export this whenever you start a new shell
87 make pdk
88
Marwan Abbasfdff8582022-02-22 17:05:31 +0200895. Now you can start hardening your design
90
91To 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
976. 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 Abbasfa8d7ec2022-02-03 09:50:05 -0800100
101.. code:: bash
102
103 make user_proj_example
Marwan Abbasfdff8582022-02-22 17:05:31 +0200104
1057. 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 Abbasfa8d7ec2022-02-03 09:50:05 -0800109 make user_project_wrapper
110
1116. To run simulation on your design
112
Marwan Abbasfdff8582022-02-22 17:05:31 +0200113You 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 Abbasfa8d7ec2022-02-03 09:50:05 -0800117.. 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 Abbasfa8d7ec2022-02-03 09:50:05 -0800128 # for example
129 make verify-io_ports
130
1317. To run the precheck locally
132
133.. code:: bash
134
135 make precheck
136 make run-precheck
137
13817. 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