You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-29Lines changed: 52 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,16 @@ Croc is developed as part of the PULP project, a joint effort between ETH Zurich
9
9
Croc was successfully taped out in Nov 2024. The chip is called [MLEM](http://asic.ee.ethz.ch/2024/MLEM.html), named after the sound Yoshi makes when eating a tasty fruit.
10
10
MLEM was designed and prepared for tapeout by ETHZ students as a bachelor project. The exact code and scripts used for the tapeout can be seen in the frozen [mlem-tapeout](https://github.com/pulp-platform/croc/tree/mlem-tapeout) branch.
11
11
12
-
13
12
## Architecture
14
13
15
14

16
15
17
16
The SoC is composed of two main parts:
18
-
- The `croc_domain` containing a CVE2 core (a fork of Ibex), SRAM, an OBI crossbar and a few simple peripherals
17
+
18
+
- The `croc_domain` containing a CVE2 core (a fork of Ibex), SRAM, an OBI crossbar and a few simple peripherals
19
19
- The `user_domain` where students are invited to add their own designs or other open-source designs (peripherals, accelerators...)
20
20
21
-
The main interconnect is OBI, you can find [the spec online](https://github.com/openhwgroup/obi/blob/072d9173c1f2d79471d6f2a10eae59ee387d4c6f/OBI-v1.6.0.pdf).
21
+
The main interconnect is OBI, you can find [the spec online](https://github.com/openhwgroup/obi/blob/072d9173c1f2d79471d6f2a10eae59ee387d4c6f/OBI-v1.6.0.pdf).
22
22
23
23
The various IPs of the SoC (UART, OBI, debug-module, timer...) come from other PULP repositories and are managed by [Bender](https://github.com/pulp-platform/bender).
24
24
To make it easier to browse and understand, only the currently used files are included in `rtl/<IP>`. You may want to explore the repositories of the respective IPs to find their documentation or additional functionality, the urls are in `Bender.yml`.
@@ -63,87 +63,101 @@ The address map of the default configuration is as follows:
63
63
|`32'h2000_0000`|`32'h2000_1000`| reserved for string formatted user ROM*|
64
64
65
65
66
-
*If people modify Croc we suggest they add a ROM at this address containing additional information
66
+
*If people modify Croc we suggest they add a ROM at this address containing additional information
67
67
like the names of the developers, a project link or similar. This can then be written out via UART.
68
68
We ask people to format the ROM like a C string with zero termination and using ASCII encoding if feasible.
69
69
The [MLEM user ROM](https://github.com/pulp-platform/croc/blob/mlem-tapeout/rtl/user_domain/user_rom.sv) may serve as a reference implementation.
70
70
71
71
## Flow
72
+
72
73
```mermaid
73
74
graph LR;
74
-
Bender-->Yosys;
75
-
Yosys-->OpenRoad;
76
-
OpenRoad-->KLayout;
75
+
Bender-->Yosys;
76
+
Yosys-->OpenRoad;
77
+
OpenRoad-->KLayout;
77
78
```
79
+
78
80
1. Bender provides a list of SystemVerilog files
79
81
2. Yosys parses, elaborates, optimizes and maps the design to the technology cells
80
82
3. The netlist, constraints and floorplan are loaded into OpenRoad for Place&Route
81
83
4. The design as def is read by klayout and the geometry of the cells and macros are merged
82
84
83
85
Currently, the final GDS is still missing the following things:
86
+
84
87
- metal density fill
85
88
- sealring
89
+
86
90
These can be added in KLayout, check the [IHP repository](https://github.com/IHP-GmbH/IHP-Open-PDK/tree/main) (possible the dev branch) for a reference script.
We are using the excellent docker container maintained by Harald Pretl. If you get stuck with installing the tools, we urge you to check the [Tool Repository](https://github.com/iic-jku/IIC-OSIC-TOOLS).
96
101
The current supported version is 2025.12, no other version is officially supported.
97
102
98
103
### ETHZ systems
104
+
99
105
ETHZ Design Center maintains an internal version of the IHP PDK, with integrations into all tools we have access to. For this reason if you work on the ETH systems it is recommended to use the `icdesign` tool (cockpit) instead of the liked Github repo.
100
106
You can directly create a cockpit directory inside the croc directory:
107
+
101
108
```sh
102
109
# Make sure you are in <somedir>/croc
103
110
# the checked-out repository
104
111
icdesign ihp13 -nogui
105
112
```
113
+
106
114
The setup is guided by the `.cockpitrc` configuration file. If you need different macros or another version of the standard cells you can change it accordingly.
107
115
108
116
An environment setup for bash is provided to get easy access to the tools:
117
+
109
118
```sh
110
119
source ethz.env
111
120
```
112
121
113
122
Additionally you may prefer to just enter a shell in the pre-installed osic-tools container using:
123
+
114
124
```sh
115
125
oseda bash
116
126
# specific version eg: oseda -2025.12 bash
117
127
```
118
128
119
129
### Other systems
130
+
120
131
**Note: this has currently only been tested on Ubuntu and RHEL Linux.**
121
132
122
-
#### Docker (easy)
133
+
#### Docker (easy)
134
+
123
135
There are two possible ways, the easiest way is to install docker and work in the docker container, you can follow the install guides on the [Docker Website](https://docs.docker.com/desktop/).
124
136
You do not need to manually download the container image, this will be done when running the script.
125
137
If you do not have `git` installed on your system, you also need to install [Github Desktop](https://desktop.github.com/download/) and then clone this git repository.
126
138
127
139
It is a good idea to grant non-root (`sudo`) users access to docker, this is decribed in the [Docker Article](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).
128
140
129
141
Finally, you can navigate to this directory, open a terminal (PowerShell in Windows) and type:
142
+
130
143
```sh
131
144
# Linux only (starts and enters docker container in shell)
132
-
./start_linux.sh
145
+
scripts/start_linux.sh
133
146
# Linux/Mac (starts VNC server on localhost:5901)
134
-
./start_vnc.sh
147
+
scripts/start_vnc.sh
135
148
# Windows (starts VNC server on localhost:5901)
136
-
./start_vnc.bat
149
+
scripts/start_vnc.bat
137
150
```
138
151
139
-
If you use the VNC option, open a browser and type `localhost` in the address bar.
152
+
If you use the VNC option, open a browser and type `localhost` in the address bar.
140
153
This should connect you to the VNC server, the password is `abc123`, then test by right-clicking somewhere, starting the terminal and typing `ls`.
141
154
You should see the files in this repository again.
142
155
143
156
Now you should be in an Ubuntu environment with all tools pre-installed for you.
144
157
If something does not work, refer to the upstream [IIC-OSIC-Tools](https://github.com/iic-jku/IIC-OSIC-TOOLS/tree/main)
145
158
146
159
#### Native install (hard)
160
+
147
161
You need to build/install the required tools manually:
The SoC is fully functional as-is and a simple software example is provided for simulation.
159
173
To run the synthesis and place & route flow execute:
174
+
160
175
```sh
161
-
make checkout
162
-
make yosys
163
-
make openroad
164
-
make klayout
176
+
git submodule update --init --recursive
177
+
cd yosys&& ./run_synthesis.sh --synth
178
+
cd ../openroad&& ./run_backend.sh --all
179
+
cd ../klayout&& ./run_finishing.sh --gds
165
180
```
166
181
167
182
To simulate you can use:
168
-
```sh
169
-
make verilator
170
-
```
171
183
172
-
If you have Questasim/Modelsim, you can also run:
173
184
```sh
174
-
make vsim
185
+
cd sw && make all
186
+
cd ../verilator && ./run_verilator.sh --build --run ../sw/bin/helloworld.hex
175
187
```
176
188
189
+
If you have Questasim/Modelsim, you can also run:
177
190
178
-
The most important make targets are documented, you can list them with:
179
191
```sh
180
-
make help
192
+
cd vsim && ./run_vsim.sh --build --run ../sw/bin/helloworld.hex
181
193
```
182
194
195
+
All `run_` scripts have a `--help` you can use to orient yourself.
196
+
183
197
### Building on Croc
198
+
184
199
To add your own design, we recommend creating a new directory under `rtl/` or put single source files (small designs) into `rtl/user_domain`, then go into `Bender.yml` and add the files in the indicated places.
185
200
This will make Bender aware of the files and any script it contains will contain your design as well.
186
201
187
202
Then re-generate the default synthesis file-list:
203
+
188
204
```sh
189
-
make yosys-flist
205
+
cd yosys && ./run_synthesis.sh --flist
206
+
cd ../verilator && ./run_verilator.sh --flist
190
207
```
191
208
192
209
If you want to add an existing design and it already containts a `Bender.yml` in its repository, you can add it as a dependency in the `Bender.yml` and reading the guide below.
193
210
194
211
## Bender
212
+
195
213
The dependency manager [Bender](https://github.com/pulp-platform/bender) is used in most pulp-platform IPs.
196
214
Usually each dependency would be in a seperate repository, each with a `Bender.yml` file to describe where the RTL files are, how you can use this dependency and which additional dependency it has.
197
215
In the top level repository (like this SoC) you also have a `Bender.yml` file but you will commonly find a `Bender.lock` file. It contains the resolved tree of dependencies with specific commits for each. Whenever you run a command using Bender, this is the file it uses to figure out where things are.
198
216
199
217
Below is a small guide aimed at the usecase for this project. The Bender repo has a more extensive [Command Guide](https://github.com/pulp-platform/bender?tab=readme-ov-file#commands).
200
218
201
219
### Checkout
202
-
Using the command `bender checkout` Bender will check the lock file and download the specified commits from the repositories (usually into a hidden `.bender` directory).
220
+
221
+
Using the command `bender checkout` Bender will check the lock file and download the specified commits from the repositories (usually into a hidden `.bender` directory).
203
222
204
223
### Update
224
+
205
225
Running `bender update` on the other hand will resolve the entire tree again and re-generate the lock file (you usually have to resolve some version/revision conflicts if multiple things use the same dependency).
206
226
207
227
**Remember:** always test everything again if you generate a new `Bender.lock`, it is the same as modifying RTL.
208
228
209
229
### Local Versions
230
+
210
231
For this repository, we use a subcommand called `bendor vendor` together with the `vendor_package` section in `Bender.yml`.
211
232
`bendor vendor` can be used to Benderize arbitrary repositories with RTL in it. The dependencies are already 'checked out' into `rtl/<IP>`. Each file or directory from the repository is mapped to a local path in this repo.
212
233
Fixes and changes to each IPs `rtl/<IP>/Bender.yml` are managed by `bender vendor` in `rtl/patches`.
@@ -217,7 +238,9 @@ To save a fix/change as a patch, stage it in git and then run `bender vendor pat
217
238
**Note:** using `bender vendor` in this repository to change the local versions of the IPs requires an up-to-date version of Bender, specifically it needs to include [PR 179](https://github.com/pulp-platform/bender/pull/179).
218
239
219
240
### Targets
241
+
220
242
Another thing we use are targets (in the `Bender.yml`), together they build different views/contexts of your RTL. For example without defining any targets the technology independent cells/memories are used (in `rtl/tech_cells_generic/`) but if we use the target `ihp13` then the same modules contain a technology-specific implementation (in `ihp13/`). Similar contexts are built for different simulators and other things.
221
243
222
244
## License
245
+
223
246
Unless specified otherwise in the respective file headers, all code checked into this repository is made available under a permissive license. All hardware sources and tool scripts are licensed under the Solderpad Hardware License 0.51 (see `LICENSE.md`). All software sources are licensed under Apache 2.0.
0 commit comments