@@ -44,6 +44,57 @@ class NesterovPlace;
4444using Cluster = std::vector<odb::dbInst*>;
4545using Clusters = std::vector<Cluster>;
4646
47+ struct PlaceOptions
48+ {
49+ int initialPlaceMaxIter = 20 ;
50+ int initialPlaceMinDiffLength = 1500 ;
51+ int initialPlaceMaxSolverIter = 100 ;
52+ int initialPlaceMaxFanout = 200 ;
53+ float initialPlaceNetWeightScale = 800 ;
54+
55+ bool skipIoMode = false ;
56+ bool timingDrivenMode = false ;
57+ bool routabilityDrivenMode = false ;
58+ bool uniformTargetDensityMode = false ;
59+ std::vector<int > timingNetWeightOverflows{64 , 20 };
60+ float timingNetWeightMax = 5 ;
61+ float overflow = 0.1 ;
62+ int nesterovPlaceMaxIter = 5000 ;
63+ // timing driven check overflow to keep resizer changes (non-virtual resizer)
64+ float keepResizeBelowOverflow = 1.0 ;
65+ bool routabilityUseRudy = true ;
66+ bool disableRevertIfDiverge = false ;
67+ bool enable_routing_congestion = false ;
68+ float minPhiCoef = 0.95 ;
69+ float maxPhiCoef = 1.05 ;
70+ float initDensityPenaltyFactor = 0.00008 ;
71+ float initWireLengthCoef = 0.25 ;
72+ float referenceHpwl = 446000000 ;
73+ int binGridCntX = 0 ;
74+ int binGridCntY = 0 ;
75+ float density = 0.7 ;
76+
77+ float routabilityCheckOverflow = 0.3 ;
78+ float routabilityMaxDensity = 0.99 ;
79+ float routabilityTargetRcMetric = 1.01 ;
80+ float routabilityInflationRatioCoef = 2 ;
81+ float routabilityMaxInflationRatio = 3 ;
82+ int routabilityMaxInflationIter = 4 ;
83+
84+ // routability RC metric coefficients
85+ float routabilityRcK1 = 1.0 ;
86+ float routabilityRcK2 = 1.0 ;
87+ float routabilityRcK3 = 0.0 ;
88+ float routabilityRcK4 = 0.0 ;
89+
90+ // OpenDB should have these values.
91+ int padLeft = 0 ;
92+ int padRight = 0 ;
93+
94+ void skipIo ();
95+ void validate (utl::Logger* log);
96+ };
97+
4798class Replace
4899{
49100 public:
@@ -64,62 +115,19 @@ class Replace
64115
65116 void reset ();
66117
67- void doIncrementalPlace (int threads);
68- void doInitialPlace (int threads);
118+ void doIncrementalPlace (int threads, const PlaceOptions& options = {});
119+ void doPlace (int threads, const PlaceOptions& options = {});
120+ void doInitialPlace (int threads, const PlaceOptions& options = {});
121+ int doNesterovPlace (int threads,
122+ const PlaceOptions& options = {},
123+ int start_iter = 0 );
124+
69125 void runMBFF (int max_sz, float alpha, float beta, int threads, int num_paths);
70126
71127 void addPlacementCluster (const Cluster& cluster);
72- int doNesterovPlace (int threads, int start_iter = 0 );
73-
74- // Initial Place param settings
75- void setInitialPlaceMaxIter (int iter);
76- void setInitialPlaceMinDiffLength (int length);
77- void setInitialPlaceMaxSolverIter (int iter);
78- void setInitialPlaceMaxFanout (int fanout);
79- void setInitialPlaceNetWeightScale (float scale);
80-
81- void setNesterovPlaceMaxIter (int iter);
82-
83- void setBinGridCnt (int binGridCntX, int binGridCntY);
84-
85- void setTargetDensity (float density);
86- // Execute gpl with uniform density as target density
87- void setUniformTargetDensityMode (bool mode);
88- void setTargetOverflow (float overflow);
89- void setInitDensityPenalityFactor (float penaltyFactor);
90- void setInitWireLengthCoef (float coef);
91- void setMinPhiCoef (float minPhiCoef);
92- void setMaxPhiCoef (float maxPhiCoef);
93128
94129 // Query for uniform density value
95- float getUniformTargetDensity (int threads);
96-
97- // HPWL: half-parameter wire length.
98- void setReferenceHpwl (float refHpwl);
99-
100- // temp funcs; OpenDB should have these values.
101- void setPadLeft (int padding);
102- void setPadRight (int padding);
103-
104- void setTimingDrivenMode (bool mode);
105-
106- void setSkipIoMode (bool mode);
107- void setDisableRevertIfDiverge (bool mode);
108-
109- void setRoutabilityDrivenMode (bool mode);
110- void setRoutabilityUseGrt (bool mode);
111- void setRoutabilityCheckOverflow (float overflow);
112- void setRoutabilityMaxDensity (float density);
113- void setRoutabilityMaxInflationIter (int iter);
114- void setRoutabilityTargetRcMetric (float rc);
115- void setRoutabilityInflationRatioCoef (float coef);
116- void setRoutabilityMaxInflationRatio (float ratio);
117- void setRoutabilityRcCoefficients (float k1, float k2, float k3, float k4);
118- void setEnableRoutingCongestion (bool mode);
119-
120- void addTimingNetWeightOverflow (int overflow);
121- void setTimingNetWeightMax (float max);
122- void setKeepResizeBelowOverflow (float overflow);
130+ float getUniformTargetDensity (const PlaceOptions& options, int threads);
123131
124132 void setDebug (int pause_iterations,
125133 int update_iterations,
@@ -128,10 +136,11 @@ class Replace
128136 odb::dbInst* inst,
129137 int start_iter,
130138 bool generate_images,
131- std::string images_path);
139+ const std::string& images_path);
132140
133141 private:
134- bool initNesterovPlace (int threads);
142+ bool initNesterovPlace (const PlaceOptions& options, int threads);
143+ void checkHasCoreRows ();
135144
136145 odb::dbDatabase* db_ = nullptr ;
137146 sta::dbSta* sta_ = nullptr ;
@@ -151,55 +160,10 @@ class Replace
151160 std::unique_ptr<InitialPlace> ip_;
152161 std::unique_ptr<NesterovPlace> np_;
153162
154- int initialPlaceMaxIter_ = 20 ;
155- int initialPlaceMinDiffLength_ = 1500 ;
156- int initialPlaceMaxSolverIter_ = 100 ;
157- int initialPlaceMaxFanout_ = 200 ;
158- float initialPlaceNetWeightScale_ = 800 ;
159-
160163 int total_placeable_insts_ = 0 ;
161164
162- int nesterovPlaceMaxIter_ = 5000 ;
163- int binGridCntX_ = 0 ;
164- int binGridCntY_ = 0 ;
165- float overflow_ = 0.1 ;
166- float density_ = 1.0 ;
167- float initDensityPenalityFactor_ = 0.00008 ;
168- float initWireLengthCoef_ = 0.25 ;
169- float minPhiCoef_ = 0.95 ;
170- float maxPhiCoef_ = 1.05 ;
171- float referenceHpwl_ = 446000000 ;
172-
173- float routabilityCheckOverflow_ = 0.3 ;
174- float routabilityMaxDensity_ = 0.99 ;
175- float routabilityTargetRcMetric_ = 1.01 ;
176- float routabilityInflationRatioCoef_ = 2 ;
177- float routabilityMaxInflationRatio_ = 3 ;
178- int routabilityMaxInflationIter_ = 4 ;
179-
180- // routability RC metric coefficients
181- float routabilityRcK1_ = 1.0 ;
182- float routabilityRcK2_ = 1.0 ;
183- float routabilityRcK3_ = 0.0 ;
184- float routabilityRcK4_ = 0.0 ;
185-
186- float timingNetWeightMax_ = 5 ;
187- float keepResizeBelowOverflow_ = 1.0 ;
188-
189- bool timingDrivenMode_ = true ;
190- bool routabilityDrivenMode_ = true ;
191- bool routabilityUseRudy_ = true ;
192- bool uniformTargetDensityMode_ = false ;
193- bool skipIoMode_ = false ;
194- bool disableRevertIfDiverge_ = false ;
195- bool enable_routing_congestion_ = false ;
196-
197- std::vector<int > timingNetWeightOverflows_;
198165 Clusters clusters_;
199166
200- // temp variable; OpenDB should have these values.
201- int padLeft_ = 0 ;
202- int padRight_ = 0 ;
203167 bool gui_debug_ = false ;
204168 int gui_debug_pause_iterations_ = 10 ;
205169 int gui_debug_update_iterations_ = 10 ;
0 commit comments