Skip to content

Commit 40bfe50

Browse files
committed
treewide: small flow fixes, wording
1 parent 09bfe7e commit 40bfe50

File tree

12 files changed

+148
-143
lines changed

12 files changed

+148
-143
lines changed

README.md

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ Croc is developed as part of the PULP project, a joint effort between ETH Zurich
99
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.
1010
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.
1111

12-
1312
## Architecture
1413

1514
![Croc block diagram](doc/croc_arch.svg)
1615

1716
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
1919
- The `user_domain` where students are invited to add their own designs or other open-source designs (peripherals, accelerators...)
2020

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).
2222

2323
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).
2424
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:
6363
| `32'h2000_0000` | `32'h2000_1000` | reserved for string formatted user ROM* |
6464

6565

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
6767
like the names of the developers, a project link or similar. This can then be written out via UART.
6868
We ask people to format the ROM like a C string with zero termination and using ASCII encoding if feasible.
6969
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.
7070

7171
## Flow
72+
7273
```mermaid
7374
graph LR;
74-
Bender-->Yosys;
75-
Yosys-->OpenRoad;
76-
OpenRoad-->KLayout;
75+
Bender-->Yosys;
76+
Yosys-->OpenRoad;
77+
OpenRoad-->KLayout;
7778
```
79+
7880
1. Bender provides a list of SystemVerilog files
7981
2. Yosys parses, elaborates, optimizes and maps the design to the technology cells
8082
3. The netlist, constraints and floorplan are loaded into OpenRoad for Place&Route
8183
4. The design as def is read by klayout and the geometry of the cells and macros are merged
8284

8385
Currently, the final GDS is still missing the following things:
86+
8487
- metal density fill
8588
- sealring
89+
8690
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.
8791

8892
### Example Results
89-
Cell/Module placement | Routing
90-
:-----------------------------------------:|:------------------------------------:
91-
![Chip module view](doc/croc_modules.jpg) | ![Chip routed](doc/croc_routed.jpg)
9293

94+
|Cell/Module placement | Routing |
95+
|:-----------------------------------------:|:------------------------------------:|
96+
|![Chip module view](doc/croc_modules.jpg) | ![Chip routed](doc/croc_routed.jpg) |
9397

9498
## Requirements
99+
95100
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).
96101
The current supported version is 2025.12, no other version is officially supported.
97102

98103
### ETHZ systems
104+
99105
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.
100106
You can directly create a cockpit directory inside the croc directory:
107+
101108
```sh
102109
# Make sure you are in <somedir>/croc
103110
# the checked-out repository
104111
icdesign ihp13 -nogui
105112
```
113+
106114
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.
107115

108116
An environment setup for bash is provided to get easy access to the tools:
117+
109118
```sh
110119
source ethz.env
111120
```
112121

113122
Additionally you may prefer to just enter a shell in the pre-installed osic-tools container using:
123+
114124
```sh
115125
oseda bash
116126
# specific version eg: oseda -2025.12 bash
117127
```
118128

119129
### Other systems
130+
120131
**Note: this has currently only been tested on Ubuntu and RHEL Linux.**
121132

122-
#### Docker (easy)
133+
#### Docker (easy)
134+
123135
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/).
124136
You do not need to manually download the container image, this will be done when running the script.
125137
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.
126138

127139
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).
128140

129141
Finally, you can navigate to this directory, open a terminal (PowerShell in Windows) and type:
142+
130143
```sh
131144
# Linux only (starts and enters docker container in shell)
132-
./start_linux.sh
145+
scripts/start_linux.sh
133146
# Linux/Mac (starts VNC server on localhost:5901)
134-
./start_vnc.sh
147+
scripts/start_vnc.sh
135148
# Windows (starts VNC server on localhost:5901)
136-
./start_vnc.bat
149+
scripts/start_vnc.bat
137150
```
138151

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.
140153
This should connect you to the VNC server, the password is `abc123`, then test by right-clicking somewhere, starting the terminal and typing `ls`.
141154
You should see the files in this repository again.
142155

