diff --git a/katana/src/GraphicKatanaEngine.cpp b/katana/src/GraphicKatanaEngine.cpp index 5c9fc529..97dbec9c 100644 --- a/katana/src/GraphicKatanaEngine.cpp +++ b/katana/src/GraphicKatanaEngine.cpp @@ -69,6 +69,7 @@ namespace Katana { katana = KatanaEngine::create( cell ); katana->setPostEventCb( boost::bind(&GraphicKatanaEngine::postEvent,this) ); katana->setViewer( _viewer ); + katana->digitalInit(); if (cmess1.enabled()) katana->printConfiguration(); } else cerr << Warning( "%s already has a Katana engine.", getString(cell).c_str() ) << endl; diff --git a/katana/src/KatanaEngine.cpp b/katana/src/KatanaEngine.cpp index d047e37f..ab170196 100644 --- a/katana/src/KatanaEngine.cpp +++ b/katana/src/KatanaEngine.cpp @@ -143,7 +143,7 @@ namespace Katana { } - void KatanaEngine::_initDataBase () + void KatanaEngine::digitalInit () { cdebug_log(155,1) << "KatanaEngine::_initDataBase()" << endl; @@ -163,7 +163,6 @@ namespace Katana { KatanaEngine* katana = new KatanaEngine ( cell ); katana->_postCreate(); - katana->_initDataBase(); return katana; } diff --git a/katana/src/PyKatanaEngine.cpp b/katana/src/PyKatanaEngine.cpp index e1022747..93701877 100644 --- a/katana/src/PyKatanaEngine.cpp +++ b/katana/src/PyKatanaEngine.cpp @@ -147,6 +147,26 @@ extern "C" { } + PyObject* PyKatanaEngine_digitalInit ( PyKatanaEngine* self ) + { + cdebug_log(40,0) << "PyKatanaEngine_digitalInit()" << endl; + + HTRY + METHOD_HEAD("KatanaEngine.digitalInit()") + if (katana->getViewer()) { + if (ExceptionWidget::catchAllWrapper( std::bind(&KatanaEngine::digitalInit,katana) )) { + PyErr_SetString( HurricaneError, "KatanaEngine::digitalInit() has thrown an exception (C++)." ); + return NULL; + } + } else { + katana->digitalInit(); + } + HCATCH + + Py_RETURN_NONE; + } + + PyObject* PyKatanaEngine_runGlobalRouter ( PyKatanaEngine* self, PyObject* args ) { cdebug_log(40,0) << "PyKatanaEngine_runGlobalRouter()" << endl; @@ -285,6 +305,8 @@ extern "C" { , "Create a Katana engine on this cell." } , { "setViewer" , (PyCFunction)PyKatanaEngine_setViewer , METH_VARARGS , "Associate a Viewer to this KatanaEngine." } + , { "digitalInit" , (PyCFunction)PyKatanaEngine_digitalInit , METH_NOARGS + , "Setup Katana for digital routing." } , { "printConfiguration" , (PyCFunction)PyKatanaEngine_printConfiguration , METH_NOARGS , "Display on the console the configuration of Katana." } , { "getToolSuccess" , (PyCFunction)PyKatanaEngine_getToolSuccess , METH_NOARGS diff --git a/katana/src/katana/KatanaEngine.h b/katana/src/katana/KatanaEngine.h index 795f5504..595167f5 100644 --- a/katana/src/katana/KatanaEngine.h +++ b/katana/src/katana/KatanaEngine.h @@ -105,6 +105,7 @@ namespace Katana { void setupGlobalGraph ( unsigned int mode ); void annotateGlobalGraph (); void setFixedPreRouted (); + void digitalInit (); void runNegociate ( unsigned int flags=Flags::NoFlags ); void runGlobalRouter (); virtual void finalizeLayout (); @@ -134,7 +135,6 @@ namespace Katana { virtual ~KatanaEngine (); virtual void _postCreate (); virtual void _preDestroy (); - void _initDataBase (); private: KatanaEngine ( const KatanaEngine& ); KatanaEngine& operator= ( const KatanaEngine& );