coriolis/bora/src/PyRVSlicingNode.cpp

139 lines
4.3 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/PyRVSlicingNode.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/isobar/PyNet.h"
#include "hurricane/isobar/PyLayer.h"
#include "bora/PyRVSlicingNode.h"
namespace Bora {
using namespace Hurricane;
using namespace Isobar;
extern "C" {
#undef ACCESS_OBJECT
#undef ACCESS_CLASS
#define ACCESS_OBJECT _baseObject._object
#define ACCESS_CLASS(_pyObject) &(_pyObject->_baseObject)
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(RVSlicingNode,node,function)
// +=================================================================+
// | "PyRVSlicingNode" Python Module Code Part |
// +=================================================================+
#if defined(__PYTHON_MODULE__)
// +-------------------------------------------------------------+
// | "PyRVSlicingNode" Attribute Methods |
// +-------------------------------------------------------------+
static PyObject* PyRVSlicingNode_create ( PyObject* , PyObject* args )
{
PyObject* pyNet = NULL;
PyObject* pyLayer = NULL;
int npitch = 0;
const char* cname = "";
const char* iname = "";
RVSlicingNode* node = NULL;
HTRY
if (not PyArg_ParseTuple( args,"OOiss|O:RVSlicingNode.create"
, &pyNet
, &pyLayer
, &npitch
, &cname
, &iname) ) {
PyErr_SetString ( ConstructorError, "RVSlicingNode.create(): Invalid/bad number of parameters ." );
return NULL;
}
if (not IsPyNet(pyNet)) {
PyErr_SetString( ConstructorError, "RVSlicingNode.create(): First argument *must* be of type Net." );
return NULL;
}
Layer* layer = PYDERIVEDLAYER_O( pyLayer );
if (not layer) {
PyErr_SetString( ConstructorError, "RVSlicingNode.create(): Fifth argument *must* be of type Layer." );
return NULL;
}
Net* net = PYNET_O( pyNet );
node = RVSlicingNode::create( net, layer, npitch, cname, iname );
HCATCH
return PyRVSlicingNode_NEW(node);
}
// Standart Destroy (Attribute).
// ---------------------------------------------------------------
// PyRVSlicingNode Attribute Method table.
PyMethodDef PyRVSlicingNode_Methods[] =
{ { "create" , (PyCFunction)PyRVSlicingNode_create , METH_VARARGS|METH_STATIC
, "Create a new RVSlicingNode." }
, { NULL, NULL, 0, NULL } /* sentinel */
};
// +-------------------------------------------------------------+
// | "PyRVSlicingNode" Object Methods |
// +-------------------------------------------------------------+
PythonOnlyDeleteMethod(RVSlicingNode)
PyTypeObjectLinkPyType(RVSlicingNode)
#else // End of Python Module Code Part.
// +=================================================================+
// | "PyRVSlicingNode" Shared Library Code Part |
// +=================================================================+
extern PyObject* PyRVSlicingNode_NEW ( RVSlicingNode* node )
{
if (not node) Py_RETURN_NONE;
PyRVSlicingNode* pyNode = NULL;
HTRY
pyNode = PyObject_NEW( PyRVSlicingNode, &PyTypeRVSlicingNode );
if (not pyNode) return NULL;
pyNode->ACCESS_OBJECT = node;
HCATCH
return (PyObject*)pyNode;
}
PyTypeInheritedObjectDefinitions(RVSlicingNode, SlicingNode)
#endif // End of Shared Library Code Part.
} // extern "C".
} // Bora namespace.