blob: 6e72e68edf5926b40779e11905587eb7c5ddd5c7 [file] [log] [blame] [view]
dineshannayya70a43d82022-12-07 09:15:15 +05301# Timing scripts
2
3A set of scripts for rcx and sta for caravel top level
4
5## Dependencies
6- Docker
7
8## Prerequisites
9
10A set of exports are needed:
11```bash
12export CARAVEL_ROOT=${HOME}/caravel/
13export MCW_ROOT=${HOME}/caravel_mgmt_soc_litex/
14export CUP_ROOT=${HOME}/caravel_user_project/
15export TIMING_ROOT=${HOME}/timing-scripts/
16export PDK_ROOT=${HOME}/pdk/
17export PDK=sky130A
18export OPENLANE_IMAGE_NAME=efabless/openlane:4476a58407d670d251aa0be6a55e5391bb181c4e-amd64
19```
20
21python modules:
22- `pyverilog`
23- `click`
24
25## Usage
26
27### caravel_user_project
28
291. After exporting the prerequisites, run:
30
31 ```
32 make -f timing.mk list-rcx
33 ```
34 You should get `rcx-user_project_wrapper` amongst others such as:
35
36 ```
37 rcx-buff_flash_clkrst
38 rcx-caravel
39 rcx-caravel_clocking
40 rcx-constant_block
41 rcx-digital_pll
42 rcx-gpio_control_block
43 rcx-gpio_defaults_block
44 rcx-gpio_logic_high
45 rcx-gpio_signal_buffering
46 rcx-gpio_signal_buffering_alt
47 rcx-housekeeping
48 rcx-mgmt_protect
49 rcx-mprj2_logic_high
50 rcx-mprj_logic_high
51 rcx-spare_logic_block
52 rcx-RAM256
53 rcx-mgmt_core_wrapper
54 rcx-user_proj_example
55 rcx-user_project_wrapper
56 ```
57
582. extract multicorner spefs for `user_project_wrapper` and any other blocks inside:
59
60 ```
61 make -f timing.mk rcx-user_project_wrapper
62 make -f timing.mk rcx-user_proj_example
63 ```
643. generate spef mapping file for caravel_user_project:
65
66 ```
67 python3 ./scripts/generate_spef_mapping -i ${CUP_ROOT}/verilog/gl/user_project_wrapper.v -o ${CUP_ROOT}/env/spef-mapping.tcl --project-root '$::env(CUP_ROOT)' --pdk-root ${PDK_ROOT} --pdk ${PDK}
68 ```
69
704. run sta:
71
72 ```
73 make -f timing.mk caravel-timing-typ
74 make -f timing.mk caravel-timing-slow
75 make -f timing.mk caravel-timing-fast
76 ```
77
78## Limitations
79
80- Makefile
81- Makefile
82- Assumes a fixed folder structure for the exported directories
83- Probably a lot of corner cases that weren't considered