coriolis/katana/src/PyGraphicKatanaEngine.cpp

123 lines
3.9 KiB
C++
Raw Normal View History

Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah! * Bug: In Hurricane, in StaticObservable::getObserver(), if the slot pointer is NULL, do not try to access the owner. Returns NULL, so the caller can be aware of the situation... * Change: In Hurricane, in BreakpointWidget & ExceptionWidget some cosmetic changes (fonts and window sizes). * Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account the constraints from the source AutoContact, as it holds the constraints transmitted by the RoutingPads and sets up by propageConstraintsFromRp(). It is likely to be a bug affecting the original Katabatic as well. * Change: In Anabatic, in RawGCellsUnder(), check that the segment is not completly oustside the cell abutment box and truncate the coordinates to the part that is inside. Use the "shrink" if we reach the east/north border. * Change: In Anabatic, in Configuration, no more decorator because we will use a true derived relationship. Katana *derives* from *Anabatic* and do not *decorate* it, so the Configuration can do the same. It also implies that we directly create a Katana engine, not an Anabatic one. * Change: In Anabatic, in Session, do not allow the opening of the Session in a standalone fashion (with a static method). Instead it must be opened using the relevant method of the Anabatic/Katana engine. This ensure we are opening the right Session type. * Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment is not part of the collection by default, but will be included if the Flags::WithSelf is set. * Change: In Configuration, all the flags value are now defined in two steps. Declared in the header and initialized in the module. This is to prevent the fact that on some cases, in relation with the Python "extern C" part modules, we need a true allocated variable. It was causing weird linking problems. A side effect is that they can no longer be used as entry is switches, have to replace them by if/else. * New: In Anabatic, new GCell::getNeighborAt() utility function. * Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with the grid type... Back annote all the edges capacity (north & east) with the reserved local capacity. * New: Complete portage of Kite over Anabatic. The new engine is christened "Katana" for Kite-Analogic. When it's capabilities and performances will be on a part with Kite, it is to completly replace it (and take back the "Kite" name). Preliminary tests seems to show that, contrary to intuition (because built on a more complex/slower grid), it is even slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2016, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | K i t e - D e t a i l e d R o u t e r |
// | |
// | Author : Jean-Paul Chaput |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./PyGraphicKatanaEngine.cpp" |
// +-----------------------------------------------------------------+
#include "katana/PyGraphicKatanaEngine.h"
#include "hurricane/isobar/PyCell.h"
#include "hurricane/Cell.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(GraphicKatanaEngine,gtool,function)
namespace Katana {
using namespace Hurricane;
using namespace Isobar;
extern "C" {
// +=================================================================+
// | "PyGraphicKatanaEngine" Python Module Code Part |
// +=================================================================+
#if defined(__PYTHON_MODULE__)
// +-------------------------------------------------------------+
// | "PyGraphicKatanaEngine" Attribute Methods |
// +-------------------------------------------------------------+
static PyObject* PyGraphicKatanaEngine_grab ( PyObject* )
{
cdebug_log(40,0) << "PyGraphicKatanaEngine_grab()" << endl;
PyGraphicKatanaEngine* pyGraphicKatanaEngine = NULL;
HTRY
pyGraphicKatanaEngine = PyObject_NEW ( PyGraphicKatanaEngine, &PyTypeGraphicKatanaEngine );
if ( pyGraphicKatanaEngine == NULL ) return NULL;
pyGraphicKatanaEngine->ACCESS_OBJECT = GraphicKatanaEngine::grab();
HCATCH
return (PyObject*)pyGraphicKatanaEngine;
}
static PyObject* PyGraphicKatanaEngine_getCell ( PyGraphicKatanaEngine* self )
{
cdebug_log(40,0) << "PyGraphicKatanaEngine_getCell ()" << endl;
Cell* cell = NULL;
HTRY
METHOD_HEAD("GraphicKatanaEngine.getCell()")
cell = gtool->getCell ();
HCATCH
if (cell == NULL) Py_RETURN_NONE;
return PyCell_Link(cell);
}
GetNameMethod(GraphicKatanaEngine, gtool)
// Standart destroy (Attribute).
PyMethodDef PyGraphicKatanaEngine_Methods[] =
{ { "grab" , (PyCFunction)PyGraphicKatanaEngine_grab , METH_NOARGS|METH_STATIC
, "Returns the GraphicKatanaEngine singleton." }
, { "getName" , (PyCFunction)PyGraphicKatanaEngine_getName , METH_NOARGS
, "Returns the name of the GraphicKatanaEngine (class attribute)." }
, { "getCell" , (PyCFunction)PyGraphicKatanaEngine_getCell , METH_NOARGS
, "Returns the Cell on which this GraphicKatanaEngine is attached." }
, {NULL, NULL, 0, NULL} /* sentinel */
};
// ---------------------------------------------------------------
// PyGraphicKatanaEngine Type Methods.
PythonOnlyDeleteMethod(GraphicKatanaEngine)
PyTypeObjectLinkPyType(GraphicKatanaEngine)
#else // End of Python Module Code Part.
// +=================================================================+
// | "PyGraphicKatanaEngine" Shared Library Code Part |
// +=================================================================+
// Link/Creation Method.
LinkCreateMethod(GraphicKatanaEngine)
PyTypeInheritedObjectDefinitions(GraphicKatanaEngine,GraphicTool)
#endif // End of Shared Library Code Part.
} // extern "C".
} // CRL namespace.