Split callback in Etesian to allow for derived placer classes

This commit is contained in:
Gabriel Gouvine 2023-11-02 19:58:35 +01:00 committed by Gabriel Gouvine
parent 44ce8dd162
commit d27cc8b956
3 changed files with 19 additions and 9 deletions

View File

@ -1080,6 +1080,18 @@ namespace Etesian {
}
void EtesianEngine::_coloquinteCallback(coloquinte::PlacementStep step) {
// Graphical update
GraphicUpdate conf = getUpdateConf();
bool updatePlacement = conf == GraphicUpdate::UpdateAll;
if (conf == GraphicUpdate::LowerBound &&
step == coloquinte::PlacementStep::LowerBound) {
updatePlacement = true;
}
_coloquinteCallbackCore(step, updatePlacement);
}
void EtesianEngine::_coloquinteCallbackCore(coloquinte::PlacementStep step, bool updatePlacement) {
auto placement = _circuit->solution();
if (step == coloquinte::PlacementStep::LowerBound) {
*_placementLB = placement;
@ -1088,13 +1100,7 @@ namespace Etesian {
*_placementUB = placement;
}
// Graphical update
GraphicUpdate conf = getUpdateConf();
if (conf == GraphicUpdate::UpdateAll) {
_updatePlacement(&placement);
}
else if (conf == GraphicUpdate::LowerBound &&
step == coloquinte::PlacementStep::LowerBound) {
if (updatePlacement) {
_updatePlacement(&placement);
}
}

View File

@ -63,7 +63,7 @@ extern "C" {
static PyModuleDef PyEtesian_ModuleDef =
{ PyModuleDef_HEAD_INIT
, "Etesian" /* m_name */
, "Standard cell analytical placer (based on SimPL)."
, "Standard cell analytical placer."
/* m_doc */
, -1 /* m_size */
, PyEtesian_Methods /* m_methods */

View File

@ -185,11 +185,15 @@ namespace Etesian {
private:
EtesianEngine ( const EtesianEngine& );
EtesianEngine& operator= ( const EtesianEngine& );
protected:
virtual void _coloquinteCallback(coloquinte::PlacementStep step);
void _coloquinteCallbackCore(coloquinte::PlacementStep step, bool updatePlacement);
private:
inline uint32_t _getNewDiodeId ();
Instance* _createDiode ( Cell* );
void _updatePlacement ( const coloquinte::PlacementSolution* );
void _coloquinteCallback(coloquinte::PlacementStep step);
void _checkNotAFeed ( Occurrence occurrence ) const;
};