Skip to content

Commit 6e9bb9c

Browse files
committed
sim: validate JTAG after reset
1 parent de6b824 commit 6e9bb9c

3 files changed

Lines changed: 65 additions & 97 deletions

File tree

README.md

Lines changed: 61 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ To make it easier to browse and understand, only used or important building bloc
2727

2828
The main SoC configurations are in `rtl/croc_pkg.sv`:
2929

30-
| Parameter | Default | Function |
31-
|---------------------|------------------|-------------------------------------------------------|
32-
| `PulpJtagIdCode` | `32'h1C0C_5DB3` | Debug module ID code |
33-
| `iDMAEnable` | `0` | Enable optional DMA (see `rtl/idma`) |
34-
| `NumSramBanks` | `2` | Number of memory banks |
35-
| `SramBankNumWords` | `512` | Number of 32bit words in a memory bank |
36-
| `BootAddr` | `32'h1000_0000` | Default boot address set in 'soc_ctrl' register |
37-
| `CrocAddrMap` | see 'Memory Map' | Routing rules used for the main crossbar |
38-
| `PeriphAddrMap` | see 'Memory Map' | Routing rules used for the peripheral demuliplexer |
30+
| Parameter | Default | Function |
31+
| ------------------ | ---------------- | -------------------------------------------------- |
32+
| `PulpJtagIdCode` | `32'h1C0C_5DB3` | Debug module ID code |
33+
| `iDMAEnable` | `0` | Enable optional DMA (see `rtl/idma`) |
34+
| `NumSramBanks` | `2` | Number of memory banks |
35+
| `SramBankNumWords` | `512` | Number of 32bit words in a memory bank |
36+
| `BootAddr` | `32'h1000_0000` | Default boot address set in 'soc_ctrl' register |
37+
| `CrocAddrMap` | see 'Memory Map' | Routing rules used for the main crossbar |
38+
| `PeriphAddrMap` | see 'Memory Map' | Routing rules used for the peripheral demuliplexer |
3939

4040
Further configurations can be made in `rtl/core_wrap.sv` (core specifics) and `rtl/croc_soc.sv` (connectivity between domains and to/from outside).
4141

@@ -52,21 +52,21 @@ Further each new subordinate should occupy multiples of 4KB of the address space
5252

5353
The address map of the default configuration is as follows:
5454

