Skip to content

Commit

Permalink
valores não mudam durante iterações
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelmoresco committed Sep 20, 2024
1 parent d757dff commit 2c0f665
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions src/tut/src/Tutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1810,6 +1810,15 @@ void
Tutorial::resetIoplacer()
{
logger_->report("Reseting IOPlacer");
auto terms = db_->getChip()->getBlock()->getBTerms();
for (auto term : terms) {
auto pins = term->getBPins();
for (auto pin : pins) {
pin->setPlacementStatus("UNPLACED");
}
}
pPlacer_->clear();
pPlacer_->clearConstraints();
auto inputFlags = parserArguments("args_input.txt");
auto tech = db_->getTech();
pPlacer_->getParameters()->setRandSeed(std::round(42 * tech->getLefUnits()));
Expand All @@ -1828,10 +1837,6 @@ Tutorial::resetIoplacer()
{
pPlacer_->excludeInterval(exclude.edge, exclude.begin, exclude.end);
}
auto terms = db_->getChip()->getBlock()->getBTerms();
// for (auto term : terms) {
// term->get
// }
}

void
Expand All @@ -1858,13 +1863,17 @@ Tutorial::placeMacrosCornerMinWL2()
logger_->report("Running IOPlacer");
pPlacer_->run(false);
double wirelenght = getWeightedWL();
logger_->report("Current wWL = {}", wirelenght);
for (int i = 0; i < 3 ; i++){
logger_->report("Iteration {} starting", i);
unlockMacros();
placeMacrosCornerMinWL();
resetIoplacer();
pPlacer_->run(false);
double wirelenght2 = getWeightedWL();
logger_->report("Current wWL = {}", wirelenght2);
if (wirelenght < wirelenght2) {
logger_->report("Breaking the Cycle");
break;
}
}
Expand All @@ -1878,6 +1887,7 @@ Tutorial::placeMacrosCornerMaxWl2()
pPlacer_->run(false);
double wirelenght = getWeightedWL();
for (int i = 0; i < 3 ; i++){
logger_->report("Iteration {} starting", i);
placeMacrosCornerMaxWl();
resetIoplacer();
pPlacer_->run(false);
Expand Down
4 changes: 2 additions & 2 deletions src/tut/src/Tutorial.i
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ void
place_macros_corner_min_wl()
{
Tutorial* macro_placer = getTutorial();
macro_placer->placeMacrosCornerMinWL();
macro_placer->placeMacrosCornerMinWL2();
}

void
place_macros_corner_max_wl()
{
Tutorial* macro_placer = getTutorial();
macro_placer->placeMacrosCornerMaxWl();
macro_placer->placeMacrosCornerMinWL2();
}

void set_debug_cmd(bool partitions)
Expand Down

0 comments on commit 2c0f665

Please sign in to comment.