coriolis/anabatic/src/PyAnabatic.cpp

89 lines
2.8 KiB
C++
Raw Normal View History

// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2016-2016, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | A n a b a t i c - Global Routing Toolbox |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./PyAnabatic.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/isobar/PyHurricane.h"
#include "hurricane/isobar/PyCell.h"
#include "anabatic/Constants.h"
namespace Anabatic {
using std::cerr;
using std::endl;
using Hurricane::tab;
using Isobar::__cs;
#if !defined(__PYTHON_MODULE__)
// +=================================================================+
// | "PyAnabatic" Shared Library Code Part |
// +=================================================================+
# else // End of PyHurricane Shared Library Code Part.
// +=================================================================+
// | "PyAnabatic" Python Module Code Part |
// +=================================================================+
extern "C" {
// +-------------------------------------------------------------+
// | "PyAnabatic" Module Methods |
// +-------------------------------------------------------------+
static PyMethodDef PyAnabatic_Methods[] =
{ {NULL, NULL, 0, NULL} /* sentinel */
};
// ---------------------------------------------------------------
// Module Initialization : "initAnabatic ()"
DL_EXPORT(void) initAnabatic () {
Anabatic transient commit 8. More Dijkstra bugs correcteds. * Bug: In Anabatic: - In _propagate(), on reaching a target, forgot to remove it from the queue before pushing it back with the new distance. It also simplificate the core algorithm as target as treated normal nodes. * New: In Anabatic: - Update cdebug to use the fastest macro version. - More readable drawings of GCells and Edges. - Added timer support. - The distance is now computed in DbU::Unit (aka long) and not in normalized float. - The distance function is now a callback (std::function<>) that can be changed (a default is provided at initialization). - New concept of branch in the agglomerated connex component. Each trace back part create a "branch" (tagged with a "branchId"). When a node is reached with the same distance, but from two different branches, choose the the branch that was lastly created. This create a slightly different tree which grows outward from the newest branches. - Makes the horizontal edges *slightly* longer than the vertical ones to skew the tree to use vertical edges, as it is usually less congested than the horiontal one (due to metal1 cell terminals). It is also my understanding that it is useful to reduce the number of vias, whithout introducing a via cost. * New: In Bootstrap: - Script sprof.py to perform sprof & demangle libraries execution profile. * ToDo: In Anabatic: - Corner optimization. Sometimes when two corners are possible, the wrong one is choosen. That is, one of it's edge cannot be used for further grow of the tree.
2016-06-17 06:09:34 -05:00
cdebug_log(32,0) << "initAnabatic()" << endl;
PyObject* module = Py_InitModule( "Anabatic", PyAnabatic_Methods );
if (module == NULL) {
cerr << "[ERROR]\n"
<< " Failed to initialize Anabatic module." << endl;
return;
}
PyObject* dictionnary = PyModule_GetDict(module);
PyObject* constant;
LoadObjectConstant( dictionnary,EngineLoadGrByNet ,"EngineLoadGrByNet" );
LoadObjectConstant( dictionnary,EngineLoadGrByGCell ,"EngineLoadGrByGCell" );
LoadObjectConstant( dictionnary,EngineLayerAssignByLength,"EngineLayerAssignByLength" );
LoadObjectConstant( dictionnary,EngineLayerAssignByTrunk ,"EngineLayerAssignByTrunk" );
LoadObjectConstant( dictionnary,EngineNoNetLayerAssign ,"EngineNoNetLayerAssign" );
}
} // End of extern "C".
#endif // End of Python Module Code Part.
} // End of Anabatic namespace.