blob: 3ca86c0115b4bc6a1706897db1356f9b9fafaf20 [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
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020028- 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 Abbas90262c42022-02-22 12:34:29 +020029
Marwan Abbasd6939212022-04-03 11:44:15 +020030- Python 3.6+ with PIP
31
Marwan Abbas90262c42022-02-22 12:34:29 +020032===============================================================================================================================================================
33
34---------------------
35Starting your project
36---------------------
37
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080038
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020039#. 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 Abbasfa8d7ec2022-02-03 09:50:05 -080040
Kareem Faride07f6622022-02-23 16:29:31 +020041#. Open your Terminal. Create an empty folder to use as your Caravel workspace, and navigate to it.
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080042
Kareem Faride07f6622022-02-23 16:29:31 +020043 .. code:: bash
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080044
Kareem Faride07f6622022-02-23 16:29:31 +020045 # Create a directory and call it anything you want
46 mkdir -p caravel_tutorial
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080047
Kareem Faride07f6622022-02-23 16:29:31 +020048 # navigate into the directory
49 cd caravel_tutorial
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080050
Kareem Faride07f6622022-02-23 16:29:31 +020051#. Clone caravel_user_project and setup the git environment as follows
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020052
Kareem Faride07f6622022-02-23 16:29:31 +020053 .. code:: bash
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020054
Kareem Faride07f6622022-02-23 16:29:31 +020055 # Make sure that "caravel_example" matches the empty github repo name in step 1
Marwan Abbasc2587f12022-04-12 13:36:28 +020056 git clone -b mpw-6b https://github.com/efabless/caravel_user_project caravel_example
Kareem Faride07f6622022-02-23 16:29:31 +020057 cd caravel_example
58 git remote rename origin upstream
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020059
Kareem Faride07f6622022-02-23 16:29:31 +020060 # You need to put your empty github repo URL from step 1
61 git remote add origin <your github repo URL>
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020062
Kareem Faride07f6622022-02-23 16:29:31 +020063 # Create a new branch, you can name it anything
64 git checkout -b <my_branch>
65 git push -u origin <my_branch>
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080066
Kareem Faride07f6622022-02-23 16:29:31 +020067#. Now that your git environment is setup, it's time to setup your local environment by running.
Marwan Abbasfdff8582022-02-22 17:05:31 +020068
Kareem Faride07f6622022-02-23 16:29:31 +020069 .. code:: bash
Marwan Abbas0588de62022-02-24 19:48:38 +020070
71 # make sure to change <directory_name> with the directory you created in step 2
72 # in this case it is caravel_tutorial
73 export OPENLANE_ROOT=~/<directory_name>/openlane # you need to export this whenever you start a new shell
74
75 export PDK_ROOT=~/<directory_name>/pdks # you need to export this whenever you start a new shell
Marwan Abbasfdff8582022-02-22 17:05:31 +020076
Kareem Faride07f6622022-02-23 16:29:31 +020077 make setup
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020078
Kareem Faride07f6622022-02-23 16:29:31 +020079 * This command will setup your environment by installing the following:
80
81 - caravel_lite (a lite version of caravel)
82 - management core for simulation
83 - openlane to harden your design
84 - pdk
85
Marwan Abbasfdff8582022-02-22 17:05:31 +020086
Kareem Faride07f6622022-02-23 16:29:31 +020087#. Now you can start hardening your design
Marwan Abbasfdff8582022-02-22 17:05:31 +020088
Kareem Faride07f6622022-02-23 16:29:31 +020089 * To start hardening you project you need
90 - RTL verilog model for your design for OpenLane to harden
91 - A subdirectory for each macro in your project under ``openlane/`` directory, each subdirectory should include openlane configuration files for the macro
Marwan Abbasfdff8582022-02-22 17:05:31 +020092
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020093 .. code:: bash
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080094
Marwan Abbas7ccab9c2022-02-23 14:30:41 +020095 make <module_name>
96 ..
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -080097
Marwan Abbas7566d6d2022-02-28 18:28:14 +020098 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 Abbasfdff8582022-02-22 17:05:31 +020099
Kareem Faride07f6622022-02-23 16:29:31 +0200100#. Integrate modules into the user_project_wrapper
Marwan Abbasfdff8582022-02-22 17:05:31 +0200101
Kareem Faride07f6622022-02-23 16:29:31 +0200102 * 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
103 * Instantiate your module(s) in ``verilog/rtl/user_project_wrapper.v``
104 * Harden the user_project_wrapper including your module(s), using this command:
Marwan Abbasfdff8582022-02-22 17:05:31 +0200105
Kareem Faride07f6622022-02-23 16:29:31 +0200106 .. code:: bash
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -0800107
Kareem Faride07f6622022-02-23 16:29:31 +0200108 make user_project_wrapper
Marwan Abbasfdff8582022-02-22 17:05:31 +0200109
Kareem Faride07f6622022-02-23 16:29:31 +0200110#. Run simulation on your design
Marwan Abbasfdff8582022-02-22 17:05:31 +0200111
Kareem Faride07f6622022-02-23 16:29:31 +0200112 * You need to include your rtl/gl/gl+sdf files in ``verilog/includes/includes.<rtl/gl/gl+sdf>.caravel_user_project``
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -0800113
Kareem Faride07f6622022-02-23 16:29:31 +0200114 **NOTE:** You shouldn't include the files inside the verilog code
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -0800115
Kareem Faride07f6622022-02-23 16:29:31 +0200116 .. code:: bash
Marwan Abbas7ccab9c2022-02-23 14:30:41 +0200117
Kareem Faride07f6622022-02-23 16:29:31 +0200118 # you can then run RTL simulations using
119 make verify-<testbench-name>-rtl
120
121 # OR GL simulation using
122 make verify-<testbench-name>-gl
123
124 # for example
125 make verify-io_ports-rtl
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -0800126
Kareem Faride07f6622022-02-23 16:29:31 +0200127#. Run the precheck locally
Marwan Abbas7ccab9c2022-02-23 14:30:41 +0200128
Kareem Faride07f6622022-02-23 16:29:31 +0200129 .. code:: bash
Marwan Abbas7ccab9c2022-02-23 14:30:41 +0200130
Kareem Faride07f6622022-02-23 16:29:31 +0200131 make precheck
132 make run-precheck
Marwan Abbas7ccab9c2022-02-23 14:30:41 +0200133
Marwan Abbas7ccab9c2022-02-23 14:30:41 +0200134#. You are done! now go to www.efabless.com to submit your project!
Marwan Abbasfa8d7ec2022-02-03 09:50:05 -0800135
136
137.. |License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
138 :target: https://opensource.org/licenses/Apache-2.0
139.. |User CI| image:: https://github.com/efabless/caravel_project_example/actions/workflows/user_project_ci.yml/badge.svg
140 :target: https://github.com/efabless/caravel_project_example/actions/workflows/user_project_ci.yml
141.. |Caravel Build| image:: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_build.yml/badge.svg
142 :target: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_build.yml