Various bug fixes for Analog P&R. OK for GM/Chamla & OTA/Miller.

* Change: In CRL::RoutingLayerGauge::getHorizontalGauge(), when selecting
    the default gauge, try, if possible to avoid the PinOnly one.
      Same goes for the vertical one.
* Bug: In Katana::TrackCost CTOR, symmetric track axis position was wrong,
    was using the reference instead of the symmetric.
* Bug: In BoraEngine::updatePlacement(), set up the Dijkstra search halo
    to one pitch so it can use immediately neighboring channels.
* New: In BoraEngine, added python startup hook like in Katana. Mainly
    to setup debug nets.
This commit is contained in:
Jean-Paul Chaput 2019-11-13 23:31:51 +01:00
parent 1e4b8b4647
commit f130417232
9 changed files with 89 additions and 16 deletions

View File

@ -31,5 +31,6 @@
find_package(Doxygen) find_package(Doxygen)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(python)
#add_subdirectory(cmake_modules) #add_subdirectory(cmake_modules)
#add_subdirectory(doc) #add_subdirectory(doc)

View File

@ -0,0 +1,2 @@
install ( FILES boraInit.py DESTINATION ${PYTHON_SITE_PACKAGES}/bora )

29
bora/python/boraInit.py Normal file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python
try:
import sys
import os.path
import helpers.io
from helpers.io import ErrorMessage
from helpers.io import WarningMessage
import Viewer
except Exception, e:
helpers.io.catch( e )
sys.exit( 1 )
def boraHook ( **kw ):
bora = None
if kw.has_key('bora'):
bora = kw['bora']
else:
print ErrorMessage( 3, 'boraHook(): Must be run from a BoraEngine.' )
return
try:
userInit = os.path.join( os.getcwd(), 'coriolis2/bora.py' )
if (os.path.exists(userInit)):
execfile( userInit )
except Exception, e:
helpers.io.catch( e )
return

View File

