Skip to content

Commit 1f6ccc9

Browse files
authored
Merge pull request The-OpenROAD-Project#3929 from eder-matheus/ppl_fix_crash
ppl: check available slots agains number of pins in the correct place
2 parents 6811331 + 96d5870 commit 1f6ccc9

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/ppl/src/IOPlacer.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,15 @@ void IOPlacer::defineSlots()
865865
findSlots(hor_layers_, Edge::left);
866866

867867
findSlotsForTopLayer();
868+
869+
if (netlist_io_pins_->getIOPins().size() > slots_.size()) {
870+
logger_->error(PPL,
871+
24,
872+
"Number of IO pins ({}) exceeds maximum number of available "
873+
"positions ({}).",
874+
netlist_io_pins_->getIOPins().size(),
875+
slots_.size());
876+
}
868877
}
869878

870879
void IOPlacer::findSections(int begin,
@@ -1290,8 +1299,10 @@ void IOPlacer::printConfig(bool annealing)
12901299
logger_->info(PPL, 1, "Number of slots {}", slots_.size());
12911300
logger_->info(PPL, 2, "Number of I/O {}", netlist_->numIOPins());
12921301
logger_->metric("floorplan__design__io", netlist_->numIOPins());
1293-
logger_->info(
1294-
PPL, 3, "Number of I/O w/sink {}", netlist_io_pins_->numIOPins());
1302+
logger_->info(PPL,
1303+
3,
1304+
"Number of I/O w/sink {}",
1305+
netlist_io_pins_->numIOPins() - zero_sink_ios_.size());
12951306
logger_->info(PPL, 4, "Number of I/O w/o sink {}", zero_sink_ios_.size());
12961307
if (!annealing) {
12971308
logger_->info(PPL, 5, "Slots per section {}", slots_per_section_);
@@ -1905,15 +1916,6 @@ void IOPlacer::run(bool random_mode)
19051916
initIOLists();
19061917
defineSlots();
19071918

1908-
if (netlist_io_pins_->getIOPins().size() > slots_.size()) {
1909-
logger_->error(PPL,
1910-
24,
1911-
"Number of IO pins ({}) exceeds maximum number of available "
1912-
"positions ({}).",
1913-
netlist_io_pins_->getIOPins().size(),
1914-
slots_.size());
1915-
}
1916-
19171919
initMirroredPins();
19181920
initConstraints();
19191921

src/ppl/test/no_instance_pins.ok

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Found 0 macro blocks.
1010
[INFO PPL-0010] Tentative 0 to set up sections.
1111
[INFO PPL-0001] Number of slots 2494
1212
[INFO PPL-0002] Number of I/O 10
13-
[INFO PPL-0003] Number of I/O w/sink 10
13+
[INFO PPL-0003] Number of I/O w/sink 0
1414
[INFO PPL-0004] Number of I/O w/o sink 10
1515
[INFO PPL-0005] Slots per section 200
1616
[INFO PPL-0006] Slots increase factor 0.01

0 commit comments

Comments
 (0)