143156
Now you should be in an Ubuntu environment with all tools pre-installed for you.
144157
If something does not work, refer to the upstream [IIC-OSIC-Tools](https://github.com/iic-jku/IIC-OSIC-TOOLS/tree/main)
145158

146159
#### Native install (hard)
160+
147161
You need to build/install the required tools manually:
148162

149163
- [Bender](https://github.com/pulp-platform/bender#installation): Dependency manager
@@ -153,60 +167,67 @@ You need to build/install the required tools manually:
153167
- (Optional) [Verilator](https://github.com/verilator/verilator): Simulator
154168
- (Optional) Questasim/Modelsim: Simulator
155169

156-
157170
## Getting started
171+
158172
The SoC is fully functional as-is and a simple software example is provided for simulation.
159173
To run the synthesis and place & route flow execute:
174+
160175
```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
165180
```
166181

167182
To simulate you can use:
168-
```sh
169-
make verilator
170-
```
171183

172-
If you have Questasim/Modelsim, you can also run:
173184
```sh
174-
make vsim
185+
cd sw && make all
186+
cd ../verilator && ./run_verilator.sh --build --run ../sw/bin/helloworld.hex
175187
```
176188

189+
If you have Questasim/Modelsim, you can also run:
177190

178-
The most important make targets are documented, you can list them with:
179191
```sh
180-
make help
192+
cd vsim && ./run_vsim.sh --build --run ../sw/bin/helloworld.hex
181193
```
182194

195+
All `run_` scripts have a `--help` you can use to orient yourself.
196+
183197
### Building on Croc
198+
184199
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.
185200
This will make Bender aware of the files and any script it contains will contain your design as well.
186201

187202
Then re-generate the default synthesis file-list:
203+
188204
```sh
189-
make yosys-flist
205+
cd yosys && ./run_synthesis.sh --flist
206+
cd ../verilator && ./run_verilator.sh --flist
190207
```
191208

192209
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.
193210

194211
## Bender
212+
195213
The dependency manager [Bender](https://github.com/pulp-platform/bender) is used in most pulp-platform IPs.
196214
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.
197215
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.
198216

199217
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).
200218

201219
### 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).
203222

204223
### Update
224+
205225
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).
206226

207227
**Remember:** always test everything again if you generate a new `Bender.lock`, it is the same as modifying RTL.
208228

209229
### Local Versions
230+
210231
For this repository, we use a subcommand called `bendor vendor` together with the `vendor_package` section in `Bender.yml`.
211232
`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.
212233
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
217238
**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).
218239

219240
### Targets
241+
220242
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.
221243

222244
## License
245+
223246
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.

artistic/run_artistic.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
# Copyright (c) 2026 ETH Zurich and University of Bologna.
33
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
44
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Authors:
7+
# - Thomas Benz <tbenz@iis.ee.ethz.ch>
58

69
set -e # Exit on error
710
set -u # Error on undefined vars
811

912

1013
################
11-
### Setup
14+
# Setup
1215
################
1316
# Source environment
1417
source "../env.sh"
@@ -17,7 +20,7 @@ export GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-localhost}" # Get commit in CI ru
1720

1821

1922
################
20-
### Helpers
23+
# Helpers
2124
################
2225

2326
show_help() {
@@ -29,14 +32,14 @@ Usage:
2932
3033
Options:
3134
--help, -h Show this help message
32-
--dry-run, -n Don't actually run any command; just print them
33-
--verbose, -v Print commands before executing them
35+
--dry-run, -n Only print commands instead of executing
36+
--verbose, -v Print commands while executing
3437
--logo SRC_FILE Create an ASIC art on the top metal layer from 'artistic/src/logo_chip.svg'
3538
The source file is seen relative to the 'klayout/out' directory.
3639
--render Render the logo-enhanced GDS
3740
--outline Annotate the render with module oulines defined in 'artistic/src/croc_modules.json'
3841
--render-map Render and generate an OpenStreetMap DB
39-
--cleanup Cleanup intermittend files
42+
--cleanup Cleanup intermittent files
4043
4144
EOF
4245
exit 0
@@ -167,7 +170,7 @@ cleanup() {
167170

168171

169172
####################
170-
### Parse Arguments
173+
# Parse Arguments
171174
####################
172175

173176
DRYRUN=0

env.sh

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/bash
2-
# Copyright (c) 2024 ETH Zurich and University of Bologna.
2+
# Copyright (c) 2026 ETH Zurich and University of Bologna.
33
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
44
# SPDX-License-Identifier: Apache-2.0
55
#
6+
# Authors:
7+
# - Philippe Sauter <phsauter@iis.ee.ethz.ch>
8+
# - Thomas Benz <tbenz@iis.ee.ethz.ch>
9+
#
610
# Environment setup for Croc SoC ASIC flow
711
# This file is sourced by all scripts to set up tool paths and PDK location
812

@@ -15,9 +19,10 @@ fi
1519
echo "[INFO][ENV] Croc root: $CROC_ROOT"
1620

1721

18-
################
19-
## PDK Discovery (priority: PDK_ROOT → technology/ → ihp13/pdk/)
20-
################
22+
###################
23+
# PDK Discovery
24+
###################
25+
# priority: technology/ over ihp13/pdk/
2126

2227
if [[ -d "${CROC_ROOT}/technology" ]]; then
2328

@@ -67,42 +72,18 @@ fi
6772
echo "[INFO][ENV] PDK root: $PDK_ROOT"
6873
echo "[INFO][ENV] KLayout path: $KLAYOUT_PATH"
6974

70-
export PDK=ihp-sg13g2
71-
7275

73-
################
74-
## Project Settings ##
75-
################
76+
######################
77+
# Project Settings
78+
######################
7679
export PROJ_NAME="${PROJ_NAME:-croc}"
7780
export TOP_DESIGN="${TOP_DESIGN:-croc_chip}"
7881
export DUT_DESIGN="${DUT_DESIGN:-croc_soc}"
7982

80-
################
81-
## Directory Structure ##
82-
################
83-
# Yosys
84-
export YOSYS_DIR="${CROC_ROOT}/yosys"
85-
export YOSYS_OUT="${YOSYS_DIR}/out"
86-
export YOSYS_REPORTS="${YOSYS_DIR}/reports"
87-
export YOSYS_TMP="${YOSYS_DIR}/tmp"
88-
89-
# OpenROAD
90-
export OR_DIR="${CROC_ROOT}/openroad"
91-
export OR_OUT="${OR_DIR}/out"
92-
export OR_REPORTS="${OR_DIR}/reports"
93-
export OR_SAVE="${OR_DIR}/save"
94-
95-
# KLayout
96-
export KLAYOUT_DIR="${CROC_ROOT}/klayout"
97-
98-
# Software
99-
export SW_DIR="${CROC_ROOT}/sw"
100-
export SW_BIN="${SW_DIR}/bin"
101-
102-
################
103-
## Netlist Paths ##
104-
################
105-
export NETLIST="${YOSYS_OUT}/${TOP_DESIGN}_yosys.v"
106-
export NETLIST_DEBUG="${YOSYS_OUT}/${TOP_DESIGN}_yosys_debug.v"
10783

84+
###################
85+
# Netlist Paths
86+
###################
87+
export NETLIST="${CROC_ROOT}/yosys/${TOP_DESIGN}_yosys.v"
88+
export NETLIST_DEBUG="${CROC_ROOT}/yosys/${TOP_DESIGN}_yosys_debug.v"
10889

ethz.env

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)