@ -14,6 +14,7 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#include <Python.h>
#include <sstream> #include <sstream>
#include <QAction> #include <QAction>
#include <QMenu> #include <QMenu>
@ -30,6 +31,7 @@
#include "hurricane/Library.h" #include "hurricane/Library.h"
#include "hurricane/viewer/HApplication.h" #include "hurricane/viewer/HApplication.h"
#include "hurricane/viewer/ExceptionWidget.h" #include "hurricane/viewer/ExceptionWidget.h"
#include "hurricane/viewer/Script.h"
#include "hurricane/UpdateSession.h" #include "hurricane/UpdateSession.h"
#include "hurricane/analog/AnalogCellExtension.h" #include "hurricane/analog/AnalogCellExtension.h"
#include "hurricane/analog/LayoutGenerator.h" #include "hurricane/analog/LayoutGenerator.h"
@ -42,12 +44,16 @@
#include "bora/SlicingDataWidget.h" #include "bora/SlicingDataWidget.h"
#include "bora/AnalogDistance.h" #include "bora/AnalogDistance.h"
#include "bora/BoraEngine.h" #include "bora/BoraEngine.h"
#include "bora/PyBoraEngine.h"
namespace Bora { namespace Bora {
using namespace std; using namespace std;
using Hurricane::dbo_ptr;
using Hurricane::Error; using Hurricane::Error;
using Hurricane::Warning;
using Hurricane::Breakpoint;
using Hurricane::DebugSession; using Hurricane::DebugSession;
using Hurricane::NetRoutingState; using Hurricane::NetRoutingState;
using Hurricane::NetRoutingExtension; using Hurricane::NetRoutingExtension;
@ -58,6 +64,7 @@ namespace Bora {
using Hurricane::UpdateSession; using Hurricane::UpdateSession;
using Analog::AnalogCellExtension; using Analog::AnalogCellExtension;
using Analog::Device; using Analog::Device;
using CRL::System;
using CRL::GdsDriver; using CRL::GdsDriver;
@ -87,6 +94,7 @@ namespace Bora {
void BoraEngine::_postCreate () void BoraEngine::_postCreate ()
{ {
Super::_postCreate(); Super::_postCreate();
_runBoraInit();
} }
@ -100,6 +108,27 @@ namespace Bora {
} }
void BoraEngine::_runBoraInit ()
{
Utilities::Path pythonSitePackages = System::getPath("pythonSitePackages");
Utilities::Path systemConfDir = pythonSitePackages / "bora";
Utilities::Path systemConfFile = systemConfDir / "boraInit.py";
if (systemConfFile.exists()) {
Isobar::Script::addPath( systemConfDir.toString() );
dbo_ptr<Isobar::Script> script = Isobar::Script::create( systemConfFile.stem().toString() );
script->addKwArgument( "bora" , (PyObject*)PyBoraEngine_Link(this) );
script->runFunction ( "boraHook", getCell() );
Isobar::Script::removePath( systemConfDir.toString() );
} else {
cerr << Warning( "Bora system configuration file:\n <%s> not found."
, systemConfFile.toString().c_str() ) << endl;
}
}
BoraEngine::~BoraEngine () BoraEngine::~BoraEngine ()
{ } { }
@ -220,7 +249,8 @@ namespace Bora {
Anabatic::Dijkstra* dijkstra = new Anabatic::Dijkstra( katana ); Anabatic::Dijkstra* dijkstra = new Anabatic::Dijkstra( katana );
AnalogDistance distance = AnalogDistance( cell, hpitch, vpitch ); AnalogDistance distance = AnalogDistance( cell, hpitch, vpitch );
dijkstra->setDistance( distance ); dijkstra->setDistance ( distance );
dijkstra->setSearchAreaHalo( std::max(hpitch,vpitch) );
for ( Net* net : cell->getNets() ) { for ( Net* net : cell->getNets() ) {
distance.setNet( net ); distance.setNet( net );

View File

@ -307,16 +307,16 @@ namespace Bora {
if (abHeight % h2pitch) { if (abHeight % h2pitch) {
cerr << Warning( "DBoxSet::create(): The height of device \"%s\" (%s) is not pitched on 2*%s (adjusted)." cerr << Warning( "DBoxSet::create(): The height of device \"%s\" (%s) is not pitched on 2*%s (adjusted)."
, getString(cell->getName()).c_str() , getString(cell->getName()).c_str()
, DbU::getValueString(abHeight).c_str() , DbU::getValueString(abHeight ).c_str()
, DbU::getValueString(h2pitch ).c_str() , DbU::getValueString(h2pitch/2).c_str()
) << endl; ) << endl;
abHeight += h2pitch - (abHeight % h2pitch); abHeight += h2pitch - (abHeight % h2pitch);
} }
if (abWidth % v2pitch) { if (abWidth % v2pitch) {
cerr << Warning( "DBoxSet::create(): The width of device \"%s\" (%s) is not pitched on 2*%s (adjusted)." cerr << Warning( "DBoxSet::create(): The width of device \"%s\" (%s) is not pitched on 2*%s (adjusted)."
, getString(cell->getName()).c_str() , getString(cell->getName()).c_str()
, DbU::getValueString(abWidth).c_str() , DbU::getValueString(abWidth ).c_str()
, DbU::getValueString(v2pitch).c_str() , DbU::getValueString(v2pitch/2).c_str()
) << endl; ) << endl;
abWidth += v2pitch - (abWidth % v2pitch); abWidth += v2pitch - (abWidth % v2pitch);
} }

View File

@ -67,6 +67,7 @@ namespace Bora {
virtual ~BoraEngine (); virtual ~BoraEngine ();
virtual void _postCreate (); virtual void _postCreate ();
virtual void _preDestroy (); virtual void _preDestroy ();
virtual void _runBoraInit ();
private: private:
static Hurricane::Name _toolName; static Hurricane::Name _toolName;

View File

@ -122,23 +122,31 @@ namespace CRL {
RoutingLayerGauge* RoutingGauge::getHorizontalGauge () const RoutingLayerGauge* RoutingGauge::getHorizontalGauge () const
{ {
RoutingLayerGauge* pinOnly = NULL;
for ( RoutingLayerGauge* gauge : _layerGauges ) { for ( RoutingLayerGauge* gauge : _layerGauges ) {
//if ( (gauge->getType() != Constant::LayerGaugeType::PinOnly) and gauge->isHorizontal() ) if (gauge->isHorizontal()) {
if (gauge->isHorizontal()) if (gauge->getType() != Constant::LayerGaugeType::PinOnly)
return gauge; return gauge;
else if (not pinOnly)
pinOnly = gauge;
}
} }
return NULL; return pinOnly;
} }
RoutingLayerGauge* RoutingGauge::getVerticalGauge () const RoutingLayerGauge* RoutingGauge::getVerticalGauge () const
{ {
RoutingLayerGauge* pinOnly = NULL;
for ( RoutingLayerGauge* gauge : _layerGauges ) { for ( RoutingLayerGauge* gauge : _layerGauges ) {
//if ( (gauge->getType() != Constant::LayerGaugeType::PinOnly) and gauge->isVertical() ) if (gauge->isVertical()) {
if (gauge->isVertical()) if (gauge->getType() != Constant::LayerGaugeType::PinOnly)
return gauge; return gauge;
else if (not pinOnly)
pinOnly = gauge;
}
} }
return NULL; return pinOnly;
} }

View File

@ -779,7 +779,7 @@ namespace Katana {
_event2->setEventLevel( 0 ); _event2->setEventLevel( 0 );
_event2->setProcessed( true ); _event2->setProcessed( true );
cdebug_log(9000,0) << "Deter| addInsertEvent() @" << getTrack1(i) << endl; cdebug_log(9000,0) << "Deter| addInsertEvent() @" << getTrack2(i) << endl;
Session::addInsertEvent( getSegment2(), getTrack2(i), getCandidateAxis2(i) ); Session::addInsertEvent( getSegment2(), getTrack2(i), getCandidateAxis2(i) );
} }

View File

@ -43,7 +43,7 @@ namespace Katana {
: _flags ((symSegment) ? Symmetric : NoFlags) : _flags ((symSegment) ? Symmetric : NoFlags)
, _span (refSegment->getTrackSpan()) , _span (refSegment->getTrackSpan())
, _refCandidateAxis(refCandidateAxis) , _refCandidateAxis(refCandidateAxis)
, _symCandidateAxis(refCandidateAxis) , _symCandidateAxis(symCandidateAxis)
, _tracks ( _span * ((symSegment) ? 2 : 1) , _tracks ( _span * ((symSegment) ? 2 : 1)
, std::tuple<Track*,size_t,size_t>(NULL,Track::npos,Track::npos) ) , std::tuple<Track*,size_t,size_t>(NULL,Track::npos,Track::npos) )
, _segment1 (refSegment) , _segment1 (refSegment)
@ -83,6 +83,8 @@ namespace Katana {
_segment1->addOverlapCost( *this ); _segment1->addOverlapCost( *this );
if (symTrack) { if (symTrack) {
cdebug_log(159,0) << " _tracks.size(): " << _tracks.size() << " _span:" << _span << endl;
std::get<0>( _tracks[_span] ) = symTrack; std::get<0>( _tracks[_span] ) = symTrack;
select( 0, Symmetric ); select( 0, Symmetric );
_segment2->addOverlapCost( *this ); _segment2->addOverlapCost( *this );