Skip to content

Commit 7b3cacc

Browse files
committed
Merge remote-tracking branch 'private/master' into secure-gpl-filler-gcell-removal
2 parents f1b39c1 + 43f9bb6 commit 7b3cacc

27 files changed

+9271
-188
lines changed

MODULE.bazel

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bazel_dep(name = "bazel-orfs")
1111
# To bump version, run: bazelisk run @bazel-orfs//:bump
1212
git_override(
1313
module_name = "bazel-orfs",
14-
commit = "9a3778bdbe63106a894a03e865335a31ebc860d1",
14+
commit = "f8a4b694b37c8f5322323eba9a9ae37f9541ee17",
1515
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
1616
)
1717

@@ -20,13 +20,13 @@ bazel_dep(name = "rules_python", version = "1.2.0")
2020
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
2121
python.toolchain(
2222
ignore_root_user_error = True,
23-
python_version = "3.12",
23+
python_version = "3.13",
2424
)
2525

2626
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
2727
pip.parse(
2828
hub_name = "orfs-pip",
29-
python_version = "3.12",
29+
python_version = "3.13",
3030
requirements_lock = "//flow:util/requirements_lock.txt",
3131
)
3232
use_repo(pip, "orfs-pip")
@@ -35,12 +35,12 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
3535

3636
# To bump version, run: bazelisk run @bazel-orfs//:bump
3737
orfs.default(
38-
image = "docker.io/openroad/orfs:v3.0-3190-g5ac9869c",
38+
image = "docker.io/openroad/orfs:v3.0-3273-gedf3d6bf",
3939
# Use local files instead of docker image
4040
makefile = "//flow:makefile",
4141
makefile_yosys = "//flow:makefile_yosys",
4242
pdk = "//flow:asap7",
43-
sha256 = "2ca999699bc91144074b7f23f42da9330d7279437c386a1413fba4a6a7520916",
43+
sha256 = "f5692c6325ebcf27cc348e033355ec95c82c35ace1af7e72a0d352624ada143e",
4444
)
4545
use_repo(orfs, "com_github_nixos_patchelf_download")
4646
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 93 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/user/FlowVariables.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,48 @@
1-
# Environment Variables for the OpenROAD Flow Scripts
1+
# Variables for the OpenROAD Flow Scripts
22

3-
4-
Environment variables are used in the OpenROAD flow to define various
3+
Variables are used in the OpenROAD flow to define various
54
platform, design and tool specific variables to allow finer control and
6-
user overrides at various flow stages. These are defined in the
7-
`config.mk` file located in the platform and design specific directories.
5+
user overrides at various flow stages.
6+
7+
These are normally defined in the `config.mk` file located in the platform and design-specific directories, but can also be defined on the command line or via environment variables. For example:
8+
9+
- Command line: `make PLACE_DENSITY=0.5`
10+
- Environment variable: `export PLACE_DENSITY=0.5`
11+
12+
This works provided that `config.mk` has defined it as a default value using the `export PLACE_DENSITY?=0.4` syntax.
13+
14+
The actual value used is determined by the priority rules set by `make`:
15+
16+
1. **Makefile Definitions**: Variables defined in the `Makefile` or included files are used when they are defined using the no-override `=` operator, `export PLACE_DENSITY=0.4` syntax. The priority within the included files is the `DESIGN_CONFIG` file, then `Makefile` definitions and finally platform(PDK) defined variables.
17+
2. **Command Line**: Variables defined on the command line take the highest priority in overriding defaults.
18+
3. **Environment Variables**: Variables exported in the shell environment are used if not overridden by the command line.
19+
4. **Default Values**: Variables defined with the `?=` operator in the `Makefile` are used only if the variable is not already defined elsewhere.
20+
21+
## Effects of variables
22+
23+
The variables for ORFS are not fully independent and can interact in complex ways. Small changes to a combination of variables can have large consequences, such as on macro placement, which can lead to vastly different quality of results.
24+
25+
Due to the large number of variables, some of which are continuous and require long runtimes, other discrete, it is not feasible to perform an exhaustive end-to-end search for the best combination of variables.
26+
27+
Instead, the following approaches are used to determine reasonable values, up to a point of diminishing returns:
28+
29+
- **Experience**: Leveraging domain expertise to set initial values.
30+
- **AI**: Using machine learning techniques to explore variable combinations.
31+
- **Parameter Sweeps**: Testing a smaller subset of variables to identify optimal ranges.
32+
33+
These values are then set in configuration files and kept under source control alongside the RTL input.
34+
35+
## Types of variables
36+
37+
Variables values are set in ORFS scripts or `config.mk` files and are kept in source control together with configuration files and RTL.
38+
39+
It is an ongoing effort to move variables upwards in the categories below.
40+
41+
| Category | Definition | User Involvement | Examples | Automation Potential | Notes |
42+
|--------------------|----------------------------------------------------------------------------|----------------------------------------|-----------------------------------------|-----------------------------|-----------------------------------------------------------------------|
43+
| **Trivial** | Automatically determined by tool with near-optimal results. | None (unless debugging) | Buffer sizing, default layers | **High** – can be hidden | Best if invisible; surfaced only in debug or verbose mode. |
44+
| **Easy** | Requires input, but easy to tune using reports or visuals. | Moderate – copy/edit from reports | `PLACE_DENSITY` | **Medium–High** | Smooth response curves, intuitive tuning. |
45+
| **Complex** | Small changes in values may result in large effects. | High – requires multiple runs/sweeps | `CTS_DISTANCE_BUF`, small changes can have large effects on skew and quality of results. Small changes to independent inputs, such as RTL, can invalidate earlier "good values". | **Low–Medium** | Needs scripted sweeps and statistical evaluation. |
846

