Skip to content

Commit 11a3520

Browse files
committed
rsz: add -max_iterations option for repair_timing
Signed-off-by: Eder Monteiro <emrmonteiro@precisioninno.com>
1 parent e819f35 commit 11a3520

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

src/rsz/include/rsz/Resizer.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ class Resizer : public dbStaState, public dbNetworkObserver
276276
bool repairSetup(double setup_margin,
277277
double repair_tns_end_percent,
278278
int max_passes,
279+
int max_iterations,
279280
int max_repairs_per_pass,
280281
bool match_cell_footprint,
281282
bool verbose,
@@ -304,6 +305,7 @@ class Resizer : public dbStaState, public dbNetworkObserver
304305
// Max buffer count as percent of design instance count.
305306
float max_buffer_percent,
306307
int max_passes,
308+
int max_iterations,
307309
bool match_cell_footprint,
308310
bool verbose);
309311
void repairHold(const Pin* end_pin,

src/rsz/src/Resizer.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4354,6 +4354,7 @@ void Resizer::cloneClkInverter(Instance* inv)
43544354
bool Resizer::repairSetup(double setup_margin,
43554355
double repair_tns_end_percent,
43564356
int max_passes,
4357+
int max_iterations,
43574358
int max_repairs_per_pass,
43584359
bool match_cell_footprint,
43594360
bool verbose,
@@ -4379,6 +4380,7 @@ bool Resizer::repairSetup(double setup_margin,
43794380
return repair_setup_->repairSetup(setup_margin,
43804381
repair_tns_end_percent,
43814382
max_passes,
4383+
max_iterations,
43824384
max_repairs_per_pass,
43834385
verbose,
43844386
sequence,
@@ -4419,6 +4421,7 @@ bool Resizer::repairHold(
44194421
// Max buffer count as percent of design instance count.
44204422
float max_buffer_percent,
44214423
int max_passes,
4424+
int max_iterations,
44224425
bool match_cell_footprint,
44234426
bool verbose)
44244427
{
@@ -4445,6 +4448,7 @@ bool Resizer::repairHold(
44454448
allow_setup_violations,
44464449
max_buffer_percent,
44474450
max_passes,
4451+
max_iterations,
44484452
verbose);
44494453
}
44504454

src/rsz/src/Resizer.i

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ bool
362362
repair_setup(double setup_margin,
363363
double repair_tns_end_percent,
364364
int max_passes,
365+
int max_iterations,
365366
int max_repairs_per_pass,
366367
bool match_cell_footprint,
367368
bool verbose,
@@ -378,9 +379,9 @@ repair_setup(double setup_margin,
378379
ensureLinked();
379380
Resizer *resizer = getResizer();
380381
return resizer->repairSetup(setup_margin, repair_tns_end_percent,
381-
max_passes, max_repairs_per_pass,
382-
match_cell_footprint, verbose,
383-
sequence,
382+
max_passes, max_iterations,
383+
max_repairs_per_pass, match_cell_footprint,
384+
verbose, sequence,
384385
skip_pin_swap, skip_gate_cloning,
385386
skip_size_down,
386387
skip_buffering, skip_buffer_removal,
@@ -409,6 +410,7 @@ repair_hold(double setup_margin,
409410
bool allow_setup_violations,
410411
float max_buffer_percent,
411412
int max_passes,
413+
int max_iterations,
412414
bool match_cell_footprint,
413415
bool verbose)
414416
{
@@ -417,7 +419,8 @@ repair_hold(double setup_margin,
417419
return resizer->repairHold(setup_margin, hold_margin,
418420
allow_setup_violations,
419421
max_buffer_percent, max_passes,
420-
match_cell_footprint, verbose);
422+
max_iterations, match_cell_footprint,
423+
verbose);
421424
}
422425

423426
void

src/rsz/src/Resizer.tcl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ sta::define_cmd_args "repair_timing" {[-setup] [-hold]\
251251
[-skip_crit_vt_swap]\
252252
[-repair_tns tns_end_percent]\
253253
[-max_passes passes]\
254+
[-max_iterations iterations]\
254255
[-max_buffer_percent buffer_percent]\
255256
[-max_utilization util] \
256257
[-match_cell_footprint] \
@@ -261,7 +262,7 @@ proc repair_timing { args } {
261262
sta::parse_key_args "repair_timing" args \
262263
keys {-setup_margin -hold_margin -slack_margin \
263264
-libraries -max_utilization -max_buffer_percent -sequence \
264-
-recover_power -repair_tns -max_passes -max_repairs_per_pass} \
265+
-recover_power -repair_tns -max_passes -max_iterations -max_repairs_per_pass} \
265266
flags {-setup -hold -allow_setup_violations -skip_pin_swap -skip_gate_cloning \
266267
-skip_size_down -skip_buffering -skip_buffer_removal -skip_last_gasp \
267268
-skip_vt_swap -skip_crit_vt_swap -match_cell_footprint -verbose}
@@ -336,6 +337,11 @@ proc repair_timing { args } {
336337
set max_passes $keys(-max_passes)
337338
}
338339

340+
set max_iterations -1
341+
if { [info exists keys(-max_iterations)] } {
342+
set max_iterations $keys(-max_iterations)
343+
}
344+
339345
set match_cell_footprint [info exists flags(-match_cell_footprint)]
340346
if { [design_is_routed] } {
341347
est::set_parasitics_src "detailed_routing"
@@ -357,15 +363,15 @@ proc repair_timing { args } {
357363
} else {
358364
if { $setup } {
359365
set repaired_setup [rsz::repair_setup $setup_margin $repair_tns_end_percent $max_passes \
360-
$max_repairs_per_pass $match_cell_footprint $verbose \
366+
$max_iterations $max_repairs_per_pass $match_cell_footprint $verbose \
361367
$sequence \
362368
$skip_pin_swap $skip_gate_cloning $skip_size_down $skip_buffering \
363369
$skip_buffer_removal $skip_last_gasp $skip_vt_swap $skip_crit_vt_swap]
364370
}
365371
if { $hold } {
366372
set repaired_hold [rsz::repair_hold $setup_margin $hold_margin \
367373
$allow_setup_violations $max_buffer_percent $max_passes \
368-
$match_cell_footprint $verbose]
374+
$max_iterations $match_cell_footprint $verbose]
369375
}
370376
}
371377

0 commit comments

Comments
 (0)