55-
| Start Address | Stop Address | Description |
56-
|-----------------|-----------------|--------------------------------------------|
57-
| `32'h0000_0000` | `32'h0004_0000` | Debug module (JTAG) |
58-
| `32'h0200_0000` | `32'h0200_4000` | Bootrom |
59-
| `32'h0204_0000` | `32'h0208_0000` | CLINT peripheral |
60-
| `32'h0300_0000` | `32'h0300_1000` | SoC control/info registers |
61-
| `32'h0300_2000` | `32'h0300_3000` | UART peripheral |
62-
| `32'h0300_5000` | `32'h0300_6000` | GPIO peripheral |
63-
| `32'h0300_A000` | `32'h0300_B000` | Timer peripheral |
64-
| `32'h0300_B000` | `32'h0300_C000` | (optional) DMA configuration |
65-
| `32'h1000_0000` | `+SRAM_SIZE` | Memory banks (SRAM) |
66-
| `32'h2000_0000` | `32'h8000_0000` | Passthrough to user domain |
67-
| `32'h2000_0000` | `32'h2000_1000` | reserved for user ROM text* |
68-
69-
*If people modify Croc we suggest they add a ROM at this address containing additional information
55+
| Start Address | Stop Address | Description |
56+
| --------------- | --------------- | ---------------------------- |
57+
| `32'h0000_0000` | `32'h0004_0000` | Debug module (JTAG) |
58+
| `32'h0200_0000` | `32'h0200_4000` | Bootrom |
59+
| `32'h0204_0000` | `32'h0208_0000` | CLINT peripheral |
60+
| `32'h0300_0000` | `32'h0300_1000` | SoC control/info registers |
61+
| `32'h0300_2000` | `32'h0300_3000` | UART peripheral |
62+
| `32'h0300_5000` | `32'h0300_6000` | GPIO peripheral |
63+
| `32'h0300_A000` | `32'h0300_B000` | Timer peripheral |
64+
| `32'h0300_B000` | `32'h0300_C000` | (optional) DMA configuration |
65+
| `32'h1000_0000` | `+SRAM_SIZE` | Memory banks (SRAM) |
66+
| `32'h2000_0000` | `32'h8000_0000` | Passthrough to user domain |
67+
| `32'h2000_0000` | `32'h2000_1000` | reserved for user ROM text\* |
68+
69+
\*If people modify Croc we suggest they add a ROM at this address containing additional information
7070
like the names of the developers, a project link or similar. This can then be written out via UART.
7171
We ask people to format the ROM like a C string with zero termination and using ASCII encoding if feasible.
7272
The [MLEM user ROM](https://github.com/pulp-platform/croc/blob/mlem-tapeout/rtl/user_domain/user_rom.sv) may serve as one possible reference implementation.
@@ -87,9 +87,9 @@ graph LR;
8787

8888
### Example Results
8989

90-
|Cell/Module placement | Routing |
91-
|:-----------------------------------------:|:------------------------------------:|
92-
|![Chip module view](doc/croc_modules.jpg) | ![Chip routed](doc/croc_routed.jpg) |
90+
| Cell/Module placement | Routing |
91+
| :---------------------------------------: | :---------------------------------: |
92+
| ![Chip module view](doc/croc_modules.jpg) | ![Chip routed](doc/croc_routed.jpg) |
9393

9494
## Requirements
9595

@@ -98,18 +98,18 @@ The current supported version is 2025.12, no other version is officially support
9898

9999
### ETHZ systems
100100

101-
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 linked GitHub PDK repositories.
101+
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 linked GitHub PDK repositories.
102102
You can directly create a cockpit `technology/` directory inside the Croc repository:
103103

104104
```sh
105105
# Make sure you are in <somedir>/croc
106106
# the checked-out repository
107-
icdesign ihp13 -nogui
107+
icdesign ihp13 -update all -nogui
108108
```
109109

110110
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.
111111

112-
You may prefer to just enter a shell in the pre-installed osic-tools container using:
112+
You may want to start a shell in the pre-installed osic-tools container using:
113113

114114
```sh
115115
oseda bash
@@ -124,7 +124,7 @@ oseda bash
124124

125125
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/).
126126
You do not need to manually download the container image, this will be done when running the script.
127-
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.
127+
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.
128128

129129
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).
130130

@@ -140,8 +140,7 @@ scripts/start_vnc.bat
140140
```
141141

142142
If you use the VNC option, open a browser and type `localhost` in the address bar.
143-
This should connect you to the VNC server, the password is `abc123`, then test by right-clicking somewhere, starting the terminal and typing `ls`.
144-
You should see the files in this repository again.
143+
This should connect you to the VNC server, the password is `abc123`, then test by right-clicking somewhere, starting the terminal and typing `ls`. You should see the files in this repository again.
145144

146145
Now you should be in an Ubuntu environment with all tools pre-installed for you.
147146
If something does not work, refer to the upstream [IIC-OSIC-Tools](https://github.com/iic-jku/IIC-OSIC-TOOLS/tree/main).
@@ -161,52 +160,47 @@ You need to build/install the required tools manually:
161160

162161
### PDK versions and sources
163162

164-
The ASIC flow supports two IHP PDK selections through `CROC_PDK`:
163+
The ASIC flow supports two IHP PDKs selected via the `CROC_PDK` environmental variable:
165164

166165
- `sg13cmos5l`: the default 5-metal CMOS5L option.
167-
- `sg13g2`: the original SG13G2 stack.
166+
- `sg13g2`: the original SG13G2 7-metal option.
168167

169-
`CROC_PDK` is the only PDK setting users select. There is one active view for
170-
the digital collateral used by synthesis, place and route, simulation, and
171-
DEF-to-GDS conversion:
168+
`CROC_PDK` is the only PDK setting users select. There is one active view used by synthesis, place and route, simulation, and DEF-to-GDS conversion:
172169

173-
- `technology/`: Liberty, LEF, Verilog models, and GDS files for the selected
174-
stack.
170+
- `technology/`: Liberty, LEF, Verilog models, and GDS files for the selected PDK.
175171

176-
On ETH systems, `technology/` is normally created by the ETHZ Design Center
177-
cockpit and takes priority. Outside ETH, `env.sh` creates `technology ->
178-
ihp13/pdk` on demand if `technology/` does not already exist. The committed
179-
`ihp13/pdk` mirror contains the Apache-2.0 Liberty, LEF, and Verilog files
180-
needed by the flow. The two Croc bondpad GDS files are committed in
181-
`ihp13/pdk/gds`; IHP GDS files are kept out of git and can be downloaded with:
172+
On ETH systems, the `technology/` directory is set up by the ETHZ Design Center cockpit and takes priority.
173+
Outside ETH, `env.sh` creates `technology -> ihp13/pdk` symbolic link on demand if `technology/` does not already exist.
174+
The committed `ihp13/pdk` mirror contains the Apache-2.0 Liberty, LEF, and Verilog files needed by the flow.
175+
The two Croc bondpad GDS files are committed in `ihp13/pdk/gds`; IHP GDS files are kept out of git and can be downloaded with:
182176

183177
```sh
184178
scripts/download_gds.sh
185179
```
186180

187-
Maintainers update the pinned PDK mirror with `scripts/update_pdk.sh`.
188-
`ihp13/pdk/pdk_manifest.csv` records the source and digest of every mirrored
189-
collateral file and supports both direct GitHub files and archive-based
190-
deliveries.
181+
Maintainers can update the pinned PDK mirror with `scripts/update_pdk.sh`.
182+
`ihp13/pdk/pdk_manifest.csv` records the source and digest of every mirrored PDK file and supports both direct GitHub files and archive-based deliveries.
191183

192-
You can also run `scripts/setup_technology.sh` manually to print the active
193-
technology view. `env.sh` runs the same setup quietly before the ASIC scripts
194-
use the PDK. If `technology/` already exists, setup leaves it unchanged;
195-
Cockpit may link shared Croc-managed collateral from `ihp13/pdk`. Otherwise,
196-
`technology/` is a symlink to the public mirror.
184+
You can also run `scripts/setup_technology.sh` manually to print the active technology view. `env.sh` runs the same setup quietly before the ASIC scripts use the PDK.
197185

198-
KLayout needs technology scripts, filling rules, and layer properties in
199-
addition to the digital collateral above. Those tool-support files remain in
200-
the `ihp13/sg13cmos5l` and `ihp13/sg13g2` submodules. They are not another
201-
choice of PDK data and must be initialized with the normal submodule command.
202-
On ETH systems, the installed CMOS5L KLayout support package takes priority
203-
when available.
186+
KLayout needs technology scripts, filling rules, and layer properties in addition to the files mentioned above.
187+
On ETH systems, the installed CMOS5L KLayout support package takes priority when available.
188+
Otherwise, the appropriate submodule, either `ihp13/sg13cmos5l` or `ihp13/sg13g2`, is required for the KLayout setup.
204189

205-
The OSIC/oseda container also contains a PDK under `/foss/pdks`, but Croc does not use that as the source of record. It is harder to inspect from the repository, it follows the container version, and it does not contain all CMOS5L/cockpit collateral used by the ETH flow.
190+
The OSIC/oseda container also contains a PDK under `/foss/pdks`, but Croc does not currently use it.
206191

207192
## Getting started
208193

209194
The SoC is fully functional as-is and a simple software example is provided for simulation.
195+
196+
On ETH systems, create or update `technology/` with cockpit first.
197+
198+
```sh
199+
icdesign ihp13 -update all -nogui
200+
```
201+
202+
For external machines the committed `ihp13/pdk` fallback is used automatically.
203+
210204
To run the synthesis and place & route flow execute:
211205

212206
```sh
@@ -216,7 +210,8 @@ cd ../openroad && ./run_backend.sh --all
216210
cd ../klayout && ./run_finishing.sh --gds
217211
```
218212

219-
The ASIC flow defaults to `CROC_PDK=sg13cmos5l`. To switch back to the original stack, export `CROC_PDK=sg13g2` before running the scripts. On ETH systems, create or update `technology/` with cockpit first; external users use the committed `ihp13/pdk` fallback automatically.
213+
The ASIC flow defaults to `CROC_PDK=sg13cmos5l`.
214+
To switch back to the original metal stack, export `CROC_PDK=sg13g2` before running the scripts.
220215

221216
To simulate you can use:
222217

@@ -225,20 +220,13 @@ cd sw && make all
225220
cd ../verilator && ./run_verilator.sh --build --run ../sw/bin/helloworld.hex
226221
```
227222

228-
To simulate the post-Yosys netlist with Verilator instead, first generate the
229-
netlist and then use the explicit netlist commands:
223+
To simulate the post-Yosys netlist with Verilator instead, first generate the netlist and then use the explicit netlist commands:
230224

231225
```sh
232226
cd yosys && ./run_synthesis.sh --synth
233227
cd ../verilator && ./run_verilator.sh --build-netlist --run-netlist ../sw/bin/helloworld.hex
234228
```
235229

236-
For a short structural check of the post-Yosys simulation, use:
237-
238-
```sh
239-
cd verilator && ./run_verilator.sh --build-netlist --run-netlist-smoke
240-
```
241-
242230
If you have Questasim/Modelsim, you can also run:
243231

244232
```sh
@@ -285,10 +273,11 @@ For this repository, we use a subcommand called `bender vendor` together with th
285273
`bender 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.
286274
Fixes and changes to each IPs `rtl/<IP>/Bender.yml` are managed by `bender vendor` in `rtl/patches`.
287275

288-
If you need to update a dependency or map another file you need to edit the coresponding `vendor_package` section in `Bender.yml` and then run `bender vendor init`. Then you might need to change `rtl/<IP>/Bender.yml` to list your new file in the sources.
276+
If you need to update a dependency or map another file you need to edit the coresponding `vendor_package` section in `Bender.yml` and then run `bender vendor init`. Then you might need to change `rtl/<IP>/Bender.yml` to list your new file in the sources.
289277
To save a fix/change as a patch, stage it in git and then run `bender vendor patch`. When prompted, add a commit message (this is used as the patches file name). Finally, commit both the patch file and the new `rtl/<IP>`.
290278

291279
**Note:** using `bender vendor` in this repository to change the local versions of the IPs requires an up-to-date version of Bender. (v0.28.2 or newer)
280+
292281
### Targets
293282

294283
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.

rtl/test/tb_croc_soc.sv

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,10 @@ module tb_croc_soc #(
4141
/////////////////////////////
4242

4343
string binary_path;
44-
bit netlist_smoke;
4544

4645
initial begin
47-
netlist_smoke = $test$plusargs("netlist_smoke");
48-
4946
// $value$plusargs defines what to look for (here +binary=...)
50-
if (netlist_smoke) begin
51-
binary_path = "";
52-
end else if ($value$plusargs("binary=%s", binary_path)) begin
47+
if ($value$plusargs("binary=%s", binary_path)) begin
5348
$display("Running program: %s", binary_path);
5449
end else begin
5550
$display("No binary path provided. Running helloworld.");
@@ -129,13 +124,9 @@ module tb_croc_soc #(
129124
// wait for reset
130125
#ClkPeriodSys;
131126

132-
if (netlist_smoke) begin
133-
#1us;
134-
if ($isunknown(jtag_tdo)) begin
135-
$fatal(1, "[NETLIST] JTAG output did not resolve after reset");
136-
end
137-
$display("@%t | [NETLIST] Reset smoke test: SUCCESS", $time);
138-
$finish();
127+
#1us;
128+
if ($isunknown(jtag_tdo)) begin
129+
$fatal(1, "[JTAG] Output is unknown (X) after reset");
139130
end
140131

141132
// init jtag

verilator/run_verilator.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ Options:
4040
--run BINARY Run the RTL simulation binary
4141
--run-netlist BINARY
4242
Run the Yosys-netlist simulation binary
43-
--run-netlist-smoke
44-
Run the Yosys-netlist reset smoke test
4543
4644
Example:
4745
# Build and run RTL simulation with a given binary
@@ -179,12 +177,6 @@ run_netlist_binary() {
179177
run_cmd "obj_dir_netlist_yosys/Vtb_croc_soc +binary="$1" | tee ${PROJ_NAME}_netlist_yosys.log"
180178
}
181179

182-
run_netlist_smoke() {
183-
run_cmd "echo [INFO][Verilator] Run Yosys-netlist reset smoke test"
184-
run_cmd "obj_dir_netlist_yosys/Vtb_croc_soc +netlist_smoke | tee ${PROJ_NAME}_netlist_yosys_smoke.log"
185-
}
186-
187-
188180
####################
189181
# Parse Arguments
190182
####################
@@ -247,10 +239,6 @@ while [[ $# -gt 0 ]]; do
247239
run_netlist_binary $2
248240
shift 2
249241
;;
250-
--run-netlist-smoke)
251-
run_netlist_smoke
252-
shift
253-
;;
254242
# Error handling
255243
*)
256244
echo "[ERROR] Unknown option: $1 (use --help for usage)" >&2

0 commit comments

Comments
 (0)