Add setters for space margin and aspect ratio in Etesian.

* Change: In EtesianEngine, add setters for space margin and aspect ratio.
    Export them in Python.
This commit is contained in:
Jean-Paul Chaput 2020-06-16 21:39:10 +02:00
parent b0a3bb33af
commit 1ccb9c340f
5 changed files with 23 additions and 19 deletions

View File

@ -548,9 +548,8 @@ namespace Etesian {
topTransformation.applyOn( topAb );
size_t instancesNb = getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()).getSize();
if (not instancesNb) {
cerr << Error( "EtesianEngine::toColoquinte(): No instance to place. We're gonna crash..." ) << endl;
}
if (not instancesNb)
throw Error( "EtesianEngine::toColoquinte(): No instance to place." );
// Coloquinte circuit description data-structures.
// One dummy fixed instance at the end

View File

@ -69,7 +69,9 @@ extern "C" {
DirectVoidMethod(EtesianEngine,etesian,setDefaultAb)
DirectVoidMethod(EtesianEngine,etesian,resetPlacement)
DirectSetLongAttribute(PyEtesianEngine_setFixedAbHeight,setFixedAbHeight,PyEtesianEngine,EtesianEngine)
DirectSetLongAttribute (PyEtesianEngine_setFixedAbHeight,setFixedAbHeight,PyEtesianEngine,EtesianEngine)
DirectSetDoubleAttribute(PyEtesianEngine_setSpaceMargin ,setSpaceMargin ,PyEtesianEngine,EtesianEngine)
DirectSetDoubleAttribute(PyEtesianEngine_setAspectRatio ,setAspectRatio ,PyEtesianEngine,EtesianEngine)
static PyObject* PyEtesianEngine_get ( PyObject*, PyObject* args )
@ -211,6 +213,10 @@ extern "C" {
, "Compute and set the abutment box using the aspect ratio and the space margin." }
, { "setFixedAbHeight" , (PyCFunction)PyEtesianEngine_setFixedAbHeight , METH_VARARGS
, "Use this height when computing the size of the default abutment box (disable aspect ratio)." }
, { "setSpaceMargin" , (PyCFunction)PyEtesianEngine_setSpaceMargin , METH_VARARGS
, "Override the configuration space margin parameter value." }
, { "setAspectRatio" , (PyCFunction)PyEtesianEngine_setAspectRatio , METH_VARARGS
, "Override the configuration aspect ratio parameter value." }
, { "resetPlacement" , (PyCFunction)PyEtesianEngine_resetPlacement , METH_NOARGS
, "Compute and set the abutment box using the aspect ratio and the space margin." }
, { "place" , (PyCFunction)PyEtesianEngine_place , METH_NOARGS

View File

@ -74,6 +74,8 @@ namespace Etesian {
inline double getAspectRatio () const;
inline string getFeedNames () const;
inline string getBloat () const;
inline void setSpaceMargin ( double );
inline void setAspectRatio ( double );
void print ( Cell* ) const;
Record* _getRecord () const;
string _getString () const;
@ -106,6 +108,8 @@ namespace Etesian {
inline double Configuration::getAspectRatio () const { return _aspectRatio; }
inline string Configuration::getFeedNames () const { return _feedNames; }
inline string Configuration::getBloat () const { return _bloat; }
inline void Configuration::setSpaceMargin ( double margin ) { _spaceMargin = margin; }
inline void Configuration::setAspectRatio ( double ratio ) { _aspectRatio = ratio; }
} // Etesian namespace.

View File

@ -1,22 +1,20 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2014-2018, All Rights Reserved
// Copyright (c) SU 2014-2020, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | E t e s i a n - A n a l y t i c P l a c e r |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./etesian/EtesianEngine.h" |
// +-----------------------------------------------------------------+
#ifndef ETESIAN_ETESIAN_ENGINE_H
#define ETESIAN_ETESIAN_ENGINE_H
#pragma once
#include <iostream>
#include <unordered_map>
#include "coloquinte/circuit.hxx"
@ -82,6 +80,8 @@ namespace Etesian {
inline Instance* getBlockInstance () const;
inline void setBlock ( Instance* );
inline void setFixedAbHeight ( DbU::Unit );
inline void setSpaceMargin ( double );
inline void setAspectRatio ( double );
void setDefaultAb ();
void adjustSliceHeight ();
void resetPlacement ();
@ -161,6 +161,8 @@ namespace Etesian {
inline Instance* EtesianEngine::getBlockInstance () const { return _block; }
inline void EtesianEngine::setBlock ( Instance* block ) { _block = block; _placed = _block->getMasterCell()->isPlaced(); }
inline void EtesianEngine::setFixedAbHeight ( DbU::Unit abHeight ) { _fixedAbHeight = abHeight; }
inline void EtesianEngine::setSpaceMargin ( double margin ) { getConfiguration()->setSpaceMargin(margin); }
inline void EtesianEngine::setAspectRatio ( double ratio ) { getConfiguration()->setAspectRatio(ratio); }
// Variables.
extern const char* missingEtesian;
@ -170,6 +172,3 @@ namespace Etesian {
INSPECTOR_P_SUPPORT(Etesian::EtesianEngine);
#endif // ETESIAN_ETESIAN_ENGINE_H

View File

@ -2,22 +2,20 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2014-2018, All Rights Reserved
// Copyright (c) SU/LIP6 2014-2020, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | E t e s i a n - A n a l y t i c P l a c e r |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./etesian/PyEtesianEngine.cpp" |
// +-----------------------------------------------------------------+
#ifndef PY_ETESIAN_ENGINE_H
#define PY_ETESIAN_ENGINE_H
#pragma once
#include "hurricane/isobar/PyHurricane.h"
#include "crlcore/PyToolEngine.h"
#include "etesian/EtesianEngine.h"
@ -55,5 +53,3 @@ extern "C" {
} // extern "C".
} // Etesian namespace.
#endif // PY_ETESIAN_ENGINE_H