blob: 5eba3ea493718baf166a1a5659c3463380ff30d0 [file] [log] [blame] [view]
Manarc7bcaf92021-04-16 18:21:23 +02001<!---
2# SPDX-FileCopyrightText: 2020 Efabless Corporation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16# SPDX-License-Identifier: Apache-2.0
17-->
18
19# Caravel User Project
Amr A. Gouhar12208af2021-04-05 20:08:26 +020020[![CI](https://github.com/efabless/caravel_project_example/actions/workflows/caravel_example_ci.yml/badge.svg)](https://github.com/efabless/caravel_project_example/actions/workflows/caravel_example_ci.yml)
Manarc7bcaf92021-04-16 18:21:23 +020021
22# Overview
23
24This repo contains a sample user project that utilizes the [caravel](https://github.com/efabless/caravel.git) chip user space. The user project is a simple counter that showcases how to make use of [caravel's](https://github.com/efabless/caravel.git) user space utilities like IO pads, logic analyzer probes, and wishbone port. The repo also demonstrates the recommended strucute for the open-mpw shuttle projects.
25
26# Caravel Integration
27
28## Files Integration
29
30Caravel files are kept seperate from the user project by having caravel as submodule. The submodule commit should point to the latest of caravel master. The following files should have a symbolic link to [caravel's](https://github.com/efabless/caravel.git) corresponding files:
31
32- [Root Makefile](Makefile): This is to make sure that you adhere to the required implementation of the `compress` and `uncompress` targets. Also, [caravel's](https://github.com/efabless/caravel.git) Makefile provides useful targets like running `lvs`, `drc`, and `xor` checks. Run `make help` to display the available targets.
33
34- [Openlane Makefile](openlane/Makefile): This provides an easier way for running openlane to harden your macros. Refer to [ Hardening the User Project Macro]. Also, the makefile retains the openlane summary reports under the signoff directory.
35
36- [Pin order](openlane/user_project_wrapper/pin_order.cfg) file for the user wrapper: The hardened user project wrapper macro must have the same pin order specified in caravel's repo. Failing to adhere to the same order will fail the gds integration of the macro with caravel's backend.
37
38To create the symbolic links run the following:
39
40```bash
41# In case caravel is submoduled under the project root, export CARAVEL_PATH=caravel
42export CARAVEL_PATH=<caravel-path>
43
44ln -s $CARAVEL_PATH/Makefile Makefile
45ln -s $CARAVEL_PATH/openlane/Makefile openlane/Makefile
46ln -s $CARAVEL_PATH/openlane/user_project_wrapper_empty/pin_order.cfg openlane/user_project_wrapper/pin_order.cfg
47```
48
49## Verilog Integration
50
51You need to create a wrapper around your macro that adheres to the template at [user_project_wrapper](caravel/verilog/rtl/__user_project_wrapper.v). The wrapper top module must be named `user_project_wrapper` and must have the same input and output ports. The wrapper gives access to the user space utilities provided by caravel like IO ports, logic analyzer probes, and wishbone bus connection to the management SoC.
52
53For this sample project, the user macro makes use of:
54
55- The IO ports are used for displaying the count register values on the IO pads.
56
57- The LA probes are used for supplying an optional reset and clock signals and for setting an initial value for the count register.
58
59- The wishbeone port is also connected to the count register allowing for reading/writing the count value through the management SoC.
60
61Refer to [user_project_wrapper](verilog/rtl/user_project_wrapper.v) for more information.
62
63<p align=”center”>
64<img src="doc/counter_32.png" width="50%" height="10%">
65</p>
66
67# Running Full Chip Simulation
68
69The verilog testbenches are under this [verilog/dv](verilog/dv). For more information on setting up the simulation enviroment and the available testbenches for this sample project, refer to [README] (verilog/dv/README.md).
70
71# Hardening the User Project Macro using Openlane
72
73For instructions on how to install openlane and the pdk refere to [README](https://github.com/efabless/openlane/blob/master/README.md).
74
75There are two options for hardening the user project macro using openlane:
76
771. Hardening the user macro, then embedding it in the wrapper
782. Flattening the user macro with the wrapper.
79
80For more details on this, refer to this [README]().
81
82For this sample project, we went for the first option where the user macro is hardened first, then it is inserted in the user wrapper as a macro.
83
84<p align=”center”>
85<img src="doc/wrapper.png" width="30%" height="5%">
86</p>
87
88To reproduce hardening this project, run the following:
89
90```bash
91export OPENLANE_TAG=v0.12
92cd openlane
93# Runs openlane to harder user_proj_example
94make user_proj_example
95# Runs openlane to harder user_project_wrapper
96make user_project_wrapper
97```
98
99# Checklist for Open-MPW Submission
100
101- [x] The project repo adheres to the same directory structure in this repo.
102- [x] The project repo contain info.yaml at the project root.
103- [x] Top level macro is named `user_project_wrapper`.
104- [x] Full Chip Simulation passes for RTL and GL (gate-level)
105- [x] Hardened Macros are LVS and DRC clean
106- [x] Hardened `user_project_wrapper` adheres to the same pin order specified at [pin_order]()
107- [x] XOR check passes with zero total difference.
108- [x] Openlane summary reports are retained under ./signoff/