Improve callbacks

This commit is contained in:
Gabriel Gouvine 2023-06-06 13:56:43 +02:00
parent 1b41976ca1
commit 2bc2e4a988
2 changed files with 21 additions and 13 deletions

View File

@ -476,6 +476,7 @@ namespace Etesian {
_placementUB = NULL;
//_densityLimits = NULL;
_diodeCount = 0;
_antennaDone = false;
}
@ -1163,18 +1164,26 @@ namespace Etesian {
}
void EtesianEngine::_coloquinteCallback(coloquinte::PlacementStep step) {
GraphicUpdate conf = getUpdateConf();
if (conf == GraphicUpdate::FinalOnly) {
return;
}
if (conf == GraphicUpdate::LowerBound) {
if (step == coloquinte::PlacementStep::UpperBound ||
step == coloquinte::PlacementStep::Detailed) {
return;
}
}
auto placement = _circuit->solution();
_updatePlacement(&placement);
if (step == coloquinte::PlacementStep::LowerBound) {
*_placementLB = placement;
}
else {
*_placementUB = placement;
}
// Graphical update
GraphicUpdate conf = getUpdateConf();
if (conf == GraphicUpdate::UpdateAll) {
_updatePlacement(&placement);
}
else if (conf == GraphicUpdate::LowerBound &&
step == coloquinte::PlacementStep::LowerBound) {
_updatePlacement(&placement);
}
// Antenna update
// TODO
}
@ -1183,7 +1192,6 @@ namespace Etesian {
coloquinte::ColoquinteParameters params(getPlaceEffort());
coloquinte::PlacementCallback callback =std::bind(&EtesianEngine::_coloquinteCallback, this, std::placeholders::_1);
_circuit->placeGlobal(params, callback);
// TODO: add callback for placement update + antenna effect
*_placementUB = _circuit->solution();
_updatePlacement(_placementUB);
}
@ -1195,7 +1203,6 @@ namespace Etesian {
coloquinte::PlacementCallback callback =std::bind(&EtesianEngine::_coloquinteCallback, this, std::placeholders::_1);
_circuit->placeDetailed(params, callback);
*_placementUB = _circuit->solution();
// TODO: add callback for placement update + antenna effect
*_placementLB = *_placementUB; // In case we run other passes
_updatePlacement(_placementUB);
}

View File

@ -181,6 +181,7 @@ namespace Etesian {
uint32_t _diodeCount;
uint32_t _bufferCount;
NetNameSet _excludedNets;
bool _antennaDone;
protected:
// Constructors & Destructors.