coriolis/bora/src/PyGraphicBoraEngine.cpp

117 lines
3.6 KiB
C++
Raw Normal View History

Analog integration part II. Analog place & route (slicing tree). * Change: In Hurricane::CellWidget, set the minimal size to 350 pixels to fit my normal DPI secondary screen... * Change: In Hurricane::Error(), reactivate the backtrace generation by default. Seriously slow down the program each time an Error is to be constructed. * Bug: In Analog::Device::preCreate(), check for NULL Technology before attempting to use it. * Change: In Hurricane/Analog, remove all '*Arguments*' classes and their Python interface. It was an obsoleted way of passing devices parameters to the Python layout generators (located in Oroshi). Now we just get them straight from the Device with the getParamter() method. * Change: In CRL::System CTOR, add Python pathes for Oroshi & Karakaze. * Change: In Oroshi/Python/WIP_*.py layout generator scripts, remove all uses of the "Arguments". Directly access the parameters through the device itself. Make the checkCoherency() with identical arguments as of layout(). * New: Bora tool that performs analog place & route. Based on a slicing tree representation. It is the thesis work of Eric Lao. Code beautyfication and some programming cleanup. * New: Karakaze tool, provide the Python base class AnalogDesign used to build an analog design. Create/configure devices and assemble them in a slicing tree. * Change: In Unicorn/cgt.py, display the stack trace in case of an ImportError exception as well as for other exceptions. Add Bora to the set for included tool engines.
2018-10-18 11:10:01 -05:00
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2016-2018, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | B o r a - A n a l o g S l i c i n g T r e e |
// | |
// | Author : Jean-Paul Chaput |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./bora/PyGraphicBoraEngine.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/isobar/PyCell.h"
#include "bora/PyGraphicBoraEngine.h"
#undef ACCESS_OBJECT
#undef ACCESS_CLASS
#define ACCESS_OBJECT _baseObject._object
#define ACCESS_CLASS(_pyObject) &(_pyObject->_baseObject)
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(GraphicBoraEngine,gtool,function)
namespace Bora {
using namespace Hurricane;
using namespace Isobar;
extern "C" {
// +=================================================================+
// | "PyGraphicBoraEngine" Python Module Code Part |
// +=================================================================+
#if defined(__PYTHON_MODULE__)
static PyObject* PyGraphicBoraEngine_grab ( PyObject* )
{
cdebug.log(61) << "PyGraphicBoraEngine_grab()" << endl;
PyGraphicBoraEngine* pyGraphicBoraEngine = NULL;
HTRY
pyGraphicBoraEngine = PyObject_NEW ( PyGraphicBoraEngine, &PyTypeGraphicBoraEngine );
if ( pyGraphicBoraEngine == NULL ) return NULL;
pyGraphicBoraEngine->ACCESS_OBJECT = GraphicBoraEngine::grab();
HCATCH
return (PyObject*)pyGraphicBoraEngine;
}
static PyObject* PyGraphicBoraEngine_getCell ( PyGraphicBoraEngine* self )
{
cdebug.log(61) << "PyGraphicBoraEngine_getCell ()" << endl;
Cell* cell = NULL;
HTRY
METHOD_HEAD("GraphicBoraEngine.getCell()")
cell = gtool->getCell ();
HCATCH
if (cell == NULL) Py_RETURN_NONE;
return PyCell_Link(cell);
}
GetNameMethod(GraphicBoraEngine, gtool)
// Standart destroy (Attribute).
PyMethodDef PyGraphicBoraEngine_Methods[] =
{ { "grab" , (PyCFunction)PyGraphicBoraEngine_grab , METH_NOARGS|METH_STATIC
, "Returns the GraphicBoraEngine singleton." }
, { "getName" , (PyCFunction)PyGraphicBoraEngine_getName , METH_NOARGS
, "Returns the name of the GraphicBoraEngine (class attribute)." }
, { "getCell" , (PyCFunction)PyGraphicBoraEngine_getCell , METH_NOARGS
, "Returns the Cell on which this GraphicBoraEngine is attached." }
, {NULL, NULL, 0, NULL} /* sentinel */
};
// ---------------------------------------------------------------
// PyGraphicBoraEngine Type Methods.
PythonOnlyDeleteMethod(GraphicBoraEngine)
PyTypeObjectLinkPyType(GraphicBoraEngine)
#else // End of Python Module Code Part.
// +=================================================================+
// | "PyGraphicBoraEngine" Shared Library Code Part |
// +=================================================================+
// Link/Creation Method.
LinkCreateMethod(GraphicBoraEngine)
PyTypeInheritedObjectDefinitions(GraphicBoraEngine,GraphicTool)
#endif // End of Shared Library Code Part.
} // extern "C".
} // Bora namespace.