|
| 1 | +From 06b8b5d592a51490cad48bff036b81b5264106f9 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Øyvind Harboe <oyvind.harboe@zylin.com> |
| 3 | +Date: Wed, 12 Aug 2026 17:48:28 +0200 |
| 4 | +Subject: [PATCH] Add PDK-aware GPL parameters |
| 5 | + |
| 6 | +--- |
| 7 | + src/gpl/include/gpl/Replace.h | 2 ++ |
| 8 | + src/gpl/src/nesterovBase.cpp | 1 + |
| 9 | + src/gpl/src/nesterovBase.h | 1 + |
| 10 | + src/gpl/src/replace.cpp | 1 + |
| 11 | + src/gpl/src/replace.i | 2 ++ |
| 12 | + src/gpl/src/replace.tcl | 4 ++++ |
| 13 | + src/gpl/src/timingBase.cpp | 9 ++++++--- |
| 14 | + src/gpl/src/timingBase.h | 5 +++++ |
| 15 | + 8 files changed, 24 insertions(+), 5 deletions(-) |
| 16 | + |
| 17 | +diff --git a/src/gpl/include/gpl/Replace.h b/src/gpl/include/gpl/Replace.h |
| 18 | +index b73e2a12..a5d89d42 100644 |
| 19 | +--- a/src/gpl/include/gpl/Replace.h |
| 20 | ++++ b/src/gpl/include/gpl/Replace.h |
| 21 | +@@ -56,6 +56,8 @@ struct PlaceOptions |
| 22 | + bool skipIoMode = false; |
| 23 | + bool forceCenterInitialPlace = false; |
| 24 | + bool timingDrivenMode = false; |
| 25 | ++ float wirelengthPenalty = 1.0; |
| 26 | ++ float timingWeightSpanClockPercent = -1.0; |
| 27 | + bool timingDrivenRepairTiming = false; |
| 28 | + float timingDrivenRepairTnsEndPercent = 1.0; |
| 29 | + bool routabilityDrivenMode = false; |
| 30 | +diff --git a/src/gpl/src/nesterovBase.cpp b/src/gpl/src/nesterovBase.cpp |
| 31 | +index 3ad4e0e5..70752538 100644 |
| 32 | +--- a/src/gpl/src/nesterovBase.cpp |
| 33 | ++++ b/src/gpl/src/nesterovBase.cpp |
| 34 | +@@ -1160,6 +1160,7 @@ NesterovBaseVars::NesterovBaseVars(const PlaceOptions& options) |
| 35 | + binCntY(isSetBinCnt ? options.binGridCntY : 0), |
| 36 | + minPhiCoef(options.minPhiCoef), |
| 37 | + maxPhiCoef(options.maxPhiCoef), |
| 38 | ++ wirelengthPenalty(options.wirelengthPenalty), |
| 39 | + initialPlacePerturbationSeed(options.initialPlacePerturbationSeed), |
| 40 | + initialPlacePerturbationDist(options.initialPlacePerturbationDist) |
| 41 | + { |
| 42 | +diff --git a/src/gpl/src/nesterovBase.h b/src/gpl/src/nesterovBase.h |
| 43 | +index ebcfebe3..591e605d 100644 |
| 44 | +--- a/src/gpl/src/nesterovBase.h |
| 45 | ++++ b/src/gpl/src/nesterovBase.h |
| 46 | +@@ -785,6 +785,7 @@ struct NesterovBaseVars |
| 47 | + |
| 48 | + const float minPhiCoef; |
| 49 | + float maxPhiCoef; // may be updated after initialization |
| 50 | ++ float wirelengthPenalty = 1.0; |
| 51 | + const int initialPlacePerturbationSeed; |
| 52 | + const float initialPlacePerturbationDist; |
| 53 | + |
| 54 | +diff --git a/src/gpl/src/replace.cpp b/src/gpl/src/replace.cpp |
| 55 | +index de52bcbc..58bf1d55 100644 |
| 56 | +--- a/src/gpl/src/replace.cpp |
| 57 | ++++ b/src/gpl/src/replace.cpp |
| 58 | +@@ -319,6 +319,7 @@ void Replace::doNesterovPlace(const int threads, |
| 59 | + tb_->setTimingNetsPercentage(options.timingDrivenNetsPercentage); |
| 60 | + tb_->setRepairTiming(options.timingDrivenRepairTiming); |
| 61 | + tb_->setRepairTnsEndPercent(options.timingDrivenRepairTnsEndPercent); |
| 62 | ++ tb_->setTimingWeightSpanClockPercent(options.timingWeightSpanClockPercent); |
| 63 | + } |
| 64 | + |
| 65 | + if (!cb_ && options.virtualCtsMode) { |
| 66 | +diff --git a/src/gpl/src/replace.i b/src/gpl/src/replace.i |
| 67 | +index dc3ea329..443302bc 100644 |
| 68 | +--- a/src/gpl/src/replace.i |
| 69 | ++++ b/src/gpl/src/replace.i |
| 70 | +@@ -24,6 +24,8 @@ static gpl::PlaceOptions getOptions( |
| 71 | + |
| 72 | + gpl::PlaceOptions options; |
| 73 | + checkFlag(flags, "-timing_driven", options.timingDrivenMode); |
| 74 | ++ checkKey(keys, "-wirelength_penalty", options.wirelengthPenalty); |
| 75 | ++ checkKey(keys, "-timing_weight_span_clock_percent", options.timingWeightSpanClockPercent); |
| 76 | + checkFlag(flags, "-timing_driven_repair_timing", options.timingDrivenRepairTiming); |
| 77 | + checkFlag(flags, "-routability_driven", options.routabilityDrivenMode); |
| 78 | + checkFlag(flags, "-virtual_cts", options.virtualCtsMode); |
| 79 | +diff --git a/src/gpl/src/replace.tcl b/src/gpl/src/replace.tcl |
| 80 | +index def690fa..aee4e101 100644 |
| 81 | +--- a/src/gpl/src/replace.tcl |
| 82 | ++++ b/src/gpl/src/replace.tcl |
| 83 | +@@ -6,6 +6,8 @@ sta::define_cmd_args "global_placement" {\ |
| 84 | + [-force_center_initial_place]\ |
| 85 | + [-skip_nesterov_place]\ |
| 86 | + [-timing_driven]\ |
| 87 | ++ [-wirelength_penalty wirelength_penalty]\ |
| 88 | ++ [-timing_weight_span_clock_percent timing_weight_span_clock_percent]\ |
| 89 | + [-timing_driven_repair_timing]\ |
| 90 | + [-routability_driven]\ |
| 91 | + [-virtual_cts]\ |
| 92 | +@@ -63,6 +65,8 @@ proc global_placement { args } { |
| 93 | + -timing_driven_net_weight_max \ |
| 94 | + -timing_driven_nets_percentage \ |
| 95 | + -timing_driven_repair_tns_end_percent \ |
| 96 | ++ -wirelength_penalty \ |
| 97 | ++ -timing_weight_span_clock_percent \ |
| 98 | + -keep_resize_below_overflow \ |
| 99 | + -virtual_cts_max_skew_fraction \ |
| 100 | + -random_seed \ |
| 101 | +diff --git a/src/gpl/src/timingBase.cpp b/src/gpl/src/timingBase.cpp |
| 102 | +index dbbdc437..cff5c65f 100644 |
| 103 | +--- a/src/gpl/src/timingBase.cpp |
| 104 | ++++ b/src/gpl/src/timingBase.cpp |
| 105 | +@@ -180,11 +180,14 @@ bool TimingBase::executeTimingDriven(bool run_journal_restore, |
| 106 | + if (slack_max == slack_min) { |
| 107 | + gNet->setTimingWeight(1.0); |
| 108 | + } else { |
| 109 | +- // weight(min_slack) = net_weight_max_ |
| 110 | +- // weight(max_slack) = 1 |
| 111 | ++ float effective_slack_max = slack_max; |
| 112 | ++ if (timing_weight_span_clock_percent_ >= 0.0f) { |
| 113 | ++ float clock_period = 1.0f; // placeholder/normalized |
| 114 | ++ effective_slack_max = slack_min + (timing_weight_span_clock_percent_ / 100.0f) * clock_period; |
| 115 | ++ } |
| 116 | + const float weight = 1 |
| 117 | +- + (net_weight_max_ - 1) * (slack_max - net_slack) |
| 118 | +- / (slack_max - slack_min); |
| 119 | +- gNet->setTimingWeight(weight); |
| 120 | ++ + (net_weight_max_ - 1) * (effective_slack_max - net_slack) |
| 121 | ++ / (effective_slack_max - slack_min); |
| 122 | ++ gNet->setTimingWeight(std::max(1.0f, std::min(net_weight_max_, weight))); |
| 123 | + } |
| 124 | + weighted_net_count++; |
| 125 | + } |
| 126 | +diff --git a/src/gpl/src/timingBase.h b/src/gpl/src/timingBase.h |
| 127 | +index bf406c11..6dc9aa8e 100644 |
| 128 | +--- a/src/gpl/src/timingBase.h |
| 129 | ++++ b/src/gpl/src/timingBase.h |
| 130 | +@@ -51,6 +51,10 @@ class TimingBase |
| 131 | + { |
| 132 | + repair_tns_end_percent_ = percent / 100.0f; |
| 133 | + } |
| 134 | ++ void setTimingWeightSpanClockPercent(float percent) |
| 135 | ++ { |
| 136 | ++ timing_weight_span_clock_percent_ = percent; |
| 137 | ++ } |
| 138 | + |
| 139 | + // updateNetWeight. |
| 140 | + // True: successfully reweighted gnets |
| 141 | +@@ -74,6 +78,7 @@ class TimingBase |
| 142 | + float nets_percentage_ = 10; |
| 143 | + bool repair_timing_ = false; |
| 144 | + float repair_tns_end_percent_ = 0.01; |
| 145 | ++ float timing_weight_span_clock_percent_ = -1.0; |
| 146 | + void initTimingOverflowChk(); |
| 147 | + }; |
| 148 | + |
| 149 | +-- |
0 commit comments