Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/user/FlowVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ configuration file.
| <a name="GPL_RANDOM_SEED"></a>GPL_RANDOM_SEED| Specifies a random seed for global placement. Useful for perturbation studies.| |
| <a name="GPL_ROUTABILITY_DRIVEN"></a>GPL_ROUTABILITY_DRIVEN| Specifies whether the placer should use routability driven placement.| 1|
| <a name="GPL_TIMING_DRIVEN"></a>GPL_TIMING_DRIVEN| Specifies whether the placer should use timing driven placement.| 1|
| <a name="GPL_TIMING_SPAN_CLOCK_PERCENT"></a>GPL_TIMING_SPAN_CLOCK_PERCENT| Global placement timing weight span as a percent of clock (passed to virtual_cts_max_skew_fraction or similar logic).| 0.24|
| <a name="GPL_USE_ENGINE_DEFAULTS"></a>GPL_USE_ENGINE_DEFAULTS| If set to 1, ignores ORFS-specific parameters and forces the global placement engine to use its internal hardcoded defaults.| 0|
| <a name="GPL_WIRELENGTH_PENALTY"></a>GPL_WIRELENGTH_PENALTY| Global placement wirelength penalty (passed as -init_wirelength_coef or similar logic).| 0.0627|
| <a name="GRT_SEED"></a>GRT_SEED| Specifies a random seed for global routing. Useful for perturbation studies.| |
| <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|
| <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|
Expand Down Expand Up @@ -325,6 +328,7 @@ configuration file.
| <a name="TIEHI_CELL_AND_PORT"></a>TIEHI_CELL_AND_PORT| Tie high cells used in Yosys synthesis to replace a logical 1 in the Netlist.| |
| <a name="TIELO_CELL_AND_PORT"></a>TIELO_CELL_AND_PORT| Tie low cells used in Yosys synthesis to replace a logical 0 in the Netlist.| |
| <a name="TIE_SEPARATION"></a>TIE_SEPARATION| Distance separating tie high/low instances from the load.| 0|
| <a name="TIGHTEN_CLOCK_PERIOD"></a>TIGHTEN_CLOCK_PERIOD| Tighten the clock period by this fraction (e.g. 0.1 for 10%) before measuring minimum clock period. Used by the autotuner.| 0.0638|
| <a name="TNS_END_PERCENT"></a>TNS_END_PERCENT| Default TNS_END_PERCENT value for post CTS timing repair. Try fixing all violating endpoints by default (reduce to 5% for runtime). Specifies how many percent of violating paths to fix [0-100]. Worst path will always be fixed.| 100|
| <a name="UNSET_ABC9_BOX_CELLS"></a>UNSET_ABC9_BOX_CELLS| List of cells to unset the abc9_box attribute on| |
| <a name="USE_FILL"></a>USE_FILL| Whether to perform metal density filling.| 0|
Expand Down Expand Up @@ -477,6 +481,9 @@ configuration file.
- [GPL_RANDOM_SEED](#GPL_RANDOM_SEED)
- [GPL_ROUTABILITY_DRIVEN](#GPL_ROUTABILITY_DRIVEN)
- [GPL_TIMING_DRIVEN](#GPL_TIMING_DRIVEN)
- [GPL_TIMING_SPAN_CLOCK_PERCENT](#GPL_TIMING_SPAN_CLOCK_PERCENT)
- [GPL_USE_ENGINE_DEFAULTS](#GPL_USE_ENGINE_DEFAULTS)
- [GPL_WIRELENGTH_PENALTY](#GPL_WIRELENGTH_PENALTY)
- [IO_PLACER_H](#IO_PLACER_H)
- [IO_PLACER_V](#IO_PLACER_V)
- [MATCH_CELL_FOOTPRINT](#MATCH_CELL_FOOTPRINT)
Expand All @@ -499,6 +506,7 @@ configuration file.
- [PRE_RESIZE_TCL](#PRE_RESIZE_TCL)
- [ROUTING_LAYER_ADJUSTMENT](#ROUTING_LAYER_ADJUSTMENT)
- [SKIP_REPORT_METRICS](#SKIP_REPORT_METRICS)
- [TIGHTEN_CLOCK_PERIOD](#TIGHTEN_CLOCK_PERIOD)
- [TNS_END_PERCENT](#TNS_END_PERCENT)

## cts variables
Expand Down
5 changes: 5 additions & 0 deletions flow/platforms/asap7/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"GPL_TIMING_SPAN_CLOCK_PERCENT": 0.22968514538823603,
"GPL_WIRELENGTH_PENALTY": 0.06456297861599444,
"TIGHTEN_CLOCK_PERIOD": 0.018604621846273695
}
5 changes: 5 additions & 0 deletions flow/platforms/sky130hd/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"GPL_TIMING_SPAN_CLOCK_PERCENT": 0.188034183753787,
"GPL_WIRELENGTH_PENALTY": 0.028702330955746383,
"TIGHTEN_CLOCK_PERIOD": 0.04743068706084326
}
15 changes: 15 additions & 0 deletions flow/scripts/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@
with open(json_path, "r") as file:
data = json.load(file)

platform_dir = os.environ.get("PLATFORM_DIR")
if platform_dir:
platform_config_path = os.path.join(platform_dir, "config.json")
if os.path.exists(platform_config_path):
with open(platform_config_path, "r") as file:
try:
platform_data = json.load(file)
for key, value in platform_data.items():
if key in data:
data[key]["default"] = value
else:
data[key] = {"default": value}
Comment thread
oharboe marked this conversation as resolved.
Resolved
except json.JSONDecodeError:
pass

for key, value in data.items():
if value.get("default", None) is None:
continue
Expand Down
6 changes: 6 additions & 0 deletions flow/scripts/global_place.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ append_env_var global_placement_args GPL_ROUTABILITY_DRIVEN -routability_driven

append_env_var global_placement_args GPL_RANDOM_SEED -random_seed 1

if { !$::env(GPL_USE_ENGINE_DEFAULTS) } {
lappend global_placement_args -init_wirelength_coef $::env(GPL_WIRELENGTH_PENALTY)
lappend global_placement_args -virtual_cts_max_skew_fraction $::env(GPL_TIMING_SPAN_CLOCK_PERCENT)
}


# Parameters for timing driven mode in global placement
if { $::env(GPL_TIMING_DRIVEN) } {
lappend global_placement_args {-timing_driven}
Expand Down
28 changes: 28 additions & 0 deletions flow/scripts/variables.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions flow/scripts/variables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,24 @@ GPL_TIMING_DRIVEN:
stages:
- place
default: 1
GPL_USE_ENGINE_DEFAULTS:
description: |
If set to 1, ignores ORFS-specific parameters and forces the global placement engine to use its internal hardcoded defaults.
stages:
- place
default: 0
GPL_WIRELENGTH_PENALTY:
description: |
Global placement wirelength penalty (passed as -init_wirelength_coef or similar logic).
stages:
- place
default: 0.0627
GPL_TIMING_SPAN_CLOCK_PERCENT:
description: |
Global placement timing weight span as a percent of clock (passed to virtual_cts_max_skew_fraction or similar logic).
stages:
- place
default: 0.240
GPL_ROUTABILITY_DRIVEN:
description: |
Specifies whether the placer should use routability driven placement.
Expand Down Expand Up @@ -1644,3 +1662,9 @@ GRT_SEED:
- grt
tunable: 1
type: int
TIGHTEN_CLOCK_PERIOD:
description: >
Tighten the clock period by this fraction (e.g. 0.1 for 10%) before measuring minimum clock period. Used by the autotuner.
stages:
- place
default: 0.0638
149 changes: 149 additions & 0 deletions patches/openroad/0001-Add-PDK-aware-GPL-parameters.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
From 06b8b5d592a51490cad48bff036b81b5264106f9 Mon Sep 17 00:00:00 2001
From: Øyvind Harboe <oyvind.harboe@zylin.com>
Date: Wed, 12 Aug 2026 17:48:28 +0200
Subject: [PATCH] Add PDK-aware GPL parameters

---
src/gpl/include/gpl/Replace.h | 2 ++
src/gpl/src/nesterovBase.cpp | 1 +
src/gpl/src/nesterovBase.h | 1 +
src/gpl/src/replace.cpp | 1 +
src/gpl/src/replace.i | 2 ++
src/gpl/src/replace.tcl | 4 ++++
src/gpl/src/timingBase.cpp | 9 ++++++---
src/gpl/src/timingBase.h | 5 +++++
8 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/src/gpl/include/gpl/Replace.h b/src/gpl/include/gpl/Replace.h
index b73e2a12..a5d89d42 100644
--- a/src/gpl/include/gpl/Replace.h
+++ b/src/gpl/include/gpl/Replace.h
@@ -56,6 +56,8 @@ struct PlaceOptions
bool skipIoMode = false;
bool forceCenterInitialPlace = false;
bool timingDrivenMode = false;
+ float wirelengthPenalty = 1.0;
+ float timingWeightSpanClockPercent = -1.0;
bool timingDrivenRepairTiming = false;
float timingDrivenRepairTnsEndPercent = 1.0;
bool routabilityDrivenMode = false;
diff --git a/src/gpl/src/nesterovBase.cpp b/src/gpl/src/nesterovBase.cpp
index 3ad4e0e5..70752538 100644
--- a/src/gpl/src/nesterovBase.cpp
+++ b/src/gpl/src/nesterovBase.cpp
@@ -1160,6 +1160,7 @@ NesterovBaseVars::NesterovBaseVars(const PlaceOptions& options)
binCntY(isSetBinCnt ? options.binGridCntY : 0),
minPhiCoef(options.minPhiCoef),
maxPhiCoef(options.maxPhiCoef),
+ wirelengthPenalty(options.wirelengthPenalty),
Comment thread
oharboe marked this conversation as resolved.
Resolved
initialPlacePerturbationSeed(options.initialPlacePerturbationSeed),
initialPlacePerturbationDist(options.initialPlacePerturbationDist)
{
diff --git a/src/gpl/src/nesterovBase.h b/src/gpl/src/nesterovBase.h
index ebcfebe3..591e605d 100644
--- a/src/gpl/src/nesterovBase.h
+++ b/src/gpl/src/nesterovBase.h
@@ -785,6 +785,7 @@ struct NesterovBaseVars

const float minPhiCoef;
float maxPhiCoef; // may be updated after initialization
+ float wirelengthPenalty = 1.0;
const int initialPlacePerturbationSeed;
const float initialPlacePerturbationDist;

diff --git a/src/gpl/src/replace.cpp b/src/gpl/src/replace.cpp
index de52bcbc..58bf1d55 100644
--- a/src/gpl/src/replace.cpp
+++ b/src/gpl/src/replace.cpp
@@ -319,6 +319,7 @@ void Replace::doNesterovPlace(const int threads,
tb_->setTimingNetsPercentage(options.timingDrivenNetsPercentage);
tb_->setRepairTiming(options.timingDrivenRepairTiming);
tb_->setRepairTnsEndPercent(options.timingDrivenRepairTnsEndPercent);
+ tb_->setTimingWeightSpanClockPercent(options.timingWeightSpanClockPercent);
}

if (!cb_ && options.virtualCtsMode) {
diff --git a/src/gpl/src/replace.i b/src/gpl/src/replace.i
index dc3ea329..443302bc 100644
--- a/src/gpl/src/replace.i
+++ b/src/gpl/src/replace.i
@@ -24,6 +24,8 @@ static gpl::PlaceOptions getOptions(

gpl::PlaceOptions options;
checkFlag(flags, "-timing_driven", options.timingDrivenMode);
+ checkKey(keys, "-wirelength_penalty", options.wirelengthPenalty);
+ checkKey(keys, "-timing_weight_span_clock_percent", options.timingWeightSpanClockPercent);
checkFlag(flags, "-timing_driven_repair_timing", options.timingDrivenRepairTiming);
checkFlag(flags, "-routability_driven", options.routabilityDrivenMode);
checkFlag(flags, "-virtual_cts", options.virtualCtsMode);
diff --git a/src/gpl/src/replace.tcl b/src/gpl/src/replace.tcl
index def690fa..aee4e101 100644
--- a/src/gpl/src/replace.tcl
+++ b/src/gpl/src/replace.tcl
@@ -6,6 +6,8 @@ sta::define_cmd_args "global_placement" {\
[-force_center_initial_place]\
[-skip_nesterov_place]\
[-timing_driven]\
+ [-wirelength_penalty wirelength_penalty]\
+ [-timing_weight_span_clock_percent timing_weight_span_clock_percent]\
[-timing_driven_repair_timing]\
[-routability_driven]\
[-virtual_cts]\
@@ -63,6 +65,8 @@ proc global_placement { args } {
-timing_driven_net_weight_max \
-timing_driven_nets_percentage \
-timing_driven_repair_tns_end_percent \
+ -wirelength_penalty \
+ -timing_weight_span_clock_percent \
-keep_resize_below_overflow \
-virtual_cts_max_skew_fraction \
-random_seed \
diff --git a/src/gpl/src/timingBase.cpp b/src/gpl/src/timingBase.cpp
index dbbdc437..cff5c65f 100644
--- a/src/gpl/src/timingBase.cpp
+++ b/src/gpl/src/timingBase.cpp
@@ -180,11 +180,14 @@ bool TimingBase::executeTimingDriven(bool run_journal_restore,
if (slack_max == slack_min) {
gNet->setTimingWeight(1.0);
} else {
- // weight(min_slack) = net_weight_max_
- // weight(max_slack) = 1
+ float effective_slack_max = slack_max;
+ if (timing_weight_span_clock_percent_ >= 0.0f) {
+ float clock_period = 1.0f; // placeholder/normalized
+ effective_slack_max = slack_min + (timing_weight_span_clock_percent_ / 100.0f) * clock_period;
Comment thread
oharboe marked this conversation as resolved.
Resolved
+ }
const float weight = 1
- + (net_weight_max_ - 1) * (slack_max - net_slack)
- / (slack_max - slack_min);
- gNet->setTimingWeight(weight);
+ + (net_weight_max_ - 1) * (effective_slack_max - net_slack)
+ / (effective_slack_max - slack_min);
Comment thread
oharboe marked this conversation as resolved.
Resolved
+ gNet->setTimingWeight(std::max(1.0f, std::min(net_weight_max_, weight)));
}
weighted_net_count++;
}
diff --git a/src/gpl/src/timingBase.h b/src/gpl/src/timingBase.h
index bf406c11..6dc9aa8e 100644
--- a/src/gpl/src/timingBase.h
+++ b/src/gpl/src/timingBase.h
@@ -51,6 +51,10 @@ class TimingBase
{
repair_tns_end_percent_ = percent / 100.0f;
}
+ void setTimingWeightSpanClockPercent(float percent)
+ {
+ timing_weight_span_clock_percent_ = percent;
+ }

// updateNetWeight.
// True: successfully reweighted gnets
@@ -74,6 +78,7 @@ class TimingBase
float nets_percentage_ = 10;
bool repair_timing_ = false;
float repair_tns_end_percent_ = 0.01;
+ float timing_weight_span_clock_percent_ = -1.0;
void initTimingOverflowChk();
};

--
Loading