Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
2016-01-20 17:41:19 -06:00
|
|
|
// Copyright (c) UPMC 2014-2016, All Rights Reserved
|
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | C O R I O L I S |
|
|
|
|
// | I s o b a r - Hurricane / Python Interface |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./PyPinPlacementStatus.h" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include "hurricane/isobar/PyPinPlacementStatus.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Isobar {
|
|
|
|
|
|
|
|
using std::cerr;
|
|
|
|
using std::endl;
|
|
|
|
using std::hex;
|
|
|
|
using std::ostringstream;
|
|
|
|
using Hurricane::tab;
|
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::Warning;
|
|
|
|
using Isobar::ProxyProperty;
|
|
|
|
using Isobar::ProxyError;
|
|
|
|
using Isobar::ConstructorError;
|
|
|
|
using Isobar::HurricaneError;
|
|
|
|
using Isobar::HurricaneWarning;
|
|
|
|
using Isobar::ParseOneArg;
|
|
|
|
using Isobar::ParseTwoArg;
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
|
|
|
|
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(PinPlacementStatus,netPlacementStatus,function)
|
|
|
|
|
|
|
|
|
|
|
|
// +=================================================================+
|
|
|
|
// | "PyPinPlacementStatus" Python Module Code Part |
|
|
|
|
// +=================================================================+
|
|
|
|
|
|
|
|
#if defined(__PYTHON_MODULE__)
|
|
|
|
|
|
|
|
|
|
|
|
// Standart Accessors (Attributes).
|
|
|
|
|
|
|
|
|
|
|
|
// Standart Destroy (Attribute).
|
|
|
|
// DBoDestroyAttribute(PyPinPlacementStatus_destroy,PyPinPlacementStatus)
|
|
|
|
|
|
|
|
|
|
|
|
PyMethodDef PyPinPlacementStatus_Methods[] =
|
|
|
|
{ {NULL, NULL, 0, NULL} /* sentinel */
|
|
|
|
};
|
|
|
|
//PyTypeObjectLinkPyType(Transformation::PinPlacementStatus)
|
|
|
|
|
|
|
|
|
|
|
|
PythonOnlyDeleteMethod(PinPlacementStatus)
|
|
|
|
DirectReprMethod(PyPinPlacementStatus_Repr, PyPinPlacementStatus, Pin::PlacementStatus)
|
|
|
|
DirectStrMethod (PyPinPlacementStatus_Str, PyPinPlacementStatus, Pin::PlacementStatus)
|
|
|
|
DirectCmpMethod (PyPinPlacementStatus_Cmp, IsPyPinPlacementStatus, PyPinPlacementStatus)
|
|
|
|
DirectHashMethod(PyPinPlacementStatus_Hash, PyPinPlacementStatus)
|
|
|
|
|
|
|
|
extern void PyPinPlacementStatus_LinkPyType() {
|
2016-05-17 16:00:06 -05:00
|
|
|
cdebug.log(20) << "PyPinPlacementStatus_LinkType()" << endl;
|
Make the Python interface closely mirroring the C++ one.
* Change: In Isobar, the Python interface was not exactly mirroring the
C++ one, now it is the case. The Python code should look likes almost
exactly like the C++ one, the only differences remaining being due
to the languages respective syntaxes. Note that in the case of
constructor functions, it leads to a slightly longer notation in
Python that it could have been (mimic the ".create()" static
member). Main modifications:
1. Mirror the static constructor syntax with create():
Cell( ... ) ==> Cell.create( ... )
2. Correct hierarchy for constants in Instance, Net, Pin
& Transformation. For example:
Hurricane.PlacementStatusFIXED
==> Hurricane.Instance.PlacementStatus.FIXED
Hurricane.OrientationID
==> Hurricane.Transformation.Orientation.ID
Hurricane.TypeLOGICAL ==> Hurricane.Net.Type.LOGICAL
Hurricane.DirectionIN ==> Hurricane.Net.Direction.IN
* Change: In CRL Core, correction to match the improved Python API
in the configutation helpers.
* Change: In Cumulus, correction to match the improved Python API.
* Change: In Stratus, correction to match the improved Python API.
* Change: In Documenation, update for the new Python interface
(both user's guide & examples).
* Note: We must port those changes into Chams for it to continue
to run.
* Change: In Documenation, update the Python script support part.
2014-06-28 10:37:59 -05:00
|
|
|
PyTypePinPlacementStatus.tp_dealloc = (destructor) PyPinPlacementStatus_DeAlloc;
|
|
|
|
PyTypePinPlacementStatus.tp_compare = (cmpfunc) PyPinPlacementStatus_Cmp;
|
|
|
|
PyTypePinPlacementStatus.tp_repr = (reprfunc) PyPinPlacementStatus_Repr;
|
|
|
|
PyTypePinPlacementStatus.tp_str = (reprfunc) PyPinPlacementStatus_Str;
|
|
|
|
PyTypePinPlacementStatus.tp_hash = (hashfunc) PyPinPlacementStatus_Hash;
|
|
|
|
PyTypePinPlacementStatus.tp_methods = PyPinPlacementStatus_Methods;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#else // End of Python Module Code Part.
|
|
|
|
|
|
|
|
|
|
|
|
// +=================================================================+
|
|
|
|
// | "PyPinPlacementStatus" Shared Library Code Part |
|
|
|
|
// +=================================================================+
|
|
|
|
|
|
|
|
// Link/Creation Method.
|
|
|
|
PyTypeObjectDefinitions(PinPlacementStatus)
|
|
|
|
|
|
|
|
|
|
|
|
extern void PyPinPlacementStatus_postModuleInit ()
|
|
|
|
{
|
|
|
|
PyObject* constant;
|
|
|
|
|
|
|
|
LoadObjectConstant(PyTypePinPlacementStatus.tp_dict,Pin::PlacementStatus::UNPLACED,"UNPLACED");
|
|
|
|
LoadObjectConstant(PyTypePinPlacementStatus.tp_dict,Pin::PlacementStatus::PLACED ,"PLACED");
|
|
|
|
LoadObjectConstant(PyTypePinPlacementStatus.tp_dict,Pin::PlacementStatus::FIXED ,"FIXED");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // Shared Library Code Part.
|
|
|
|
|
|
|
|
} // extern "C".
|
|
|
|
|
|
|
|
} // Isobar namespace.
|
|
|
|
|