947
## Platform
1048

@@ -20,7 +58,7 @@ variable. For OpenROAD Flow Scripts we have the following public platforms:
2058
- `nangate45`
2159
- `asap7`
2260

23-
## Platform Specific Environment Variables
61+
## Platform Specific Variables
2462

2563

2664
The table below lists the complete set of variables used in each of the
@@ -108,8 +146,8 @@ configuration file.
108146
| <a name="GUI_TIMING"></a>GUI_TIMING| Load timing information when opening GUI. For large designs, this can be quite time consuming. Useful to disable when investigating non-timing aspects like floorplan, placement, routing, etc.| 1| |
109147
| <a name="HOLD_SLACK_MARGIN"></a>HOLD_SLACK_MARGIN| Specifies a time margin for the slack when fixing hold violations. This option allows you to overfix or underfix (negative value, terminate retiming before 0 or positive slack). floorplan.tcl uses min of HOLD_SLACK_MARGIN and 0 (default hold slack margin). This avoids overrepair in floorplan for hold by default, but allows skipping hold repair using a negative HOLD_SLACK_MARGIN. Exiting timing repair early is useful in exploration where the .sdc has a fixed clock period at the design's target clock period and where HOLD/SETUP_SLACK_MARGIN is used to avoid overrepair (extremely long running times) when exploring different parameter settings. When an ideal clock is used, that is before CTS, a clock insertion delay of 0 is used in timing paths. This creates a mismatch between macros that have a .lib file from after CTS, when the clock is propagated. To mitigate this, OpenSTA will use subtract the clock insertion delay of macros when calculating timing with ideal clock. Provided that min_clock_tree_path and max_clock_tree_path are in the .lib file, which is the case for macros built with OpenROAD. This is less accurate than if OpenROAD had created a placeholder clock tree for timing estimation purposes prior to CTS. There will inevitably be inaccuracies in the timing calculation prior to CTS. Use a slack margin that is low enough, even negative, to avoid overrepair. Inaccuracies in the timing prior to CTS can also lead to underrepair, but there no obvious and simple way to avoid underrapir in these cases. Overrepair can lead to excessive runtimes in repair or too much buffering being added, which can present itself as congestion of hold cells or buffer cells. Another use of SETUP/HOLD_SLACK_MARGIN is design parameter exploration when trying to find the minimum clock period for a design. The SDC_FILE for a design can be quite complicated and instead of modifying the clock period in the SDC_FILE, which can be non-trivial, the clock period can be fixed at the target frequency and the SETUP/HOLD_SLACK_MARGIN can be swept to find a plausible current minimum clock period.| 0| |
110148
| <a name="IO_CONSTRAINTS"></a>IO_CONSTRAINTS| File path to the IO constraints .tcl file.| | |
111-
| <a name="IO_PLACER_H"></a>IO_PLACER_H| The metal layer on which to place the I/O pins horizontally (top and bottom of the die).| | |
112-
| <a name="IO_PLACER_V"></a>IO_PLACER_V| The metal layer on which to place the I/O pins vertically (sides of the die).| | |
149+
| <a name="IO_PLACER_H"></a>IO_PLACER_H| A list of metal layers on which the I/O pins are placed horizontally (top and bottom of the die).| | |
150+
| <a name="IO_PLACER_V"></a>IO_PLACER_V| A list of metal layers on which the I/O pins are placed vertically (sides of the die).| | |
113151
| <a name="IR_DROP_LAYER"></a>IR_DROP_LAYER| Default metal layer to report IR drop.| | |
114152
| <a name="KLAYOUT_TECH_FILE"></a>KLAYOUT_TECH_FILE| A mapping from LEF/DEF to GDS using the KLayout tool.| | |
115153
| <a name="LATCH_MAP_FILE"></a>LATCH_MAP_FILE| List of latches treated as a black box by Yosys.| | |
@@ -128,7 +166,7 @@ configuration file.
128166
| <a name="MIN_BUF_CELL_AND_PORTS"></a>MIN_BUF_CELL_AND_PORTS| Used to insert a buffer cell to pass through wires. Used in synthesis.| | |
129167
| <a name="MIN_ROUTING_LAYER"></a>MIN_ROUTING_LAYER| The lowest metal layer name to be used in routing.| | |
130168
| <a name="PDN_TCL"></a>PDN_TCL| File path which has a set of power grid policies used by pdn to be applied to the design, such as layers to use, stripe width and spacing to generate the actual metal straps.| | |
131-
| <a name="PLACE_DENSITY"></a>PLACE_DENSITY| The desired placement density of cells. It reflects how spread the cells would be on the core area. 1.0 = closely dense. 0.0 = widely spread.| | |
169+
| <a name="PLACE_DENSITY"></a>PLACE_DENSITY| The desired average placement density of cells: 1.0 = dense, 0.0 = widely spread. The intended effort is also communicated by this parameter. Use a low value for faster builds and higher value for better quality of results. If a too low value is used, the placer will not be able to place all cells and a recommended minimum placement density can be found in the logs. A too high value can lead to excessive runtimes, even timeouts and subtle failures in the flow after placement, such as in CTS or global routing when timing repair fails. The default is platform specific.| | |
132170
| <a name="PLACE_DENSITY_LB_ADDON"></a>PLACE_DENSITY_LB_ADDON| Check the lower boundary of the PLACE_DENSITY and add PLACE_DENSITY_LB_ADDON if it exists.| | |
133171
| <a name="PLACE_PINS_ARGS"></a>PLACE_PINS_ARGS| Arguments to place_pins| | |
134172
| <a name="PLACE_SITE"></a>PLACE_SITE| Placement site for core cells defined in the technology LEF file.| | |
@@ -143,8 +181,6 @@ configuration file.
143181
| <a name="REMOVE_CELLS_FOR_EQY"></a>REMOVE_CELLS_FOR_EQY| String patterns directly passed to write_verilog -remove_cells <> for equivalence checks.| | |
144182
| <a name="REPAIR_PDN_VIA_LAYER"></a>REPAIR_PDN_VIA_LAYER| Remove power grid vias which generate DRC violations after detailed routing.| | |
145183
| <a name="REPORT_CLOCK_SKEW"></a>REPORT_CLOCK_SKEW| Report clock skew as part of reporting metrics, starting at CTS, before which there is no clock skew. This metric can be quite time-consuming, so it can be useful to disable.| 1| |
146-
| <a name="RESYNTH_AREA_RECOVER"></a>RESYNTH_AREA_RECOVER| Enable re-synthesis for area reclaim.| 0| |
147-
| <a name="RESYNTH_TIMING_RECOVER"></a>RESYNTH_TIMING_RECOVER| Enable re-synthesis for timing optimization.| 0| |
148184
| <a name="ROUTING_LAYER_ADJUSTMENT"></a>ROUTING_LAYER_ADJUSTMENT| Adjusts routing layer capacities to manage congestion and improve detailed routing. High values ease detailed routing but risk excessive detours and long global routing times, while low values reduce global routing failure but can complicate detailed routing. The global routing running time normally reduces dramatically (entirely design specific, but going from hours to minutes has been observed) when the value is low (such as 0.10). Sometimes, global routing will succeed with lower values and fail with higher values. Exploring results with different values can help shed light on the problem. Start with a too low value, such as 0.10, and bisect to value that works by doing multiple global routing runs. As a last resort, `make global_route_issue` and using the tools/OpenROAD/etc/deltaDebug.py can be useful to debug global routing errors. If there is something specific that is impossible to route, such as a clock line over a macro, global routing will terminate with DRC errors routes that could have been routed were it not for the specific impossible routes. deltaDebug.py should weed out the possible routes and leave a minimal failing case that pinpoints the problem.| 0.5| |
149185
| <a name="RTLMP_AREA_WT"></a>RTLMP_AREA_WT| Weight for the area of the current floorplan.| 0.1| |
150186
| <a name="RTLMP_ARGS"></a>RTLMP_ARGS| Overrides all other RTL macro placer arguments.| | |
@@ -258,8 +294,6 @@ configuration file.
258294
- [PLACE_DENSITY_LB_ADDON](#PLACE_DENSITY_LB_ADDON)
259295
- [PLACE_SITE](#PLACE_SITE)
260296
- [REMOVE_ABC_BUFFERS](#REMOVE_ABC_BUFFERS)
261-
- [RESYNTH_AREA_RECOVER](#RESYNTH_AREA_RECOVER)
262-
- [RESYNTH_TIMING_RECOVER](#RESYNTH_TIMING_RECOVER)
263297
- [RTLMP_AREA_WT](#RTLMP_AREA_WT)
264298
- [RTLMP_ARGS](#RTLMP_ARGS)
265299
- [RTLMP_BOUNDARY_WT](#RTLMP_BOUNDARY_WT)

flow/designs/asap7/cva6/config.mk

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,33 @@ export VERILOG_FILES = $(sort $(wildcard $(SRC_HOME)/common/local/util/
6565
$(SRC_HOME)/core/cvxif_example/include/cvxif_instr_pkg.sv \
6666
$(sort $(wildcard $(SRC_HOME)/core/frontend/*.sv)) \
6767
$(SRC_HOME)/vendor/pulp-platform/tech_cells_generic/src/rtl/tc_sram.sv \
68-
$(PLATFORM_DIR)/verilog/fakeram7_256x256.sv
68+
$(PLATFORM_DIR)/verilog/fakeram7_64x256.sv \
69+
$(PLATFORM_DIR)/verilog/fakeram7_128x64.sv \
70+
$(PLATFORM_DIR)/verilog/fakeram7_64x28.sv \
71+
$(PLATFORM_DIR)/verilog/fakeram7_64x25.sv
6972

7073
export VERILOG_INCLUDE_DIRS = $(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/core/include \
7174
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/core/cvfpu/src/common_cells/include \
7275
$(DESIGN_HOME)/src/$(DESIGN_NICKNAME)/core/cache_subsystem/hpdcache/rtl/include
7376

7477
export VERILOG_DEFINES += -D HPDCACHE_ASSERT_OFF
7578

76-
export ADDITIONAL_LEFS = $(PLATFORM_DIR)/lef/fakeram7_256x256.lef
79+
export ADDITIONAL_LEFS = $(PLATFORM_DIR)/lef/fakeram7_64x256.lef \
80+
$(PLATFORM_DIR)/lef/fakeram7_128x64.lef \
81+
$(PLATFORM_DIR)/lef/fakeram7_64x28.lef \
82+
$(PLATFORM_DIR)/lef/fakeram7_64x25.lef
7783

78-
export ADDITIONAL_LIBS = $(PLATFORM_DIR)/lib/NLDM/fakeram7_256x256.lib
84+
export ADDITIONAL_LIBS = $(PLATFORM_DIR)/lib/NLDM/fakeram7_64x256.lib \
85+
$(PLATFORM_DIR)/lib/NLDM/fakeram7_128x64.lib \
86+
$(PLATFORM_DIR)/lib/NLDM/fakeram7_64x28.lib \
87+
$(PLATFORM_DIR)/lib/NLDM/fakeram7_64x25.lib
7988

8089
export SDC_FILE = $(DESIGN_HOME)/$(PLATFORM)/$(DESIGN_NAME)/constraint.sdc
8190

82-
export CORE_UTILIZATION = 40
91+
export CORE_UTILIZATION = 50
8392
export CORE_MARGIN = 2
8493
export MACRO_HALO = 5
85-
export PLACE_DENSITY = 0.50
94+
export PLACE_DENSITY = 0.64
8695

8796
# a smoketest for this option, there are a
8897
# few last gasp iterations
@@ -92,3 +101,7 @@ export SKIP_LAST_GASP ?= 1
92101
export SYNTH_MINIMUM_KEEP_SIZE ?= 40000
93102

94103
export SYNTH_HDL_FRONTEND = slang
104+
105+
export ASAP7_USE_VT = RVT LVT SLVT
106+
107+
export CTS_LIB_NAME = asap7sc7p5t_INVBUF_SLVT_FF_nldm_211120
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
22
"synth__design__instance__area__stdcell": {
3-
"value": 40631.65,
3+
"value": 19725.15,
44
"compare": "<="
55
},
66
"constraints__clocks__count": {
77
"value": 1,
88
"compare": "=="
99
},
1010
"placeopt__design__instance__area": {
11-
"value": 45043,
11+
"value": 20743,
1212
"compare": "<="
1313
},
1414
"placeopt__design__instance__count__stdcell": {
15-
"value": 163049,
15+
"value": 137118,
1616
"compare": "<="
1717
},
1818
"detailedplace__design__violations": {
1919
"value": 0,
2020
"compare": "=="
2121
},
2222
"cts__design__instance__count__setup_buffer": {
23-
"value": 14178,
23+
"value": 11923,
2424
"compare": "<="
2525
},
2626
"cts__design__instance__count__hold_buffer": {
27-
"value": 14178,
27+
"value": 11923,
2828
"compare": "<="
2929
},
3030
"globalroute__antenna_diodes_count": {
3131
"value": 0,
3232
"compare": "<="
3333
},
3434
"detailedroute__route__wirelength": {
35-
"value": 1884562,
35+
"value": 1124948,
3636
"compare": "<="
3737
},
3838
"detailedroute__route__drc_errors": {
@@ -48,23 +48,23 @@
4848
"compare": "<="
4949
},
5050
"finish__timing__setup__ws": {
51-
"value": -216.36,
51+
"value": -68.36,
5252
"compare": ">="
5353
},
5454
"finish__design__instance__area": {
55-
"value": 45315,
55+
"value": 20933,
5656
"compare": "<="
5757
},
5858
"finish__timing__drv__setup_violation_count": {
59-
"value": 7089,
59+
"value": 5962,
6060
"compare": "<="
6161
},
6262
"finish__timing__drv__hold_violation_count": {
63-
"value": 101,
63+
"value": 100,
6464
"compare": "<="
6565
},
6666
"finish__timing__wns_percent_delay": {
67-
"value": -20.3,
67+
"value": -10.27,
6868
"compare": ">="
6969
}
7070
}

flow/designs/sky130hd/ibex/BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ orfs_flow(
55
arguments = {
66
"ADDER_MAP_FILE": "",
77
"CORE_UTILIZATION": "45",
8-
"PLACE_DENSITY_LB_ADDON": "0.2",
8+
"PLACE_DENSITY_LB_ADDON": "0.25",
99
"TNS_END_PERCENT": "100",
1010
"REMOVE_ABC_BUFFERS": "1",
1111
"SYNTH_HDL_FRONTEND": "slang",
1212
"VERILOG_INCLUDE_DIRS": "flow/designs/src/ibex_sv/vendor/lowrisc_ip/prim/rtl",
13+
"CTS_CLUSTER_SIZE": "20",
14+
"CTS_CLUSTER_DIAMETER": "50",
1315
},
1416
pdk = "@docker_orfs//:sky130hd",
1517
sources = {

flow/designs/src/cva6/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
Extracted from https://github.com/openhwgroup/cva6
2+
3+
Based on commit 3a389af with some changes for the RAMs

flow/designs/src/cva6/common/local/util/sram_cache.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module sram_cache #(
5252
rdata_o = rdata_user[DATA_AND_USER_WIDTH-1:DATA_WIDTH];
5353
ruser_o = rdata_user[USER_WIDTH-1:0];
5454
end
55-
fakeram7_256x256 i_tc_sram_wrapper(
55+
fakeram7_64x256 i_tc_sram_wrapper(
5656
.clk ( clk_i ),
5757
.ce_in ( req_i ),
5858
.we_in ( we_i ),
@@ -91,7 +91,7 @@ module sram_cache #(
9191
rdata_o = rdata_user;
9292
ruser_o = '0;
9393
end
94-
fakeram7_256x256 i_tc_sram_wrapper(
94+
fakeram7_64x25 i_tc_sram_wrapper(
9595
.clk ( clk_i ),
9696
.ce_in ( req_i ),
9797
.we_in ( we_i ),

flow/designs/src/cva6/core/cache_subsystem/hpdcache/rtl/src/common/hpdcache_sram.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module hpdcache_sram
3939
output logic [DATA_SIZE-1:0] rdata
4040
);
4141

42-
fakeram7_256x256 ram_i (
42+
fakeram7_64x28 ram_i (
4343
.clk(clk),
4444
.ce_in(cs),
4545
.we_in(we),

flow/designs/src/cva6/core/cache_subsystem/hpdcache/rtl/src/common/hpdcache_sram_wbyteenable.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module hpdcache_sram_wbyteenable
3939
input logic [DATA_SIZE/8-1:0] wbyteenable,
4040
output logic [DATA_SIZE-1:0] rdata
4141
);
42-
fakeram7_256x256 ram_i (
42+
fakeram7_128x64 ram_i (
4343
.clk (clk),
4444
.ce_in(cs),
4545
.we_in(we),

0 commit comments

Comments
 (0)