blob: 44e8a316c52e580680832da67a08c1af3a0431c7 [file] [log] [blame]
Mohamed Kassem6f2fcd22021-04-19 10:14:19 -07001.. 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
21Caravel User Project
22====================
23
24|License| |CI|
25
26Table of contents
27=================
28
29- `Overview <#overview>`__
30- `Caravel Integration <#caravel-integration>`__
31
32 - `Repo Integration <#repo-integration>`__
33 - `Verilog Integration <#verilog-integration>`__
34
35- `Running Full Chip Simulation <#running-full-chip-simulation>`__
36- `Hardening the User Project Macro using
37 Openlane <#hardening-the-user-project-macro-using-openlane>`__
38- `Checklist for Open-MPW
39 Submission <#checklist-for-open-mpw-submission>`__
40
41Overview
42========
43
44This repo contains a sample user project that utilizes the
45`caravel <https://github.com/efabless/caravel.git>`__ chip user space.
46The user project is a simple counter that showcases how to make use of
47`caravel's <https://github.com/efabless/caravel.git>`__ user space
48utilities like IO pads, logic analyzer probes, and wishbone port. The
49repo also demonstrates the recommended structure for the open-mpw
50shuttle projects.
51
52Caravel Integration
53===================
54
55Repo Integration
56----------------
57
58Caravel files are kept separate from the user project by having caravel
59as submodule. The submodule commit should point to the latest of caravel
60master. The following files should have a symbolic link to
61`caravel's <https://github.com/efabless/caravel.git>`__ corresponding
62files:
63
64- `Root Makefile <Makefile>`__: This is to make sure that you adhere to
65 the required implementation of the ``compress`` and ``uncompress``
66 targets. Also,
67 `caravel's <https://github.com/efabless/caravel.git>`__ Makefile
68 provides useful targets like running ``lvs``, ``drc``, and ``xor``
69 checks. Run ``make help`` to display the available targets.
70
71- `Openlane Makefile <openlane/Makefile>`__: This provides an easier
72 way for running openlane to harden your macros. Refer to [ Hardening
73 the User Project Macro]. Also, the makefile retains the openlane
74 summary reports under the signoff directory.
75
76- `Pin order <openlane/user_project_wrapper/pin_order.cfg>`__ file for
77 the user wrapper: The hardened user project wrapper macro must have
78 the same pin order specified in caravel's repo. Failing to adhere to
79 the same order will fail the gds integration of the macro with
80 caravel's back-end.
81
82To create the symbolic links run the following:
83
84.. code:: bash
85
86 # In case caravel is sub-moduled under the project root, export CARAVEL_ROOT=caravel
87 export CARAVEL_ROOT=<caravel-path>
88
89 ln -s $CARAVEL_ROOT/Makefile Makefile
90 ln -s $CARAVEL_ROOT/openlane/Makefile openlane/Makefile
91 ln -s $CARAVEL_ROOT/openlane/user_project_wrapper_empty/pin_order.cfg openlane/user_project_wrapper/pin_order.cfg
92
93Verilog Integration
94-------------------
95
96You need to create a wrapper around your macro that adheres to the
97template at
98`user\_project\_wrapper <caravel/verilog/rtl/__user_project_wrapper.v>`__.
99The wrapper top module must be named ``user_project_wrapper`` and must
100have the same input and output ports. The wrapper gives access to the
101user space utilities provided by caravel like IO ports, logic analyzer
102probes, and wishbone bus connection to the management SoC.
103
104For this sample project, the user macro makes use of:
105
106- The IO ports for displaying the count register values on the IO pads.
107
108- The LA probes for supplying an optional reset and clock signals and
109 for setting an initial value for the count register.
110
111- The wishbeone port for reading/writing the count value through the
112 management SoC.
113
114Refer to `user\_project\_wrapper <verilog/rtl/user_project_wrapper.v>`__
115for more information.
116
117.. raw:: html
118
119 <p align="center">
120 <img src="./_static/counter_32.png" width="50%" height="50%">
121 </p>
122
123.. raw:: html
124
125 </p>
126
127Running Full Chip Simulation
128============================
129
130The verilog test-benches are under this `verilog/dv <verilog/dv>`__. For
131more information on setting up the simulation environment and the
132available testbenches for this sample project, refer to
133`README <verilog/dv/README.md>`__.
134
135Hardening the User Project Macro using Openlane
136===============================================
137
138For instructions on how to install openlane and the pdk refer to
139`README <https://github.com/efabless/openlane/blob/master/README.md>`__.
140
141There are two options for hardening the user project macro using
142openlane:
143
1441. Hardening the user macro, then embedding it in the wrapper
1452. Flattening the user macro with the wrapper.
146
147For more details on this, refer to this
148`README <caravel/blob/master/openlane/README.rst>`__.
149
150For this sample project, we went for the first option where the user
151macro is hardened first, then it is inserted in the user project
152wrapper.
153
154.. raw:: html
155
156 <p align="center">
157 <img src="./_static/wrapper.png" width="50%" height="50%">
158 </p>
159
160To reproduce hardening this project, run the following:
161
162.. code:: bash
163
164 export OPENLANE_TAG=v0.12
165 cd openlane
166 # Run openlane to harden user_proj_example
167 make user_proj_example
168 # Run openlane to harden user_project_wrapper
169 make user_project_wrapper
170
171Checklist for Open-MPW Submission
172=================================
173
174- [x] The project repo adheres to the same directory structure in this
175 repo.
176- [x] The project repo contain info.yaml at the project root.
177- [x] Top level macro is named ``user_project_wrapper``.
178- [x] Full Chip Simulation passes for RTL and GL (gate-level)
179- [x] The hardened Macros are LVS and DRC clean
180- [x] The hardened ``user_project_wrapper`` adheres to the same pin
181 order specified at
182 `pin\_order <https://github.com/efabless/caravel/blob/master/openlane/user_project_wrapper_empty/pin_order.cfg>`__
183- [x] XOR check passes with zero total difference.
184- [x] Openlane summary reports are retained under ./signoff/
185
186.. |License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
187 :target: https://opensource.org/licenses/Apache-2.0
188.. |CI| image:: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_example_ci.yml/badge.svg
189 :target: https://github.com/efabless/caravel_project_example/actions/workflows/caravel_example_ci.yml