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
{{ message }}
Repository navigation
Commit dc359a6
Browse filesBrowse the repository at this point in the historyBrowse files
Merge The-OpenROAD-Project/OpenROAD-flow-scripts master into grt-fails-hard
global_route.tcl: master's estimate_parasitics without -global_routing
(#4691) taken into the unwrapped script; master's change to the
GENERATE_ARTIFACTS_ON_FAILURE branch goes with the branch.
FlowVariables.md, variables.json: GLOBAL_CONNECT_TCL kept,
GENERATE_ARTIFACTS_ON_FAILURE dropped; generate-variables-docs.py
reproduces both files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PFLaCzFtFbnWE4nPTDwpC
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Copy file name to clipboardExpand all lines: docs/contrib/EndpointSlackTracking.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,19 +27,21 @@ cells) re-time the design if it is loaded, or else copy the previous step's
27
27
snapshot. Intermediate `.odb` files written through `orfs_write_db` (e.g. CTS
28
28
`save_progress`) also get a snapshot; `*-failed` ones don't.
29
29
30
-
So that all steps are timed the same way, parasitics are estimated before
31
-
reporting as in `open.tcl`, based on the step number:
30
+
A placed step is timed with the parasitics OpenROAD has for it: a bare
31
+
`estimate_parasitics` estimates from the global routes when there are any,
32
+
else from placement, and does nothing once `read_spef` has read the
33
+
extracted parasitics:
32
34
33
35
| Steps | Parasitics |
34
36
| --- | --- |
35
-
|1, 2 | none (cells are not placed)|
36
-
|3, 4 |`estimate_parasitics -placement`|
37
-
|5, `6_1_fill`|`estimate_parasitics -global_routing` if global routes exist|
38
-
|`6_final`|`rcx`: the extracted `6_final.spef`, as in `6_finish.rpt` (`global_routing` on platforms without `RCX_RULES`) |
37
+
|before placement, and `3_1_place_gp_skip_io` while the pins are unplaced |`none`|
38
+
|placed, before global route |`placement`|
39
+
|global route and later |`global_routing`|
40
+
|`6_final`|`spef`: the extracted `6_final.spef`, as in `6_finish.rpt` (`global_routing` on platforms without `RCX_RULES`, or with `SKIP_DETAILED_ROUTE=1`) |
39
41
40
42
The parasitics model is recorded in each snapshot and shown by
41
43
`endpointSlack.py`. Slack changes between steps with different models (e.g.
42
-
`2_4_floorplan_pdn` to `3_1_place_gp_skip_io`, `4_1_cts` to `5_1_grt`, or
44
+
`2_4_floorplan_pdn` to the first placed step, `4_1_cts` to `5_1_grt`, or
43
45
`6_1_fill` to `6_final`) include the change of model. Detailed routing is
44
46
only extracted in `6_final`, so `5_2_route` to `6_1_fill` show global routing
Copy file name to clipboardExpand all lines: docs/user/AutoMemories.md
+130Lines changed: 130 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,134 @@ the left edge, alternating horizontal M4 `VDD`/`VSS` straps across the
160
160
macro (which the platform's PDN macro grid connects to M5), and an `OBS`
161
161
covering M1 to M4.
162
162
163
+
## Register files
164
+
165
+
A register file, many read and write ports over a few words, is no
166
+
SRAM: FakeRAM's single-port model does not describe it, and synthesised
167
+
to flops its mux trees are placed by a placer that does not know they
168
+
are an array. `AUTO_MEMORIES_REGFILES` lists spec files, one per RTL
169
+
module, and OpenROAD's `generate_ram` builds each as an array of placed
170
+
standard cells: a flop per bit, its write logic beside it, the read
171
+
trees in columns. The spec names the module, its words and bits, its
172
+
read and write ports by the module's own port names, and the cells:
173
+
174
+
```
175
+
module RegFile
176
+
mode netlist
177
+
words 16
178
+
bits 8
179
+
clock clock
180
+
read io_r0_addr io_r0_data
181
+
write io_w0_addr io_w0_data io_w0_en
182
+
cell flop DFFHQNx1_ASAP7_75t_R
183
+
...
184
+
```
185
+
186
+
`memories/regfile_ram.py` translates the spec to `generate_ram_netlist`
187
+
options (ports, banks, folds, the zero word, reset, read latency, write
188
+
style and priority, cells) and checks it against the module's ports,
189
+
from synthesis: a port in one and not the other, or a data port of
190
+
another width, stops the build rather than miswire the parent. The RAM
191
+
is a block `<m>_ram`, and a wrapper takes the module's place,
192
+
connecting the module's ports to the RAM's (an active-high reset
193
+
inverted for an active-low flop, an address narrowed or widened). What
194
+
happens next depends on `AUTO_MEMORIES_MACRO_PLACE`, the register files
195
+
to place as macros:
196
+
197
+
-**Not listed (the default): inlined.** Synthesis reads the wrapper
198
+
and the RAM's netlist in the module's place; from there on their cells
199
+
are placed, sized and buffered with the rest of the design. No macro,
200
+
no abstract, no dissolve. The better shape for a small design, where a
201
+
macro's outline and channels cost more core than the array saves.
202
+
-**Listed: a macro.**`<m>_ram` is a macro to synthesis and macro
203
+
placement: its abstract `<m>_ram.lef` and a liberty of its area and
204
+
pins land beside the FakeRAM views and it joins `blackboxes.txt`. In
205
+
`mode netlist` (the only one) `generate_ram` places only the array's
206
+
core and leaves its periphery (decode, select and input buffers) to
207
+
the parent, and the macro dissolves into its cells at the end of macro
208
+
placement (`regfile_dissolve.tcl`): the core lands FIRM where the
209
+
macro was placed, flipped as the macro was, on the parent's rows; the
210
+
periphery is left to global placement and the resizer, and dead logic
211
+
is eliminated as at synthesis. A large design whose floorplan plans
212
+
its register files lists them.
213
+
-**A macro of its own.** A register file wanted as a macro to the end
214
+
is a design of its own: run its module through the flow, its spec
215
+
listed and macro-placed so it dissolves there, and give the parent
216
+
its abstract as a macro. Its clock tree is then built and its timing
217
+
model is written from it. `mode macro` stops with that advice: a
218
+
timing model written from `generate_ram`'s netlist before any clock
219
+
tree would have the whole unbuffered clock net as one pin.
220
+
221
+
A word holds its value between writes either through a hold mux per
222
+
bit (`write_style mux`, the default here) or through one integrated
223
+
clock gate per word, enabled by its write selects (`write_style
224
+
clock_gate`, `generate_ram`'s own default). Where a row holds more than
225
+
one word (`bank_columns`), each word's bits sit side by side, so its
226
+
selects and write enables are no longer than its bits; and a word whose
227
+
bits would run more than 150 um is folded into more rows. `tap_columns`
228
+
and `service_sites` leave empty columns in the array for the buffers a
229
+
parent puts on the nets that cross it.
230
+
231
+
Listed register files appear in `memories.json` with kind `regfile`;
232
+
the rest have kind `fakeram` or `flops`.
233
+
234
+
Moving the dissolve into OpenROAD is left for later: it would make it
235
+
faster, testable at unit level and maintained with the database it
236
+
edits.
237
+
238
+
### Designs to measure it on
239
+
240
+
What a register file of placed cells buys is a shorter minimum clock
241
+
period (the read mux trees are columns, not a cloud) and a shorter
242
+
build (fewer cells for synthesis, placement and the resizer to work
243
+
on). The ORFS designs whose register file is flip-flops today and its
244
+
own module, the seam a spec needs, measured as flops against
245
+
`AUTO_MEMORIES_REGFILES`:
246
+
247
+
| Design | Module | Today | Shape | Ready? |
248
+
|---|---|---|---|---|
249
+
| asap7/riscv32i |`regfile`| flip-flops: `reg [31:0] rf[31:0]`, mapped to flops (no AUTO_MEMORIES) | 32 x 32, 2R1W, x0 reads 0 | Yes: the ports are the spec's (`zero_word 0`). Also exercises `OPENROAD_HIERARCHICAL=1` beside two FakeRAM macros. |
250
+
| asap7/ibex |`ibex_register_file_ff`| flip-flops: `RegFile = RegFileFF`, the default | 32 x 32, 2R1W, x0 reads 0 | Yes: `unused` names `test_en_i` and `dummy_instr_id_i`, ports the array does not use, and `async_reset rst_ni low` resets the flops to 0 as ibex does; simulated against ibex's RTL. |
251
+
| asap7/cva6 |`ariane_regfile` (`ariane_regfile_ff.sv`) | flip-flops: cv32a65x has `FpgaEn` 0 | 32 x 32, 2R1W | Not yet: the ports are packed arrays (`raddr_i[1:0][4:0]`), one port per slice, which a spec cannot yet address; asynchronous reset as ibex. |
252
+
| asap7/swerv_wrapper |`dec_gpr_ctl_*`| flip-flops | 32 x 32, 4R3W | Not yet: read enables, bank ids and scan ports around the array need a seam in the RTL. |
253
+
254
+
coralnpu's `Regfile` (8R4W) and `FRegfile` (3R2W) carry their
255
+
scoreboard and bypass logic in the same module, and picorv32 and
256
+
tinyRocket keep their register file inside the CPU module: those need a
257
+
seam in their RTL first.
258
+
259
+
### Status: at parity on riscv32i, on a smaller core
260
+
261
+
riscv32i with its register file generated and inlined (a spec in
262
+
`AUTO_MEMORIES_REGFILES`, `zero_word 0`), at riscv32i's own
263
+
utilisation, against `designs/asap7/riscv32i`. To global route, 950 ps
264
+
clock, minimum period from placement parasitics on the global-route
265
+
database:
266
+
267
+
|| flops | register file |
268
+
|---|---|---|
269
+
| minimum period | 950 ps | 943 ps |
270
+
| core area | 4 012 um2 | 3 503 um2 |
271
+
272
+
Both are limited by the same single-cycle path: the instruction into
273
+
the register file's read, the ALU, the data memory and back into the
274
+
register file's write. The register file's share of it, decode and read
275
+
tree, is about 260 ps in either.
276
+
277
+
What did not pay, measured on the same design:
278
+
279
+
- the register file as a macro dissolved after macro placement: it does
280
+
not fit riscv32i's 62 % beside the four FakeRAMs, and at 55 % it is
281
+
959 ps on a 4 644 um2 core;
282
+
- a hold mux per bit instead of the clock gate: 994 ps inlined, every
283
+
array endpoint carrying the mux;
284
+
- predecoded read selects: 960 ps;
285
+
- a tree of 2:1 muxes steered by the address bits instead of a decoded
286
+
one-hot read: 959 ps, the address bits' fanout (about 1 000 inputs a
287
+
port) needs as many buffer levels as the decode it replaces;
288
+
- four-input gates in the read tree, stronger cells: 950 to 954 ps,
289
+
within what any change to the placement moves.
290
+
163
291
## Platform support
164
292
165
293
**asap7 only.**`gen_memories.py` rejects any other platform. The
Copy file name to clipboardExpand all lines: docs/user/FlowVariables.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,8 @@ configuration file.
104
104
| <aname="ADDITIONAL_SITES"></a>ADDITIONAL_SITES| Passed as -additional_sites to initialize_floorplan.||
105
105
| <aname="ASAP7_USE_VT"></a>ASAP7_USE_VT| A space separated list of VT options to use with the ASAP7 standard cell library: RVT, LVT, SLVT.| RVT|
106
106
| <aname="AUTO_MEMORIES"></a>AUTO_MEMORIES| Experimental. When set to 1, memories that yosys infers in the RTL (`$mem_v2` cells, module boundary only) are detected pre-synthesis, inventoried in `$(RESULTS_DIR)/memories.json`, and — when idiomatic as an SRAM macro — given generated .lib/.lef views under `$(RESULTS_DIR)/memories/`. Synthesis blackboxes those modules and all later stages read the generated views, so an existing design gets macro-based results without a memory compiler. Supported for the asap7 platform only. See docs/user/AutoMemories.md.| 0|
107
+
| <aname="AUTO_MEMORIES_MACRO_PLACE"></a>AUTO_MEMORIES_MACRO_PLACE| Experimental. Space-separated list of module names of AUTO_MEMORIES_REGFILES register files to place as macros, blackboxed in synthesis and placed by the macro placer (and, in `mode netlist`, dissolved after macro placement). A register file not listed is inlined: its generated netlist of standard cells replaces the module's body in synthesis, and its cells are placed, sized and buffered with the rest of the design -- the better shape for a small design, where a macro's outline and channels cost more core than the array saves. A name no spec builds stops the build. Requires AUTO_MEMORIES=1.||
108
+
| <aname="AUTO_MEMORIES_REGFILES"></a>AUTO_MEMORIES_REGFILES| Experimental. Space-separated list of register-file spec files, one per RTL module to build as a register file of placed standard cells rather than synthesise to flops. Each spec names its module, words, bits, read and write ports by the RTL's own port names, and the cells. memories/regfile_ram.py checks the spec against the module's ports and has OpenROAD's generate_ram build it as `<module>_ram`, under `$(RESULTS_DIR)/memories/`, with a wrapper in the module's place. A module named in AUTO_MEMORIES_MACRO_PLACE is blackboxed like an AUTO_MEMORIES macro and placed as one; any other is inlined as its generated netlist. A placed spec in `mode netlist` then dissolves into its cells after macro placement: its core FIRM where the macro was placed, in the macro's orientation, its periphery left to placement. Every register file appears in memories.json with kind `regfile`. Requires AUTO_MEMORIES=1.||
107
109
| <aname="BALANCE_ROWS"></a>BALANCE_ROWS| Balance rows during placement.| 0|
108
110
| <aname="BLOCKS"></a>BLOCKS| Blocks used as hard macros in a hierarchical flow. Do note that you have to specify block-specific inputs file in the directory mentioned by Makefile.||
109
111
| <aname="BUFFER_PORTS_ARGS"></a>BUFFER_PORTS_ARGS| Specify arguments to the buffer_ports call during placement. Only used if DONT_BUFFER_PORTS=0.||
@@ -155,6 +157,7 @@ configuration file.
155
157
| <aname="FOOTPRINT_TCL"></a>FOOTPRINT_TCL| Specifies a Tcl script with custom footprint-related commands for floorplan setup.||
156
158
| <aname="GDS_ALLOW_EMPTY"></a>GDS_ALLOW_EMPTY| Single regular expression of module names of macros that have no .gds file||
157
159
| <aname="GDS_FILES"></a>GDS_FILES| Path to platform GDS files.||
160
+
| <aname="GLOBAL_CONNECT_TCL"></a>GLOBAL_CONNECT_TCL| File path to the add_global_connection rules that connect the supply pins of the instances to the supply nets. Sourced at floorplan right after the netlist is loaded, before any step can mark an instance dont_touch; the rules are kept in the database. The platform's file by default; a design whose PDN_TCL names other supply nets sets its own. PDN_TCL defines the grids.||
158
161
| <aname="GLOBAL_PLACEMENT_ARGS"></a>GLOBAL_PLACEMENT_ARGS| Use additional tuning parameters during global placement other than default args defined in global_place.tcl.||
159
162
| <aname="GLOBAL_ROUTE_ARGS"></a>GLOBAL_ROUTE_ARGS| Replaces default arguments for global route. The -congestion_iterations default is set by the flow (30 for FastRoute, 10 for CUGR); add -congestion_iterations here to override it.| -congestion_report_iter_step 5 -verbose|
160
163
| <aname="GLOBAL_ROUTE_USE_CUGR"></a>GLOBAL_ROUTE_USE_CUGR| Passed as -use_cugr to global_route. Uses CUGR as the global routing solver instead of the default FastRoute solver. NOTE: CUGR is not ready for production.| 0|
@@ -298,6 +301,7 @@ configuration file.
298
301
| <aname="SWAP_ARITH_OPERATORS"></a>SWAP_ARITH_OPERATORS| Improve timing QoR by swapping ALU and MULT arithmetic operators.| 0|
299
302
| <aname="SYNTH_ARGS"></a>SYNTH_ARGS| Optional synthesis variables for yosys.||
300
303
| <aname="SYNTH_BLACKBOXES"></a>SYNTH_BLACKBOXES| List of cells treated as a black box by Yosys. With Bazel, this can be used to run synthesis in parallel for the large modules of the design. Non-existant modules are ignored silently, useful when listing modules statically, even if modules come and go dynamically.||
304
+
| <aname="SYNTH_BLACKBOXES_FILE"></a>SYNTH_BLACKBOXES_FILE| Path to a file with more modules to treat as black boxes, one name per line, added to SYNTH_BLACKBOXES. For a parallel synthesis whose list is too long for one environment variable: Linux caps one at 128 KiB.||
301
305
| <aname="SYNTH_CANONICALIZE_TCL"></a>SYNTH_CANONICALIZE_TCL| Specifies a Tcl script with commands to run as part of the synth canonicalize step.||
302
306
| <aname="SYNTH_CHECKPOINT"></a>SYNTH_CHECKPOINT| Path to a Yosys RTLIL checkpoint to read in place of the default canonicalization checkpoint at the start of synth.tcl. Intended for parallel synthesis flows that reuse a checkpoint taken after coarse synthesis and `keep_hierarchy` have already been decided, so each partition skips that common prefix. Leave unset for the normal flow.||
303
307
| <aname="SYNTH_GUT"></a>SYNTH_GUT| Load design and remove all internal logic before doing synthesis. This is useful when creating a mock .lef abstract that has a smaller area than the amount of logic would allow. bazel-orfs uses this to mock SRAMs, for instance.| 0|
0 commit comments