Compare commits

..

1 Commits

Author SHA1 Message Date
Jean-Paul Chaput 3db5f27aec Adjust parameters of socInstaler.py to re-enable nightly builds on bop. 2019-05-28 15:37:10 +02:00
3587 changed files with 107702 additions and 516524 deletions

View File

@ -5,19 +5,20 @@
Coriolis README Coriolis README
=============== ===============
Coriolis is a free database, placement tool and routing tool for VLSI design.
Coriolis is a free database, placement tool and routing tool for VLSI designs.
Purpose Purpose
======= =======
Coriolis provides several tools to perform the layout of VLSI circuits. Its Coriolis provides several tools to perform the layout of VLSI circuits. Its
main components are the Hurricane database, the Etesian placer and the Katana main components are the Hurricane database, the Etesian placer and the Kite
router, but other tools can use the Hurricane database and the parsers router, but other tools can use the Hurricane database and the parsers
provided. provided.
The user interface <cgt> is the prefered way to use Coriolis, but all The user interface <cgt> is the prefered way to use Coriolis, but all
Coriolis tools are Python modules and thus scriptable. Coriolis tools are Python modules and thus scriptables.
Documentation Documentation
@ -25,14 +26,14 @@ Documentation
The complete documentation is available here, both in pdf & html: The complete documentation is available here, both in pdf & html:
./documentation/output/html ./documentation/_build/html/index.html
./documentation/UsersGuide/UsersGuide.pdf ./documentation/UsersGuide/UsersGuide.pdf
The documentation of the latest *stable* version is also The documentation of the latest *stable* version is also
available online. It may be quite outdated from the *devel* available online. It may be quite outdated from the *devel*
version. version.
https://www-soc.lip6.fr/sesi-docs/coriolis2-docs/coriolis2/en/latex/users-guide/UsersGuide.pdf https://soc-extras.lip6.fr/en/coriolis/coriolis2-users-guide/
Building Coriolis Building Coriolis
@ -84,8 +85,8 @@ The Coriolis main interface can be launched with the command: ::
ego@home:~: ~/coriolis-2.x/<OS>.<DISTRIB>/Release.Shared/install/bin/coriolis ego@home:~: ~/coriolis-2.x/<OS>.<DISTRIB>/Release.Shared/install/bin/coriolis
The ``coriolis`` script detects its location and setups the UNIX The ``coriolis`` script is tasked to guess it's location and setup appropriatly
environment appropriately, then lauches ``cgt`` (or *any* command, with the the UNIX environment, then lauch ``cgt`` (or *any* command, with the
``--run=<COMMAND>`` option). ``--run=<COMMAND>`` option).
Conversely, you can setup the current shell environement for Coriolis by Conversely, you can setup the current shell environement for Coriolis by

View File

@ -3,7 +3,7 @@
set(CMAKE_LEGACY_CYGWIN_WIN32 0) set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(ANABATIC) project(ANABATIC)
set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") set(ignoreVariables "${BUILD_DOC}")
option(BUILD_DOC "Build the documentation (doxygen)" OFF) option(BUILD_DOC "Build the documentation (doxygen)" OFF)
option(CHECK_DATABASE "Run database in full check mode (very slow)" OFF) option(CHECK_DATABASE "Run database in full check mode (very slow)" OFF)
@ -24,7 +24,6 @@
find_package(VLSISAPD REQUIRED) find_package(VLSISAPD REQUIRED)
find_package(HURRICANE REQUIRED) find_package(HURRICANE REQUIRED)
find_package(CORIOLIS REQUIRED) find_package(CORIOLIS REQUIRED)
find_package(ETESIAN REQUIRED)
find_package(Doxygen) find_package(Doxygen)
add_subdirectory(src) add_subdirectory(src)

View File

@ -26,7 +26,7 @@ IF(UNIX)
FIND_LIBRARY(ANABATIC_LIBRARY_PATH FIND_LIBRARY(ANABATIC_LIBRARY_PATH
NAMES anabatic NAMES anabatic
PATHS ${CORIOLIS_DIR_SEARCH} PATHS ${CORIOLIS_DIR_SEARCH}
PATH_SUFFIXES lib64 lib PATH_SUFFIXES lib${LIB_SUFFIX}
# Help the user find it if we cannot. # Help the user find it if we cannot.
DOC "The ${ANABATIC_INCLUDE_PATH_DESCRIPTION}" DOC "The ${ANABATIC_INCLUDE_PATH_DESCRIPTION}"
) )

View File

@ -20,18 +20,15 @@
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Breakpoint.h" #include "hurricane/Breakpoint.h"
#include "hurricane/DataBase.h"
#include "hurricane/RegularLayer.h" #include "hurricane/RegularLayer.h"
#include "hurricane/Horizontal.h" #include "hurricane/Horizontal.h"
#include "hurricane/RoutingPad.h" #include "hurricane/RoutingPad.h"
#include "hurricane/Vertical.h" #include "hurricane/Vertical.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "hurricane/NetExternalComponents.h"
#include "hurricane/DebugSession.h" #include "hurricane/DebugSession.h"
#include "hurricane/UpdateSession.h" #include "hurricane/UpdateSession.h"
#include "crlcore/RoutingGauge.h" #include "crlcore/RoutingGauge.h"
#include "crlcore/Measures.h" #include "crlcore/Measures.h"
#include "crlcore/Histogram.h"
#include "anabatic/GCell.h" #include "anabatic/GCell.h"
#include "anabatic/AutoContactTerminal.h" #include "anabatic/AutoContactTerminal.h"
#include "anabatic/NetBuilderM2.h" #include "anabatic/NetBuilderM2.h"
@ -122,33 +119,6 @@ namespace {
} }
class NonReducedItem {
public:
inline NonReducedItem ( AutoSegment* segment=NULL, uint32_t nonReduceds=0 );
inline AutoSegment* segment () const;
inline uint32_t nonReduceds () const;
private:
AutoSegment* _segment;
uint32_t _nonReduceds;
};
inline NonReducedItem::NonReducedItem ( AutoSegment* segment, uint32_t nonReduceds )
: _segment (segment)
, _nonReduceds(nonReduceds)
{ }
inline AutoSegment* NonReducedItem::segment () const { return _segment; }
inline uint32_t NonReducedItem::nonReduceds () const { return _nonReduceds; }
bool operator< ( const NonReducedItem& lhs, const NonReducedItem& rhs )
{
int32_t deltaReduceds = (int32_t)lhs.nonReduceds() - (int32_t)rhs.nonReduceds();
if (deltaReduceds > 0) return true; // Most connected first.
if (deltaReduceds < 0) return false;
return lhs.segment()->getId() < rhs.segment()->getId(); // Smallest Id first.
}
} // Anonymous namespace. } // Anonymous namespace.
@ -163,13 +133,11 @@ namespace Anabatic {
using Hurricane::Error; using Hurricane::Error;
using Hurricane::Warning; using Hurricane::Warning;
using Hurricane::Breakpoint; using Hurricane::Breakpoint;
using Hurricane::DataBase;
using Hurricane::RegularLayer; using Hurricane::RegularLayer;
using Hurricane::Component; using Hurricane::Component;
using Hurricane::Horizontal; using Hurricane::Horizontal;
using Hurricane::Vertical; using Hurricane::Vertical;
using Hurricane::NetRoutingExtension; using Hurricane::NetRoutingExtension;
using Hurricane::NetExternalComponents;
using Hurricane::Cell; using Hurricane::Cell;
using Hurricane::DebugSession; using Hurricane::DebugSession;
using Hurricane::UpdateSession; using Hurricane::UpdateSession;
@ -177,7 +145,6 @@ namespace Anabatic {
using CRL::RoutingLayerGauge; using CRL::RoutingLayerGauge;
using CRL::addMeasure; using CRL::addMeasure;
using CRL::getMeasure; using CRL::getMeasure;
using CRL::Histogram;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -201,67 +168,28 @@ namespace Anabatic {
RawGCellsUnder::RawGCellsUnder ( const AnabaticEngine* engine, Segment* segment ) RawGCellsUnder::RawGCellsUnder ( const AnabaticEngine* engine, Segment* segment )
{ {
cdebug_log(112,1) << "RawGCellsUnder::RawGCellsUnder(Segment*): " << segment << endl; cdebug_log(112,1) << "RawGCellsUnder::RawGCellsUnder(): " << segment << endl;
commonCtor( engine, segment->getSourcePosition(), segment->getTargetPosition() );
cdebug_tabw(112,-1);
}
RawGCellsUnder::RawGCellsUnder ( const AnabaticEngine* engine, Point source, Point target )
{
cdebug_log(112,1) << "RawGCellsUnder::RawGCellsUnder(Point,Point): s:"
<< source << " t:" << target << endl;
commonCtor( engine, source, target );
cdebug_tabw(112,-1);
}
void RawGCellsUnder::commonCtor ( const AnabaticEngine* engine, Point source, Point target )
{
cdebug_log(112,1) << "RawGCellsUnder::commontCtor(): s:" << source << " t:" << target << endl;
Box gcellsArea = engine->getCell()->getAbutmentBox(); Box gcellsArea = engine->getCell()->getAbutmentBox();
DbU::Unit axis = 0; Point sourcePosition = segment->getSourcePosition();
Flags side = Flags::NoFlags; Point targetPosition = segment->getTargetPosition();
if (source.getY() == target.getY()) { if ( (sourcePosition.getX() > gcellsArea.getXMax())
side = Flags::EastSide; or (sourcePosition.getY() > gcellsArea.getYMax())
axis = source.getY(); or (targetPosition.getX() <= gcellsArea.getXMin())
if (source.getX() > target.getX()) std::swap( source, target ); or (targetPosition.getY() <= gcellsArea.getYMin()) ) {
} cerr << Error( "RawGCellsUnder::RawGCellsUnder(): %s is completly outside the GCells area (ignored)."
if (source.getX() == target.getX()) { , getString(segment).c_str()
side = Flags::NorthSide;
axis = source.getX();
if (source.getY() > target.getY()) std::swap( source, target );
}
if (side == Flags::NoFlags) {
cerr << Error( "RawGCellsUnder::commonCtor(): Points are neither horizontally nor vertically aligneds (ignored)."
) << endl; ) << endl;
cdebug_tabw(112,-1); cdebug_tabw(112,-1);
DebugSession::close(); DebugSession::close();
return; return;
} }
if ( (source.getX() > gcellsArea.getXMax()) DbU::Unit xsource = std::max( sourcePosition.getX(), gcellsArea.getXMin() );
or (source.getY() > gcellsArea.getYMax()) DbU::Unit ysource = std::max( sourcePosition.getY(), gcellsArea.getYMin() );
or (target.getX() <= gcellsArea.getXMin()) DbU::Unit xtarget = std::min( targetPosition.getX(), gcellsArea.getXMax() );
or (target.getY() <= gcellsArea.getYMin()) ) { DbU::Unit ytarget = std::min( targetPosition.getY(), gcellsArea.getYMax() );
cerr << Error( "RawGCellsUnder::commonCtor(): Area is completly outside the GCells area (ignored)."
) << endl;
cdebug_tabw(112,-1);
DebugSession::close();
return;
}
DbU::Unit xsource = std::max( source.getX(), gcellsArea.getXMin() );
DbU::Unit ysource = std::max( source.getY(), gcellsArea.getYMin() );
DbU::Unit xtarget = std::min( target.getX(), gcellsArea.getXMax() );
DbU::Unit ytarget = std::min( target.getY(), gcellsArea.getYMax() );
if (xtarget == gcellsArea.getXMax()) --xtarget; if (xtarget == gcellsArea.getXMax()) --xtarget;
if (ytarget == gcellsArea.getYMax()) --ytarget; if (ytarget == gcellsArea.getYMax()) --ytarget;
@ -270,14 +198,16 @@ namespace Anabatic {
GCell* gtarget = engine->getGCellUnder( xtarget, ytarget ); GCell* gtarget = engine->getGCellUnder( xtarget, ytarget );
if (not gsource) { if (not gsource) {
cerr << Bug( "RawGCellsUnder::RawGCellsUnder(): Source not under a GCell (ignored)." cerr << Bug( "RawGCellsUnder::RawGCellsUnder(): %s source not under a GCell (ignored)."
, getString(segment).c_str()
) << endl; ) << endl;
cdebug_tabw(112,-1); cdebug_tabw(112,-1);
DebugSession::close(); DebugSession::close();
return; return;
} }
if (not gtarget) { if (not gtarget) {
cerr << Bug( "RawGCellsUnder::RawGCellsUnder(): Target not under a GCell (ignored)." cerr << Bug( "RawGCellsUnder::RawGCellsUnder(): %s target not under a GCell (ignored)."
, getString(segment).c_str()
) << endl; ) << endl;
cdebug_tabw(112,-1); cdebug_tabw(112,-1);
DebugSession::close(); DebugSession::close();
@ -291,6 +221,24 @@ namespace Anabatic {
return; return;
} }
Flags side = Flags::NoFlags;
DbU::Unit axis = 0;
Horizontal* horizontal = dynamic_cast<Horizontal*>( segment );
if (horizontal) {
side = Flags::EastSide;
axis = horizontal->getY();
if (horizontal->getSourceX() > horizontal->getTargetX())
std::swap( gsource, gtarget );
} else {
Vertical* vertical = dynamic_cast<Vertical*>( segment );
side = Flags::NorthSide;
axis = vertical->getX();
if (vertical->getSourceY() > vertical->getTargetY())
std::swap( gsource, gtarget );
}
cdebug_log(112,0) << "flags:" << side << " axis:" << DbU::getValueString(axis) << endl; cdebug_log(112,0) << "flags:" << side << " axis:" << DbU::getValueString(axis) << endl;
Edge* edge = gsource->getEdgeAt( side, axis ); Edge* edge = gsource->getEdgeAt( side, axis );
@ -311,27 +259,19 @@ namespace Anabatic {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Anabatic::NetData". // Class : "Anabatic::NetData".
NetData::NetData ( Net* net, AnabaticEngine* anabatic ) NetData::NetData ( Net* net )
: _net (net) : _net (net)
, _state (NetRoutingExtension::get(net)) , _state (NetRoutingExtension::get(net))
, _searchArea() , _searchArea()
, _rpCount (0) , _rpCount (0)
, _diodeCount(0)
, _sparsity (0) , _sparsity (0)
, _flags () , _flags ()
{ {
if (_state and _state->isMixedPreRoute()) return; if (_state and _state->isMixedPreRoute()) return;
Cell* diodeCell = anabatic->getDiodeCell();
for ( RoutingPad* rp : _net->getRoutingPads() ) { for ( RoutingPad* rp : _net->getRoutingPads() ) {
_searchArea.merge( rp->getBoundingBox() ); _searchArea.merge( rp->getBoundingBox() );
++_rpCount; ++_rpCount;
if (diodeCell) {
Plug* plug = dynamic_cast<Plug*>( rp->getPlugOccurrence().getEntity() );
if (plug and (plug->getInstance()->getMasterCell() == diodeCell))
++_diodeCount;
}
} }
_update(); _update();
} }
@ -373,15 +313,11 @@ namespace Anabatic {
, _autoContactLut () , _autoContactLut ()
, _edgeCapacitiesLut() , _edgeCapacitiesLut()
, _blockageNet (cell->getNet("blockagenet")) , _blockageNet (cell->getNet("blockagenet"))
, _diodeCell (NULL)
{ {
_matrix.setCell( cell, _configuration->getSliceHeight() ); _matrix.setCell( cell, _configuration->getSliceHeight() );
Edge::unity = _configuration->getSliceHeight(); Edge::unity = _configuration->getSliceHeight();
if (not _blockageNet) { if (not _blockageNet) _blockageNet = Net::create( cell, "blockagenet" );
_blockageNet = Net::create( cell, "blockagenet" );
_blockageNet->setType( Net::Type::BLOCKAGE );
}
} }
@ -389,17 +325,9 @@ namespace Anabatic {
{ {
Super::_postCreate(); Super::_postCreate();
_diodeCell = DataBase::getDB()->getCell( getConfiguration()->getDiodeName() );;
if (not _diodeCell) {
cerr << Warning( "AnabaticEngine::_postCreate() Unable to find \"%s\" diode cell."
, getConfiguration()->getDiodeName().c_str()
) << endl;
}
UpdateSession::open(); UpdateSession::open();
GCell::create( this ); GCell::create( this );
UpdateSession::close(); UpdateSession::close();
checkPlacement();
} }
@ -446,7 +374,6 @@ namespace Anabatic {
void AnabaticEngine::_gutAnabatic () void AnabaticEngine::_gutAnabatic ()
{ {
//DebugSession::open( 159, 160 );
openSession(); openSession();
_flags.reset( Flags::DestroyBaseContact|Flags::DestroyBaseSegment ); _flags.reset( Flags::DestroyBaseContact|Flags::DestroyBaseSegment );
@ -454,32 +381,12 @@ namespace Anabatic {
if (_state == EngineDriving) { if (_state == EngineDriving) {
cdebug_log(145,1) << "Saving AutoContacts/AutoSegments." << endl; cdebug_log(145,1) << "Saving AutoContacts/AutoSegments." << endl;
vector<NonReducedItem> reduceds;
size_t fixedSegments = 0; size_t fixedSegments = 0;
size_t sameLayerDoglegs = 0; size_t sameLayerDoglegs = 0;
size_t bloatedStraps = 0;
for ( auto isegment : _autoSegmentLut ) { for ( auto isegment : _autoSegmentLut ) {
if (isegment.second->isFixed()) ++fixedSegments; if (isegment.second->isFixed()) ++fixedSegments;
if (isegment.second->canReduce( Flags::NullLength )) {
//cerr << "push_back() " << (void*)isegment.second << ":" << isegment.second << endl;
reduceds.push_back( NonReducedItem( isegment.second
, isegment.second->getNonReduceds( Flags::NoFlags ) ));
} else {
if (isegment.second->reduceDoglegLayer()) ++sameLayerDoglegs; if (isegment.second->reduceDoglegLayer()) ++sameLayerDoglegs;
} }
//if (isegment.second->bloatStackedStrap()) ++bloatedStraps;
}
sort( reduceds.begin(), reduceds.end() );
// cerr << "Reduced segment queue:" << endl;
// for ( size_t i=0 ; i<reduceds.size() ; ++i ) {
// cerr << "| " << setw(3) << i
// << " " << reduceds[i].nonReduceds()
// << " " << reduceds[i].segment() << endl;
// }
for ( auto& item : reduceds ) {
item.segment()->reduce( Flags::NoFlags );
if (item.segment()->reduceDoglegLayer()) ++sameLayerDoglegs;
}
cmess1 << " o Driving Hurricane data-base." << endl; cmess1 << " o Driving Hurricane data-base." << endl;
cmess1 << Dots::asSizet(" - Active AutoSegments",AutoSegment::getAllocateds()-fixedSegments) << endl; cmess1 << Dots::asSizet(" - Active AutoSegments",AutoSegment::getAllocateds()-fixedSegments) << endl;
@ -487,7 +394,6 @@ namespace Anabatic {
cmess1 << Dots::asSizet(" - AutoSegments" ,AutoSegment::getAllocateds()) << endl; cmess1 << Dots::asSizet(" - AutoSegments" ,AutoSegment::getAllocateds()) << endl;
cmess1 << Dots::asSizet(" - AutoContacts" ,AutoContact::getAllocateds()) << endl; cmess1 << Dots::asSizet(" - AutoContacts" ,AutoContact::getAllocateds()) << endl;
cmess1 << Dots::asSizet(" - Same Layer doglegs" ,sameLayerDoglegs) << endl; cmess1 << Dots::asSizet(" - Same Layer doglegs" ,sameLayerDoglegs) << endl;
cmess1 << Dots::asSizet(" - Bloated straps (< minArea)",bloatedStraps ) << endl;
//for ( Net* net : _cell->getNets() ) _saveNet( net ); //for ( Net* net : _cell->getNets() ) _saveNet( net );
@ -510,22 +416,7 @@ namespace Anabatic {
_ovEdges.clear(); _ovEdges.clear();
} }
exportExternalNets();
Session::close(); Session::close();
//DebugSession::close();
}
void AnabaticEngine::exportExternalNets ()
{
for ( Net* net : getCell()->getNets() ) {
if (not net->isExternal()) continue;
if (net->isSupply()) continue;
for ( Segment* segment : net->getSegments() ) {
NetExternalComponents::setExternal( segment );
}
}
} }
@ -533,10 +424,6 @@ namespace Anabatic {
{ return _configuration; } { return _configuration; }
const Configuration* AnabaticEngine::getConfiguration () const
{ return _configuration; }
Interval AnabaticEngine::getUSide ( Flags direction ) const Interval AnabaticEngine::getUSide ( Flags direction ) const
{ {
Interval side; Interval side;
@ -584,105 +471,6 @@ namespace Anabatic {
} }
bool AnabaticEngine::checkPlacement () const
{
bool valid = true;
Box cellAb = getCell()->getAbutmentBox();
for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences() ) {
Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell();
string instanceName = occurrence.getCompactString();
instanceName.erase( 0, 1 );
instanceName.erase( instanceName.size()-1 );
Box instanceAb = masterCell->getAbutmentBox();
Transformation instanceTransf = instance->getTransformation();
occurrence.getPath().getTransformation().applyOn( instanceTransf );
instanceTransf.applyOn( instanceAb );
if (not cellAb.contains(instanceAb)) {
valid = false;
cerr << Error( "AnabaticEngine::checkPlacement(): Instance %s is outside top cell abutment box, routing will be incomplete.\n"
" (cell:%s vs instance:%s)"
, instanceName.c_str()
, getString(cellAb ).c_str()
, getString(instanceAb).c_str()
) << endl;
}
}
size_t errorCount = 0;
ostringstream errors;
errors << "AnabaticEngine::checkPlacement():\n";
for ( Net* net: getCell()->getNets() ) {
for ( RoutingPad* rp : net->getRoutingPads() ) {
Pin* pin = dynamic_cast<Pin*>( rp->getOccurrence().getEntity() );
if (not pin) continue;
ostringstream pinError;
Point pinCenter = rp->getCenter();
if ( (pin->getAccessDirection() == Pin::AccessDirection::NORTH)
or (pin->getAccessDirection() == Pin::AccessDirection::SOUTH) ) {
if (pin->getLayer() != getConfiguration()->getDVerticalLayer()) {
pinError << " Should be in vertical routing layer, "
<< "pin:" << pin->getLayer()->getName()
<< " vs gauge:" << getConfiguration()->getDVerticalLayer()->getName()
<< "\n";
valid = false;
++errorCount;
}
if ((pinCenter.getX() - getCell()->getAbutmentBox().getXMin()
- getConfiguration()->getDVerticalOffset())
% getConfiguration()->getDVerticalPitch()) {
pinError << " Misaligned, "
<< "pin:" << DbU::getValueString(pinCenter.getX())
<< " vs gauge, pitch:" << DbU::getValueString(getConfiguration()->getDVerticalPitch ())
<< ", offset:" << DbU::getValueString(getConfiguration()->getDVerticalOffset())
<< "\n";
valid = false;
++errorCount;
}
}
if ( (pin->getAccessDirection() == Pin::AccessDirection::EAST)
or (pin->getAccessDirection() == Pin::AccessDirection::WEST) ) {
if (pin->getLayer() != getConfiguration()->getDHorizontalLayer()) {
pinError << " Should be in horizontal routing layer, "
<< "pin:" << pin->getLayer()->getName()
<< " vs gauge:" << getConfiguration()->getDHorizontalLayer()->getName()
<< "\n";
valid = false;
++errorCount;
}
if ((pinCenter.getY() - getCell()->getAbutmentBox().getYMin()
- getConfiguration()->getDHorizontalOffset())
% getConfiguration()->getDHorizontalPitch()) {
pinError << " Misaligned, "
<< "pin:" << DbU::getValueString(pinCenter.getY())
<< " vs gauge, pitch:" << DbU::getValueString(getConfiguration()->getDHorizontalPitch ())
<< ", offset:" << DbU::getValueString(getConfiguration()->getDHorizontalOffset())
<< "\n";
valid = false;
++errorCount;
}
}
if (not pinError.str().empty()) {
errors << "On " << pin << "\n" << pinError.str();
}
}
}
if (errorCount) throw Error( errors.str() );
return valid;
}
void AnabaticEngine::openSession () void AnabaticEngine::openSession ()
{ Session::_open(this); } { Session::_open(this); }
@ -701,18 +489,10 @@ namespace Anabatic {
void AnabaticEngine::setupNetDatas () void AnabaticEngine::setupNetDatas ()
{ {
Histogram netHistogram ( 0.0, 1.0, 1 );
netHistogram.setTitle ( "RoutingPads", 0 );
netHistogram.setColor ( "green" , 0 );
netHistogram.setIndent( " " , 0 );
size_t oindex = _netOrdering.size(); size_t oindex = _netOrdering.size();
for ( Net* net : _cell->getNets() ) { for ( Net* net : _cell->getNets() ) {
if (_netDatas.find(net->getId()) != _netDatas.end()) continue; if (_netDatas.find(net->getId()) != _netDatas.end()) continue;
NetData* data = new NetData( net, this ); _netOrdering.push_back( new NetData(net) );
_netOrdering.push_back( data );
netHistogram.addSample( (float)(data->getRpCount() - data->getDiodeRpCount()), 0 );
} }
for ( ; oindex < _netOrdering.size() ; ++oindex ) { for ( ; oindex < _netOrdering.size() ; ++oindex ) {
@ -721,9 +501,6 @@ namespace Anabatic {
} }
sort( _netOrdering.begin(), _netOrdering.end(), SparsityOrder() ); sort( _netOrdering.begin(), _netOrdering.end(), SparsityOrder() );
cmess2 << " o Nets Histogram." << endl;
cmess2 << netHistogram.toString(0) << endl;
} }
@ -790,7 +567,7 @@ namespace Anabatic {
NetData* data = NULL; NetData* data = NULL;
NetDatas::iterator idata = _netDatas.find( net->getId() ); NetDatas::iterator idata = _netDatas.find( net->getId() );
if (idata == _netDatas.end()) { if (idata == _netDatas.end()) {
data = new NetData( net, this ); data = new NetData( net );
_netDatas.insert( make_pair(net->getId(),data) ); _netDatas.insert( make_pair(net->getId(),data) );
_netOrdering.push_back( data ); _netOrdering.push_back( data );
// cerr << Bug( "AnabaticEngine::getNetData() - %s is missing in NetDatas table." // cerr << Bug( "AnabaticEngine::getNetData() - %s is missing in NetDatas table."
@ -1074,17 +851,6 @@ namespace Anabatic {
UpdateSession::open(); UpdateSession::open();
for ( GCell* gcell : _gcells ) gcell->cleanupGlobal(); for ( GCell* gcell : _gcells ) gcell->cleanupGlobal();
UpdateSession::close(); UpdateSession::close();
for ( Net* net : getCell()->getNets() ) {
for ( Component* component : net->getComponents() ) {
if (getConfiguration()->isGLayer(component->getLayer())) {
cerr << Error( "AnabaticEngine::cleanupGlobal(): Remaining global routing,\n"
" %s"
, getString(component).c_str()
) << endl;
}
}
}
} }
@ -1096,8 +862,6 @@ namespace Anabatic {
if (_state > EngineGlobalLoaded) if (_state > EngineGlobalLoaded)
throw Error ("AnabaticEngine::loadGlobalRouting() : global routing already loaded."); throw Error ("AnabaticEngine::loadGlobalRouting() : global routing already loaded.");
antennaProtect();
if (method == EngineLoadGrByNet ) { _loadGrByNet(); } if (method == EngineLoadGrByNet ) { _loadGrByNet(); }
else { else {
throw Error( badMethod, "Anabatic::loadGlobalRouting()", method, getString(_cell).c_str() ); throw Error( badMethod, "Anabatic::loadGlobalRouting()", method, getString(_cell).c_str() );
@ -1114,7 +878,7 @@ namespace Anabatic {
{ {
openSession(); openSession();
//DbU::Unit pitch3 = Session::getPitch( 2 ); DbU::Unit pitch3 = Session::getPitch( 2 );
AutoSegment::IdSet constraineds; AutoSegment::IdSet constraineds;
AutoSegment::IdSet processeds; AutoSegment::IdSet processeds;
@ -1241,10 +1005,7 @@ namespace Anabatic {
//AutoSegment::setShortNetMode( true ); //AutoSegment::setShortNetMode( true );
++shortNets; ++shortNets;
} }
if (NetRoutingExtension::isManualDetailRoute(net)) if (NetRoutingExtension::isAutomaticGlobalRoute(net)) {
continue;
if ( NetRoutingExtension::isManualGlobalRoute(net)
or NetRoutingExtension::isAutomaticGlobalRoute(net)) {
DebugSession::open( net, 145, 150 ); DebugSession::open( net, 145, 150 );
AutoSegment::setAnalogMode( NetRoutingExtension::isAnalog(net) ); AutoSegment::setAnalogMode( NetRoutingExtension::isAnalog(net) );
@ -1278,8 +1039,8 @@ namespace Anabatic {
printMeasures( "load" ); printMeasures( "load" );
addMeasure<size_t>( "Globals", AutoSegment::getGlobalsCount() ); addMeasure<size_t>( getCell(), "Globals", AutoSegment::getGlobalsCount() );
addMeasure<size_t>( "Edges" , AutoSegment::getAllocateds() ); addMeasure<size_t>( getCell(), "Edges" , AutoSegment::getAllocateds() );
} }
@ -1415,7 +1176,7 @@ namespace Anabatic {
set<const Layer*> connectedLayers; set<const Layer*> connectedLayers;
forEach ( Segment*, segment, net->getSegments() ) { forEach ( Segment*, segment, net->getSegments() ) {
if (segment->getAnchoredLength()) { if (segment->getLength()) {
if (net->isExternal()) { if (net->isExternal()) {
NetExternalComponents::setExternal( *segment ); NetExternalComponents::setExternal( *segment );
} }
@ -1632,83 +1393,6 @@ namespace Anabatic {
} }
void AnabaticEngine::computeEdgeCapacities ( int maxHCap, int maxVCap, int termSatThreshold, int maxTermSat )
{
vector<RoutingPad*> rps;
vector<GCell*> saturateds;
const vector<NetData*>& netDatas = getNetOrdering();
for ( NetData* netData : netDatas ) {
for ( Component* component : netData->getNet()->getComponents() ) {
RoutingPad* rp = dynamic_cast<RoutingPad*>( component );
if (rp) rps.push_back( rp );
}
}
UpdateSession::open();
for ( auto rp : rps ) {
if (not getConfiguration()->selectRpComponent(rp))
cerr << Warning( "AnabaticEngine::computeEdgeCapacities(): %s has no components on grid.", getString(rp).c_str() ) << endl;
Point center = rp->getBoundingBox().getCenter();
GCell* gcell = getGCellUnder( center );
if (not gcell) {
cerr << Error( "AnabaticEngine::computeEdgeCapacities(): %s\n"
" @%s of %s is not under any GCell.\n"
" It will be ignored so the edge capacity estimate may be wrong."
, getString(rp).c_str()
, getString(center).c_str()
, getString(rp->getNet()).c_str()
) << endl;
continue;
}
gcell->incRpCount( 1 );
if (gcell->getRpCount() == termSatThreshold) saturateds.push_back( gcell );
}
for ( GCell* gcell : getGCells() ) {
if (not gcell->isMatrix()) continue;
for ( Edge* edge : gcell->getEdges(Flags::EastSide|Flags::NorthSide) ) {
GCell* opposite = edge->getOpposite( gcell );
int maxReserved = maxHCap;
int reserved = std::max( gcell->getRpCount(), opposite->getRpCount() );
if (edge->isVertical()) maxReserved = maxVCap;
edge->reserveCapacity( std::min( maxReserved, reserved ) );
}
}
for ( GCell* gcell : saturateds ) {
GCell* neighbor = gcell;
for ( size_t i=0 ; i<2; ++i ) {
Edge* edge = neighbor->getWestEdge();
if (not edge) break;
if (edge->getReservedCapacity() < (uint32_t)maxTermSat)
edge->reserveCapacity( maxTermSat - edge->getReservedCapacity() );
neighbor = neighbor->getWest();
}
neighbor = gcell;
for ( size_t i=0 ; i<2; ++i ) {
Edge* edge = neighbor->getEastEdge();
if (not edge) break;
if (edge->getReservedCapacity() < (uint32_t)maxTermSat)
edge->reserveCapacity( maxTermSat - edge->getReservedCapacity() );
neighbor = neighbor->getEast();
}
}
UpdateSession::close();
//Breakpoint::stop( 1, "Edge capacities computeds." );
}
void AnabaticEngine::_check ( Net* net ) const void AnabaticEngine::_check ( Net* net ) const
{ {
cdebug_log(149,1) << "Checking " << net << endl; cdebug_log(149,1) << "Checking " << net << endl;

File diff suppressed because it is too large Load Diff

View File

@ -178,7 +178,6 @@ namespace Anabatic {
AutoHorizontal* AutoContact::getHorizontal2 () const { return NULL; } AutoHorizontal* AutoContact::getHorizontal2 () const { return NULL; }
AutoVertical* AutoContact::getVertical1 () const { return NULL; } AutoVertical* AutoContact::getVertical1 () const { return NULL; }
AutoVertical* AutoContact::getVertical2 () const { return NULL; } AutoVertical* AutoContact::getVertical2 () const { return NULL; }
bool AutoContact::isOnPin () const { return false; }
void AutoContact::getDepthSpan ( size_t& minDepth, size_t& maxDepth ) const void AutoContact::getDepthSpan ( size_t& minDepth, size_t& maxDepth ) const
@ -199,20 +198,6 @@ namespace Anabatic {
} }
void AutoContact::updateLayer ()
{
size_t minDepth = (size_t)-1;
size_t maxDepth = 0;
getDepthSpan( minDepth, maxDepth );
setLayerAndWidth( maxDepth-minDepth, minDepth );
// if (minDepth == maxDepth)
// setLayer( Session::getRoutingGauge()->getRoutingLayer(minDepth) );
// else
// setLayer( Session::getRoutingGauge()->getContactLayer(minDepth) );
}
void AutoContact::getLengths ( DbU::Unit* lengths, AutoSegment::DepthLengthSet& processeds ) void AutoContact::getLengths ( DbU::Unit* lengths, AutoSegment::DepthLengthSet& processeds )
{ {
DbU::Unit hSideLength = getGCell()->getSide( Flags::Horizontal ).getSize(); DbU::Unit hSideLength = getGCell()->getSide( Flags::Horizontal ).getSize();
@ -227,17 +212,14 @@ namespace Anabatic {
size_t depth = Session::getRoutingGauge()->getLayerDepth(segment->getLayer()); size_t depth = Session::getRoutingGauge()->getLayerDepth(segment->getLayer());
DbU::Unit length; DbU::Unit length;
if (segment->isLocal()) { if (segment->isLocal()) {
length = segment->getAnchoredLength(); length = segment->getLength();
lengths[depth] += length; lengths[depth] += length;
DbU::Unit sideLength = (segment->isHorizontal()) ? hSideLength : vSideLength; DbU::Unit sideLength = (segment->isHorizontal()) ? hSideLength : vSideLength;
if ( not segment->isUnbound() and (abs(length) > sideLength) ) if ( not segment->isUnbound() and (abs(length) > sideLength) )
cerr << Error( "AutoContact::getLength(): Suspicious length %s (> %s) of %s.\n" cerr << Error("Suspicious length:%.2f of %s."
" (on: %s)"
,DbU::getValueString(length).c_str() ,DbU::getValueString(length).c_str()
, DbU::getValueString(sideLength).c_str() ,getString(segment).c_str()) << endl;
, getString(segment).c_str()
, getString(this).c_str()) << endl;
} else { } else {
if (segment->isHorizontal()) { if (segment->isHorizontal()) {
if (isSourceHook) if (isSourceHook)
@ -292,11 +274,11 @@ namespace Anabatic {
void AutoContact::invalidate ( Flags flags ) void AutoContact::invalidate ( Flags flags )
{ {
if (flags & Flags::Topology ) setFlags( CntInvalidatedCache );
if (not isInvalidated()) { if (not isInvalidated()) {
cdebug_log(145,1) << "AutoContact::invalidate() - " << this << endl; cdebug_log(145,1) << "AutoContact::invalidate() - " << this << endl;
cdebug_log(145,0) << "flags:" << flags.asString(FlagsFunction) << endl; cdebug_log(145,0) << "flags:" << flags.asString(FlagsFunction) << endl;
setFlags( CntInvalidated ); setFlags( CntInvalidated );
if (flags & Flags::Topology ) setFlags( CntInvalidatedCache );
Session::invalidate( this ); Session::invalidate( this );
_invalidate( flags ); _invalidate( flags );
@ -474,13 +456,12 @@ namespace Anabatic {
void AutoContact::setConstraintBox ( const Box& box ) void AutoContact::setConstraintBox ( const Box& box )
{ {
cdebug_log(149,0) << "setConstraintBox() " << this << " " << getConstraintBox()
<< " from:" << box << endl;
setCBXMin ( box.getXMin() ); setCBXMin ( box.getXMin() );
setCBXMax ( box.getXMax() ); setCBXMax ( box.getXMax() );
setCBYMin ( box.getYMin() ); setCBYMin ( box.getYMin() );
setCBYMax ( box.getYMax() ); setCBYMax ( box.getYMax() );
cdebug_log(149,0) << "setConstraintBox() " << this << " " << getConstraintBox() << endl; cdebug_log(149,0) << "setConstraintBox() - " << this << " " << getConstraintBox()
<< " from:" << box << endl;
cdebug_log(149,0) << "* " << _gcell << endl; cdebug_log(149,0) << "* " << _gcell << endl;
} }
@ -573,25 +554,15 @@ namespace Anabatic {
void AutoContact::setLayerAndWidth ( size_t delta, size_t depth ) void AutoContact::setLayerAndWidth ( size_t delta, size_t depth )
{ {
cdebug_log(145,1) << "AutoContact::setLayerAndWidth() " << this << endl;
cdebug_log(145,0) << "delta:" << delta << " depth:" << depth << endl;
if (delta == 0) { if (delta == 0) {
setLayer( Session::getRoutingLayer(depth) ); setLayer( Session::getRoutingLayer(depth) );
if (Session::getDirection(depth) & Flags::Horizontal) {
setSizes( Session::getPWireWidth(depth)
, Session::getWireWidth (depth) );
} else {
setSizes( Session::getWireWidth (depth) setSizes( Session::getWireWidth (depth)
, Session::getPWireWidth(depth) ); , Session::getWireWidth (depth) );
}
} else { } else {
setLayer( Session::getContactLayer(depth) ); setLayer( Session::getContactLayer(depth) );
setSizes( Session::getViaWidth (depth) setSizes( Session::getViaWidth (depth)
, Session::getViaWidth (depth) ); , Session::getViaWidth (depth) );
} }
cdebug_tabw(145,-1);
} }

View File

@ -29,7 +29,6 @@
#include "hurricane/RoutingPad.h" #include "hurricane/RoutingPad.h"
#include "hurricane/Vertical.h" #include "hurricane/Vertical.h"
#include "hurricane/Horizontal.h" #include "hurricane/Horizontal.h"
#include "hurricane/Pin.h"
#include "hurricane/DebugSession.h" #include "hurricane/DebugSession.h"
#include "crlcore/RoutingGauge.h" #include "crlcore/RoutingGauge.h"
#include "anabatic/AutoContactTerminal.h" #include "anabatic/AutoContactTerminal.h"
@ -48,7 +47,6 @@ namespace Anabatic {
using Hurricane::Transformation; using Hurricane::Transformation;
using Hurricane::Entity; using Hurricane::Entity;
using Hurricane::Occurrence; using Hurricane::Occurrence;
using Hurricane::Pin;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -131,13 +129,6 @@ namespace Anabatic {
} }
bool AutoContactTerminal::isOnPin () const
{
RoutingPad* rp = dynamic_cast<RoutingPad*>( getAnchor() );
return (dynamic_cast<Pin*>(rp->getOccurrence().getEntity()) != NULL);
}
AutoSegment* AutoContactTerminal::getOpposite ( const AutoSegment* ) const AutoSegment* AutoContactTerminal::getOpposite ( const AutoSegment* ) const
{ return NULL; } { return NULL; }
@ -203,7 +194,7 @@ namespace Anabatic {
// SxLib bug: METAL1 terminal segments are 0.5 lambdas too shorts on // SxLib bug: METAL1 terminal segments are 0.5 lambdas too shorts on
// their extremities. Should modificate all the standard cells layout... // their extremities. Should modificate all the standard cells layout...
// HARDCODED. // HARDCODED.
if (getString(Session::getRoutingGauge()->getName()).substr(0,6) == "msxlib") if (Session::getRoutingGauge()->getName() == "msxlib")
yborder -= DbU::fromLambda( 1.0 ); yborder -= DbU::fromLambda( 1.0 );
else else
yborder -= DbU::fromLambda( 0.5 ); yborder -= DbU::fromLambda( 0.5 );
@ -346,7 +337,7 @@ namespace Anabatic {
void AutoContactTerminal::cacheDetach ( AutoSegment* segment ) void AutoContactTerminal::cacheDetach ( AutoSegment* segment )
{ {
if (_segment == segment) { if (_segment == segment) {
//_segment->unsetFlags( AutoSegment::SegAxisSet ); _segment->unsetFlags( AutoSegment::SegAxisSet );
_segment = NULL; _segment = NULL;
setFlags( CntInvalidatedCache ); setFlags( CntInvalidatedCache );
unsetFlags( CntDrag ); unsetFlags( CntDrag );
@ -506,11 +497,8 @@ namespace Anabatic {
DbU::Unit y = perpandicular->getAxis(); DbU::Unit y = perpandicular->getAxis();
y = std::min( y, getCBYMax() ); y = std::min( y, getCBYMax() );
y = std::max( y, getCBYMin() ); y = std::max( y, getCBYMin() );
Point onGrid = Session::getNearestGridPoint( Point(getX(),y), getConstraintBox() ); setY( y );
setY( onGrid.getY() ); cdebug_log(145,0) << "Draging to Y @" << DbU::getValueString(y) << endl;
cdebug_log(145,0) << "Draging to Y @" << DbU::getValueString(y)
<< " pitched:" << DbU::getValueString(onGrid.getY())
<< " " << getConstraintBox() << endl;
} }
} }

View File

@ -88,17 +88,8 @@ namespace Anabatic {
AutoSegment* AutoContactTurn::getPerpandicular ( const AutoSegment* reference ) const AutoSegment* AutoContactTurn::getPerpandicular ( const AutoSegment* reference ) const
{ {
cdebug_log(149,0) << _getTypeName() << "::getPerpandicular() " << this
<< " to:" << reference << endl;
cdebug_log(149,0) << "| _horizontal1:" << _horizontal1 << endl;
cdebug_log(149,0) << "| _vertical1 :" << _vertical1 << endl;
if (reference == _horizontal1) return _vertical1; if (reference == _horizontal1) return _vertical1;
if (reference == _vertical1 ) return _horizontal1; if (reference == _vertical1 ) return _horizontal1;
cdebug_log(149,0) << _getTypeName() << "::getPerpandicular() " << this
<< " to:" << reference << " failed." << endl;
return NULL; return NULL;
} }
@ -126,9 +117,6 @@ namespace Anabatic {
void AutoContactTurn::cacheDetach ( AutoSegment* segment ) void AutoContactTurn::cacheDetach ( AutoSegment* segment )
{ {
cdebug_log(149,0) << _getTypeName() << "::cacheDetach() " << this
<< " from:" << segment << endl;
if (segment == _horizontal1) _horizontal1 = NULL; if (segment == _horizontal1) _horizontal1 = NULL;
else if (segment == _vertical1) _vertical1 = NULL; else if (segment == _vertical1) _vertical1 = NULL;
else return; else return;
@ -139,9 +127,6 @@ namespace Anabatic {
void AutoContactTurn::cacheAttach ( AutoSegment* segment ) void AutoContactTurn::cacheAttach ( AutoSegment* segment )
{ {
cdebug_log(149,0) << _getTypeName() << "::cacheAttach() " << this
<< " to:" << segment << endl;
if (segment->getDirection() == Flags::Horizontal) { if (segment->getDirection() == Flags::Horizontal) {
if (_horizontal1) { if (_horizontal1) {
cerr << Bug( "%s::cacheAttach() On %s,\n" cerr << Bug( "%s::cacheAttach() On %s,\n"
@ -254,7 +239,7 @@ namespace Anabatic {
RoutingGauge* rg = Session::getRoutingGauge(); RoutingGauge* rg = Session::getRoutingGauge();
size_t depthH1 = rg->getLayerDepth( getHorizontal1()->getLayer() ); size_t depthH1 = rg->getLayerDepth( getHorizontal1()->getLayer() );
size_t depthV1 = rg->getLayerDepth( getVertical1 ()->getLayer() ); size_t depthV1 = rg->getLayerDepth( getVertical1 ()->getLayer() );
size_t depthContact = (depthH1 <= depthV1) ? depthH1 : depthH1-1; size_t depthContact = (depthH1 < depthV1) ? depthH1 : depthH1-1;
size_t delta = abssub ( depthH1, depthV1 ); size_t delta = abssub ( depthH1, depthV1 );
unsetFlags( CntWeakTerminal ); unsetFlags( CntWeakTerminal );
@ -262,7 +247,7 @@ namespace Anabatic {
showTopologyError( "Sheared Turn, layer delta exceed 3." ); showTopologyError( "Sheared Turn, layer delta exceed 3." );
setFlags( CntBadTopology ); setFlags( CntBadTopology );
} else { } else {
if (delta > 1) { if (delta == 3) {
if (_horizontal1->isInvalidatedLayer()) { if (_horizontal1->isInvalidatedLayer()) {
//_horizontal1 = static_cast<AutoHorizontal*>( _horizontal1->makeDogleg(this) ); //_horizontal1 = static_cast<AutoHorizontal*>( _horizontal1->makeDogleg(this) );
_horizontal1->makeDogleg(this); _horizontal1->makeDogleg(this);
@ -274,7 +259,7 @@ namespace Anabatic {
} }
depthH1 = rg->getLayerDepth( _horizontal1->getLayer() ); depthH1 = rg->getLayerDepth( _horizontal1->getLayer() );
depthV1 = rg->getLayerDepth( _vertical1->getLayer() ); depthV1 = rg->getLayerDepth( _vertical1->getLayer() );
depthContact = (depthH1 <= depthV1) ? depthH1 : depthH1-1; depthContact = (depthH1 < depthV1) ? depthH1 : depthH1-1;
delta = abssub ( depthH1, depthV1 ); delta = abssub ( depthH1, depthV1 );
} }

View File

@ -47,8 +47,8 @@ namespace Anabatic {
Segment* AutoHorizontal::base () { return _horizontal; } Segment* AutoHorizontal::base () { return _horizontal; }
Segment* AutoHorizontal::base () const { return _horizontal; } Segment* AutoHorizontal::base () const { return _horizontal; }
Horizontal* AutoHorizontal::getHorizontal () { return _horizontal; } Horizontal* AutoHorizontal::getHorizontal () { return _horizontal; }
DbU::Unit AutoHorizontal::getSourceU () const { return _horizontal->getSource()->getX(); } DbU::Unit AutoHorizontal::getSourceU () const { return _horizontal->getSourceX(); }
DbU::Unit AutoHorizontal::getTargetU () const { return _horizontal->getTarget()->getX(); } DbU::Unit AutoHorizontal::getTargetU () const { return _horizontal->getTargetX(); }
DbU::Unit AutoHorizontal::getDuSource () const { return _horizontal->getDxSource(); } DbU::Unit AutoHorizontal::getDuSource () const { return _horizontal->getDxSource(); }
DbU::Unit AutoHorizontal::getDuTarget () const { return _horizontal->getDxTarget(); } DbU::Unit AutoHorizontal::getDuTarget () const { return _horizontal->getDxTarget(); }
Interval AutoHorizontal::getSpanU () const { return Interval(_horizontal->getSourceX(),_horizontal->getTargetX()); } Interval AutoHorizontal::getSpanU () const { return Interval(_horizontal->getSourceX(),_horizontal->getTargetX()); }
@ -93,14 +93,6 @@ namespace Anabatic {
mergeNativeMax( gcell->getConstraintYMax() ); mergeNativeMax( gcell->getConstraintYMax() );
} }
} }
// if (getId() == 1518590) {
// cerr << "AutoHorizontal::_postCreate(): " << this << endl;
// cerr << "| Source contact:" << source << endl;
// cerr << "| Source GCell: " << getGCell() << endl;
// cerr << "| Target contact:" << target << endl;
// cerr << "| Target GCell: " << target->getGCell() << endl;
// }
} }
@ -232,7 +224,6 @@ namespace Anabatic {
gcell = gcell->getEast( yprobe ); gcell = gcell->getEast( yprobe );
if (not gcell) { if (not gcell) {
success = false; success = false;
if (not isCreated()) {
cerr << Error( "AutoHorizontal::getGCells() : NULL GCell under %s\n" cerr << Error( "AutoHorizontal::getGCells() : NULL GCell under %s\n"
" begin:%s\n" " begin:%s\n"
" end: %s" " end: %s"
@ -240,7 +231,6 @@ namespace Anabatic {
, getString(getAutoSource()->getGCell()).c_str() , getString(getAutoSource()->getGCell()).c_str()
, getString(getAutoTarget()->getGCell()).c_str() , getString(getAutoTarget()->getGCell()).c_str()
) << endl; ) << endl;
}
break; break;
} }
@ -255,35 +245,24 @@ namespace Anabatic {
{ {
cdebug_tabw(149,1); cdebug_tabw(149,1);
AutoContact* source = getAutoSource(); Interval sourceSide = getAutoSource()->getGCell()->getSide( Flags::Vertical );
AutoContact* target = getAutoTarget(); Interval targetSide = getAutoTarget()->getGCell()->getSide( Flags::Vertical );
if (source->isOnPin() or target->isOnPin()) { cdebug_tabw(149,-1); return false; } Interval sourceConstraints = Interval(getAutoSource()->getCBYMin(),getAutoSource()->getCBYMax());
Interval targetConstraints = Interval(getAutoTarget()->getCBYMin(),getAutoTarget()->getCBYMax());
Interval sourceSide = source->getGCell()->getSide( Flags::Vertical );
Interval targetSide = target->getGCell()->getSide( Flags::Vertical );
Interval sourceConstraints = Interval(source->getCBYMin(),source->getCBYMax());
Interval targetConstraints = Interval(target->getCBYMin(),target->getCBYMax());
bool sourceGoStraight = source->getGCell()->isGoStraight();
bool targetGoStraight = target->getGCell()->isGoStraight();
// Expand by a tiny amount for the "contains" to work for sure. // Expand by a tiny amount for the "contains" to work for sure.
sourceConstraints.inflate( 1 ); sourceConstraints.inflate( 1 );
targetConstraints.inflate( 1 ); targetConstraints.inflate( 1 );
cdebug_log(149,0) << "source " << source << endl; cdebug_log(149,0) << "source " << getAutoSource() << endl;
cdebug_log(149,0) << "source constraints: " << sourceConstraints cdebug_log(149,0) << "source constraints: " << sourceConstraints
<< " " << DbU::getValueString(sourceConstraints.getSize()) << endl; << " " << DbU::getValueString(sourceConstraints.getSize()) << endl;
cdebug_log(149,0) << "target " << target << endl; cdebug_log(149,0) << "target " << getAutoTarget() << endl;
cdebug_log(149,0) << "target constraints: " << targetConstraints cdebug_log(149,0) << "target constraints: " << targetConstraints
<< " " << DbU::getValueString(targetConstraints.getSize()) << endl; << " " << DbU::getValueString(targetConstraints.getSize()) << endl;
if (not sourceGoStraight and not sourceConstraints.contains(sourceSide)) { cdebug_tabw(149,-1); return true; } if (not sourceConstraints.contains(sourceSide)) { cdebug_tabw(149,-1); return true; }
if (not targetGoStraight and not targetConstraints.contains(targetSide)) { cdebug_tabw(149,-1); return true; } if (not targetConstraints.contains(targetSide)) { cdebug_tabw(149,-1); return true; }
if (not isUnbreakable()) {
if (source->isTurn() and (source->getPerpandicular(this)->getLayer() == getLayer())) { cdebug_tabw(149,-1); return true; }
if (target->isTurn() and (target->getPerpandicular(this)->getLayer() == getLayer())) { cdebug_tabw(149,-1); return true; }
}
cdebug_tabw(149,-1); cdebug_tabw(149,-1);
return false; return false;
@ -302,49 +281,27 @@ namespace Anabatic {
bool success = false; bool success = false;
bool isMetal2Source = false; bool isMetal2Source = false;
bool isMetal2Target = false; bool isMetal2Target = false;
bool isNonPrefSource = false;
bool isNonPrefTarget = false;
DbU::Unit height = 0; DbU::Unit height = 0;
AutoContact* source = getAutoSource(); AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget(); AutoContact* target = getAutoTarget();
bool slackenSource = false;
bool slackenTarget = false;
if (source->isTerminal()) { if (source->isTerminal()) {
height = (static_cast<RoutingPad*>(source->getAnchor()))->getBoundingBox().getHeight(); height = (static_cast<RoutingPad*>(source->getAnchor()))->getBoundingBox().getHeight();
isMetal2Source = (source->getLayer() == metal2); isMetal2Source = (source->getLayer() == metal2);
slackenSource = true;
} }
if (target->isTerminal()) { if (target->isTerminal()) {
height = std::min( height, (static_cast<RoutingPad*>(target->getAnchor()))->getBoundingBox().getHeight() ); height = std::min( height, (static_cast<RoutingPad*>(target->getAnchor()))->getBoundingBox().getHeight() );
isMetal2Target = (target->getLayer() == metal2); isMetal2Target = (target->getLayer() == metal2);
slackenTarget = true;
}
if (source->isTurn() and (source->getPerpandicular(this)->getLayer() == getLayer())) {
isNonPrefSource = true;
slackenSource = true;
} }
cdebug_log(149,0) << "target:" << target << endl; if (height >= 4*getPitch()) {
cdebug_log(149,0) << "target->getPerpandicular(this):" << target->getPerpandicular(this) << endl; if (not (_flags & (SegGlobal|SegWeakGlobal)) and (getLength() < 5*getPitch()))
if (target->isTurn() and (target->getPerpandicular(this)->getLayer() == getLayer())) { return false;
isNonPrefTarget = true;
slackenTarget = true;
} }
cdebug_tabw(149,1); cdebug_tabw(149,1);
cdebug_log(149,0) << "_flags:" << (_flags & (SegGlobal|SegWeakGlobal)) << endl; cdebug_log(149,0) << "_flags:" << (_flags & (SegGlobal|SegWeakGlobal)) << endl;
cdebug_log(149,0) << "test:" << (getAnchoredLength() < 5*getPitch()) << endl; cdebug_log(149,0) << "test:" << (getLength() < 5*getPitch()) << endl;
cdebug_log(149,0) << "length:" << DbU::getValueString(getAnchoredLength()) << endl; cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
if (height >= 4*getPitch()) {
if (not (_flags & (SegGlobal|SegWeakGlobal)) and (getAnchoredLength() < 5*getPitch())) {
cdebug_log(149,0) << "Too short terminal segment to slacken." << endl;
cdebug_tabw(149,-1);
return false;
}
}
int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10; int lowSlack = (flags & Flags::HalfSlacken) ? 3 : 10;
bool sourceSlackened = false; bool sourceSlackened = false;
@ -353,7 +310,7 @@ namespace Anabatic {
DbU::Unit targetPosition = getTargetPosition(); DbU::Unit targetPosition = getTargetPosition();
AutoSegment* parallel = this; AutoSegment* parallel = this;
if (slackenSource) { if (source->isTerminal()) {
Interval perpandConstraints = getAutoTarget()->getUConstraints(Flags::Horizontal); Interval perpandConstraints = getAutoTarget()->getUConstraints(Flags::Horizontal);
Interval constraints = source->getUConstraints (Flags::Vertical|Flags::NoGCellShrink); Interval constraints = source->getUConstraints (Flags::Vertical|Flags::NoGCellShrink);
Interval nativeConstraints = source->getNativeUConstraints(Flags::Vertical|Flags::NoGCellShrink); Interval nativeConstraints = source->getNativeUConstraints(Flags::Vertical|Flags::NoGCellShrink);
@ -365,7 +322,7 @@ namespace Anabatic {
<< " native slack:" << nativeSlack << endl; << " native slack:" << nativeSlack << endl;
cdebug_log(149,0) << "Perpand constraints on target: " << perpandConstraints << endl; cdebug_log(149,0) << "Perpand constraints on target: " << perpandConstraints << endl;
// Ugly: GCell's track number is hardwired. // Ugly: GCell's track number is hardwired.
if (isNonPrefSource or (nativeSlack < lowSlack) or (nativeSlack - slack < 3)) { if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
cdebug_log(149,0) << "Slackening from Source: " << source << endl; cdebug_log(149,0) << "Slackening from Source: " << source << endl;
_makeDogleg( source->getGCell(), Flags::NoFlags ); _makeDogleg( source->getGCell(), Flags::NoFlags );
sourceSlackened = true; sourceSlackened = true;
@ -393,7 +350,7 @@ namespace Anabatic {
if (parallel) target = parallel->getAutoTarget(); if (parallel) target = parallel->getAutoTarget();
if (slackenTarget) { if (target->isTerminal()) {
Interval constraints = target->getUConstraints (Flags::Vertical|Flags::NoGCellShrink); Interval constraints = target->getUConstraints (Flags::Vertical|Flags::NoGCellShrink);
Interval nativeConstraints = target->getNativeUConstraints(Flags::Vertical|Flags::NoGCellShrink); Interval nativeConstraints = target->getNativeUConstraints(Flags::Vertical|Flags::NoGCellShrink);
int slack = constraints.getSize() / getPitch(); int slack = constraints.getSize() / getPitch();
@ -403,7 +360,7 @@ namespace Anabatic {
cdebug_log(149,0) << "Target constraint: " << constraints cdebug_log(149,0) << "Target constraint: " << constraints
<< " slack:" << slack << " slack:" << slack
<< " native slack:" << nativeSlack << endl; << " native slack:" << nativeSlack << endl;
if (isNonPrefTarget or (nativeSlack < lowSlack) or (nativeSlack - slack < 3)) { if ((nativeSlack < lowSlack) or (nativeSlack - slack < 3)) {
cdebug_log(149,0) << "Slackening from Target: " << target << endl; cdebug_log(149,0) << "Slackening from Target: " << target << endl;
parallel->_makeDogleg( target->getGCell(), Flags::NoFlags ); parallel->_makeDogleg( target->getGCell(), Flags::NoFlags );
targetSlackened = true; targetSlackened = true;
@ -413,15 +370,7 @@ namespace Anabatic {
const vector<AutoSegment*>& doglegs = Session::getDoglegs(); const vector<AutoSegment*>& doglegs = Session::getDoglegs();
if (targetSlackened and (doglegs.size() >= 2)) { if (targetSlackened and (doglegs.size() >= 2)) {
GCell* targetGCell = target->getGCell(); cdebug_log(149,0) << "AutoHorizontal::_slacken(): Target @" << DbU::getValueString(targetPosition) << endl;
Box constraintBox = target->getConstraintBox();
cdebug_log(149,0) << "slacken from Target @" << DbU::getValueString(targetPosition) << endl;
if (targetPosition >= targetGCell->getXMax()) {
cdebug_log(149,0) << "On the rigthmost track, adjust of one P-pitch to the left." << endl;
targetPosition -= getPPitch();
constraintBox.inflate( getPPitch(), 0, 0, 0 );
}
doglegs[doglegs.size()-2]->setAxis( targetPosition ); doglegs[doglegs.size()-2]->setAxis( targetPosition );
success = true; success = true;
@ -429,7 +378,7 @@ namespace Anabatic {
cdebug_log(149,0) << "Fixing on target terminal contact: " cdebug_log(149,0) << "Fixing on target terminal contact: "
<< doglegs[doglegs.size()-2]->getAutoTarget() << endl; << doglegs[doglegs.size()-2]->getAutoTarget() << endl;
//doglegs[doglegs.size()-2]->getAutoTarget()->setFlags( CntFixed ); //doglegs[doglegs.size()-2]->getAutoTarget()->setFlags( CntFixed );
doglegs[doglegs.size()-2]->getAutoTarget()->setConstraintBox( constraintBox ); doglegs[doglegs.size()-2]->getAutoTarget()->setConstraintBox( target->getConstraintBox() );
doglegs[doglegs.size()-2]->getAutoTarget()->setFlags( CntUserNativeConstraints ); doglegs[doglegs.size()-2]->getAutoTarget()->setFlags( CntUserNativeConstraints );
} }
} }
@ -486,18 +435,9 @@ namespace Anabatic {
void AutoHorizontal::updateOrient () void AutoHorizontal::updateOrient ()
{ {
if (_horizontal->getTarget()->getX() < _horizontal->getSource()->getX()) { if (_horizontal->getTargetX() < _horizontal->getSourceX()) {
cdebug_log(145,0) << "updateOrient() " << this << " (before S/T swap)" << endl; cdebug_log(145,0) << "updateOrient() " << this << " (before S/T swap)" << endl;
if (isAtMinArea()) {
DbU::Unit sourceX = _horizontal->getSourceX();
DbU::Unit targetX = _horizontal->getTargetX();
_horizontal->invert(); _horizontal->invert();
setDuSource( sourceX - getSourceU() );
setDuTarget( targetX - getTargetU() );
} else {
_horizontal->invert();
}
cdebug_log(145,0) << "updateOrient() " << this << " (after S/T swap)" << endl;
uint64_t spinFlags = _flags & SegDepthSpin; uint64_t spinFlags = _flags & SegDepthSpin;
unsetFlags( SegDepthSpin ); unsetFlags( SegDepthSpin );
@ -521,8 +461,8 @@ namespace Anabatic {
void AutoHorizontal::updatePositions () void AutoHorizontal::updatePositions ()
{ {
_sourcePosition = getSourceU() - getExtensionCap(Flags::Source); _sourcePosition = _horizontal->getSourceX() - getExtensionCap(Flags::Source);
_targetPosition = getTargetU() + getExtensionCap(Flags::Target); _targetPosition = _horizontal->getTargetX() + getExtensionCap(Flags::Target);
} }
@ -542,8 +482,8 @@ namespace Anabatic {
bool AutoHorizontal::checkPositions () const bool AutoHorizontal::checkPositions () const
{ {
bool coherency = true; bool coherency = true;
DbU::Unit sourcePosition = _horizontal->getSource()->getX() - getExtensionCap(Flags::Source); DbU::Unit sourcePosition = _horizontal->getSourceX() - getExtensionCap(Flags::Source);
DbU::Unit targetPosition = _horizontal->getTarget()->getX() + getExtensionCap(Flags::Target); DbU::Unit targetPosition = _horizontal->getTargetX() + getExtensionCap(Flags::Target);
if ( _sourcePosition != sourcePosition ) { if ( _sourcePosition != sourcePosition ) {
cerr << "extensionCap: " << DbU::getValueString(getExtensionCap(Flags::Source)) << endl; cerr << "extensionCap: " << DbU::getValueString(getExtensionCap(Flags::Source)) << endl;
@ -866,6 +806,7 @@ namespace Anabatic {
size_t doglegDepth = depth + ((upLayer)?1:-1); size_t doglegDepth = depth + ((upLayer)?1:-1);
Layer* contactLayer = Session::getRoutingGauge()->getContactLayer( depth + ((upLayer)?0:-1) ); Layer* contactLayer = Session::getRoutingGauge()->getContactLayer( depth + ((upLayer)?0:-1) );
const Layer* doglegLayer = Session::getRoutingGauge()->getRoutingLayer( doglegDepth );
Session::dogleg( this ); Session::dogleg( this );
targetDetach(); targetDetach();
@ -890,48 +831,27 @@ namespace Anabatic {
segment2->setFlags( (isSlackened()?SegSlackened:0) ); segment2->setFlags( (isSlackened()?SegSlackened:0) );
Session::dogleg( segment2 ); Session::dogleg( segment2 );
if (autoSource->isTerminal() and autoTarget->isTerminal()) { if (autoSource->isTerminal()) {
dlContact1->setFlags ( CntWeakTerminal ); segment1->setFlags( SegWeakTerminal1 );
dlContact2->setFlags ( CntWeakTerminal ); segment2->setFlags( SegWeakTerminal1 );
if (autoTarget->getGCell() == doglegGCell) dlContact1->migrateConstraintBox( autoTarget );
if (autoSource->getGCell() == doglegGCell) dlContact2->migrateConstraintBox( autoSource );
} else if (autoSource->isTerminal()) {
autoTarget->unsetFlags( CntWeakTerminal ); autoTarget->unsetFlags( CntWeakTerminal );
dlContact1->setFlags ( CntWeakTerminal ); dlContact1->setFlags ( CntWeakTerminal );
if (autoTarget->getGCell() == doglegGCell) dlContact1->migrateConstraintBox( autoTarget ); if (autoTarget->getGCell() == doglegGCell)
dlContact1->migrateConstraintBox( autoTarget );
} else if (autoTarget->isTerminal()) { } else if (autoTarget->isTerminal()) {
unsetFlags( SegTargetTerminal ); unsetFlags( SegTargetTerminal );
setFlags( SegWeakTerminal1 ); setFlags( SegWeakTerminal1 );
segment1->setFlags( SegWeakTerminal1 );
segment2->setFlags( SegTargetTerminal );
autoSource->unsetFlags( CntWeakTerminal ); autoSource->unsetFlags( CntWeakTerminal );
dlContact2->setFlags ( CntWeakTerminal ); dlContact2->setFlags ( CntWeakTerminal );
if (autoSource->getGCell() == doglegGCell) dlContact2->migrateConstraintBox( autoSource ); if (autoSource->getGCell() == doglegGCell)
dlContact2->migrateConstraintBox( autoSource );
} else if (isWeakTerminal()) { } else if (isWeakTerminal()) {
segment1->setFlags( SegWeakTerminal1 ); segment1->setFlags( SegWeakTerminal1 );
segment2->setFlags( SegWeakTerminal1 ); segment2->setFlags( SegWeakTerminal1 );
} }
// if (autoSource->isTerminal()) {
// segment1->setFlags( SegWeakTerminal1 );
// segment2->setFlags( SegWeakTerminal1 );
// autoTarget->unsetFlags( CntWeakTerminal );
// dlContact1->setFlags ( CntWeakTerminal );
// if (autoTarget->getGCell() == doglegGCell)
// dlContact1->migrateConstraintBox( autoTarget );
// } else if (autoTarget->isTerminal()) {
// unsetFlags( SegTargetTerminal );
// setFlags( SegWeakTerminal1 );
// segment1->setFlags( SegWeakTerminal1 );
// segment2->setFlags( SegTargetTerminal );
// autoSource->unsetFlags( CntWeakTerminal );
// dlContact2->setFlags ( CntWeakTerminal );
// if (autoSource->getGCell() == doglegGCell)
// dlContact2->migrateConstraintBox( autoSource );
// } else if (isWeakTerminal()) {
// segment1->setFlags( SegWeakTerminal1 );
// segment2->setFlags( SegWeakTerminal1 );
// }
if (isAnalog()) { if (isAnalog()) {
segment1->setFlags( SegAnalog ); segment1->setFlags( SegAnalog );
segment2->setFlags( SegAnalog ); segment2->setFlags( SegAnalog );
@ -951,15 +871,12 @@ namespace Anabatic {
updateNativeConstraints(); updateNativeConstraints();
segment2->updateNativeConstraints(); segment2->updateNativeConstraints();
if ( isLocal()) autoSource->setFlags( AutoContactFlag::CntVDogleg );
if (segment2->isLocal()) autoTarget->setFlags( AutoContactFlag::CntVDogleg );
if (autoTarget->canDrag() and not autoSource->canDrag()) { if (autoTarget->canDrag() and not autoSource->canDrag()) {
if (not autoTarget->getGCell()->isDevice() and (segment1->getGCell() == autoTarget->getGCell())) { if (not autoTarget->getGCell()->isDevice()) {
Interval dragConstraints = autoTarget->getNativeUConstraints(Flags::Horizontal); Interval dragConstraints = autoTarget->getNativeUConstraints(Flags::Horizontal);
segment1->mergeUserConstraints( dragConstraints ); segment1->mergeUserConstraints( dragConstraints );
cdebug_log(149,0) << "Perpandicular has drag constraints: " << dragConstraints << endl; cdebug_log(149,0) << "Perpandical has drag constraints: " << dragConstraints << endl;
} }
} }

View File

@ -14,7 +14,6 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#include <cmath>
#include "hurricane/DebugSession.h" #include "hurricane/DebugSession.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Bug.h" #include "hurricane/Bug.h"
@ -348,25 +347,23 @@ namespace Anabatic {
if ( deltaUnit < 0 ) return true; // Smallest source first. if ( deltaUnit < 0 ) return true; // Smallest source first.
if ( deltaUnit > 0 ) return false; if ( deltaUnit > 0 ) return false;
deltaUnit = lhs->getAnchoredLength() - rhs->getAnchoredLength(); deltaUnit = lhs->getLength() - rhs->getLength();
if ( deltaUnit > 0 ) return true; // Longest first. if ( deltaUnit > 0 ) return true; // Longest first.
if ( deltaUnit < 0 ) return false; if ( deltaUnit < 0 ) return true;
deltaUnit = lhs->getAxis() - rhs->getAxis(); deltaUnit = lhs->getAxis() - rhs->getAxis();
if ( deltaUnit < 0 ) return true; // Smallest axis first. if ( deltaUnit < 0 ) return true; // Smallest axis first.
if ( deltaUnit > 0 ) return false; if ( deltaUnit > 0 ) return false;
#if THIS_IS_DISABLED // if ( lhs->isCanonical () xor rhs->isCanonical () ) return lhs->isCanonical();
if ( lhs->isCanonical () xor rhs->isCanonical () ) return lhs->isCanonical(); // if ( lhs->isCollapsed () xor rhs->isCollapsed () ) return rhs->isCollapsed();
if ( lhs->isCollapsed () xor rhs->isCollapsed () ) return rhs->isCollapsed(); // if ( lhs->isSlackenStrap() xor rhs->isSlackenStrap() ) return lhs->isSlackenStrap();
if ( lhs->isSlackenStrap() xor rhs->isSlackenStrap() ) return lhs->isSlackenStrap();
if ( lhs->isGlobal () xor rhs->isGlobal () ) return lhs->isGlobal(); // if ( lhs->isGlobal () xor rhs->isGlobal () ) return lhs->isGlobal();
if ( lhs->isTerminal () xor rhs->isTerminal () ) return rhs->isTerminal(); // if ( lhs->isTerminal () xor rhs->isTerminal () ) return rhs->isTerminal();
if ( lhs->isHorizontal() xor rhs->isHorizontal() ) return lhs->isHorizontal(); // if ( lhs->isHorizontal() xor rhs->isHorizontal() ) return lhs->isHorizontal();
if ( lhs->isFixed() xor rhs->isFixed() ) return lhs->isFixed(); // if ( lhs->isFixed() xor rhs->isFixed() ) return lhs->isFixed();
#endif
return lhs->getId() < rhs->getId(); return lhs->getId() < rhs->getId();
} }
@ -409,32 +406,6 @@ namespace Anabatic {
} }
// -------------------------------------------------------------------
// Class : "Anabatic::AutoSegment::CompareByRevalidate".
bool AutoSegment::CompareByRevalidate::operator() ( AutoSegment* lhs, AutoSegment* rhs ) const
{
if (lhs->isNonPref() xor rhs->isNonPref() ) return lhs->isNonPref();
DbU::Unit deltaLength = lhs->getAnchoredLength() - rhs->getAnchoredLength();
if (deltaLength > 0) return true; // Longest length first.
if (deltaLength < 0) return false;
return lhs->getId() < rhs->getId(); // Smallest Id first.
}
bool AutoSegment::CompareByReduceds::operator() ( AutoSegment* lhs, AutoSegment* rhs ) const
{
uint32_t deltaReduceds = lhs->getReduceds() - rhs->getReduceds();
if (deltaReduceds < 0) return true; // Smallest source first.
if (deltaReduceds > 0) return false;
return lhs->getId() < rhs->getId(); // Smallest Id first.
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Anabatic::AutoSegment". // Class : "Anabatic::AutoSegment".
@ -444,7 +415,7 @@ namespace Anabatic {
bool AutoSegment::_analogMode = false; bool AutoSegment::_analogMode = false;
bool AutoSegment::_shortNetMode = false; bool AutoSegment::_shortNetMode = false;
bool AutoSegment::_initialized = false; bool AutoSegment::_initialized = false;
vector< array<DbU::Unit*,4> > AutoSegment::_extensionCaps; vector< array<DbU::Unit*,3> > AutoSegment::_extensionCaps;
void AutoSegment::setAnalogMode ( bool state ) { _analogMode = state; } void AutoSegment::setAnalogMode ( bool state ) { _analogMode = state; }
@ -457,19 +428,17 @@ namespace Anabatic {
//cerr << "AutoSegment::_initialize()" << endl; //cerr << "AutoSegment::_initialize()" << endl;
_initialized = true; _initialized = true;
DbU::Unit twoGrid = DbU::fromGrid( 2 );
for ( size_t depth=0 ; depth<Session::getDepth() ; ++depth ) { for ( size_t depth=0 ; depth<Session::getDepth() ; ++depth ) {
DbU::Unit* viaToTopCap = new DbU::Unit ( 0 ); DbU::Unit* viaToTopCap = new DbU::Unit ( 0 );
DbU::Unit* viaToBottomCap = new DbU::Unit ( 0 ); DbU::Unit* viaToBottomCap = new DbU::Unit ( 0 );
DbU::Unit* viaToSameCap = new DbU::Unit ( 0 ); DbU::Unit* viaToSameCap = new DbU::Unit ( 0 );
DbU::Unit* minimalLength = new DbU::Unit ( 0 );
bool isVertical = (depth == 0) or (Session::getLayerGauge(depth)->isVertical()); bool isVertical = (depth == 0) or (Session::getLayerGauge(depth)->isVertical());
uint32_t flags = (isVertical) ? Layer::EnclosureV : Layer::EnclosureH ; uint32_t flags = (isVertical) ? Layer::EnclosureV : Layer::EnclosureH ;
//cerr << depth << ":" << Session::getLayerGauge(depth)->getLayer()->getName() //cerr << depth << ":" << Session::getLayerGauge(depth)->getLayer()->getName()
// << " isVertical:" << Session::getLayerGauge(depth)->isVertical() << endl; // << " isVertical:" << Session::getLayerGauge(depth)->isVertical() << endl;
*viaToSameCap = Session::getPWireWidth(depth)/2; *viaToSameCap = Session::getWireWidth(depth)/2;
// Bottom metal of the VIA going *up*. // Bottom metal of the VIA going *up*.
const Layer* viaLayer = dynamic_cast<const ViaLayer*>( Session::getContactLayer(depth) ); const Layer* viaLayer = dynamic_cast<const ViaLayer*>( Session::getContactLayer(depth) );
@ -483,15 +452,6 @@ namespace Anabatic {
*viaToBottomCap = Session::getViaWidth(depth-1)/2 + viaLayer->getTopEnclosure( flags ); *viaToBottomCap = Session::getViaWidth(depth-1)/2 + viaLayer->getTopEnclosure( flags );
} }
const Layer* routingLayer = Session::getRoutingLayer( depth );
double minimalArea = routingLayer->getMinimalArea();
if (minimalArea != 0.0) {
*minimalLength = DbU::fromMicrons( minimalArea / DbU::toMicrons( Session::getWireWidth(depth) ) );
DbU::Unit modulo = *minimalLength % twoGrid;
if (modulo)
*minimalLength += twoGrid - modulo;
}
//cerr << " viaToTop width: " << DbU::getValueString( Session::getViaWidth(depth) ) << endl; //cerr << " viaToTop width: " << DbU::getValueString( Session::getViaWidth(depth) ) << endl;
//cerr << " viaToTopCap: " << DbU::getValueString(*viaToTopCap ) << endl; //cerr << " viaToTopCap: " << DbU::getValueString(*viaToTopCap ) << endl;
//if (depth > 0) //if (depth > 0)
@ -499,10 +459,7 @@ namespace Anabatic {
//cerr << " viaToBottomCap: " << DbU::getValueString(*viaToBottomCap) << endl; //cerr << " viaToBottomCap: " << DbU::getValueString(*viaToBottomCap) << endl;
//cerr << " viaToSameCap: " << DbU::getValueString(*viaToSameCap ) << endl; //cerr << " viaToSameCap: " << DbU::getValueString(*viaToSameCap ) << endl;
_extensionCaps.push_back( std::array<DbU::Unit*,4>( {{ viaToTopCap _extensionCaps.push_back( std::array<DbU::Unit*,3>( { viaToTopCap, viaToBottomCap, viaToSameCap } ) );
, viaToBottomCap
, viaToSameCap
, minimalLength }} ) );
} }
} }
@ -515,7 +472,6 @@ namespace Anabatic {
, _optimalMin (0) , _optimalMin (0)
, _optimalMax (0) , _optimalMax (0)
, _reduceds (0) , _reduceds (0)
, _rpDistance (15)
, _sourcePosition (0) , _sourcePosition (0)
, _targetPosition (0) , _targetPosition (0)
, _userConstraints (false) , _userConstraints (false)
@ -575,11 +531,6 @@ namespace Anabatic {
_observers.notify( Destroy ); _observers.notify( Destroy );
AutoContact* contact = getAutoSource();
if (contact) contact->cacheDetach( this );
contact = getAutoTarget();
if (contact) contact->cacheDetach( this );
Session::unlink( this ); Session::unlink( this );
cdebug_tabw(145,-1); cdebug_tabw(145,-1);
} }
@ -714,10 +665,6 @@ namespace Anabatic {
incReduceds(); incReduceds();
} }
Interval oldSpan = Interval( _sourcePosition, _targetPosition );
if (not expandToMinLength(oldSpan)) {
unexpandToMinLength();
}
updatePositions(); updatePositions();
unsigned int observerFlags = Revalidate; unsigned int observerFlags = Revalidate;
@ -740,11 +687,11 @@ namespace Anabatic {
bool AutoSegment::isStrongTerminal ( Flags flags ) const bool AutoSegment::isStrongTerminal ( Flags flags ) const
{ {
if (isTerminal()) return true; if (_flags & SegStrongTerminal) return true;
if ((flags & Flags::Propagate) and not isNotAligned()) { if ((flags & Flags::Propagate) and not isNotAligned()) {
for ( AutoSegment* segment : const_cast<AutoSegment*>(this)->getAligneds() ) { for ( AutoSegment* segment : const_cast<AutoSegment*>(this)->getAligneds() ) {
if (segment->isTerminal()) return true; if (segment->_flags & SegStrongTerminal) return true;
} }
} }
return false; return false;
@ -770,53 +717,20 @@ namespace Anabatic {
if (getFlags() & SegSourceTop ) cap = getViaToTopCap (depth); if (getFlags() & SegSourceTop ) cap = getViaToTopCap (depth);
else if (getFlags() & SegSourceBottom) cap = getViaToBottomCap(depth); else if (getFlags() & SegSourceBottom) cap = getViaToBottomCap(depth);
else cap = getViaToSameCap (depth); else cap = getViaToSameCap (depth);
cdebug_log(150,0) << "getExtensionCap(): (source) flags:" << getFlags() cdebug_log(159,0) << "getExtensionCap(): flags:" << getFlags()
<< " VIA cap:" << DbU::getValueString(cap) << " VIA cap:" << DbU::getValueString(cap)
<< " t:" << (getFlags() & SegSourceBottom) << " " << (getFlags() & SegSourceBottom)
<< " b:" << (getFlags() & SegSourceTop)
<< endl; << endl;
if (not (flags & Flags::NoSegExt)) {
cdebug_log(150,0) << "duSource=" << DbU::getValueString(getDuSource()) << endl;
if (-getDuSource() > cap) {
cap = -getDuSource();
cdebug_log(150,0) << "-> Custom cap (-duSource):" << DbU::getValueString(cap) << endl;
}
}
} }
if (flags & Flags::Target) { if (flags & Flags::Target) {
if (getFlags() & SegTargetTop ) cap = getViaToTopCap (depth); if (getFlags() & SegTargetTop ) cap = getViaToTopCap (depth);
else if (getFlags() & SegTargetBottom) cap = getViaToBottomCap(depth); else if (getFlags() & SegTargetBottom) cap = getViaToBottomCap(depth);
else cap = getViaToSameCap (depth); else cap = getViaToSameCap (depth);
cdebug_log(150,0) << "getExtensionCap(): (target) flags:" << getFlags()
<< " VIA cap:" << DbU::getValueString(cap)
<< " t:" << (getFlags() & SegSourceBottom)
<< " b:" << (getFlags() & SegSourceTop)
<< endl;
if (not (flags & Flags::NoSegExt)) {
cdebug_log(150,0) << "duTarget=" << DbU::getValueString(getDuTarget()) << endl;
if (getDuTarget() > cap) {
cap = getDuTarget();
cdebug_log(150,0) << "-> Custom cap (+duTarget):" << DbU::getValueString(cap) << endl;
}
}
} }
// if ( not isCreated() if (cap < getWidth()/2) cap = getWidth()/2;
// and not (flags & Flags::NoMinLength) return cap + getLayer()->getMinimalSpacing()/2;;
// and (flags & Flags::Target)
// and (getMinimalLength(depth) != 0.0)
// and isMiddleStack() ) {
// DbU::Unit realLength = getExtensionCap( Flags::Source|Flags::LayerCapOnly|Flags::NoMinLength )
// + getAnchoredLength();
// if (realLength + cap < getMinimalLength(depth)) {
// cap = getMinimalLength(depth) - realLength;
// }
// }
if (getLayer()->isSymbolic() and (cap < getWidth()/2)) cap = getWidth()/2;
if (not (flags & Flags::LayerCapOnly)) cap += getLayer()->getMinimalSpacing()/2;
return cap;
} }
@ -861,14 +775,14 @@ namespace Anabatic {
DbU::Unit collapsedMax; DbU::Unit collapsedMax;
if (not isNotAligned()) { if (not isNotAligned()) {
for ( AutoSegment* segment : getAligneds() ) { forEach( AutoSegment*, isegment, getAligneds() ) {
if (segment->isCanonical()) { if (isegment->isCanonical()) {
canonical = segment; canonical = *isegment;
canonicals++; canonicals++;
} }
collapsedMin = segment->getSourcePosition(); collapsedMin = isegment->getSourcePosition();
collapsedMax = segment->getTargetPosition(); collapsedMax = isegment->getTargetPosition();
if (collapsedMax < collapsedMin) swap( collapsedMin, collapsedMax ); if (collapsedMax < collapsedMin) swap( collapsedMin, collapsedMax );
if (collapsedMin < min) min = collapsedMin; if (collapsedMin < min) min = collapsedMin;
if (collapsedMax > max) max = collapsedMax; if (collapsedMax > max) max = collapsedMax;
@ -885,8 +799,8 @@ namespace Anabatic {
int count = 0; int count = 0;
cerr << " " << count++ << ": " << this << endl; cerr << " " << count++ << ": " << this << endl;
for ( AutoSegment* segment : getAligneds() ) forEach( AutoSegment*, isegment, getAligneds() )
cerr << " " << count++ << ": " << segment << endl; cerr << " " << count++ << ": " << *isegment << endl;
} }
} }
@ -1122,10 +1036,6 @@ namespace Anabatic {
cdebug_log(149,1) << "toOptimalAxis() " << this << endl; cdebug_log(149,1) << "toOptimalAxis() " << this << endl;
if (not isCanonical()) { cdebug_tabw(149,-1); return false; } if (not isCanonical()) { cdebug_tabw(149,-1); return false; }
if (not isUnsetAxis()) {
cdebug_tabw(149,-1);
return toConstraintAxis( flags );
}
DbU::Unit constraintMin; DbU::Unit constraintMin;
DbU::Unit constraintMax; DbU::Unit constraintMax;
@ -1161,7 +1071,7 @@ namespace Anabatic {
void AutoSegment::setAxis ( DbU::Unit axis, Flags flags ) void AutoSegment::setAxis ( DbU::Unit axis, Flags flags )
{ {
if (not isCanonical() and not (flags & Flags::Force)) return; if (not isCanonical()) return;
if ( (axis == getAxis()) and not (flags & Flags::Realignate) ) return; if ( (axis == getAxis()) and not (flags & Flags::Realignate) ) return;
@ -1388,7 +1298,7 @@ namespace Anabatic {
if (terminalMin != terminalMax) if (terminalMin != terminalMax)
attractors.addAttractor( terminalMax ); attractors.addAttractor( terminalMax );
} }
} else if (autoSegment->isLongLocal() or (autoSegment->getAnchoredLength() > getPPitch()*20)) { } else if (autoSegment->isLongLocal() or (autoSegment->getLength() > getPPitch()*20)) {
cdebug_log(145,0) << "Used as long global attractor." << endl; cdebug_log(145,0) << "Used as long global attractor." << endl;
DbU::Unit perpandMin = autoSegment->getSourceU(); DbU::Unit perpandMin = autoSegment->getSourceU();
@ -1612,135 +1522,6 @@ namespace Anabatic {
} }
bool AutoSegment::isMiddleStack () const
{
cdebug_log(149,0) << "AutoSegment::isMiddleStack() - " << this << endl;
if (not isCanonical()) return false;
if (isNonPref()) return false;
if (isGlobal()) {
if (getLength() > getPPitch()) return false;
cdebug_log(149,0) << "| Considering this global anyway because it is too short. " << endl;
}
AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget();
if (not source or not target) {
cdebug_log(149,0) << "| false, missing source or target (in creation?). " << endl;
return false;
}
if (isSpinTopOrBottom()) {
cdebug_log(149,0) << "| false, neither spin top nor bottom. " << endl;
return false;
}
if (not (source->isTerminal() xor target->isTerminal())) {
if (source->isTerminal() and target->isTerminal()) {
cdebug_log(149,0) << "| false, source & target are terminals. " << endl;
return false;
}
if (source->isTurn()) {
AutoSegment* perpandicular = source->getPerpandicular( this );
if (perpandicular->isNonPref() and (perpandicular->getAnchoredLength() != 0)) {
cdebug_log(149,0) << "| false, perpandicular is non-pref and non-zero. " << this << endl;
return false;
}
} else if (target->isTurn()) {
AutoSegment* perpandicular = target->getPerpandicular( this );
if (perpandicular->isNonPref() and (perpandicular->getAnchoredLength() != 0)) {
cdebug_log(149,0) << "| false, perpandicular is non-pref and non-zero. " << this << endl;
return false;
}
} else if ((source->isHTee() or target->isHTee()) and isHorizontal()) {
cdebug_log(149,0) << "| false, S/T HTee+Terminal and horizontal. " << this << endl;
return false;
} else if ((source->isVTee() or target->isVTee()) and isVertical()) {
cdebug_log(149,0) << "| false, S/T VTee+Terminal and vertical. " << this << endl;
return false;
}
}
DbU::Unit sourceAxis = 0;
DbU::Unit targetAxis = 0;
getEndAxes( sourceAxis, targetAxis );
if ((targetAxis - sourceAxis) >= getPPitch()) {
cdebug_log(149,0) << "| Canonical axis length superior to P-Pitch " << this << endl;
return false;
}
cdebug_log(149,0) << " Middle stack or terminal bound." << endl;
return true;
}
bool AutoSegment::isUnderMinLength () const
{
return false;
// cdebug_log(149,0) << "AutoSegment::isUnderMinLength() - " << this << endl;
// if (not isMiddleStack()) return false;
// DbU::Unit spanLength = getSpanLength();
// DbU::Unit minimalLength = getMinimalLength( Session::getLayerDepth( getLayer() ));
// cdebug_log(149,0) << " span=" << DbU::getValueString(spanLength)
// << " < min=" << DbU::getValueString(minimalLength)<< endl;
// return spanLength < minimalLength;
}
bool AutoSegment::expandToMinLength ( Interval span )
{
if (not isMiddleStack()) return false;
cdebug_log(149,1) << "AutoSegment::expandToMinLength() " << this << endl;
cdebug_log(149,0) << "In span=" << span << endl;
cdebug_log(149,0) << "Before: [" << DbU::getValueString(getSourceU() - getExtensionCap( Flags::Source|Flags::LayerCapOnly ))
<< " " << DbU::getValueString(getTargetU() + getExtensionCap( Flags::Target|Flags::LayerCapOnly ))
<< "]" << endl;
DbU::Unit sourceCap = getExtensionCap( Flags::Source|Flags::NoSegExt|Flags::LayerCapOnly );
DbU::Unit targetCap = getExtensionCap( Flags::Target|Flags::NoSegExt|Flags::LayerCapOnly );
DbU::Unit segMinLength = getAnchoredLength() + sourceCap + targetCap;
DbU::Unit techMinLength = getMinimalLength( Session::getLayerDepth( getLayer() ));
if (techMinLength <= segMinLength) {
cdebug_log(149,0) << "Above minimal length (" << DbU::getValueString(segMinLength)
<< " >= " << DbU::getValueString(techMinLength) << ")" << endl;
cdebug_tabw(149,-1);
return false;
}
DbU::Unit oneGrid = DbU::fromGrid( 1 );
DbU::Unit targetExpand = (techMinLength - segMinLength) / 2 + targetCap;
DbU::Unit sourceExpand = - (techMinLength - segMinLength) / 2 - sourceCap;
if (targetExpand % oneGrid)
targetExpand += oneGrid - targetExpand % oneGrid;
if (sourceExpand % oneGrid)
sourceExpand -= oneGrid + sourceExpand % oneGrid;
if (not span.isEmpty()) {
DbU::Unit shiftLeft = span.getVMax() - (getTargetU() + targetExpand);
if (shiftLeft < 0) {
targetExpand += shiftLeft;
sourceExpand += shiftLeft;
}
}
setDuSource( sourceExpand );
setDuTarget( targetExpand );
cdebug_log(149,0) << "sourceExpand=" << DbU::getValueString(sourceExpand)
<< " targetExpand=" << DbU::getValueString(targetExpand) << endl;
cdebug_log(149,0) << "After: [" << DbU::getValueString(getSourceU() - getExtensionCap( Flags::Source|Flags::LayerCapOnly ))
<< " " << DbU::getValueString(getTargetU() + getExtensionCap( Flags::Target|Flags::LayerCapOnly ))
<< "] expand:" << DbU::getValueString(techMinLength - segMinLength)<< endl;
setFlags( SegAtMinArea );
cdebug_tabw(149,-1);
return true;
}
bool AutoSegment::unexpandToMinLength ()
{
if (not isAtMinArea()) return false;
cdebug_log(149,0) << "AutoSegment::unexpandToMinLength() " << this << endl;
setDuSource( 0 );
setDuTarget( 0 );
unsetFlags( SegAtMinArea );
return true;
}
bool AutoSegment::isReduceCandidate () const bool AutoSegment::isReduceCandidate () const
{ {
if (isGlobal()) return false; if (isGlobal()) return false;
@ -1756,94 +1537,46 @@ namespace Anabatic {
} }
bool AutoSegment::canReduce ( Flags flags ) const bool AutoSegment::canReduce () const
{ {
cdebug_log(159,0) << "AutoSegment::canReduce():" << this << endl; if (isGlobal() or isDrag()) return false;
cdebug_log(159,0) << " _reduceds:" << _reduceds << endl;
DbU::Unit length = getAnchoredLength();
if (isGlobal() and (length > getPPitch())) return false;
if (isDrag() or isFixed()) return false;
if (not isSpinTopOrBottom()) return false; if (not isSpinTopOrBottom()) return false;
if ((getDepth() == 1) and isSpinBottom()) return false; if (_reduceds) return false;
if ((flags & Flags::WithPerpands) and _reduceds) return false;
AutoContact* source = getAutoSource(); AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget(); AutoContact* target = getAutoTarget();
cdebug_log(159,0) << " source:" << source->isHTee() << "+" << source->isVTee() << endl; if (not source->isTurn() or not target->isTurn()) return false;
cdebug_log(159,0) << " target:" << target->isHTee() << "+" << target->isVTee() << endl;
if ( ((source->isHTee() or target->isHTee()) and isHorizontal())
or ((source->isVTee() or target->isVTee()) and isVertical ()) ) return false;
// if ( source->isHTee() or source->isVTee()
// or target->isHTee() or target->isVTee() ) return false;
cdebug_log(159,0) << " length:" << DbU::getValueString(length) << endl;
if (flags & Flags::NullLength) return (length == 0);
unsigned int perpandicularDepth = getDepth(); unsigned int perpandicularDepth = getDepth();
if (isSpinBottom()) { if (isSpinBottom()) --perpandicularDepth;
if (perpandicularDepth > 0) --perpandicularDepth; else if (isSpinTop()) {
} else if (isSpinTop()) {
++perpandicularDepth; ++perpandicularDepth;
if (perpandicularDepth >= Session::getDepth()) return false; if (perpandicularDepth >= Session::getDepth()) return false;
} else } else
return false; return false;
if (getAnchoredLength() >= Session::getPitch(perpandicularDepth) * 2) return false; if (getLength() >= (Session::getPitch(perpandicularDepth) * 2)) return false;
return true; return true;
} }
bool AutoSegment::reduce ( Flags flags ) bool AutoSegment::reduce ()
{ {
if (isReduced()) return false; if (not canReduce()) return false;
if (not canReduce(flags)) return false;
cdebug_log(159,0) << "AutoSegment::reduce():" << this << endl;
AutoContact* source = getAutoSource(); AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget(); AutoContact* target = getAutoTarget();
_flags |= SegIsReduced; _flags |= SegIsReduced;
for ( AutoSegment* perpandicular : source->getAutoSegments() ) { source->getPerpandicular( this )->incReduceds();
if (perpandicular == this) continue; target->getPerpandicular( this )->incReduceds();
perpandicular->incReduceds();
}
for ( AutoSegment* perpandicular : target->getAutoSegments() ) {
if (perpandicular == this) continue;
perpandicular->incReduceds();
}
return true; return true;
} }
uint32_t AutoSegment::getNonReduceds ( Flags flags ) const
{
if (not canReduce(flags)) return false;
cdebug_log(159,0) << "AutoSegment::getNonReduceds():" << this << endl;
AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget();
uint32_t nonReduceds = 0;
for ( AutoSegment* perpandicular : source->getAutoSegments() ) {
if (perpandicular == this) continue;
if (perpandicular->getAnchoredLength()) ++nonReduceds;
}
for ( AutoSegment* perpandicular : target->getAutoSegments() ) {
if (perpandicular == this) continue;
if (perpandicular->getAnchoredLength()) ++nonReduceds;
}
return nonReduceds;
}
bool AutoSegment::mustRaise () const bool AutoSegment::mustRaise () const
{ {
if (not (_flags & SegIsReduced)) return false; if (not (_flags & SegIsReduced)) return false;
@ -1853,29 +1586,20 @@ namespace Anabatic {
else if (isSpinTop ()) ++perpandicularDepth; else if (isSpinTop ()) ++perpandicularDepth;
else return true; else return true;
return (getAnchoredLength() >= (Session::getPitch(perpandicularDepth) * 2)); return (getLength() >= (Session::getPitch(perpandicularDepth) * 2));
} }
bool AutoSegment::raise () bool AutoSegment::raise ()
{ {
if (not (_flags & SegIsReduced)) return false; if (not (_flags & SegIsReduced)) return false;
cdebug_log(159,0) << "AutoSegment::raise():" << this << endl;
AutoContact* source = getAutoSource(); AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget(); AutoContact* target = getAutoTarget();
_flags &= ~SegIsReduced; _flags &= ~SegIsReduced;
for ( AutoSegment* perpandicular : source->getAutoSegments() ) { source->getPerpandicular( this )->decReduceds();
if (perpandicular == this) continue; target->getPerpandicular( this )->decReduceds();
cdebug_log(159,0) << "dec PP:" << perpandicular << endl;
perpandicular->decReduceds();
}
for ( AutoSegment* perpandicular : target->getAutoSegments() ) {
if (perpandicular == this) continue;
cdebug_log(159,0) << "dec PP:" << perpandicular << endl;
perpandicular->decReduceds();
}
return true; return true;
} }
@ -1883,8 +1607,6 @@ namespace Anabatic {
void AutoSegment::changeDepth ( unsigned int depth, Flags flags ) void AutoSegment::changeDepth ( unsigned int depth, Flags flags )
{ {
DebugSession::open( getNet(), 145, 150 );
cdebug_log(149,1) << "changeDepth() " << depth << " - " << this << endl; cdebug_log(149,1) << "changeDepth() " << depth << " - " << this << endl;
Session::invalidate( getNet() ); Session::invalidate( getNet() );
@ -1898,8 +1620,6 @@ namespace Anabatic {
} }
cdebug_tabw(149,-1); cdebug_tabw(149,-1);
DebugSession::close();
} }
@ -1912,7 +1632,6 @@ namespace Anabatic {
const Layer* newLayer = Session::getRoutingGauge()->getRoutingLayer(depth); const Layer* newLayer = Session::getRoutingGauge()->getRoutingLayer(depth);
if (getLayer() != newLayer) { if (getLayer() != newLayer) {
cdebug_log(149,0) << "Effective layer change to " << depth << "/" << newLayer << endl;
setLayer( depth ); setLayer( depth );
getAutoSource()->invalidate( Flags::Topology|Flags::NoCheckLayer ); getAutoSource()->invalidate( Flags::Topology|Flags::NoCheckLayer );
getAutoTarget()->invalidate( Flags::Topology|Flags::NoCheckLayer ); getAutoTarget()->invalidate( Flags::Topology|Flags::NoCheckLayer );
@ -1964,8 +1683,8 @@ namespace Anabatic {
if (_canSlacken()) return true; if (_canSlacken()) return true;
if ((flags & Flags::Propagate) and not isNotAligned()) { if ((flags & Flags::Propagate) and not isNotAligned()) {
for ( AutoSegment* segment : const_cast<AutoSegment*>(this)->getAligneds() ) { forEach ( AutoSegment*, isegment, const_cast<AutoSegment*>(this)->getAligneds() ) {
if (segment->_canSlacken()) return true; if (isegment->_canSlacken()) return true;
} }
} }
@ -2022,7 +1741,7 @@ namespace Anabatic {
cdebug_log(149,0) << "AutoSegment::canPivotUp() - " << flags cdebug_log(149,0) << "AutoSegment::canPivotUp() - " << flags
<< " (reserve:" << reserve << ")" << endl; << " (reserve:" << reserve << ")" << endl;
if ( isLayerChange() or isFixed() or isUnbreakable() ) return false; if ( isLayerChange() or isFixed() ) return false;
if ( isStrongTerminal() and (not (flags & Flags::AllowTerminal)) ) return false; if ( isStrongTerminal() and (not (flags & Flags::AllowTerminal)) ) return false;
if ( isLocal() and (not (flags & Flags::AllowLocal )) ) return false; if ( isLocal() and (not (flags & Flags::AllowLocal )) ) return false;
@ -2071,7 +1790,7 @@ namespace Anabatic {
cdebug_log(149,0) << "AutoSegment::canPivotDown()" cdebug_log(149,0) << "AutoSegment::canPivotDown()"
<< " (reserve:" << reserve << ")" << endl; << " (reserve:" << reserve << ")" << endl;
if ( isLayerChange() or isFixed() or isUnbreakable() ) return false; if ( isLayerChange() or isFixed() ) return false;
if ( isStrongTerminal() or isLocal() ) return false; if ( isStrongTerminal() or isLocal() ) return false;
size_t depth = Session::getRoutingGauge()->getLayerDepth( getLayer() ); size_t depth = Session::getRoutingGauge()->getLayerDepth( getLayer() );
@ -2117,17 +1836,11 @@ namespace Anabatic {
{ {
cdebug_log(159,0) << "AutoSegment::canMoveUp() " << flags cdebug_log(159,0) << "AutoSegment::canMoveUp() " << flags
<< " (reserve:" << reserve << ") " << this << endl; << " (reserve:" << reserve << ") " << this << endl;
if (Session::getRoutingGauge()->getName() == "FlexLib")
reserve += 2.0;
// ls180 hard-coded hack.
//if (getId() == 10023986) return false;
if (getId() == 6378409) return false;
bool nLowDensity = true; bool nLowDensity = true;
bool nLowUpDensity = true; bool nLowUpDensity = true;
if ( isLayerChange() or isFixed() or isUnbreakable() ) return false; if ( isLayerChange() or isFixed() ) return false;
if ( isStrongTerminal() and (not (flags & Flags::AllowTerminal)) ) return false; if ( isStrongTerminal() and (not (flags & Flags::AllowTerminal)) ) return false;
if ( isLocal() and (not (flags & Flags::AllowLocal )) ) return false; if ( isLocal() and (not (flags & Flags::AllowLocal )) ) return false;
@ -2158,10 +1871,6 @@ namespace Anabatic {
if (not getAutoTarget()->canMoveUp(this)) return false; if (not getAutoTarget()->canMoveUp(this)) return false;
return true; return true;
} }
// if (getAutoSource()->isTurn() and (getAutoSource()->getPerpandicular(this)->getLayer() == getLayer())) return false;
// if (getAutoTarget()->isTurn() and (getAutoTarget()->getPerpandicular(this)->getLayer() == getLayer())) return false;
cdebug_log(159,0) << "Both source & target Contacts can move up." << endl; cdebug_log(159,0) << "Both source & target Contacts can move up." << endl;
//bool hasGlobalSegment = false; //bool hasGlobalSegment = false;
@ -2241,152 +1950,38 @@ namespace Anabatic {
bool AutoSegment::reduceDoglegLayer () bool AutoSegment::reduceDoglegLayer ()
{ {
if (not isReduced()) return false; if (not isReduced()) return true;
DebugSession::open( getNet(), 149, 160 );
cdebug_log(159,1) << "AutoSegment::reduceDoglegLayer(): " << this << endl;
bool success = false;
AutoContact* source = getAutoSource(); AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget(); AutoContact* target = getAutoTarget();
unsigned int minSourceDepth = Session::getAllowedDepth(); unsigned int perpandicularDepth = getDepth();
unsigned int maxSourceDepth = 0; if (isSpinBottom()) --perpandicularDepth;
unsigned int minTargetDepth = Session::getAllowedDepth(); if (isSpinTop ()) ++perpandicularDepth;
unsigned int maxTargetDepth = 0;
if (source->isTerminal()) { if (perpandicularDepth == getDepth()) {
unsigned int anchorDepth = Session::getLayerDepth( source->base()->getAnchor()->getLayer() ); cerr << Bug( "AutoSegment::reduceDoglegLayer(): Reduced segment spin is neither top (TT) nor bottom (BB).\n"
minSourceDepth = std::min( minSourceDepth, anchorDepth ); " %s"
maxSourceDepth = std::max( maxSourceDepth, anchorDepth ); , getString(this).c_str() ) << endl;
cdebug_log(151,0) << " source:" << source << endl; return false;
} else {
for ( AutoSegment* perpandicular : source->getAutoSegments() ) {
if (perpandicular == this) continue;
cdebug_log(151,0) << " connected:" << perpandicular << endl;
minSourceDepth = std::min( minSourceDepth, perpandicular->getDepth() );
maxSourceDepth = std::max( maxSourceDepth, perpandicular->getDepth() );
}
}
if (target->isTerminal()) {
unsigned int anchorDepth = Session::getLayerDepth( target->base()->getAnchor()->getLayer() );
minTargetDepth = std::min( minTargetDepth, anchorDepth );
maxTargetDepth = std::max( maxTargetDepth, anchorDepth );
cdebug_log(151,0) << " target:" << target << endl;
} else {
for ( AutoSegment* perpandicular : target->getAutoSegments() ) {
if (perpandicular == this) continue;
cdebug_log(151,0) << " connected:" << perpandicular << endl;
minTargetDepth = std::min( minTargetDepth, perpandicular->getDepth() );
maxTargetDepth = std::max( maxTargetDepth, perpandicular->getDepth() );
}
} }
cdebug_log(159,0) << "Source span: [" << minSourceDepth << " " << maxSourceDepth << "]" << endl; const Layer* layer = Session::getRoutingLayer(perpandicularDepth);
cdebug_log(159,0) << "Target span: [" << minTargetDepth << " " << maxTargetDepth << "]" << endl; DbU::Unit side = Session::getWireWidth (perpandicularDepth);
if ( (minSourceDepth == maxSourceDepth)
and (minTargetDepth == maxTargetDepth)
and (minSourceDepth == minTargetDepth) ) {
const Layer* layer = Session::getRoutingLayer(minSourceDepth);
DbU::Unit vside = Session::getWireWidth (minSourceDepth);
DbU::Unit hside = Session::getPWireWidth (minSourceDepth);
if (Session::getDirection(minSourceDepth) & Flags::Vertical)
std::swap( hside, vside );
cdebug_log(159,0) << "Reducing to " << minSourceDepth << " " << layer << endl;
source->setLayer( layer ); source->setLayer( layer );
target->setLayer( layer ); target->setLayer( layer );
setLayer( layer ); setLayer( layer );
setWidth( hside ); source->setSizes( side, side );
source->setSizes( hside, vside ); target->setSizes( side, side );
target->setSizes( hside, vside );
success = true;
}
cdebug_tabw(159,-1);
DebugSession::close();
return success;
// if (not source->isTurn() or not target->isTurn()) return true;
// unsigned int perpandicularDepth = getDepth();
// if (isSpinBottom()) --perpandicularDepth;
// if (isSpinTop ()) ++perpandicularDepth;
// if (perpandicularDepth == getDepth()) {
// cerr << Bug( "AutoSegment::reduceDoglegLayer(): Reduced segment spin is neither top (TT) nor bottom (BB).\n"
// " %s"
// , getString(this).c_str() ) << endl;
// return false;
// }
// const Layer* layer = Session::getRoutingLayer(perpandicularDepth);
// DbU::Unit side = Session::getWireWidth (perpandicularDepth);
// source->setLayer( layer );
// target->setLayer( layer );
// setLayer( layer );
// source->setSizes( side, side );
// target->setSizes( side, side );
// return true;
}
bool AutoSegment::bloatStackedStrap ()
{
DebugSession::open( getNet(), 145, 150 );
cdebug_log(149,1) << "AutoSegment::bloatStackedStrap() " << this << endl;
double minArea = getLayer()->getMinimalArea();
if (minArea == 0.0) {
cdebug_log(149,-1) << "False, NO minimal area." << endl;
DebugSession::close();
return false;
}
DbU::Unit minLength
= DbU::fromPhysical( minArea / DbU::toPhysical( getWidth(), DbU::UnitPower::Micro )
, DbU::UnitPower::Micro );
cdebug_log(149,0) << "Min length: " << DbU::getValueString(minLength) << " ." << endl;
if ((getSpanLength() >= minLength) or isReduced()) {
cdebug_log(149,-1) << "False, has length or is reduced." << endl;
DebugSession::close();
return false;
}
if (isDrag()) {
for ( AutoSegment* perpandicular : getPerpandiculars() ) {
if (perpandicular->getSpanLength() > minLength) {
cdebug_log(149,-1) << "False (drag), has length or PP has length." << endl;
DebugSession::close();
return false;
}
}
} else {
if ( ((_flags & (SegSourceBottom|SegTargetTop)) != (SegSourceBottom|SegTargetTop))
and ((_flags & (SegTargetBottom|SegSourceTop)) != (SegTargetBottom|SegSourceTop)) ) {
cdebug_log(149,-1) << "False, not part of a stacked VIA." << endl;
DebugSession::close();
return false;
}
}
DbU::Unit side = DbU::fromPhysical( std::sqrt(minArea) , DbU::UnitPower::Micro );
setWidth( side );
setDuSource( -side/2 );
setDuTarget( side/2 );
cdebug_log(149,-1) << "True, add area." << endl;
DebugSession::close();
return true; return true;
} }
#if THIS_IS_DISABLED #if THIS_IS_DISABLED
bool AutoSegment::shearUp ( GCell* upGCell, AutoSegment*& movedUp, float reserve, Flags flags ) bool AutoSegment::shearUp ( GCell* upGCell, AutoSegment*& movedUp, float reserve, Flags flags )
{ {
cdebug_log(149,0) << "AutoSegment::shearUp() " << this << endl; cdebug_log(149,0) << "AutoSegment::shearUp() " << this << endl;
@ -2470,11 +2065,11 @@ namespace Anabatic {
if (not isNotAligned()) { if (not isNotAligned()) {
for ( AutoSegment* segment : getAligneds() ) { for ( AutoSegment* segment : getAligneds() ) {
if (segment->getSpanU().contains(interval.getVMin())) { if (segment->getSpanU().contains(interval.getVMin())) {
if (segment->isFixed()) return Flags::NoFlags; if (segment->isFixed()) return false;
leftDogleg++; leftDogleg++;
} }
if (segment->getSpanU().contains(interval.getVMax())) { if (segment->getSpanU().contains(interval.getVMax())) {
if (segment->isFixed()) return Flags::NoFlags; if (segment->isFixed()) return 0;
rightDogleg++; rightDogleg++;
} }
} }
@ -2519,12 +2114,16 @@ namespace Anabatic {
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1] << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1] << endl;
if (isSource) { if (isSource) {
doglegs[ index + 0 ]->setLayer( std::max((size_t)1,segmentDepth-2) ); doglegs[ index + 0 ]->setLayer( segmentDepth-2 );
doglegs[ index + 1 ]->getAutoSource()->setLayer( rg->getContactLayer(segmentDepth-2) );
doglegs[ index + 1 ]->getAutoTarget()->setLayer( rg->getContactLayer(segmentDepth-1) );
cdebug_log(149,0) << "doglegs[i+0]: " << doglegs[index+0] << endl; cdebug_log(149,0) << "doglegs[i+0]: " << doglegs[index+0] << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl;
} else { } else {
doglegs[ index + 2 ]->setLayer( std::max((size_t)1,segmentDepth-2) ); doglegs[ index + 2 ]->setLayer( segmentDepth-2 );
doglegs[ index + 1 ]->getAutoTarget()->setLayer( rg->getContactLayer(segmentDepth-2) );
doglegs[ index + 1 ]->getAutoSource()->setLayer( rg->getContactLayer(segmentDepth-1) );
cdebug_log(149,0) << "doglegs[i+2]: " << doglegs[index+2] << endl; cdebug_log(149,0) << "doglegs[i+2]: " << doglegs[index+2] << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl;
@ -2537,18 +2136,20 @@ namespace Anabatic {
if (isSource) { if (isSource) {
doglegs[ index + 0 ]->setLayer( segmentDepth+2 ); doglegs[ index + 0 ]->setLayer( segmentDepth+2 );
doglegs[ index + 1 ]->getAutoSource()->setLayer( rg->getContactLayer(segmentDepth+1) );
doglegs[ index + 1 ]->getAutoTarget()->setLayer( rg->getContactLayer(segmentDepth ) );
cdebug_log(149,0) << "doglegs[i+0]: " << doglegs[index+0] << endl; cdebug_log(149,0) << "doglegs[i+0]: " << doglegs[index+0] << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl;
} else { } else {
doglegs[ index + 2 ]->setLayer( segmentDepth+2 ); doglegs[ index + 2 ]->setLayer( segmentDepth+2 );
doglegs[ index + 1 ]->getAutoTarget()->setLayer( rg->getContactLayer(segmentDepth+1) );
doglegs[ index + 1 ]->getAutoSource()->setLayer( rg->getContactLayer(segmentDepth ) );
cdebug_log(149,0) << "doglegs[i+2]: " << doglegs[index+2] << endl; cdebug_log(149,0) << "doglegs[i+2]: " << doglegs[index+2] << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoTarget() << endl;
cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl; cdebug_log(149,0) << "doglegs[i+1]: " << doglegs[index+1]->getAutoSource() << endl;
} }
} }
doglegs[ index + 1 ]->getAutoSource()->updateLayer();
doglegs[ index + 1 ]->getAutoTarget()->updateLayer();
} }
cdebug_tabw(149,-1); cdebug_tabw(149,-1);
@ -2661,10 +2262,10 @@ namespace Anabatic {
} else { } else {
cdebug_log(149,0) << "Looking in aligneds." << endl; cdebug_log(149,0) << "Looking in aligneds." << endl;
if (not isNotAligned()) { if (not isNotAligned()) {
for ( AutoSegment* aligned : getAligneds(flags) ) { forEach ( AutoSegment*, aligned, getAligneds(flags) ) {
cdebug_log(149,0) << "| Try in " << aligned << endl; cdebug_log(149,0) << "| Try in " << *aligned << endl;
if (doglegGCell->getSide(getDirection()).intersect(aligned->getSpanU())) { if (doglegGCell->getSide(getDirection()).intersect(aligned->getSpanU())) {
cdebug_log(149,0) << "Dogleg in " << aligned << endl; cdebug_log(149,0) << "Dogleg in " << *aligned << endl;
rflags = aligned->_makeDogleg( doglegGCell, flags ); rflags = aligned->_makeDogleg( doglegGCell, flags );
cdebug_tabw(149,-1); cdebug_tabw(149,-1);
return 0; return 0;
@ -2711,7 +2312,6 @@ namespace Anabatic {
state += isFixedAxis () ? "X": "-"; state += isFixedAxis () ? "X": "-";
state += isUnsetAxis () ? "u": "-"; state += isUnsetAxis () ? "u": "-";
state += isStrap () ? "S": "-"; state += isStrap () ? "S": "-";
state += isUnbreakable () ? "U": "-";
state += isCanonical () ? "C": "-"; state += isCanonical () ? "C": "-";
state += isGlobal () ? "G": "-"; state += isGlobal () ? "G": "-";
state += isWeakGlobal () ? "g": "-"; state += isWeakGlobal () ? "g": "-";
@ -2741,9 +2341,9 @@ namespace Anabatic {
string AutoSegment::_getString () const string AutoSegment::_getString () const
{ {
string sdistance = " rpD:" + getString(_rpDistance);
string s = base()->_getString(); string s = base()->_getString();
s.insert ( s.size()-1, sdistance ); //s.insert ( 1, "id: " );
//s.insert ( 4, getString(_id) );
s.insert ( s.size()-1, _getStringFlags() ); s.insert ( s.size()-1, _getStringFlags() );
return s; return s;
} }
@ -2870,10 +2470,9 @@ namespace Anabatic {
segment->_postCreate(); segment->_postCreate();
} else if (vertical) { } else if (vertical) {
if (vertical->getLayer() != verticalLayer) { if (vertical->getLayer() != verticalLayer) {
if (Session::getAnabatic()->getConfiguration()->isGMetal(vertical->getLayer()) ) { if (Session::getAnabatic()->getConfiguration()->isGMetal(vertical->getLayer()) )
vertical->setLayer( verticalLayer ); vertical->setLayer( verticalLayer );
vertical->setWidth( verticalWidth ); vertical->setWidth( verticalWidth );
}
} else { } else {
if (vertical->getWidth() != verticalWidth) { if (vertical->getWidth() != verticalWidth) {
cerr << Warning("Segment %s has non-default width %s." cerr << Warning("Segment %s has non-default width %s."
@ -2912,33 +2511,16 @@ namespace Anabatic {
const Layer* vLayer = Session::getDVerticalLayer(); const Layer* vLayer = Session::getDVerticalLayer();
DbU::Unit vWidth = Session::getDVerticalWidth(); DbU::Unit vWidth = Session::getDVerticalWidth();
if (dir & Flags::UseNonPref) {
if (dir & Flags::Vertical) {
vLayer = hLayer;
vWidth = Session::getDPHorizontalWidth();
cdebug_log(149,0) << "Make vertical in non-preferred direction (ppW:"
<< DbU::getValueString(vWidth).c_str() << ")." << endl;
}
if (dir & Flags::Horizontal) {
hLayer = vLayer;
hWidth = Session::getDPVerticalWidth();
cdebug_log(149,0) << "Make horizontal in non-preferred direction (ppW:"
<< DbU::getValueString(hWidth).c_str() << ")." << endl;
}
}
const Layer* horizontalLayer = hLayer; const Layer* horizontalLayer = hLayer;
DbU::Unit horizontalWidth = hWidth; DbU::Unit horizontalWidth = hWidth;
const Layer* verticalLayer = vLayer; const Layer* verticalLayer = vLayer;
DbU::Unit verticalWidth = vWidth; DbU::Unit verticalWidth = vWidth;
cdebug_log(149,0) << "verticalWidth:" << DbU::getValueString(verticalWidth).c_str() << endl;
uint32_t wPitch = NetRoutingExtension::getWPitch( source->getNet() ); uint32_t wPitch = NetRoutingExtension::getWPitch( source->getNet() );
if (wPitch > 1) { if (wPitch > 1) {
horizontalWidth = (wPitch-1) * Session::getDHorizontalPitch() + hWidth; horizontalWidth = (wPitch-1) * Session::getDHorizontalPitch() + hWidth;
verticalWidth = (wPitch-1) * Session::getDVerticalPitch () + vWidth; verticalWidth = (wPitch-1) * Session::getDVerticalPitch () + vWidth;
} }
cdebug_log(149,0) << "verticalWidth:" << DbU::getValueString(verticalWidth).c_str() << endl;
if (depth != RoutingGauge::nlayerdepth) { if (depth != RoutingGauge::nlayerdepth) {
horizontalLayer = verticalLayer = Session::getRoutingLayer( depth ); horizontalLayer = verticalLayer = Session::getRoutingLayer( depth );
@ -2947,23 +2529,9 @@ namespace Anabatic {
horizontalWidth = verticalWidth = (wPitch-1) * Session::getPitch (depth) horizontalWidth = verticalWidth = (wPitch-1) * Session::getPitch (depth)
+ Session::getWireWidth(depth); + Session::getWireWidth(depth);
} else { } else {
if (dir & Flags::Horizontal) { horizontalWidth = verticalWidth = Session::getWireWidth( depth );
horizontalWidth = Session::getWireWidth ( depth );
verticalWidth = Session::getPWireWidth( depth );
} else {
verticalWidth = Session::getWireWidth ( depth );
horizontalWidth = Session::getPWireWidth( depth );
}
cdebug_log(149,0) << "hW:" << DbU::getValueString(horizontalWidth).c_str()
<< "vW:" << DbU::getValueString( verticalWidth).c_str()
<< endl;
if (dir & Flags::UseNonPref) {
cdebug_log(149,0) << "swap H/W width." << endl;
std::swap( horizontalWidth, verticalWidth );
} }
} }
}
cdebug_log(149,0) << "verticalWidth:" << DbU::getValueString(verticalWidth).c_str() << endl;
AutoSegment* segment; AutoSegment* segment;
AutoContact* reference = source; AutoContact* reference = source;
@ -3013,7 +2581,6 @@ namespace Anabatic {
if (wPitch > 1) segment->setFlags( SegWide ); if (wPitch > 1) segment->setFlags( SegWide );
if (source->canDrag() or target->canDrag()) segment->setFlags( SegDrag ); if (source->canDrag() or target->canDrag()) segment->setFlags( SegDrag );
if (dir & Flags::UseNonPref) segment->setFlags( SegNonPref );
return segment; return segment;
} }
@ -3063,7 +2630,7 @@ namespace Anabatic {
exploreds.insert( seed->getAutoSource() ); exploreds.insert( seed->getAutoSource() );
exploreds.insert( seed->getAutoTarget() ); exploreds.insert( seed->getAutoTarget() );
if (seed->getAnchoredLength()) { if (seed->getLength()) {
if (flags & Flags::Superior) stack.push_back( seed->getAutoTarget() ); if (flags & Flags::Superior) stack.push_back( seed->getAutoTarget() );
else stack.push_back( seed->getAutoSource() ); else stack.push_back( seed->getAutoSource() );
} else { } else {
@ -3088,7 +2655,7 @@ namespace Anabatic {
AutoSegment* autoSegment = Session::lookup( segment ); AutoSegment* autoSegment = Session::lookup( segment );
if (not autoSegment) continue; if (not autoSegment) continue;
if (not autoSegment->getAnchoredLength()) { if (not autoSegment->getLength()) {
AutoContact* contact = autoSegment->getAutoSource(); AutoContact* contact = autoSegment->getAutoSource();
if (contact and (contact != currentContact)) { if (contact and (contact != currentContact)) {
if (exploreds.find(contact) == exploreds.end()) if (exploreds.find(contact) == exploreds.end())

View File

@ -41,8 +41,8 @@ namespace Anabatic {
Segment* AutoVertical::base () { return _vertical; } Segment* AutoVertical::base () { return _vertical; }
Segment* AutoVertical::base () const { return _vertical; } Segment* AutoVertical::base () const { return _vertical; }
Vertical* AutoVertical::getVertical () { return _vertical; } Vertical* AutoVertical::getVertical () { return _vertical; }
DbU::Unit AutoVertical::getSourceU () const { return _vertical->getSource()->getY(); } DbU::Unit AutoVertical::getSourceU () const { return _vertical->getSourceY(); }
DbU::Unit AutoVertical::getTargetU () const { return _vertical->getTarget()->getY(); } DbU::Unit AutoVertical::getTargetU () const { return _vertical->getTargetY(); }
DbU::Unit AutoVertical::getDuSource () const { return _vertical->getDySource(); } DbU::Unit AutoVertical::getDuSource () const { return _vertical->getDySource(); }
DbU::Unit AutoVertical::getDuTarget () const { return _vertical->getDyTarget(); } DbU::Unit AutoVertical::getDuTarget () const { return _vertical->getDyTarget(); }
Interval AutoVertical::getSpanU () const { return Interval(_vertical->getSourceY(),_vertical->getTargetY()); } Interval AutoVertical::getSpanU () const { return Interval(_vertical->getSourceY(),_vertical->getTargetY()); }
@ -218,7 +218,6 @@ namespace Anabatic {
if (not gcell) { if (not gcell) {
success = false; success = false;
if (not isCreated()) {
cerr << Error( "AutoVertical::getGCells() : NULL GCell under %s\n" cerr << Error( "AutoVertical::getGCells() : NULL GCell under %s\n"
" begin:%s\n" " begin:%s\n"
" end: %s" " end: %s"
@ -226,7 +225,6 @@ namespace Anabatic {
, getString(getAutoSource()->getGCell()).c_str() , getString(getAutoSource()->getGCell()).c_str()
, getString(getAutoTarget()->getGCell()).c_str() , getString(getAutoTarget()->getGCell()).c_str()
) << endl; ) << endl;
}
break; break;
} }
@ -241,21 +239,17 @@ namespace Anabatic {
{ {
cdebug_tabw(149,-1); cdebug_tabw(149,-1);
if (getAutoSource()->isOnPin() or getAutoTarget()->isOnPin()) { cdebug_tabw(149,-1); return false; }
Interval sourceSide = getAutoSource()->getGCell()->getSide( Flags::Horizontal ); Interval sourceSide = getAutoSource()->getGCell()->getSide( Flags::Horizontal );
Interval targetSide = getAutoTarget()->getGCell()->getSide( Flags::Horizontal ); Interval targetSide = getAutoTarget()->getGCell()->getSide( Flags::Horizontal );
Interval sourceConstraints = Interval(getAutoSource()->getCBXMin(),getAutoSource()->getCBXMax()); Interval sourceConstraints = Interval(getAutoSource()->getCBXMin(),getAutoSource()->getCBXMax());
Interval targetConstraints = Interval(getAutoTarget()->getCBXMin(),getAutoTarget()->getCBXMax()); Interval targetConstraints = Interval(getAutoTarget()->getCBXMin(),getAutoTarget()->getCBXMax());
bool sourceGoStraight = getAutoSource()->getGCell()->isGoStraight();
bool targetGoStraight = getAutoTarget()->getGCell()->isGoStraight();
// Expand by a tiny amount for the "contains" to work for sure. // Expand by a tiny amount for the "contains" to work for sure.
sourceConstraints.inflate( 1 ); sourceConstraints.inflate( 1 );
targetConstraints.inflate( 1 ); targetConstraints.inflate( 1 );
if (not sourceGoStraight and not sourceConstraints.contains(sourceSide)) { cdebug_tabw(149,-1); return true; } if (not sourceConstraints.contains(sourceSide)) { cdebug_tabw(149,-1); return true; }
if (not targetGoStraight and not targetConstraints.contains(targetSide)) { cdebug_tabw(149,-1); return true; } if (not targetConstraints.contains(targetSide)) { cdebug_tabw(149,-1); return true; }
cdebug_tabw(149,-1); cdebug_tabw(149,-1);
return false; return false;
@ -268,13 +262,13 @@ namespace Anabatic {
if (not isDrag()) { if (not isDrag()) {
if ( not isStrongTerminal() if ( not isStrongTerminal()
or (not (_flags & (SegGlobal|SegWeakGlobal)) and (getAnchoredLength() < getPitch()*5)) ) or (not (_flags & (SegGlobal|SegWeakGlobal)) and (getLength() < getPitch()*5)) )
{ cdebug_tabw(149,-1); return false; } { cdebug_tabw(149,-1); return false; }
} }
cdebug_log(149,0) << "_flags:" << (_flags & (SegGlobal|SegWeakGlobal)) << endl; cdebug_log(149,0) << "_flags:" << (_flags & (SegGlobal|SegWeakGlobal)) << endl;
cdebug_log(149,0) << "test:" << (getAnchoredLength() < getPitch()*5) << endl; cdebug_log(149,0) << "test:" << (getLength() < getPitch()*5) << endl;
cdebug_log(149,0) << "length:" << DbU::getValueString(getAnchoredLength()) << endl; cdebug_log(149,0) << "length:" << DbU::getValueString(getLength()) << endl;
bool success = false; bool success = false;
bool sourceSlackened = false; bool sourceSlackened = false;
@ -382,10 +376,6 @@ namespace Anabatic {
if (_vertical->getTargetY() < _vertical->getSourceY()) { if (_vertical->getTargetY() < _vertical->getSourceY()) {
cdebug_log(145,0) << "updateOrient() " << this << " (before S/T swap)" << endl; cdebug_log(145,0) << "updateOrient() " << this << " (before S/T swap)" << endl;
_vertical->invert(); _vertical->invert();
DbU::Unit duSource = getDuSource();
DbU::Unit duTarget = getDuTarget();
setDuSource( -duTarget );
setDuTarget( -duSource );
unsigned int spinFlags = _flags & SegDepthSpin; unsigned int spinFlags = _flags & SegDepthSpin;
unsetFlags( SegDepthSpin ); unsetFlags( SegDepthSpin );
@ -409,8 +399,8 @@ namespace Anabatic {
void AutoVertical::updatePositions () void AutoVertical::updatePositions ()
{ {
_sourcePosition = getSourceU() - getExtensionCap(Flags::Source); _sourcePosition = _vertical->getSourceY() - getExtensionCap(Flags::Source);
_targetPosition = getTargetU() + getExtensionCap(Flags::Target); _targetPosition = _vertical->getTargetY() + getExtensionCap(Flags::Target);
} }
@ -430,8 +420,8 @@ namespace Anabatic {
bool AutoVertical::checkPositions () const bool AutoVertical::checkPositions () const
{ {
bool coherency = true; bool coherency = true;
DbU::Unit sourcePosition = _vertical->getSource()->getY() - getExtensionCap(Flags::Source); DbU::Unit sourcePosition = _vertical->getSourceY() - getExtensionCap(Flags::Source);
DbU::Unit targetPosition = _vertical->getTarget()->getY() + getExtensionCap(Flags::Target); DbU::Unit targetPosition = _vertical->getTargetY() + getExtensionCap(Flags::Target);
if ( _sourcePosition != sourcePosition ) { if ( _sourcePosition != sourcePosition ) {
cerr << Error ( "%s\n Source position incoherency: " cerr << Error ( "%s\n Source position incoherency: "
@ -724,6 +714,7 @@ namespace Anabatic {
size_t doglegDepth = depth + ((upLayer)?1:-1); size_t doglegDepth = depth + ((upLayer)?1:-1);
Layer* contactLayer = Session::getRoutingGauge()->getContactLayer ( depth + ((upLayer)?0:-1) ); Layer* contactLayer = Session::getRoutingGauge()->getContactLayer ( depth + ((upLayer)?0:-1) );
const Layer* doglegLayer = Session::getRoutingGauge()->getRoutingLayer ( doglegDepth );
Session::dogleg( this ); Session::dogleg( this );
targetDetach(); targetDetach();
@ -750,48 +741,27 @@ namespace Anabatic {
segment2->setFlags( (isSlackened()?SegSlackened:0) ); segment2->setFlags( (isSlackened()?SegSlackened:0) );
Session::dogleg( segment2 ); Session::dogleg( segment2 );
if (autoSource->isTerminal() and autoTarget->isTerminal()) { if (isSourceTerminal()) {
dlContact1->setFlags ( CntWeakTerminal ); segment1->setFlags( SegWeakTerminal1 );
dlContact2->setFlags ( CntWeakTerminal ); segment2->setFlags( SegWeakTerminal1 );
if (autoTarget->getGCell() == doglegGCell) dlContact1->migrateConstraintBox( autoTarget );
if (autoSource->getGCell() == doglegGCell) dlContact2->migrateConstraintBox( autoSource );
} else if (autoSource->isTerminal()) {
autoTarget->unsetFlags( CntWeakTerminal ); autoTarget->unsetFlags( CntWeakTerminal );
dlContact1->setFlags ( CntWeakTerminal ); dlContact1->setFlags ( CntWeakTerminal );
if (autoTarget->getGCell() == doglegGCell) dlContact1->migrateConstraintBox( autoTarget ); if (autoTarget->getGCell() == doglegGCell)
} else if (autoTarget->isTerminal()) { dlContact1->migrateConstraintBox( autoTarget );
} else if (isTargetTerminal()) {
unsetFlags( SegTargetTerminal ); unsetFlags( SegTargetTerminal );
setFlags( SegWeakTerminal1 ); setFlags( SegWeakTerminal1 );
segment1->setFlags( SegWeakTerminal1 );
segment2->setFlags( SegTargetTerminal );
autoSource->unsetFlags( CntWeakTerminal ); autoSource->unsetFlags( CntWeakTerminal );
dlContact2->setFlags ( CntWeakTerminal ); dlContact2->setFlags ( CntWeakTerminal );
if (autoSource->getGCell() == doglegGCell) dlContact2->migrateConstraintBox( autoSource ); if (autoSource->getGCell() == doglegGCell)
dlContact2->migrateConstraintBox( autoSource );
} else if (isWeakTerminal()) { } else if (isWeakTerminal()) {
segment1->setFlags( SegWeakTerminal1 ); segment1->setFlags( SegWeakTerminal1 );
segment2->setFlags( SegWeakTerminal1 ); segment2->setFlags( SegWeakTerminal1 );
} }
// if (isSourceTerminal()) {
// segment1->setFlags( SegWeakTerminal1 );
// segment2->setFlags( SegWeakTerminal1 );
// autoTarget->unsetFlags( CntWeakTerminal );
// dlContact1->setFlags ( CntWeakTerminal );
// if (autoTarget->getGCell() == doglegGCell)
// dlContact1->migrateConstraintBox( autoTarget );
// } else if (isTargetTerminal()) {
// unsetFlags( SegTargetTerminal );
// setFlags( SegWeakTerminal1 );
// segment1->setFlags( SegWeakTerminal1 );
// segment2->setFlags( SegTargetTerminal );
// autoSource->unsetFlags( CntWeakTerminal );
// dlContact2->setFlags ( CntWeakTerminal );
// if (autoSource->getGCell() == doglegGCell)
// dlContact2->migrateConstraintBox( autoSource );
// } else if (isWeakTerminal()) {
// segment1->setFlags( SegWeakTerminal1 );
// segment2->setFlags( SegWeakTerminal1 );
// }
if (isAnalog()) { if (isAnalog()) {
segment1->setFlags( SegAnalog ); segment1->setFlags( SegAnalog );
segment2->setFlags( SegAnalog ); segment2->setFlags( SegAnalog );
@ -811,15 +781,12 @@ namespace Anabatic {
updateNativeConstraints(); updateNativeConstraints();
segment2->updateNativeConstraints(); segment2->updateNativeConstraints();
if ( isLocal()) autoSource->setFlags( AutoContactFlag::CntHDogleg );
if (segment2->isLocal()) autoTarget->setFlags( AutoContactFlag::CntHDogleg );
if (autoTarget->canDrag() and not autoSource->canDrag()) { if (autoTarget->canDrag() and not autoSource->canDrag()) {
if (not autoTarget->getGCell()->isDevice() and (segment1->getGCell() == autoTarget->getGCell())) { if (not autoTarget->getGCell()->isDevice()) {
Interval dragConstraints = autoTarget->getNativeUConstraints(Flags::Vertical); Interval dragConstraints = autoTarget->getNativeUConstraints(Flags::Vertical);
segment1->mergeUserConstraints( dragConstraints ); segment1->mergeUserConstraints( dragConstraints );
cdebug_log(149,0) << "Perpandicular has drag constraints: " << dragConstraints << endl; cdebug_log(149,0) << "Perpandical has drag constraints: " << dragConstraints << endl;
} }
} }

View File

@ -63,15 +63,13 @@ endif ( CHECK_DETERMINISM )
NetBuilderVH.cpp NetBuilderVH.cpp
ChipTools.cpp ChipTools.cpp
LayerAssign.cpp LayerAssign.cpp
AntennaProtect.cpp
PreRouteds.cpp PreRouteds.cpp
AnabaticEngine.cpp AnabaticEngine.cpp
) )
set( pyCpps PyAnabatic.cpp set( pyCpps PyAnabatic.cpp
) )
set( depLibs ${ETESIAN_LIBRARIES} set( depLibs ${CORIOLIS_PYTHON_LIBRARIES}
${CORIOLIS_PYTHON_LIBRARIES}
${CORIOLIS_LIBRARIES} ${CORIOLIS_LIBRARIES}
${HURRICANE_PYTHON_LIBRARIES} ${HURRICANE_PYTHON_LIBRARIES}
${HURRICANE_GRAPHICAL_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES}

View File

@ -25,7 +25,6 @@
#include "hurricane/BasicLayer.h" #include "hurricane/BasicLayer.h"
#include "hurricane/RegularLayer.h" #include "hurricane/RegularLayer.h"
#include "hurricane/RoutingPad.h" #include "hurricane/RoutingPad.h"
#include "hurricane/Pin.h"
#include "hurricane/NetExternalComponents.h" #include "hurricane/NetExternalComponents.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "crlcore/Utilities.h" #include "crlcore/Utilities.h"
@ -56,7 +55,6 @@ namespace Anabatic {
using Hurricane::BasicLayer; using Hurricane::BasicLayer;
using Hurricane::RegularLayer; using Hurricane::RegularLayer;
using Hurricane::Segment; using Hurricane::Segment;
using Hurricane::Pin;
using Hurricane::Plug; using Hurricane::Plug;
using Hurricane::Path; using Hurricane::Path;
using Hurricane::Occurrence; using Hurricane::Occurrence;
@ -79,8 +77,8 @@ namespace Anabatic {
, _cg (NULL) , _cg (NULL)
, _rg (NULL) , _rg (NULL)
, _extensionCaps () , _extensionCaps ()
, _saturateRatio (Cfg::getParamPercentage("anabatic.saturateRatio",80.0)->asDouble()) , _saturateRatio (Cfg::getParamPercentage("katabatic.saturateRatio",80.0)->asDouble())
, _saturateRp (Cfg::getParamInt ("anabatic.saturateRp" ,8 )->asInt()) , _saturateRp (Cfg::getParamInt ("katabatic.saturateRp" ,8 )->asInt())
, _globalThreshold (0) , _globalThreshold (0)
, _allowedDepth (0) , _allowedDepth (0)
, _edgeLength (DbU::fromLambda(Cfg::getParamInt("anabatic.edgeLength",24)->asInt())) , _edgeLength (DbU::fromLambda(Cfg::getParamInt("anabatic.edgeLength",24)->asInt()))
@ -90,9 +88,6 @@ namespace Anabatic {
, _edgeHInc (Cfg::getParamDouble("anabatic.edgeHInc" , 1.5)->asDouble()) , _edgeHInc (Cfg::getParamDouble("anabatic.edgeHInc" , 1.5)->asDouble())
, _edgeHScaling (Cfg::getParamDouble("anabatic.edgeHScaling" , 1.0)->asDouble()) , _edgeHScaling (Cfg::getParamDouble("anabatic.edgeHScaling" , 1.0)->asDouble())
, _globalIterations(Cfg::getParamInt ("anabatic.globalIterations", 10 )->asInt()) , _globalIterations(Cfg::getParamInt ("anabatic.globalIterations", 10 )->asInt())
, _diodeName (Cfg::getParamString("etesian.diodeName" , "dio_x0")->asString() )
, _antennaGateMaxWL (Cfg::getParamInt ("etesian.antennaGateMaxWL" , 0 )->asInt())
, _antennaDiodeMaxWL(Cfg::getParamInt ("etesian.antennaDiodeMaxWL", 0 )->asInt())
{ {
GCell::setDisplayMode( Cfg::getParamEnumerate("anabatic.gcell.displayMode", GCell::Boundary)->asInt() ); GCell::setDisplayMode( Cfg::getParamEnumerate("anabatic.gcell.displayMode", GCell::Boundary)->asInt() );
@ -160,14 +155,6 @@ namespace Anabatic {
} }
} }
} }
if (_antennaGateMaxWL and not _antennaDiodeMaxWL) {
_antennaDiodeMaxWL = _antennaGateMaxWL;
cerr << Warning( "Anabatic::Configuration(): \"etesian.antennaGateMaxWL\" is defined but not \"etesian.antennaDiodeMaxWL\".\n"
" Setting both to %s"
, DbU::getValueString(_antennaGateMaxWL).c_str()
) << endl;
}
} }
@ -191,9 +178,6 @@ namespace Anabatic {
, _edgeHInc (other._edgeHInc) , _edgeHInc (other._edgeHInc)
, _edgeHScaling (other._edgeHScaling) , _edgeHScaling (other._edgeHScaling)
, _globalIterations(other._globalIterations) , _globalIterations(other._globalIterations)
, _diodeName (other._diodeName)
, _antennaGateMaxWL (other._antennaGateMaxWL)
, _antennaDiodeMaxWL(other._antennaDiodeMaxWL)
{ {
GCell::setDisplayMode( Cfg::getParamEnumerate("anabatic.gcell.displayMode", GCell::Boundary)->asInt() ); GCell::setDisplayMode( Cfg::getParamEnumerate("anabatic.gcell.displayMode", GCell::Boundary)->asInt() );
@ -302,10 +286,6 @@ namespace Anabatic {
{ return getWireWidth( getLayerDepth(layer) ); } { return getWireWidth( getLayerDepth(layer) ); }
DbU::Unit Configuration::getPWireWidth ( const Layer* layer ) const
{ return getPWireWidth( getLayerDepth(layer) ); }
Flags Configuration::getDirection ( const Layer* layer ) const Flags Configuration::getDirection ( const Layer* layer ) const
{ return getDirection( getLayerDepth(layer) ); } { return getDirection( getLayerDepth(layer) ); }
@ -357,9 +337,6 @@ namespace Anabatic {
{ return _rg->getLayerWireWidth(depth); } { return _rg->getLayerWireWidth(depth); }
DbU::Unit Configuration::getPWireWidth ( size_t depth ) const
{ return _rg->getLayerPWireWidth(depth); }
DbU::Unit Configuration::getExtensionCap ( size_t depth ) const DbU::Unit Configuration::getExtensionCap ( size_t depth ) const
{ return _extensionCaps[depth]; } { return _extensionCaps[depth]; }
@ -481,24 +458,13 @@ namespace Anabatic {
cdebug_log(112,0) << "Looking into: " << masterNet->getCell() << endl; cdebug_log(112,0) << "Looking into: " << masterNet->getCell() << endl;
for ( Component* component : masterNet->getComponents() ) { for ( Component* component : masterNet->getComponents() ) {
cdebug_log(112,0) << "@ " << component << endl; cdebug_log(112,0) << "@ " << component << endl;
if (not NetExternalComponents::isExternal(component)) { if (not NetExternalComponents::isExternal(component)) continue;
cdebug_log(112,0) << " Not an external component, skip." << endl;
continue;
}
if (dynamic_cast<Pin*>(component)) { Segment* segment = dynamic_cast<Segment*>(component);
cdebug_log(112,0) << " Pins are always considered best candidates:" << component << endl; if (not segment) continue;
bestComponent = component; if (segment->getLayer()->getMask() != metal1->getMask()) continue;
break;
}
Component* candidate = dynamic_cast<Segment*>(component); Box bb = transformation.getBox( component->getBoundingBox() );
if (not candidate
or (candidate->getLayer()->getMask() != metal1->getMask()) )
candidate = dynamic_cast<Pin*>(component);
if (not candidate) continue;
Box bb = transformation.getBox( candidate->getBoundingBox() );
DbU::Unit trackPos = 0; DbU::Unit trackPos = 0;
DbU::Unit minPos = DbU::Max; DbU::Unit minPos = DbU::Max;
DbU::Unit maxPos = DbU::Min; DbU::Unit maxPos = DbU::Min;
@ -512,8 +478,8 @@ namespace Anabatic {
maxPos = bb.getXMax(); maxPos = bb.getXMax();
cdebug_log(112,0) << "Vertical gauge: " << gauge << endl; cdebug_log(112,0) << "Vertical gauge: " << gauge << endl;
cdebug_log(112,0) << "ab.getXMin(): " << DbU::getValueString(bb.getXMin()) << endl; cdebug_log(112,0) << "ab.getXMin(): " << DbU::getValueString(ab.getXMin()) << endl;
cdebug_log(112,0) << "ab.getXMax(): " << DbU::getValueString(bb.getXMax()) << endl; cdebug_log(112,0) << "ab.getXMax(): " << DbU::getValueString(ab.getXMax()) << endl;
cdebug_log(112,0) << "bb.getCenter(): " << DbU::getValueString(bb.getCenter().getX()) << endl; cdebug_log(112,0) << "bb.getCenter(): " << DbU::getValueString(bb.getCenter().getX()) << endl;
} else { } else {
trackPos = gauge->getTrackPosition( ab.getYMin() trackPos = gauge->getTrackPosition( ab.getYMin()
@ -524,18 +490,18 @@ namespace Anabatic {
maxPos = bb.getYMax(); maxPos = bb.getYMax();
cdebug_log(112,0) << "Horizontal gauge: " << gauge << endl; cdebug_log(112,0) << "Horizontal gauge: " << gauge << endl;
cdebug_log(112,0) << "ab.getYMin(): " << DbU::getValueString(bb.getYMin()) << endl; cdebug_log(112,0) << "ab.getYMin(): " << DbU::getValueString(ab.getYMin()) << endl;
cdebug_log(112,0) << "ab.getYMax(): " << DbU::getValueString(bb.getYMax()) << endl; cdebug_log(112,0) << "ab.getYMax(): " << DbU::getValueString(ab.getYMax()) << endl;
cdebug_log(112,0) << "bb.getCenter(): " << DbU::getValueString(bb.getCenter().getY()) << endl; cdebug_log(112,0) << "bb.getCenter(): " << DbU::getValueString(bb.getCenter().getY()) << endl;
} }
cdebug_log(112,0) << "| " << occurrence.getPath() << endl; cdebug_log(112,0) << "| " << occurrence.getPath() << endl;
cdebug_log(112,0) << "| " << transformation << endl; cdebug_log(112,0) << "| " << transformation << endl;
cdebug_log(112,0) << "| " << bb << " of:" << candidate << endl; cdebug_log(112,0) << "| " << bb << " of:" << segment << endl;
cdebug_log(112,0) << "| Nearest Pos: " << DbU::getValueString(trackPos) << endl; cdebug_log(112,0) << "| Nearest Pos: " << DbU::getValueString(trackPos) << endl;
if ( (trackPos >= minPos) and (trackPos <= maxPos) ) { if ( (trackPos >= minPos) and (trackPos <= maxPos) ) {
if (not bestComponent or (bestSpan < maxPos-minPos)) { if (not bestComponent or (bestSpan > maxPos-minPos)) {
bestComponent = component; bestComponent = component;
bestSpan = maxPos - minPos; bestSpan = maxPos - minPos;
} }
@ -567,7 +533,6 @@ namespace Anabatic {
cout << " o Configuration of ToolEngine<Anabatic> for Cell <" << cell->getName() << ">" << endl; cout << " o Configuration of ToolEngine<Anabatic> for Cell <" << cell->getName() << ">" << endl;
cout << Dots::asIdentifier(" - Routing Gauge" ,getString(_rg->getName())) << endl; cout << Dots::asIdentifier(" - Routing Gauge" ,getString(_rg->getName())) << endl;
cout << Dots::asString (" - Top routing layer" ,topLayerName) << endl; cout << Dots::asString (" - Top routing layer" ,topLayerName) << endl;
cout << Dots::asUInt (" - Maximum GR iterations" ,_globalIterations) << endl;
} }
@ -599,13 +564,8 @@ namespace Anabatic {
record->add ( getSlot( "_allowedDepth", _allowedDepth ) ); record->add ( getSlot( "_allowedDepth", _allowedDepth ) );
record->add ( getSlot( "_edgeCostH" , _edgeCostH ) ); record->add ( getSlot( "_edgeCostH" , _edgeCostH ) );
record->add ( getSlot( "_edgeCostK" , _edgeCostK ) ); record->add ( getSlot( "_edgeCostK" , _edgeCostK ) );
record->add( getSlot( "_edgeHInc" , _edgeHInc ) );
record->add( getSlot( "_edgeHScaling" , _edgeHScaling ) );
record->add( getSlot( "_globalIterations", _globalIterations ) );
record->add( DbU::getValueSlot( "_antennaGateMaxWL" , &_antennaGateMaxWL ) );
record->add( DbU::getValueSlot( "_antennaDiodeMaxWL", &_antennaDiodeMaxWL ) );
return record; return ( record );
} }

View File

@ -43,7 +43,6 @@ namespace Anabatic {
const BaseFlags Flags::ChannelRow = (1L << 13); const BaseFlags Flags::ChannelRow = (1L << 13);
const BaseFlags Flags::HRailGCell = (1L << 14); const BaseFlags Flags::HRailGCell = (1L << 14);
const BaseFlags Flags::VRailGCell = (1L << 15); const BaseFlags Flags::VRailGCell = (1L << 15);
const BaseFlags Flags::GoStraight = (1L << 16);
// Flags for Edge objects states only. // Flags for Edge objects states only.
const BaseFlags Flags::NullCapacity = (1L << 5); const BaseFlags Flags::NullCapacity = (1L << 5);
const BaseFlags Flags::InfiniteCapacity = (1L << 6); const BaseFlags Flags::InfiniteCapacity = (1L << 6);
@ -54,11 +53,9 @@ namespace Anabatic {
const BaseFlags Flags::DestroyBaseContact = (1L << 8); const BaseFlags Flags::DestroyBaseContact = (1L << 8);
const BaseFlags Flags::DestroyBaseSegment = (1L << 9); const BaseFlags Flags::DestroyBaseSegment = (1L << 9);
// Flags for NetDatas objects states only. // Flags for NetDatas objects states only.
const BaseFlags Flags::GlobalFixed = (1L << 5); const BaseFlags Flags::GlobalRouted = (1L << 5);
const BaseFlags Flags::GlobalEstimated = (1L << 6); const BaseFlags Flags::GlobalEstimated = (1L << 6);
const BaseFlags Flags::GlobalRouted = (1L << 7); const BaseFlags Flags::ExcludeRoute = (1L << 7);
const BaseFlags Flags::DetailRouted = (1L << 8);
const BaseFlags Flags::ExcludeRoute = (1L << 9);
// Masks. // Masks.
const BaseFlags Flags::WestSide = Horizontal|Target; const BaseFlags Flags::WestSide = Horizontal|Target;
const BaseFlags Flags::EastSide = Horizontal|Source; const BaseFlags Flags::EastSide = Horizontal|Source;
@ -119,12 +116,6 @@ namespace Anabatic {
const BaseFlags Flags::CheckLowUpDensity = (1L << 31); const BaseFlags Flags::CheckLowUpDensity = (1L << 31);
const BaseFlags Flags::NoUpdate = (1L << 32); const BaseFlags Flags::NoUpdate = (1L << 32);
const BaseFlags Flags::NorthPath = (1L << 33); const BaseFlags Flags::NorthPath = (1L << 33);
const BaseFlags Flags::UseNonPref = (1L << 34);
const BaseFlags Flags::Force = (1L << 35);
const BaseFlags Flags::LayerCapOnly = (1L << 36);
const BaseFlags Flags::NoMinLength = (1L << 37);
const BaseFlags Flags::NoSegExt = (1L << 38);
const BaseFlags Flags::NullLength = (1L << 39);
Flags::~Flags () Flags::~Flags ()
@ -178,7 +169,6 @@ namespace Anabatic {
return s.str(); return s.str();
} }
string Flags::_getTypeName () const string Flags::_getTypeName () const
{ return "Anabatic::Flags"; } { return "Anabatic::Flags"; }
@ -193,13 +183,12 @@ namespace Anabatic {
s += (_flags & (uint64_t)DeviceGCell ) ? 'd' : '-'; s += (_flags & (uint64_t)DeviceGCell ) ? 'd' : '-';
s += (_flags & (uint64_t)HChannelGCell) ? 'c' : '-'; s += (_flags & (uint64_t)HChannelGCell) ? 'c' : '-';
s += (_flags & (uint64_t)VChannelGCell) ? 'c' : '-'; s += (_flags & (uint64_t)VChannelGCell) ? 'c' : '-';
s += (_flags & (uint64_t)HRailGCell ) ? 'H' : '-'; s += (_flags & (uint64_t)HRailGCell ) ? 'r' : '-';
s += (_flags & (uint64_t)VRailGCell ) ? 'V' : '-'; s += (_flags & (uint64_t)VRailGCell ) ? 'r' : '-';
s += (_flags & (uint64_t)StrutGCell ) ? 'S' : '-'; s += (_flags & (uint64_t)StrutGCell ) ? 's' : '-';
s += (_flags & (uint64_t)MatrixGCell ) ? 'M' : '-'; s += (_flags & (uint64_t)MatrixGCell ) ? 'm' : '-';
s += (_flags & (uint64_t)StdCellRow ) ? 'R' : '-'; s += (_flags & (uint64_t)StdCellRow ) ? 'S' : '-';
s += (_flags & (uint64_t)ChannelRow ) ? 'C' : '-'; s += (_flags & (uint64_t)ChannelRow ) ? 'C' : '-';
s += (_flags & (uint64_t)GoStraight ) ? 'g' : '-';
s += ","; s += ",";
s += (_flags & (uint64_t)Invalidated ) ? 'i' : '-'; s += (_flags & (uint64_t)Invalidated ) ? 'i' : '-';
s += (_flags & (uint64_t)DestroyGCell ) ? 'D' : '-'; s += (_flags & (uint64_t)DestroyGCell ) ? 'D' : '-';

View File

@ -19,7 +19,6 @@
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Net.h" #include "hurricane/Net.h"
#include "hurricane/Pin.h"
#include "hurricane/RoutingPad.h" #include "hurricane/RoutingPad.h"
#include "hurricane/Horizontal.h" #include "hurricane/Horizontal.h"
#include "hurricane/Vertical.h" #include "hurricane/Vertical.h"
@ -43,7 +42,6 @@ namespace Anabatic {
using Hurricane::Error; using Hurricane::Error;
using Hurricane::Warning; using Hurricane::Warning;
using Hurricane::Component; using Hurricane::Component;
using Hurricane::Pin;
using Hurricane::Segment; using Hurricane::Segment;
using Hurricane::Horizontal; using Hurricane::Horizontal;
using Hurricane::Vertical; using Hurricane::Vertical;
@ -300,68 +298,52 @@ namespace Anabatic {
GCell* c2 = v2->getGCell(); GCell* c2 = v2->getGCell();
// Check from GCell 1 // Check from GCell 1
if ( c1->isNorth(c2) and not v1->isNRestricted() ) restricted = false; if ( c1->isNorth(c2) ) {
else if ( c1->isSouth(c2) and not v1->isSRestricted() ) restricted = false; if ( !v1->isNRestricted() ) restricted = false;
else if ( c1->isEast (c2) and not v1->isERestricted() ) restricted = false; } else if ( c1->isSouth(c2) ) {
else if ( c1->isWest (c2) and not v1->isWRestricted() ) restricted = false; if ( !v1->isSRestricted() ) restricted = false;
// else { } else if ( c1->isEast (c2) ) {
// cerr << Error( "Vertex::isRestricted(): Vertexes/GCells v1 & v2 do not share a side.\n" if ( !v1->isERestricted() ) restricted = false;
// " v1:%s\n" } else if ( c1->isWest (c2) ) {
// " v2:%s" if ( !v1->isWRestricted() ) restricted = false;
// , getString(v1).c_str() } else {
// , getString(v2).c_str() cerr << Error( "GCells are not side by side." ) << endl;
// ) << endl;
// return true;
// }
if (restricted) {
cdebug_log(112,0) << "v1 -> v2 edge is restricted." << endl;
return true;
}
if ( e->isVertical() and (c1->getWidth() < hpitch) ) {
cdebug_log(112,0) << "GCell 1 is too narrow for V edges." << endl;
return true;
}
if ( e->isHorizontal() and (c1->getHeight() < vpitch) ) {
cdebug_log(112,0) << "GCell 1 is too narrow for H edges." << endl;
return true; return true;
} }
if ( (c1->getWidth() < hpitch)
||(c1->getHeight() < vpitch)
||(restricted)
) return true;
else {
restricted = true; restricted = true;
// Check from GCell 2 // Check from GCell 2
if ( c2->isNorth(c1) and not v2->isNRestricted() ) restricted = false; if ( c2->isNorth(c1) ) {
else if ( c2->isSouth(c1) and not v2->isSRestricted() ) restricted = false; if ( !v2->isNRestricted() ) restricted = false;
else if ( c2->isEast (c1) and not v2->isERestricted() ) restricted = false; } else if ( c2->isSouth(c1) ) {
else if ( c2->isWest (c1) and not v2->isWRestricted() ) restricted = false; if ( !v2->isSRestricted() ) restricted = false;
// else { } else if ( c2->isEast (c1) ) {
// cerr << Error( "Vertex::isRestricted(): Vertexes/GCells v1 & v2 do not share a side.\n" if ( !v2->isERestricted() ) restricted = false;
// " v1:%s\n" } else if ( c2->isWest (c1) ) {
// " v2:%s" if ( !v2->isWRestricted() ) restricted = false;
// , getString(v1).c_str() } else {
// , getString(v2).c_str() cerr << Error( "GCells are not side by side." ) << endl;
// ) << endl;
// return true;
// }
if (restricted) {
cdebug_log(112,0) << "v2 -> v1 edge is restricted." << endl;
return true; return true;
} }
if ( e->isVertical() and (c2->getWidth() < hpitch) ) { if ( (c2->getWidth() < hpitch)
cdebug_log(112,0) << "GCell 2 is too narrow for V edges." << endl; ||(c2->getHeight() < vpitch)
return true; ||(restricted)
} ) return true;
if ( e->isHorizontal() and (c2->getHeight() < vpitch) ) { else {
cdebug_log(112,0) << "GCell 2 is too narrow for H edges." << endl; if ((v2->getGCell()->isStrut())){
return true; if (e->isMaxCapacity(net)) {
}
if ( v2->getGCell()->isStrut() and e->isMaxCapacity(net) ) {
cdebug_log(112,0) << "Overcapacity:" << e << endl; cdebug_log(112,0) << "Overcapacity:" << e << endl;
return true; return true;
} }
else return false;
return false; } else return false;
}
}
} }
@ -1459,10 +1441,6 @@ namespace Anabatic {
} }
DbU::Unit Dijkstra::getAntennaGateMaxWL () const
{ return _anabatic->getAntennaGateMaxWL(); }
Point Dijkstra::_getPonderedPoint() const Point Dijkstra::_getPonderedPoint() const
{ {
vector<RoutingPad*> rps; vector<RoutingPad*> rps;
@ -1484,48 +1462,6 @@ namespace Anabatic {
} }
void Dijkstra::loadFixedGlobal ( Net* net )
{
NetData* netData = _anabatic->getNetData( net );
netData->setGlobalRouted( true );
netData->setGlobalFixed ( true );
for ( Component* component : net->getComponents() ) {
Horizontal* horizontal = dynamic_cast<Horizontal*>( component );
if (horizontal) {
if (not Session::isGLayer(horizontal->getLayer())) {
cerr << Error( "Dijsktra::loadFixedGlobal(): A component of \"%s\" has not a global layer.\n"
" (%s)"
, getString(net->getName()).c_str()
, getString(component).c_str()
) << endl;
continue;
}
GCell* begin = _anabatic->getGCellUnder( horizontal->getSource()->getPosition() );
GCell* end = _anabatic->getGCellUnder( horizontal->getTarget()->getPosition() );
for ( Edge* edge : _anabatic->getEdgesUnderPath(begin,end) )
edge->add( horizontal );
}
Vertical* vertical = dynamic_cast<Vertical*>( component );
if (vertical) {
if (not Session::isGLayer(vertical->getLayer())) {
cerr << Error( "Dijsktra::loadFixedGlobal(): A component of \"%s\" has not a global layer.\n"
" (%s)"
, getString(net->getName()).c_str()
, getString(component).c_str()
) << endl;
continue;
}
GCell* begin = _anabatic->getGCellUnder( vertical->getSource()->getPosition() );
GCell* end = _anabatic->getGCellUnder( vertical->getTarget()->getPosition() );
for ( Edge* edge : _anabatic->getEdgesUnderPath(begin,end,Flags::NorthPath) )
edge->add( vertical );
}
}
}
void Dijkstra::load ( Net* net ) void Dijkstra::load ( Net* net )
{ {
_cleanup(); _cleanup();
@ -1543,7 +1479,6 @@ namespace Anabatic {
if (state->isSelfSym()) { if (state->isSelfSym()) {
cdebug_log(112,0) << "Dijkstra::SELF SYMMETRY CASE " << DbU::getValueString(state->getSymAxis()) << endl; cdebug_log(112,0) << "Dijkstra::SELF SYMMETRY CASE " << DbU::getValueString(state->getSymAxis()) << endl;
} }
state->unsetFlags( NetRoutingState::HasAntenna );
} }
for ( Component* component : _net->getComponents() ) { for ( Component* component : _net->getComponents() ) {
@ -1553,15 +1488,12 @@ namespace Anabatic {
cdebug_log(112,0) << "@ frp:" << rp << endl; cdebug_log(112,0) << "@ frp:" << rp << endl;
rps.push_back( rp ); rps.push_back( rp );
continue;
} }
} }
if (rps.size() < 2) { if (rps.size() < 2) return;
cdebug_tabw(112,-1);
return;
}
uint32_t driverCount = 0;
for ( auto rp : rps ) { for ( auto rp : rps ) {
if (not _anabatic->getConfiguration()->selectRpComponent(rp)) if (not _anabatic->getConfiguration()->selectRpComponent(rp))
cerr << Warning( "Dijktra::load(): %s has no components on grid.", getString(rp).c_str() ) << endl; cerr << Warning( "Dijktra::load(): %s has no components on grid.", getString(rp).c_str() ) << endl;
@ -1570,12 +1502,11 @@ namespace Anabatic {
Point center = rp->getBoundingBox().getCenter(); Point center = rp->getBoundingBox().getCenter();
GCell* gcell = _anabatic->getGCellUnder( center ); GCell* gcell = _anabatic->getGCellUnder( center );
Box bb = rp->getBoundingBox(); Box bb = rp->getBoundingBox();
bool isDriver = false;
cdebug_log(112,0) << bb.getXMin() << " " << bb.getXMax() << endl; cdebug_log(112,0) << bb.getXMin() << " " << bb.getXMax() << endl;
cdebug_log(112,0) << "center X:" << center.getX() << " gcell Xmax:" << gcell->getXMax() << endl; cdebug_log(112,0) << "center X:" << center.getX() << " gcell Xmax:" << gcell->getXMax() << endl;
if (state and state->isSymmetric()) _limitSymSearchArea( rp ); _limitSymSearchArea(rp); // ANALOG
if (not gcell) { if (not gcell) {
cerr << Error( "Dijkstra::load(): %s\n" cerr << Error( "Dijkstra::load(): %s\n"
@ -1588,29 +1519,6 @@ namespace Anabatic {
continue; continue;
} }
Net* rpNet = NULL;
Plug* plug = dynamic_cast<Plug*>( rp->getPlugOccurrence().getEntity() );
if (plug) {
rpNet = plug->getMasterNet();
if (rpNet->getDirection() & Net::Direction::DirOut) {
cdebug_log(112,0) << "Driver/cell: " << rp << endl;
cdebug_log(112,0) << "masterNet: " << rpNet << endl;
++driverCount;
isDriver = true;
}
} else {
Pin* pin = dynamic_cast<Pin*>( rp->getPlugOccurrence().getEntity() );
if (pin) {
rpNet = pin->getNet();
if (rpNet->getDirection() & Net::Direction::DirIn) {
cdebug_log(112,0) << "Driver/pin: " << rp << endl;
cdebug_log(112,0) << "masterNet: " << rpNet << endl;
++driverCount;
isDriver = true;
}
}
}
_searchArea.merge( gcell->getBoundingBox() ); // TO CHANGE _searchArea.merge( gcell->getBoundingBox() ); // TO CHANGE
cdebug_log(112,0) << "| Merged search area: " << _searchArea << ", gcell: " << gcell << endl; cdebug_log(112,0) << "| Merged search area: " << _searchArea << ", gcell: " << gcell << endl;
@ -1627,7 +1535,6 @@ namespace Anabatic {
++_connectedsId; ++_connectedsId;
for ( Vertex* vertex : connecteds ) { for ( Vertex* vertex : connecteds ) {
vertex->getGCell()->flags().reset( Flags::GoStraight );
vertex->setDistance ( Vertex::unreached ); vertex->setDistance ( Vertex::unreached );
vertex->setStamp ( _stamp ); vertex->setStamp ( _stamp );
vertex->setConnexId ( _connectedsId ); vertex->setConnexId ( _connectedsId );
@ -1635,8 +1542,6 @@ namespace Anabatic {
vertex->setDegree ( 0 ); vertex->setDegree ( 0 );
vertex->setRpCount ( 0 ); vertex->setRpCount ( 0 );
vertex->setFrom ( NULL ); vertex->setFrom ( NULL );
if (isDriver)
vertex->setDriver( true );
vertex->setFrom2 ( NULL); vertex->setFrom2 ( NULL);
vertex->unsetFlags ( Vertex::UseFromFrom2 ); vertex->unsetFlags ( Vertex::UseFromFrom2 );
@ -1662,45 +1567,6 @@ namespace Anabatic {
rp->getBodyHook()->attach( vcontact->getBodyHook() ); rp->getBodyHook()->attach( vcontact->getBodyHook() );
} }
if (driverCount == 0) {
cerr << Error( "Diskstra::load(): Net \"%s\" do not have a driver.\n"
, getString(_net->getName()).c_str()
) << endl;
}
if (driverCount > 1) {
cerr << Error( "Diskstra::load(): Net \"%s\" have multiple drivers (%u).\n"
, getString(_net->getName()).c_str(), driverCount
) << endl;
}
if (state and state->isSymmetric() and not state->isSelfSym() and state->isSymMaster()) {
if (state->isSymVertical()) {
if ( (_searchArea.getXMin() < state->getSymAxis())
and (_searchArea.getXMax() > state->getSymAxis()) ) {
cerr << Error( "Diskstra::load(): For net \"%s\" (paired with \"%s\"),\n"
" Vertical symmetry axis @%s is inside the net area %s."
, getString(_net->getName()).c_str()
, getString(state->getSymNet()->getName()).c_str()
, DbU::getValueString(state->getSymAxis()).c_str()
, getString(_searchArea).c_str()
) << endl;
}
}
if (state->isSymHorizontal()) {
if ( (_searchArea.getYMin() < state->getSymAxis())
and (_searchArea.getYMax() > state->getSymAxis()) ) {
cerr << Error( "Diskstra::load(): For net \"%s\" (paired with \"%s\"),\n"
" Horizontal symmetry axis @%s is inside the net area %s."
, getString(_net->getName()).c_str()
, getString(state->getSymNet()->getName()).c_str()
, DbU::getValueString(state->getSymAxis()).c_str()
, getString(_searchArea).c_str()
) << endl;
}
}
}
_searchArea.inflate( _searchAreaHalo ); _searchArea.inflate( _searchAreaHalo );
cdebug_log(112,0) << "Search halo: " << DbU::getValueString(_searchAreaHalo) << endl; cdebug_log(112,0) << "Search halo: " << DbU::getValueString(_searchAreaHalo) << endl;
cdebug_log(112,0) << "Search area: " << _searchArea << endl; cdebug_log(112,0) << "Search area: " << _searchArea << endl;
@ -1850,14 +1716,7 @@ namespace Anabatic {
} }
Vertex* firstSource = NULL; Vertex* firstSource = NULL;
VertexSet drivers;
for ( Vertex* vertex : _targets ) {
if (vertex->isDriver()) drivers.insert( vertex );
}
if (drivers.empty()) drivers = _targets;
#if THIS_IS_DISABLED
if (_mode & Mode::Monotonic) { if (_mode & Mode::Monotonic) {
if (_targets.size() == 2) { if (_targets.size() == 2) {
auto ivertex = _targets.begin(); auto ivertex = _targets.begin();
@ -1874,25 +1733,24 @@ namespace Anabatic {
_mode = Mode::Standart; _mode = Mode::Standart;
} }
} }
#endif
if (not firstSource) { if (not firstSource) {
// Standart routing. // Standart routing.
bool hasDevice = false; bool hasDevice = false;
for ( Vertex* vertex : drivers ) { for ( Vertex* ivertex : _targets ) {
if (vertex->getGCell()->isDevice()) hasDevice = true; if (ivertex->getGCell()->isDevice()) hasDevice = true;
} }
Point areaCenter; Point areaCenter;
if (hasDevice) areaCenter = _getPonderedPoint(); if (hasDevice) areaCenter = _getPonderedPoint();
else areaCenter = _searchArea.getCenter(); else areaCenter = _searchArea.getCenter();
auto ivertex = drivers.begin(); auto ivertex = _targets.begin();
firstSource = *ivertex++; firstSource = *ivertex++;
DbU::Unit minDistance = areaCenter.manhattanDistance( firstSource->getCenter() ); DbU::Unit minDistance = areaCenter.manhattanDistance( firstSource->getCenter() );
for ( ; ivertex != drivers.end() ; ++ivertex ) { for ( ; ivertex != _targets.end() ; ++ivertex ) {
DbU::Unit distance = areaCenter.manhattanDistance( (*ivertex)->getCenter() ); DbU::Unit distance = areaCenter.manhattanDistance( (*ivertex)->getCenter() );
if (distance < minDistance) { if (distance < minDistance) {
minDistance = distance; minDistance = distance;
@ -2201,7 +2059,6 @@ namespace Anabatic {
if (_sources.size() < 2) { cdebug_tabw(112,-1); return; } if (_sources.size() < 2) { cdebug_tabw(112,-1); return; }
DbU::Unit gWL = 0;
NetRoutingState* state = NetRoutingExtension::get( _net ); NetRoutingState* state = NetRoutingExtension::get( _net );
//cerr << "state: " << state << endl; //cerr << "state: " << state << endl;
@ -2292,8 +2149,6 @@ namespace Anabatic {
, constraint.getCenter() , constraint.getCenter()
, width , width
); );
gWL += segment->getLength();
cdebug_log(112,0) << "| ref: " << segment << endl;
for ( Edge* through : aligneds ) through->add( segment ); for ( Edge* through : aligneds ) through->add( segment );
if (state) { if (state) {
@ -2312,8 +2167,6 @@ namespace Anabatic {
, constraint.getCenter() , constraint.getCenter()
, width , width
); );
gWL += segment->getLength();
cdebug_log(112,0) << "| ref: " << segment << endl;
for ( Edge* through : aligneds ) through->add( segment ); for ( Edge* through : aligneds ) through->add( segment );
if (state) { if (state) {
@ -2330,14 +2183,6 @@ namespace Anabatic {
} }
} }
if (gWL > getAntennaGateMaxWL()) {
cdebug_log(113,0) << "| \"" << _net->getName() << "\" may have antenna effect, "
<< DbU::getValueString(gWL)
<< endl;
if (state)
state->setFlags( NetRoutingState::HasAntenna );
}
cdebug_tabw(112,-1); cdebug_tabw(112,-1);
} }
@ -2484,66 +2329,51 @@ namespace Anabatic {
void Dijkstra::_createSelfSymSeg ( Segment* segment ) void Dijkstra::_createSelfSymSeg ( Segment* segment )
{ {
cdebug_log(112,1) << "Dijkstra::_createSelfSymSeg(): " << segment << endl; cdebug_log(112,0) << "void Dijkstra::_createSelfSymSeg ( Segment* segment ): " << _net << ", seg: " << segment << endl;
NetRoutingState* state = NetRoutingExtension::get( _net ); NetRoutingState* state = NetRoutingExtension::get( _net );
if (state and segment) { //cdebug_log(112,0) << "state: " << state << endl;
if ((state != NULL)&&(segment!=NULL)){
Horizontal* h = dynamic_cast<Horizontal*>(segment); Horizontal* h = dynamic_cast<Horizontal*>(segment);
Vertical* v = dynamic_cast<Vertical*>(segment); Vertical* v = dynamic_cast<Vertical*>(segment);
Point sp; Point sp, tp;
Point tp;
DbU::Unit axis; DbU::Unit axis;
Component* sourceContact = segment->getSource(); Component* sourceContact = segment->getSource();
Component* targetContact = segment->getTarget(); Component* targetContact = segment->getTarget();
cdebug_log(112,0) << "source: " << sourceContact << endl;
cdebug_log(112,0) << "target: " << targetContact << endl;
cdebug_log(112,0) << "sym axis: " << DbU::getValueString(state->getSymAxis()) << endl;
if (h){ if (h){
if (state->isSymHorizontal()){ if (state->isSymHorizontal()){
cdebug_log(112,0) << "Horizontal + Horizontal symmetry." << endl; cdebug_log(112,0) << "H case Horizontal" << endl;
sp = Point(sourceContact->getX(), state->getSymValue(sourceContact->getY()) ); sp = Point(sourceContact->getX(), state->getSymValue(sourceContact->getY()) );
tp = Point(targetContact->getX(), state->getSymValue(targetContact->getY()) ); tp = Point(targetContact->getX(), state->getSymValue(targetContact->getY()) );
axis = state->getSymValue(segment->getY()); axis = state->getSymValue(segment->getY());
} else if (state->isSymVertical()){ } else if (state->isSymVertical()){
cdebug_log(112,0) << "Horizontal + Vertical symmetry." << endl; cdebug_log(112,0) << "H case Vertical" << endl;
sp = Point( state->getSymValue(targetContact->getX()), targetContact->getY() ); sp = Point( state->getSymValue(targetContact->getX()), targetContact->getY() );
tp = Point( state->getSymValue(sourceContact->getX()), sourceContact->getY() ); tp = Point( state->getSymValue(sourceContact->getX()), sourceContact->getY() );
axis = segment->getY(); axis = segment->getY();
} else { } else {
cdebug_log(112,0) << "Dijkstra::_materialize(): Horizontal + Unknown symmetry. " << endl; cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong here. " << endl;
cdebug_tabw(112,-1);
return; return;
} }
//cerr << "sp: " << sp << endl;
cdebug_log(112,0) << "sp: " << sp << endl; //cerr << "tp: " << tp << endl;
cdebug_log(112,0) << "tp: " << tp << endl;
GCell* sgcell = _anabatic->getGCellUnder( sp ); GCell* sgcell = _anabatic->getGCellUnder( sp );
GCell* tgcell = _anabatic->getGCellUnder( tp ); GCell* tgcell = _anabatic->getGCellUnder( tp );
//cerr << "Gcell: " << sgcell << endl;
cdebug_log(112,0) << "GCell: " << sgcell << endl; //cerr << "Gcell: " << tgcell << endl;
cdebug_log(112,0) << "GCell: " << tgcell << endl;
Vertex* svertex = sgcell->getObserver<Vertex>(GCell::Observable::Vertex); Vertex* svertex = sgcell->getObserver<Vertex>(GCell::Observable::Vertex);
Vertex* tvertex = tgcell->getObserver<Vertex>(GCell::Observable::Vertex); Vertex* tvertex = tgcell->getObserver<Vertex>(GCell::Observable::Vertex);
Contact* sourceSym = NULL; Contact* sourceSym = NULL;
Contact* targetSym = NULL; Contact* targetSym = NULL;
if (state->isSelfSym()){ if (state->isSelfSym()){
cdebug_log(112,0) << "Symmetrical to myself (isSelfSym)." << endl; cdebug_log(112,0) << "isSelfSym" << endl;
sourceSym = svertex->getGContact( _net ); sourceSym = svertex->getGContact( _net );
targetSym = tvertex->getGContact( _net ); targetSym = tvertex->getGContact( _net );
} else if (state->isSymMaster()){ } else if (state->isSymMaster()){
cdebug_log(112,0) << "Symmetrical to (isSymPair): " << state->getSymNet() << endl; cdebug_log(112,0) << "isSymPair: " << state->getSymNet() << endl;
sourceSym = svertex->getGContact( state->getSymNet() ); sourceSym = svertex->getGContact( state->getSymNet() );
targetSym = tvertex->getGContact( state->getSymNet() ); targetSym = tvertex->getGContact( state->getSymNet() );
} else { } else {
cdebug_log(112,0) << "Dijkstra::_materialize(): Unknown Net pairing symmetry. " << endl; cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong with the symmetry. " << endl;
cdebug_tabw(112,-1);
return; return;
} }
@ -2555,7 +2385,7 @@ namespace Anabatic {
, axis , axis
, state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL2")) , state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL2"))
); );
cdebug_log(112,0) << "| dup:" << segment2 << endl; cdebug_log(112,0) << "|| " << segment2 << endl;
} else if (v) { } else if (v) {
if (state->isSymVertical()){ if (state->isSymVertical()){
//cerr << "V case Vertical" << endl; //cerr << "V case Vertical" << endl;
@ -2569,7 +2399,6 @@ namespace Anabatic {
axis = segment->getX(); axis = segment->getX();
} else { } else {
cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong here. " << endl; cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong here. " << endl;
cdebug_tabw(112,-1);
return; return;
} }
GCell* sgcell = _anabatic->getGCellUnder( sp ); GCell* sgcell = _anabatic->getGCellUnder( sp );
@ -2586,7 +2415,6 @@ namespace Anabatic {
targetSym = tvertex->getGContact( state->getSymNet() ); targetSym = tvertex->getGContact( state->getSymNet() );
} else { } else {
cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong with the symmetry. " << endl; cdebug_log(112,0) << "Dijkstra::_materialize(): Something is wrong with the symmetry. " << endl;
cdebug_tabw(112,-1);
return; return;
} }
@ -2601,7 +2429,6 @@ namespace Anabatic {
cdebug_log(112,0) << "|| " << segment2 << endl; cdebug_log(112,0) << "|| " << segment2 << endl;
} }
} }
cdebug_tabw(112,-1);
} }

View File

@ -29,31 +29,16 @@ namespace {
using namespace std; using namespace std;
using namespace Hurricane; using namespace Hurricane;
using Anabatic::NetData;
using Anabatic::AnabaticEngine;
class SortSegmentByLength { class SortSegmentByLength {
public: public:
inline SortSegmentByLength ( AnabaticEngine* );
inline bool operator() ( const Segment*, const Segment* ); inline bool operator() ( const Segment*, const Segment* );
private:
AnabaticEngine* _anabatic;
}; };
inline SortSegmentByLength::SortSegmentByLength ( AnabaticEngine* anabatic )
: _anabatic(anabatic)
{ }
inline bool SortSegmentByLength::operator() ( const Segment* lhs, const Segment* rhs ) inline bool SortSegmentByLength::operator() ( const Segment* lhs, const Segment* rhs )
{ {
NetData* lhsNData = _anabatic->getNetData( lhs->getNet() );
NetData* rhsNData = _anabatic->getNetData( rhs->getNet() );
if (lhsNData->isGlobalFixed() and not rhsNData->isGlobalFixed()) return true;
if (rhsNData->isGlobalFixed() and not lhsNData->isGlobalFixed()) return false;
DbU::Unit delta = rhs->getLength() - lhs->getLength(); DbU::Unit delta = rhs->getLength() - lhs->getLength();
if (delta > 0) return true; if (delta > 0) return true;
if (delta < 0) return false; if (delta < 0) return false;
@ -371,15 +356,15 @@ namespace Anabatic {
size_t Edge::ripup () size_t Edge::ripup ()
{ {
AnabaticEngine* anabatic = getAnabatic(); AnabaticEngine* anabatic = getAnabatic();
DbU::Unit globalThreshold = Session::getSliceHeight()*3;
size_t netCount = 0; size_t netCount = 0;
sort( _segments.begin(), _segments.end(), SortSegmentByLength(anabatic) ); sort( _segments.begin(), _segments.end(), SortSegmentByLength() );
if (Session::getRoutingGauge()->isTwoMetals()) { if (Session::getRoutingGauge()->isTwoMetals()) {
for ( size_t i=0 ; i<_segments.size() ; ) { for ( size_t i=0 ; i<_segments.size() ; ) {
if (not isEnding(_segments[i])) { if (not isEnding(_segments[i])) {
NetData* netData = anabatic->getNetData( _segments[i]->getNet() ); NetData* netData = anabatic->getNetData( _segments[i]->getNet() );
if (netData->isGlobalFixed ()) break;
if (netData->isGlobalRouted()) ++netCount; if (netData->isGlobalRouted()) ++netCount;
anabatic->ripup( _segments[i], Flags::Propagate ); anabatic->ripup( _segments[i], Flags::Propagate );
continue; continue;
@ -390,12 +375,10 @@ namespace Anabatic {
size_t truncate = (size_t)( (getCapacity()*2) / 3 ); size_t truncate = (size_t)( (getCapacity()*2) / 3 );
while ( _segments.size() > truncate ) { while ( _segments.size() > truncate ) {
NetData* netData = anabatic->getNetData( _segments[truncate]->getNet() ); NetData* netData = anabatic->getNetData( _segments[truncate]->getNet() );
if (netData->isGlobalFixed ()) break;
if (netData->isGlobalRouted()) ++netCount; if (netData->isGlobalRouted()) ++netCount;
anabatic->ripup( _segments[truncate], Flags::Propagate ); anabatic->ripup( _segments[truncate], Flags::Propagate );
} }
// DbU::Unit globalThreshold = Session::getSliceHeight()*3;
// for ( size_t i=0 ; i<_segments.size() ; ) { // for ( size_t i=0 ; i<_segments.size() ; ) {
// if (_segments[i]->getLength() >= globalThreshold) { // if (_segments[i]->getLength() >= globalThreshold) {
// NetData* netData = anabatic->getNetData( _segments[i]->getNet() ); // NetData* netData = anabatic->getNetData( _segments[i]->getNet() );

View File

@ -298,7 +298,6 @@ namespace Anabatic {
, _contacts () , _contacts ()
, _depth (Session::getRoutingGauge()->getDepth()) , _depth (Session::getRoutingGauge()->getDepth())
, _pinDepth (0) , _pinDepth (0)
, _rpCount (0)
, _blockages (new DbU::Unit [_depth]) , _blockages (new DbU::Unit [_depth])
, _cDensity (0.0) , _cDensity (0.0)
, _densities (new float [_depth]) , _densities (new float [_depth])
@ -306,7 +305,6 @@ namespace Anabatic {
, _fragmentations(new float [_depth]) , _fragmentations(new float [_depth])
, _globalsCount (new float [_depth]) , _globalsCount (new float [_depth])
, _key (this,1) , _key (this,1)
, _lastClonedKey (NULL)
{ {
if (not _matrixHSide) { if (not _matrixHSide) {
_matrixVSide = Session::getSliceHeight(); _matrixVSide = Session::getSliceHeight();
@ -476,26 +474,6 @@ namespace Anabatic {
} }
bool GCell::hasNet ( const Net* net ) const
{
if (hasGContact(net)) return true;
for ( Edge* edge : _eastEdges ) {
for ( Segment* segment : edge->getSegments() ) {
if (segment->getNet() == net) return true;
}
}
for ( Edge* edge : _northEdges ) {
for ( Segment* segment : edge->getSegments() ) {
if (segment->getNet() == net) return true;
}
}
return false;
}
Contact* GCell::hasGContact ( const Contact* owned ) const Contact* GCell::hasGContact ( const Contact* owned ) const
{ {
for ( Contact* contact : _gcontacts ) { for ( Contact* contact : _gcontacts ) {
@ -528,22 +506,6 @@ namespace Anabatic {
} }
Segment* GCell::hasGoThrough ( Net* net ) const
{
for ( Edge* edge : _eastEdges ) {
for ( Segment* segment : edge->getSegments() ) {
if (segment->getNet() == net) return segment;
}
}
for ( Edge* edge : _northEdges ) {
for ( Segment* segment : edge->getSegments() ) {
if (segment->getNet() == net) return segment;
}
}
return NULL;
}
Edge* GCell::getEdgeTo ( GCell* neighbor, Flags sideHint ) const Edge* GCell::getEdgeTo ( GCell* neighbor, Flags sideHint ) const
{ {
for ( Edge* edge : getEdges(sideHint) ) { for ( Edge* edge : getEdges(sideHint) ) {
@ -1253,7 +1215,7 @@ namespace Anabatic {
int GCell::getCapacity ( size_t depth ) const int GCell::getCapacity ( size_t depth ) const
{ {
const vector<Edge*>* edges = NULL; const vector<Edge*>* edges = NULL;
if (isHorizontalPlane(depth)) edges = (_eastEdges .empty()) ? &_westEdges : &_eastEdges; if (isHorizontalPlane(depth)) edges = (_eastEdges .empty()) ? &_westEdges : &_westEdges;
else edges = (_northEdges.empty()) ? &_southEdges : &_northEdges; else edges = (_northEdges.empty()) ? &_southEdges : &_northEdges;
int capacity = 0; int capacity = 0;
@ -1349,7 +1311,7 @@ namespace Anabatic {
_blockages[depth] += length; _blockages[depth] += length;
_flags |= Flags::Invalidated; _flags |= Flags::Invalidated;
cdebug_log(149,0) << "GCell::addBlockage() " << this << " " cdebug_log(149,0) << "GCell:addBlockage() " << this << " "
<< depth << ":" << DbU::getValueString(_blockages[depth]) << endl; << depth << ":" << DbU::getValueString(_blockages[depth]) << endl;
} }
@ -1383,17 +1345,11 @@ namespace Anabatic {
size_t begin = 0; size_t begin = 0;
for ( ; begin < end ; begin++ ) { for ( ; begin < end ; begin++ ) {
if (not _hsegments[begin])
cerr << Bug( "GCell::removeHSegment(): In %s, NULL segment at [%u/%u]."
, _getString().c_str(), begin, _hsegments.size() ) << endl;
if (_hsegments[begin] == segment) std::swap( _hsegments[begin], _hsegments[--end] ); if (_hsegments[begin] == segment) std::swap( _hsegments[begin], _hsegments[--end] );
cdebug_log(9000,0) << "GCell::removeHSegment() " << this << endl;
cdebug_log(9000,0) << " " << segment << endl;
} }
if (_hsegments.size() == end) { if (_hsegments.size() == end) {
cerr << Bug( "GCell::removeHSegment(): %s do not go through %s." cerr << Bug( "%s do not go through %s."
, getString(segment).c_str(), _getString().c_str() ) << endl; , getString(segment).c_str(), _getString().c_str() ) << endl;
return; return;
} }
@ -1441,6 +1397,11 @@ namespace Anabatic {
_flags.reset( Flags::Saturated ); _flags.reset( Flags::Saturated );
for ( size_t i=0 ; i<_vsegments.size() ; i++ ) {
if ( _vsegments[i] == NULL )
cerr << "NULL Autosegment at index " << i << endl;
}
sort( _hsegments.begin(), _hsegments.end(), AutoSegment::CompareByDepthLength() ); sort( _hsegments.begin(), _hsegments.end(), AutoSegment::CompareByDepthLength() );
sort( _vsegments.begin(), _vsegments.end(), AutoSegment::CompareByDepthLength() ); sort( _vsegments.begin(), _vsegments.end(), AutoSegment::CompareByDepthLength() );
@ -1527,14 +1488,7 @@ namespace Anabatic {
} }
// Add the blockages. // Add the blockages.
for ( size_t i=0 ; i<_depth ; i++ ) { for ( size_t i=0 ; i<_depth ; i++ ) uLengths2[i] += _blockages[i];
uLengths2[i] += _blockages[i];
if (not i) continue;
if ((float)(_blockages[i] * Session::getPitch(i)) > 0.40*(float)(width*height)) {
flags() |= Flags::GoStraight;
//cerr << "| Set GoStraight on " << this << endl;
}
}
// Compute the number of non pass-through tracks. // Compute the number of non pass-through tracks.
if (not processeds.empty()) { if (not processeds.empty()) {
@ -1544,8 +1498,7 @@ namespace Anabatic {
size_t depth = Session::getRoutingGauge()->getLayerDepth(layer); size_t depth = Session::getRoutingGauge()->getLayerDepth(layer);
size_t count = 0; size_t count = 0;
for ( ; isegment != processeds.end(); ++isegment ) { for ( ; isegment != processeds.end(); ++isegment ) {
//_feedthroughs[depth] += ((*isegment)->isGlobal()) ? 0.50 : 0.33; _feedthroughs[depth] += ((*isegment)->isGlobal()) ? 0.50 : 0.33;
_feedthroughs[depth] += 0.50;
localCounts [depth] += 1.0; localCounts [depth] += 1.0;
if ( (*isegment)->isGlobal() ) _globalsCount[depth] += 1.0; if ( (*isegment)->isGlobal() ) _globalsCount[depth] += 1.0;
@ -1783,7 +1736,7 @@ namespace Anabatic {
bool GCell::stepNetDesaturate ( size_t depth, set<Net*>& globalNets, GCell::Set& invalidateds ) bool GCell::stepNetDesaturate ( size_t depth, set<Net*>& globalNets, GCell::Set& invalidateds )
{ {
cdebug_log(149,0) << "GCell::stepNetDesaturate() depth:" << depth << endl; cdebug_log(9000,0) << "Deter| GCell::stepNetDesaturate() depth:" << depth << endl;
cdebug_log(9000,0) << "Deter| " << this << endl; cdebug_log(9000,0) << "Deter| " << this << endl;
updateDensity(); updateDensity();
@ -1805,7 +1758,7 @@ namespace Anabatic {
if (segmentDepth < depth) continue; if (segmentDepth < depth) continue;
if (segmentDepth > depth) break; if (segmentDepth > depth) break;
cdebug_log(149,0) << "Move up " << (*isegment) << endl; cdebug_log(9000,0) << "Deter| Move up " << (*isegment) << endl;
if (getAnabatic()->moveUpNetTrunk(*isegment,globalNets,invalidateds)) if (getAnabatic()->moveUpNetTrunk(*isegment,globalNets,invalidateds))
return true; return true;
@ -1837,7 +1790,6 @@ namespace Anabatic {
string s = Super::_getString(); string s = Super::_getString();
s.insert( s.size()-1, " "+getString(getBoundingBox()) ); s.insert( s.size()-1, " "+getString(getBoundingBox()) );
s.insert( s.size()-1, " "+getString(_flags) ); s.insert( s.size()-1, " "+getString(_flags) );
s.insert( s.size()-1, " "+getString(_rpCount) );
/* string s = "<GCell at(" + DbU::getValueString(getXMin()) /* string s = "<GCell at(" + DbU::getValueString(getXMin())
+ "-" + DbU::getValueString(getYMin()) + "-" + DbU::getValueString(getYMin())
+ "-" + DbU::getValueString(getXMax()) + "-" + DbU::getValueString(getXMax())
@ -1870,7 +1822,7 @@ namespace Anabatic {
ostringstream s; ostringstream s;
const Layer* layer = rg->getRoutingLayer(depth)->getBlockageLayer(); const Layer* layer = rg->getRoutingLayer(depth)->getBlockageLayer();
s << "_blockages[" << depth << ":" << ((layer) ? layer->getName() : "None") << "]"; s << "_blockages[" << depth << ":" << ((layer) ? layer->getName() : "None") << "]";
record->add( DbU::getValueSlot( s.str(), &_blockages[depth] ) ); record->add( getSlot ( s.str(), &_blockages[depth] ) );
} }
for ( size_t depth=0 ; depth<_depth ; ++depth ) { for ( size_t depth=0 ; depth<_depth ; ++depth ) {

View File

@ -31,287 +31,11 @@
#include "hurricane/Horizontal.h" #include "hurricane/Horizontal.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "crlcore/RoutingGauge.h" #include "crlcore/RoutingGauge.h"
#include "anabatic/AutoContactTerminal.h" #include "anabatic/AutoContact.h"
#include "anabatic/AutoSegment.h" #include "anabatic/AutoSegment.h"
#include "anabatic/AnabaticEngine.h" #include "anabatic/AnabaticEngine.h"
namespace {
using namespace std;
using namespace CRL;
using namespace Hurricane;
using namespace Anabatic;
class SortRpByX {
public:
inline SortRpByX ();
inline bool operator() ( RoutingPad* rp1, RoutingPad* rp2 );
};
inline SortRpByX::SortRpByX ()
{ }
inline bool SortRpByX::operator() ( RoutingPad* rp1, RoutingPad* rp2 )
{
DbU::Unit x1 = rp1->getCenter().getX();
DbU::Unit x2 = rp2->getCenter().getX();
if (x1 == x2) return false;
return (x1 < x2);
}
// -----------------------------------------------------------------
// Class : "RpsInRow".
class RpsInRow {
public:
class Compare {
public:
bool operator() ( const RpsInRow* lhs, const RpsInRow* rhs ) const;
};
public:
inline RpsInRow ( RoutingPad*, AnabaticEngine* );
inline const vector<RoutingPad*>& getRps () const;
inline size_t getSouth () const;
inline size_t getNorth () const;
inline const Interval& getRpsHSpan () const;
inline const Interval& getRpsVSpan () const;
void slacken ();
private:
void _findTopology ();
inline void _merge ( RoutingPad* );
private:
AnabaticEngine* _anabatic;
vector<RoutingPad*> _rps;
size_t _north;
size_t _south;
Interval _hSpan;
Interval _vSpan;
};
inline RpsInRow::RpsInRow ( RoutingPad* seed, AnabaticEngine* anabatic )
: _anabatic(anabatic)
, _rps ()
, _north (0)
, _south (0)
, _hSpan ()
, _vSpan ( false )
{
_rps.push_back( seed );
_findTopology();
}
inline const vector<RoutingPad*>& RpsInRow::getRps () const { return _rps; }
inline size_t RpsInRow::getSouth () const { return _south; }
inline size_t RpsInRow::getNorth () const { return _north; }
inline const Interval& RpsInRow::getRpsHSpan () const { return _hSpan; }
inline const Interval& RpsInRow::getRpsVSpan () const { return _vSpan; }
bool RpsInRow::Compare::operator() ( const RpsInRow* lhs, const RpsInRow* rhs ) const
{
if ( (lhs->_rps.size() == 2) and (rhs->_rps.size() != 2) ) return true;
if ( (lhs->_rps.size() != 2) and (rhs->_rps.size() == 2) ) return false;
if ( lhs->_rps.size() != rhs->_rps.size() ) return lhs->_rps.size() < rhs->_rps.size();
size_t lhsNs = lhs->_south + lhs->_north;
size_t rhsNs = rhs->_south + rhs->_north;
if (lhsNs != rhsNs) return lhsNs < rhsNs;
if (lhs->_vSpan != rhs->_vSpan) return lhs->_vSpan.getSize() < rhs->_vSpan.getSize();
if (lhs->_hSpan != rhs->_hSpan) return lhs->_hSpan.getSize() < rhs->_hSpan.getSize();
return lhs->_rps[0]->getId() < rhs->_rps[0]->getId();
}
inline void RpsInRow::_merge ( RoutingPad* rp )
{
if (rp != _rps[0]) _rps.push_back( rp );
Box bb ( _rps.back()->getBoundingBox() );
_hSpan.merge( bb.getCenter().getX() );
_vSpan.intersection( bb.getYMin(), bb.getYMax() );
}
void RpsInRow::_findTopology ()
{
cdebug_log(146,1) << "RpsInRow::findTopology() - " << _rps[0] << endl;
_merge( _rps[0] );
AutoSegmentStack stack;
for ( Component* component : _rps[0]->getSlaveComponents() ) {
cdebug_log(146,0) << "slave component: " << component << endl;
AutoContact* rpContact = Session::lookup( dynamic_cast<Contact*>(component) );
if (rpContact) {
cdebug_log(146,0) << "Start rp: " << rpContact << endl;
for ( AutoSegment* segment : rpContact->getAutoSegments() ) {
cdebug_log(146,0) << "Examining: " << segment << endl;
AutoContact* target = segment->getOppositeAnchor(rpContact);
if (target) {
if (segment->isHorizontal()) {
stack.push( target, segment );
} else {
if (segment->isLocal()) {
stack.push( target, segment );
} else {
if (segment->getAutoSource() == rpContact) ++_north;
else ++_south;
}
}
}
}
// Find Rps in same horizontal GCell range.
cdebug_log(146,0) << "Find Rps in same horizontal GCell range" << endl;
while ( not stack.isEmpty() ) {
AutoSegment* from = stack.getAutoSegment();
AutoContact* contact = stack.getAutoContact();
stack.pop();
for ( AutoSegment* segment : contact->getAutoSegments() ) {
if (segment == from) continue;
if (segment->isVertical() and not segment->isLocal()) {
if (segment->getAutoSource() == contact) ++_north;
else ++_south;
continue;
}
AutoContact* target = segment->getOppositeAnchor( contact );
AutoContactTerminal* terminal = dynamic_cast<AutoContactTerminal*>( target );
if (terminal) {
_merge( terminal->getRoutingPad() );
}
stack.push( target, segment );
}
}
}
}
sort( _rps.begin(), _rps.end(), SortRpByX() );
cdebug_log(146,0) << "findHAlignedsRps() - Exit" << endl;
cdebug_tabw(146,-1);
}
void RpsInRow::slacken ()
{
cdebug_log(149,1) << "RpsInRow::slacken()" << endl;
for ( RoutingPad* rp : _rps ) {
cdebug_log(149,0) << "Slacken from: " << rp << endl;
if (rp->getLayer()) {
if (_anabatic->getConfiguration()->getLayerDepth(rp->getLayer()) == 1)
cdebug_log(149,0) << "In METAL2, skiping" << endl;
continue;
}
for ( Component* component : rp->getSlaveComponents() ) {
AutoContact* rpContact = Session::lookup( dynamic_cast<Contact*>(component) );
if (rpContact) {
cdebug_log(149,0) << "+ " << rpContact << endl;
for ( AutoSegment* segment : rpContact->getAutoSegments() ) {
cdebug_log(149,0) << "| " << segment << endl;
if (segment->isVertical()) {
if (segment->getDepth() == 1) {
cdebug_log(149,0) << "| Slacken: " << segment << endl;
segment->changeDepth( 2, Flags::NoFlags );
cdebug_log(149,0) << "| After Slacken: " << segment << endl;
}
} else {
segment->makeDogleg( rpContact->getGCell() );
cdebug_log(149,0) << "| Make dogleg: " << segment << endl;
}
}
}
}
}
cdebug_tabw(149,-1);
}
// -----------------------------------------------------------------
// Class : "GCellRps".
class GCellRps {
public:
class Compare {
public:
bool operator() ( const GCellRps* lhs, const GCellRps* rhs ) const;
};
public:
GCellRps ( GCell*, AnabaticEngine* );
~GCellRps ();
inline GCell* getGCell () const;
inline size_t add ( RoutingPad* );
inline void consolidate ();
inline RpsInRow* getRpsInRow ( size_t i );
inline const vector<RpsInRow*>& getRpsInRows () const;
private:
AnabaticEngine* _anabatic;
GCell* _gcell;
vector<RpsInRow*> _rpsInRows;
};
GCellRps::GCellRps ( GCell* gcell, AnabaticEngine* anabatic )
: _anabatic (anabatic)
, _gcell (gcell)
, _rpsInRows()
{ }
GCellRps::~GCellRps ()
{
for ( RpsInRow* elem : _rpsInRows ) delete elem;
}
inline GCell* GCellRps::getGCell () const { return _gcell; }
inline size_t GCellRps::add ( RoutingPad* rp )
{
_rpsInRows.push_back( new RpsInRow(rp,_anabatic) );
return _rpsInRows.size() - 1;
}
inline void GCellRps::consolidate ()
{
sort( _rpsInRows.begin(), _rpsInRows.end(), RpsInRow::Compare() );
}
inline RpsInRow* GCellRps::getRpsInRow ( size_t i ) { return _rpsInRows[i]; }
inline const vector<RpsInRow*>& GCellRps::getRpsInRows () const { return _rpsInRows; }
bool GCellRps::Compare::operator() ( const GCellRps* lhs, const GCellRps* rhs ) const
{ return lhs->getGCell()->getId() < rhs->getGCell()->getId(); }
} // Anonymous namespace.
namespace Anabatic { namespace Anabatic {
using Hurricane::DebugSession; using Hurricane::DebugSession;
@ -335,53 +59,7 @@ namespace Anabatic {
cmess1 << " o Desaturate layer " cmess1 << " o Desaturate layer "
<< Session::getRoutingGauge()->getRoutingLayer(depth)->getName() << endl; << Session::getRoutingGauge()->getRoutingLayer(depth)->getName() << endl;
cdebug_log(149,0) << "Session::getSaturateRatio()=" << Session::getSaturateRatio() << endl;
GCellKeyQueue queue;
GCell::Set invalidateds;
for ( GCell* gcell : getGCells() ) queue.push( gcell->cloneKey(depth) );
bool optimized = true;
bool finished = false;
while ( optimized ) {
Session::revalidate ();
optimized = false;
while ( not queue.empty() ) {
GCell::Key* topKey = queue.top();
GCell* gcell = const_cast<GCell*>( topKey->getGCell() );
queue.pop();
if (topKey->isActive()) {
cdebug_log(149,0) << "_desaturate: [" << depth << "]:"
<< gcell->getDensity(depth) << " " << gcell << endl;
if (not gcell->isSaturated(depth)) {
cdebug_log(149,0) << "STOP desaturated: " << gcell << endl;
finished = true;
} else {
if (finished) {
cparanoid << "[ERROR] Still saturated: " << gcell << endl;
}
}
if (not finished) {
optimized = gcell->stepNetDesaturate( depth, globalNets, invalidateds );
if (optimized) {
for ( GCell* gcell : invalidateds ) {
queue.push( gcell->cloneKey(depth) );
}
}
}
}
delete topKey;
}
}
#if OLD_QUEUE_DISABLED
GCellDensitySet queue ( depth, getGCells() ); GCellDensitySet queue ( depth, getGCells() );
GCell::Set invalidateds; GCell::Set invalidateds;
@ -417,7 +95,6 @@ namespace Anabatic {
} }
} }
} }
#endif
} }
@ -574,8 +251,8 @@ namespace Anabatic {
vector<AutoSegment*> southBounds; vector<AutoSegment*> southBounds;
DbU::Unit leftBound; DbU::Unit leftBound;
DbU::Unit rightBound; DbU::Unit rightBound;
//bool hasNorth = false; bool hasNorth = false;
//bool hasSouth = false; bool hasSouth = false;
AutoSegment::getTopologicalInfos( horizontal AutoSegment::getTopologicalInfos( horizontal
, collapseds , collapseds
@ -754,7 +431,7 @@ namespace Anabatic {
if (not segment->isStrongTerminal()) locals.push_back( segment ); if (not segment->isStrongTerminal()) locals.push_back( segment );
continue; continue;
} }
if ( (segment->getAnchoredLength() < 3*Session::getSliceHeight()) and (segment != seed) ) { if ( (segment->getLength() < 3*Session::getSliceHeight()) and (segment != seed) ) {
locals.push_back( segment ); locals.push_back( segment );
continue; continue;
} }
@ -922,8 +599,6 @@ namespace Anabatic {
void AnabaticEngine::layerAssign ( uint32_t method ) void AnabaticEngine::layerAssign ( uint32_t method )
{ {
//DebugSession::open( 145, 150 );
cdebug_log(9000,0) << "Deter| Layer Assignment" << endl; cdebug_log(9000,0) << "Deter| Layer Assignment" << endl;
set<Net*> globalNets; set<Net*> globalNets;
@ -971,54 +646,6 @@ namespace Anabatic {
Session::setAnabaticFlags( Flags::WarnOnGCellOverload ); Session::setAnabaticFlags( Flags::WarnOnGCellOverload );
} }
set<GCellRps*,GCellRps::Compare> gcellRpss;
for ( GCell* gcell : getGCells() ) {
set<RoutingPad*,Entity::CompareById> rps;
const vector<AutoContact*> contacts = gcell->getContacts();
for ( AutoContact* contact : contacts ) {
AutoContactTerminal* terminal = dynamic_cast<AutoContactTerminal*>( contact );
if (terminal) {
rps.insert( terminal->getRoutingPad() );
}
}
if (rps.size() > 8) {
GCellRps* gcellRps = new GCellRps ( gcell, this );
gcellRpss.insert( gcellRps );
for ( RoutingPad* rp : rps ) gcellRps->add( rp );
}
}
for ( GCellRps* gcellRps : gcellRpss ) {
gcellRps->consolidate();
const vector<RpsInRow*>& rpsInRows = gcellRps->getRpsInRows();
cdebug_log(149,0) << gcellRps->getGCell() << " has " << rpsInRows.size() << " terminals." << endl;
size_t count = 0;
for ( RpsInRow* rpsInRow : rpsInRows ) {
cdebug_log(149,0) << "North:" << rpsInRow->getNorth() << " South:"
<< rpsInRow->getSouth() << " net:"
<< rpsInRow->getRps()[0]->getNet()->getName() << endl;
cdebug_log(149,0) << "H-Span:" << rpsInRow->getRpsHSpan() << " V-Span:" << rpsInRow->getRpsVSpan() << endl;
for ( RoutingPad* arp : rpsInRow->getRps() ) {
cdebug_log(149,0) << "| " << arp << endl;
}
if (++count < 2) rpsInRow->slacken();
}
for ( AutoSegment* segment : gcellRps->getGCell()->getHSegments() ) {
if (segment->canPivotUp()) {
cdebug_log(149,0) << "Move up horizontal: " << segment << endl;
segment->moveUp( Flags::Propagate );
}
}
delete gcellRps;
}
checkGCellDensities(); checkGCellDensities();
Session::close(); Session::close();
@ -1029,8 +656,6 @@ namespace Anabatic {
// cmess2 << " - Global segments : " << global << endl; // cmess2 << " - Global segments : " << global << endl;
// cmess2 << " - Ratio : " // cmess2 << " - Ratio : "
// << ((float)global/(float)total)*100.0 << "%." << endl; // << ((float)global/(float)total)*100.0 << "%." << endl;
//DebugSession::close();
} }

View File

@ -232,40 +232,18 @@ namespace Anabatic {
if (segment) { if (segment) {
source = segment->getSourcePosition(); source = segment->getSourcePosition();
target = segment->getTargetPosition(); target = segment->getTargetPosition();
} else { return;
}
RoutingPad* rp = dynamic_cast<RoutingPad*>( anchor ); RoutingPad* rp = dynamic_cast<RoutingPad*>( anchor );
if (rp) { if (rp) {
source = rp->getSourcePosition(); source = rp->getSourcePosition();
target = rp->getTargetPosition(); target = rp->getTargetPosition();
} else {
source = anchor->getPosition();
target = anchor->getPosition();
return; return;
} }
}
if (source == target) return; source = anchor->getPosition();
if (source.getX() > target.getX()) swap( source, target ); target = anchor->getPosition();
if (source.getY() > target.getY()) swap( source, target );
if (not Session::getRoutingGauge()->isSymbolic()) {
size_t rpDepth = Session::getLayerDepth( anchor->getLayer() );
Flags direction = Session::getDirection ( rpDepth );
DbU::Unit wwidth = Session::getWireWidth (rpDepth) / 2;
cdebug_log(145,0) << "Not a symbolic gauge, shrink positions of " << DbU::getValueString(wwidth) << endl;
if (rpDepth == 0) return;
if (direction.contains(Flags::Horizontal)) {
cdebug_log(145,0) << "H shrink" << endl;
source.translate( wwidth, 0 );
target.translate( -wwidth, 0 );
} else {
cdebug_log(145,0) << "V shrink" << endl;
source.translate( 0, wwidth );
target.translate( 0, -wwidth );
}
} else {
cdebug_log(145,0) << "Symbolic gauge, no shrink" << endl;
}
} }
@ -529,16 +507,6 @@ namespace Anabatic {
if (_gcell == NULL) throw Error( missingGCell ); if (_gcell == NULL) throw Error( missingGCell );
cdebug_log(145,0) << "Topology [" << _connexity.connexity << "] = "
<< "[" << (int)_connexity.fields.globals
<< "+" << (int)_connexity.fields.M1
<< "+" << (int)_connexity.fields.M2
<< "+" << (int)_connexity.fields.M3
<< "+" << (int)_connexity.fields.Pin
<< "+" << (int)_connexity.fields.Pad
<< "] " << _gcell
<< endl;
return *this; return *this;
} }
@ -575,15 +543,6 @@ namespace Anabatic {
void NetBuilder::construct () void NetBuilder::construct ()
{ {
cdebug_log(145,1) << "NetBuilder::construct() [" << _connexity.connexity << "] in " << _gcell << endl; cdebug_log(145,1) << "NetBuilder::construct() [" << _connexity.connexity << "] in " << _gcell << endl;
cdebug_log(145,0) << "Topology [" << _connexity.connexity << "] = "
<< "[" << (int)_connexity.fields.globals
<< "+" << (int)_connexity.fields.M1
<< "+" << (int)_connexity.fields.M2
<< "+" << (int)_connexity.fields.M3
<< "+" << (int)_connexity.fields.Pin
<< "+" << (int)_connexity.fields.Pad
<< "] " << _gcell
<< endl;
if (not isTwoMetals()) { if (not isTwoMetals()) {
_southWestContact = NULL; _southWestContact = NULL;
@ -603,11 +562,7 @@ namespace Anabatic {
case Conn_1G_2M1: case Conn_1G_2M1:
case Conn_1G_3M1: case Conn_1G_3M1:
case Conn_1G_4M1: case Conn_1G_4M1:
case Conn_1G_5M1: case Conn_1G_5M1: _do_1G_xM1(); break;
case Conn_1G_6M1:
case Conn_1G_7M1:
case Conn_1G_8M1:
case Conn_1G_9M1: _do_1G_xM1(); break;
// End 1G_xM1 cascaded cases. // End 1G_xM1 cascaded cases.
case Conn_1G_1M2: case Conn_1G_1M2:
@ -627,31 +582,17 @@ namespace Anabatic {
case Conn_2G_3M1: case Conn_2G_3M1:
case Conn_2G_4M1: case Conn_2G_4M1:
case Conn_2G_5M1: case Conn_2G_5M1:
case Conn_2G_6M1:
case Conn_2G_7M1:
case Conn_2G_8M1:
case Conn_2G_9M1:
case Conn_3G_1M1: if (_do_xG_1M1()) break; case Conn_3G_1M1: if (_do_xG_1M1()) break;
case Conn_3G_2M1: case Conn_3G_2M1:
case Conn_3G_3M1: case Conn_3G_3M1:
case Conn_3G_4M1: case Conn_3G_4M1:
case Conn_3G_5M1:
case Conn_3G_6M1:
case Conn_3G_7M1:
case Conn_3G_8M1:
case Conn_3G_9M1:
case Conn_3G_2M3: case Conn_3G_2M3:
case Conn_3G_3M3: case Conn_3G_3M3:
case Conn_3G_4M3: case Conn_3G_4M3:
case Conn_4G_1M1: if (_do_xG_1M1()) break; case Conn_4G_1M1: if (_do_xG_1M1()) break;
case Conn_4G_2M1: case Conn_4G_2M1:
case Conn_4G_3M1: case Conn_4G_3M1:
case Conn_4G_4M1: case Conn_4G_4M1: _do_xG_xM1_xM3(); break;
case Conn_4G_5M1:
case Conn_4G_6M1:
case Conn_4G_7M1:
case Conn_4G_8M1:
case Conn_4G_9M1: _do_xG_xM1_xM3(); break;
// End xG_xM1_xM3 cascaded cases. // End xG_xM1_xM3 cascaded cases.
case Conn_4G_1M2: if (_do_4G_1M2()) break; case Conn_4G_1M2: if (_do_4G_1M2()) break;
@ -675,25 +616,12 @@ namespace Anabatic {
case Conn_4G: _do_xG(); break; case Conn_4G: _do_xG(); break;
// End xG cascaded cases. // End xG cascaded cases.
// Optimized specific cases. // Optimized specific cases.
case Conn_1G_1PinM1: _do_1G_1PinM1 (); break;
case Conn_2G_1PinM1: _do_2G_1PinM1 (); break;
case Conn_1G_1PinM2: _do_1G_1PinM2 (); break; case Conn_1G_1PinM2: _do_1G_1PinM2 (); break;
case Conn_2G_1PinM2: case Conn_2G_1PinM2:
case Conn_3G_1PinM2: _do_xG_1PinM2 (); break; case Conn_3G_1PinM2: _do_xG_1PinM2 (); break;
case Conn_1G_1PinM3: _do_1G_1PinM3 (); break; case Conn_1G_1PinM3: _do_1G_1PinM3 (); break;
case Conn_2G_1PinM3: case Conn_2G_1PinM3:
case Conn_3G_1PinM3: _do_xG_1PinM3 (); break; case Conn_3G_1PinM3: _do_xG_1PinM3 (); break;
case Conn_1G_1M1_1PinM3: _do_1G_1M1_1PinM3(); break;
case Conn_1G_1M1_1PinM2:
case Conn_1G_2M1_1PinM2: _do_1G_xM1_1PinM2(); break;
case Conn_2G_1M1_1PinM2:
case Conn_2G_2M1_1PinM2: _do_2G_xM1_1PinM2(); break;
case Conn_2G_1M1_1PinM3:
case Conn_2G_2M1_1PinM3:
case Conn_2G_3M1_1PinM3: _do_2G_xM1_1PinM3(); break;
case Conn_3G_1M1_1PinM3:
case Conn_3G_2M1_1PinM3:
case Conn_3G_3M1_1PinM3: _do_3G_xM1_1PinM3(); break;
case Conn_1G_1M1_1M2: _do_xG_1M1_1M2(); break; case Conn_1G_1M1_1M2: _do_xG_1M1_1M2(); break;
case Conn_1G_1M1_1M3: _do_1G_xM1 (); break; case Conn_1G_1M1_1M3: _do_1G_xM1 (); break;
case Conn_2G_1M1_1M2: _do_xG_1M1_1M2(); break; case Conn_2G_1M1_1M2: _do_xG_1M1_1M2(); break;
@ -1034,20 +962,6 @@ namespace Anabatic {
} }
bool NetBuilder::_do_1G_1PinM1 ()
{
throw Error ( "%s::_do_1G_1PinM1() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_2G_1PinM1 ()
{
throw Error ( "%s::_do_2G_1PinM1() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_xG_1PinM2 () bool NetBuilder::_do_xG_1PinM2 ()
{ {
throw Error ( "%s::_do_xG_1PinM2() method *not* reimplemented from base class.", getTypeName().c_str() ); throw Error ( "%s::_do_xG_1PinM2() method *not* reimplemented from base class.", getTypeName().c_str() );
@ -1139,41 +1053,6 @@ namespace Anabatic {
} }
bool NetBuilder::_do_1G_1M1_1PinM3 ()
{
throw Error ( "%s::_do_1G_1M1_1PinM3() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_1G_xM1_1PinM2 ()
{
throw Error ( "%s::_do_1G_xM1_1PinM2() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_2G_xM1_1PinM2 ()
{
throw Error ( "%s::_do_2G_xM1_1PinM2() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_2G_xM1_1PinM3 ()
{
throw Error ( "%s::_do_2G_xM1_1PinM3() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_3G_xM1_1PinM3 ()
{
throw Error ( "%s::_do_3G_xM1_1PinM3() method *not* reimplemented from base class.", getTypeName().c_str() );
return false;
}
bool NetBuilder::_do_globalSegment () bool NetBuilder::_do_globalSegment ()
{ {
throw Error ( "%s::_do_globalSegment() method *not* reimplemented from base class.", getTypeName().c_str() ); throw Error ( "%s::_do_globalSegment() method *not* reimplemented from base class.", getTypeName().c_str() );
@ -2366,10 +2245,8 @@ namespace Anabatic {
size_t degree = routingPads.getSize(); size_t degree = routingPads.getSize();
if (degree == 0) { if (degree == 0) {
if (not net->isBlockage()) {
cmess2 << Warning("Net \"%s\" do not have any RoutingPad (ignored)." cmess2 << Warning("Net \"%s\" do not have any RoutingPad (ignored)."
,getString(net->getName()).c_str()) << endl; ,getString(net->getName()).c_str()) << endl;
}
cdebug_tabw(145,-1); cdebug_tabw(145,-1);
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@ -318,7 +318,7 @@ namespace Anabatic {
cdebug_log(145,0) << "Create global segment: " << globalSegment << endl; cdebug_log(145,0) << "Create global segment: " << globalSegment << endl;
// HARDCODED VALUE. // HARDCODED VALUE.
if ( (getTopology() & Global_Fixed) and (globalSegment->getAnchoredLength() < 2*Session::getSliceHeight()) ) if ( (getTopology() & Global_Fixed) and (globalSegment->getLength() < 2*Session::getSliceHeight()) )
addToFixSegments( globalSegment ); addToFixSegments( globalSegment );
if (getConnexity().fields.globals < 2) { if (getConnexity().fields.globals < 2) {

View File

@ -521,12 +521,6 @@ namespace Anabatic {
} }
bool NetBuilderVH::_do_2G ()
{
cdebug_log(145,0) << getTypeName() << "::_do_2G()" << endl;
return _do_xG();
}
bool NetBuilderVH::_do_xG () bool NetBuilderVH::_do_xG ()
{ {
cdebug_log(145,1) << getTypeName() << "::_do_xG()" << endl; cdebug_log(145,1) << getTypeName() << "::_do_xG()" << endl;
@ -577,7 +571,7 @@ namespace Anabatic {
cdebug_log(145,0) << "Create global segment: " << globalSegment << endl; cdebug_log(145,0) << "Create global segment: " << globalSegment << endl;
// HARDCODED VALUE. // HARDCODED VALUE.
if ( (getTopology() & Global_Fixed) and (globalSegment->getAnchoredLength() < 2*Session::getSliceHeight()) ) if ( (getTopology() & Global_Fixed) and (globalSegment->getLength() < 2*Session::getSliceHeight()) )
addToFixSegments( globalSegment ); addToFixSegments( globalSegment );
if (getConnexity().fields.globals < 2) { if (getConnexity().fields.globals < 2) {

View File

@ -61,55 +61,55 @@ namespace {
void propagateConstraintFromRp ( RoutingPad* rp ) void propagateConstraintFromRp ( RoutingPad* rp )
{ {
cdebug_log(146,1) << "propagateConstraintFromRp() - " << rp << endl; cdebug_log(145,1) << "propagateConstraintFromRp() - " << rp << endl;
for ( Component* component : rp->getSlaveComponents() ) { for ( Component* component : rp->getSlaveComponents() ) {
cdebug_log(146,0) << "slave component: " << component << endl; cdebug_log(145,0) << "slave component: " << component << endl;
AutoContact* sourceContact = Session::lookup( dynamic_cast<Contact*>(component) ); AutoContact* sourceContact = Session::lookup( dynamic_cast<Contact*>(component) );
if (sourceContact) { if (sourceContact) {
Box constraintBox = sourceContact->getConstraintBox(); Box constraintBox = sourceContact->getConstraintBox();
cdebug_log(146,0) << "Start slave: " << sourceContact << endl; cdebug_log(145,0) << "Start slave: " << sourceContact << endl;
cdebug_log(146,0) << "Constraint: " << constraintBox << endl; cdebug_log(145,0) << "Constraint: " << constraintBox << endl;
set<AutoSegment*> verticalSegments; set<AutoSegment*> verticalSegments;
set<AutoSegment*> horizontalSegments; set<AutoSegment*> horizontalSegments;
for ( AutoSegment* segment : sourceContact->getAutoSegments() ) { for ( AutoSegment* segment : sourceContact->getAutoSegments() ) {
cdebug_log(146,0) << "Examining: " << segment << endl; cdebug_log(145,0) << "Examining: " << segment << endl;
AutoContact* targetContact = segment->getOppositeAnchor(sourceContact); AutoContact* targetContact = segment->getOppositeAnchor(sourceContact);
if (targetContact) { if (targetContact) {
if (segment->isHorizontal()) { if (segment->isHorizontal()) {
cdebug_log(146,0) << "On horizontal stack " << segment << endl; cdebug_log(145,0) << "On horizontal stack " << segment << endl;
horizontalSegments.insert( segment ); horizontalSegments.insert( segment );
} else { } else {
cdebug_log(146,0) << "On vertical stack " << segment << endl; cdebug_log(145,0) << "On vertical stack " << segment << endl;
verticalSegments.insert( segment ); verticalSegments.insert( segment );
} }
} }
} }
// Propagate constraint through horizontally aligned segments. // Propagate constraint through horizontally aligned segments.
cdebug_log(146,0) << "Propagate constraint on horizontal segments" << endl; cdebug_log(145,0) << "Propagate constraint on horizontal segments" << endl;
for ( AutoSegment* horizontal : horizontalSegments ) { for ( AutoSegment* horizontal : horizontalSegments ) {
AutoContact* contact = NULL; AutoContact* contact = NULL;
for ( AutoSegment* aligned : horizontal->getAligneds(Flags::WithSelf) ) { for ( AutoSegment* aligned : horizontal->getAligneds(Flags::WithSelf) ) {
cdebug_log(146,0) << "aligned horizontal: " << aligned << endl; cdebug_log(145,0) << "aligned horizontal: " << aligned << endl;
contact = aligned->getAutoTarget(); contact = aligned->getAutoTarget();
cdebug_log(146,0) << "contact: " << contact << endl; cdebug_log(145,0) << "contact: " << contact << endl;
if (contact) { if (contact) {
cdebug_log(146,0) << "Apply to (target): " << contact << endl; cdebug_log(145,0) << "Apply to (target): " << contact << endl;
contact->restrictConstraintBox( constraintBox.getYMin() contact->restrictConstraintBox( constraintBox.getYMin()
, constraintBox.getYMax() , constraintBox.getYMax()
, Flags::Horizontal|Flags::WarnOnError ); , Flags::Horizontal|Flags::WarnOnError );
} }
contact = aligned->getAutoSource(); contact = aligned->getAutoSource();
cdebug_log(146,0) << "contact: " << contact << endl; cdebug_log(145,0) << "contact: " << contact << endl;
if (contact) { if (contact) {
cdebug_log(146,0) << "Apply to (source): " << contact << endl; cdebug_log(145,0) << "Apply to (source): " << contact << endl;
contact->restrictConstraintBox( constraintBox.getYMin() contact->restrictConstraintBox( constraintBox.getYMin()
, constraintBox.getYMax() , constraintBox.getYMax()
, Flags::Horizontal|Flags::WarnOnError ); , Flags::Horizontal|Flags::WarnOnError );
@ -118,23 +118,23 @@ namespace {
} }
// Propagate constraint through vertically aligned segments. // Propagate constraint through vertically aligned segments.
cdebug_log(146,0) << "Propagate constraint on vertical segments" << endl; cdebug_log(145,0) << "Propagate constraint on vertical segments" << endl;
for ( AutoSegment* vertical : verticalSegments ) { for ( AutoSegment* vertical : verticalSegments ) {
AutoContact* contact = NULL; AutoContact* contact = NULL;
for ( AutoSegment* aligned : vertical->getAligneds(Flags::WithSelf) ) { for ( AutoSegment* aligned : vertical->getAligneds(Flags::WithSelf) ) {
cdebug_log(146,0) << "aligned vertical: " << aligned << endl; cdebug_log(145,0) << "aligned vertical: " << aligned << endl;
contact = aligned->getAutoTarget(); contact = aligned->getAutoTarget();
if (contact) { if (contact) {
cdebug_log(146,0) << "Apply to (target): " << contact << endl; cdebug_log(145,0) << "Apply to (target): " << contact << endl;
contact->restrictConstraintBox( constraintBox.getXMin() contact->restrictConstraintBox( constraintBox.getXMin()
, constraintBox.getXMax() , constraintBox.getXMax()
, Flags::Vertical|Flags::WarnOnError ); , Flags::Vertical|Flags::WarnOnError );
} }
contact = aligned->getAutoSource(); contact = aligned->getAutoSource();
if (contact) { if (contact) {
cdebug_log(146,0) << "Apply to (source): " << contact << endl; cdebug_log(145,0) << "Apply to (source): " << contact << endl;
contact->restrictConstraintBox( constraintBox.getXMin() contact->restrictConstraintBox( constraintBox.getXMin()
, constraintBox.getXMax() , constraintBox.getXMax()
, Flags::Vertical|Flags::WarnOnError ); , Flags::Vertical|Flags::WarnOnError );
@ -144,8 +144,8 @@ namespace {
} }
} }
cdebug_log(146,0) << "propagateConstraintFromRp() - Exit" << endl; cdebug_log(145,0) << "propagateConstraintFromRp() - Exit" << endl;
cdebug_tabw(146,-1); cdebug_tabw(145,-1);
} }
@ -159,128 +159,35 @@ namespace Anabatic {
using Hurricane::Cell; using Hurricane::Cell;
void propagateDistanceFromRp ( RoutingPad* rp )
{
cdebug_log(146,1) << "propagateDistanceFromRp() - " << rp << endl;
unsigned int distance = 0;
vector< pair<AutoContact*,AutoSegment*> > currents;
vector< pair<AutoContact*,AutoSegment*> > successors;
for ( Component* component : rp->getSlaveComponents() ) {
cdebug_log(146,0) << "slave component: " << component << endl;
AutoContact* sourceContact = Session::lookup( dynamic_cast<Contact*>(component) );
if (sourceContact) {
cdebug_log(146,0) << "Start slave: " << sourceContact << endl;
for ( AutoSegment* segment : sourceContact->getAutoSegments() ) {
cdebug_log(146,0) << "Pushing: " << segment << endl;
currents.push_back( make_pair(sourceContact,segment) );
}
}
}
while ( not currents.empty() ) {
for ( size_t i = 0 ; i<currents.size() ; ++i ) {
AutoContact* source = currents[i].first;
AutoSegment* segment = currents[i].second;
if ( (distance == 1) and (segment->getRpDistance() == 1) ) {
vector<GCell*> gcells;
segment->getGCells( gcells );
if (gcells.size() < 3)
segment->setFlags( AutoSegment::SegUnbreakable );
}
if (distance >= segment->getRpDistance()) continue;
segment->setRpDistance( distance );
cdebug_log(146,0) << "Popped: " << segment << endl;
AutoContact* target = segment->getOppositeAnchor( source );
if (target) {
for ( AutoSegment* successor : target->getAutoSegments() ) {
if (successor == segment) continue;
// if (successor->isNonPref()) {
// cdebug_log(146,0) << "Pushing (non-pref): " << successor << endl;
// currents.push_back( make_pair(target,successor) );
// } else {
cdebug_log(146,0) << "Pushing: " << successor << endl;
successors.push_back( make_pair(target,successor) );
// }
}
}
}
if (++distance > 15) break;
currents.clear();
currents.swap( successors );
}
cdebug_log(146,0) << "propagateDistanceFromRp() - Exit" << endl;
cdebug_tabw(146,-1);
}
void AnabaticEngine::computeNetConstraints ( Net* net ) void AnabaticEngine::computeNetConstraints ( Net* net )
{ {
DebugSession::open( net, 146, 150); DebugSession::open( net, 145, 150);
cdebug_log(149,0) << "Anabatic::computeNetConstraints( " << net << " )" << endl; cdebug_log(149,0) << "Anabatic::computeNetConstraints( " << net << " )" << endl;
cdebug_tabw(146,1); cdebug_tabw(145,1);
vector<RoutingPad*> routingPads; vector<RoutingPad*> routingPads;
for ( Component* component : net->getComponents() ) { forEach ( Component*, icomponent, net->getComponents() ) {
Contact* contact = dynamic_cast<Contact*>( component ); Contact* contact = dynamic_cast<Contact*>( *icomponent );
if (contact) { if (contact) {
AutoContact* autoContact = Session::lookup( contact ); AutoContact* autoContact = Session::lookup( contact );
if (autoContact) if (autoContact)
autoContact->restoreNativeConstraintBox(); autoContact->restoreNativeConstraintBox();
} else { } else {
Segment* segment = dynamic_cast<Segment*>( component ); RoutingPad* routingPad = dynamic_cast<RoutingPad*>( *icomponent );
if (segment) {
AutoSegment* autoSegment = Session::lookup( segment );
if (autoSegment)
autoSegment->setRpDistance( 15 );
} else {
RoutingPad* routingPad = dynamic_cast<RoutingPad*>( component );
if (routingPad) routingPads.push_back( routingPad ); if (routingPad) routingPads.push_back( routingPad );
} }
} }
}
for ( size_t i=0 ; i<routingPads.size() ; i++ ) { for ( size_t i=0 ; i<routingPads.size() ; i++ )
propagateConstraintFromRp( routingPads[i] ); propagateConstraintFromRp( routingPads[i] );
propagateDistanceFromRp ( routingPads[i] );
}
for ( Segment* segment : net->getSegments() ) {
AutoSegment* autoSegment = Session::lookup( segment );
if (not autoSegment) continue;
if (autoSegment->isUnbreakable()) continue;
if (autoSegment->getRpDistance() >= 2) continue;
if (autoSegment->getRpDistance() == 1) continue;
vector<GCell*> gcells;
autoSegment->getGCells( gcells );
if (gcells.size() > 2) continue;
//if ( (gcells.size() == 2)
// and ( not autoSegment->getAutoSource()->isTerminal()
// or not autoSegment->getAutoTarget()->isTerminal()) ) continue;
autoSegment->setFlags( AutoSegment::SegUnbreakable );
}
// forEach ( Segment*, isegment, net->getSegments() ) { // forEach ( Segment*, isegment, net->getSegments() ) {
// AutoSegment* autoSegment = Session::lookup( *isegment ); // AutoSegment* autoSegment = Session::lookup( *isegment );
// if (autoSegment) autoSegment->toConstraintAxis(); // if (autoSegment) autoSegment->toConstraintAxis();
// } // }
cdebug_tabw(146,-1); cdebug_tabw(145,-1);
DebugSession::close(); DebugSession::close();
} }

View File

@ -35,7 +35,6 @@ namespace Anabatic {
using Hurricane::RegularLayer; using Hurricane::RegularLayer;
using Hurricane::Component; using Hurricane::Component;
using Hurricane::Pin; using Hurricane::Pin;
using Hurricane::Plug;
using Hurricane::DeepNet; using Hurricane::DeepNet;
using Hurricane::Cell; using Hurricane::Cell;
using Hurricane::NetRoutingExtension; using Hurricane::NetRoutingExtension;
@ -86,73 +85,47 @@ namespace Anabatic {
vector<Segment*> segments; vector<Segment*> segments;
vector<Contact*> contacts; vector<Contact*> contacts;
bool isManualGlobalRouted = false; bool isPreRouted = false;
bool isManualDetailRouted = false;
bool isFixed = false; bool isFixed = false;
size_t rpCount = 0; size_t rpCount = 0;
for( Component* component : net->getComponents() ) { for( Component* component : net->getComponents() ) {
if (dynamic_cast<Pin*>(component)) continue; if (dynamic_cast<Pin*>(component)) continue;
if (dynamic_cast<Plug*>(component)) continue;
const RegularLayer* layer = dynamic_cast<const RegularLayer*>(component->getLayer()); const RegularLayer* layer = dynamic_cast<const RegularLayer*>(component->getLayer());
if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage)) if (layer and (layer->getBasicLayer()->getMaterial() == BasicLayer::Material::blockage))
continue; continue;
if ( not Session::isGaugeLayer(component->getLayer())
and not Session::isGLayer (component->getLayer())) {
const BasicLayer* basicLayer = dynamic_cast<const BasicLayer*>( component->getLayer() );
if (basicLayer and (basicLayer->getMaterial() == BasicLayer::Material::cut))
continue;
throw Error( "AnabaticEngine::setupPreRouted(): A component of \"%s\" has a routing gauge umanaged layer.\n"
" (%s)"
, getString(net->getName()).c_str()
, getString(component).c_str()
);
}
Horizontal* horizontal = dynamic_cast<Horizontal*>(component); Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
if (horizontal) { if (horizontal) {
if ( not ab.contains(horizontal->getSourcePosition()) if ( not ab.contains(horizontal->getSourcePosition())
and not ab.contains(horizontal->getTargetPosition()) ) continue; and not ab.contains(horizontal->getTargetPosition()) ) continue;
segments.push_back( horizontal ); segments.push_back( horizontal );
if (Session::isGLayer(component->getLayer())) { isPreRouted = true;
isManualGlobalRouted = true;
} else {
isManualDetailRouted = true;
if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer())) if (horizontal->getWidth() != Session::getWireWidth(horizontal->getLayer()))
isFixed = true; isFixed = true;
}
} else { } else {
Vertical* vertical = dynamic_cast<Vertical*>(component); Vertical* vertical = dynamic_cast<Vertical*>(component);
if (vertical) { if (vertical) {
if ( not ab.contains(vertical->getSourcePosition()) if ( not ab.contains(vertical->getSourcePosition())
and not ab.contains(vertical->getTargetPosition()) ) continue; and not ab.contains(vertical->getTargetPosition()) ) continue;
if (Session::isGLayer(component->getLayer())) { isPreRouted = true;
isManualGlobalRouted = true;
} else {
isManualDetailRouted = true;
segments.push_back( vertical ); segments.push_back( vertical );
if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer())) if (vertical->getWidth() != Session::getWireWidth(vertical->getLayer()))
isFixed = true; isFixed = true;
}
} else { } else {
Contact* contact = dynamic_cast<Contact*>(component); Contact* contact = dynamic_cast<Contact*>(component);
if (contact) { if (contact) {
if (not ab.contains(contact->getCenter())) continue; if (not ab.contains(contact->getCenter())) continue;
if (Session::isGLayer(component->getLayer())) { isPreRouted = true;
isManualGlobalRouted = true;
} else {
isManualGlobalRouted = true;
contacts.push_back( contact ); contacts.push_back( contact );
if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer())) if ( (contact->getWidth () != Session::getViaWidth(contact->getLayer()))
or (contact->getHeight() != Session::getViaWidth(contact->getLayer())) or (contact->getHeight() != Session::getViaWidth(contact->getLayer()))
or (contact->getLayer () == Session::getContactLayer(0)) ) or (contact->getLayer () == Session::getContactLayer(0)) )
isFixed = true; isFixed = true;
}
} else { } else {
RoutingPad* rp = dynamic_cast<RoutingPad*>(component); RoutingPad* rp = dynamic_cast<RoutingPad*>(component);
if (rp) { if (rp) {
@ -169,10 +142,7 @@ namespace Anabatic {
} }
} }
if ( (not isFixed) if ((not isFixed and not isPreRouted) and net->isDeepNet()) {
and (not isManualGlobalRouted)
and (not isManualDetailRouted)
and net->isDeepNet()) {
Net* rootNet = dynamic_cast<Net*>( Net* rootNet = dynamic_cast<Net*>(
dynamic_cast<DeepNet*>(net)->getRootNetOccurrence().getEntity() ); dynamic_cast<DeepNet*>(net)->getRootNetOccurrence().getEntity() );
for( Component* component : rootNet->getComponents() ) { for( Component* component : rootNet->getComponents() ) {
@ -182,16 +152,11 @@ namespace Anabatic {
} }
} }
if (isFixed or isManualDetailRouted or isManualGlobalRouted or (rpCount < 2)) { if (isFixed or isPreRouted or (rpCount < 2)) {
NetData* ndata = getNetData( net, Flags::Create ); NetData* ndata = getNetData( net, Flags::Create );
NetRoutingState* state = ndata->getNetRoutingState(); NetRoutingState* state = ndata->getNetRoutingState();
state->unsetFlags( NetRoutingState::AutomaticGlobalRoute ); state->unsetFlags( NetRoutingState::AutomaticGlobalRoute );
if (isManualGlobalRouted) {
state->setFlags ( NetRoutingState::ManualGlobalRoute ); state->setFlags ( NetRoutingState::ManualGlobalRoute );
ndata->setGlobalFixed( true );
}
if (isManualDetailRouted)
state->setFlags( NetRoutingState::ManualDetailRoute );
ndata->setGlobalRouted( true ); ndata->setGlobalRouted( true );
if (rpCount < 2) if (rpCount < 2)
state->setFlags ( NetRoutingState::Unconnected ); state->setFlags ( NetRoutingState::Unconnected );
@ -199,17 +164,17 @@ namespace Anabatic {
if (isFixed) { if (isFixed) {
if (rpCount > 1) if (rpCount > 1)
cmess2 << " - <" << net->getName() << "> is fixed." << endl; cmess2 << " - <" << net->getName() << "> is fixed." << endl;
state->unsetFlags( NetRoutingState::ManualGlobalRoute|NetRoutingState::ManualDetailRoute ); state->unsetFlags( NetRoutingState::ManualGlobalRoute );
state->setFlags ( NetRoutingState::Fixed ); state->setFlags ( NetRoutingState::Fixed );
} else if (isManualGlobalRouted) { } else {
cmess2 << " - <" << net->getName() << "> is manually global routed." << endl;
} else if (isManualDetailRouted) {
if (rpCount > 1) { if (rpCount > 1) {
++toBeRouteds; ++toBeRouteds;
cmess2 << " - <" << net->getName() << "> is manually detail routed." << endl;
for ( auto contact : contacts ) { cmess2 << " - <" << net->getName() << "> is manually global routed." << endl;
AutoContact::createFrom( contact ); for ( auto icontact : contacts ) {
AutoContact::createFrom( icontact );
} }
for ( auto segment : segments ) { for ( auto segment : segments ) {
AutoContact* source = Session::lookup( dynamic_cast<Contact*>( segment->getSource() )); AutoContact* source = Session::lookup( dynamic_cast<Contact*>( segment->getSource() ));
AutoContact* target = Session::lookup( dynamic_cast<Contact*>( segment->getTarget() )); AutoContact* target = Session::lookup( dynamic_cast<Contact*>( segment->getTarget() ));

View File

@ -82,12 +82,7 @@ namespace Anabatic {
, _segmentRevalidateds() , _segmentRevalidateds()
, _netInvalidateds () , _netInvalidateds ()
, _netRevalidateds () , _netRevalidateds ()
{ { }
_autoContacts .reserve( 1024 );
_doglegs .reserve( 1024 );
_segmentInvalidateds.reserve( 1024 );
_segmentRevalidateds.reserve( 1024 );
}
void Session::_postCreate () void Session::_postCreate ()
@ -220,13 +215,11 @@ namespace Anabatic {
_anabatic->updateNetTopology ( net ); _anabatic->updateNetTopology ( net );
_anabatic->computeNetConstraints( net ); _anabatic->computeNetConstraints( net );
_anabatic->_computeNetOptimals ( net ); _anabatic->_computeNetOptimals ( net );
//_anabatic->_computeNetTerminals ( net ); _anabatic->_computeNetTerminals ( net );
} }
_canonize (); _canonize ();
AutoSegment* segment = NULL; for ( AutoSegment* segment : _segmentInvalidateds ) {
for ( size_t i=0 ; i<_segmentInvalidateds.size() ; ++i ) {
segment = _segmentInvalidateds[i];
if (segment->isCanonical()) { if (segment->isCanonical()) {
if (segment->isUnsetAxis()) segment->toOptimalAxis(); if (segment->isUnsetAxis()) segment->toOptimalAxis();
else segment->toConstraintAxis(); else segment->toConstraintAxis();
@ -259,8 +252,6 @@ namespace Anabatic {
cdebug_log(145,0) << "_segmentInvalidateds.size(): " << _segmentInvalidateds.size() << endl; cdebug_log(145,0) << "_segmentInvalidateds.size(): " << _segmentInvalidateds.size() << endl;
_segmentRevalidateds.clear(); _segmentRevalidateds.clear();
std::sort( _segmentInvalidateds.begin(), _segmentInvalidateds.end()
, AutoSegment::CompareByRevalidate() );
for ( size_t i=0 ; i < _segmentInvalidateds.size() ; ++i, ++count ) { for ( size_t i=0 ; i < _segmentInvalidateds.size() ; ++i, ++count ) {
_segmentInvalidateds[i]->revalidate(); _segmentInvalidateds[i]->revalidate();
if ( not _destroyedSegments.empty() if ( not _destroyedSegments.empty()
@ -362,31 +353,6 @@ namespace Anabatic {
} }
DbU::Unit Session::_getNearestTrackAxis ( const Layer* layer, DbU::Unit axis, uint32_t mode )
{
Box ab = _anabatic->getCell()->getAbutmentBox();
RoutingLayerGauge* lg = _routingGauge->getLayerGauge( layer );
if (not lg) return axis;
DbU::Unit minAxis = 0;
DbU::Unit maxAxis = 0;
if (lg->getDirection() == Constant::Horizontal) {
minAxis = ab.getYMin();
maxAxis = ab.getYMax();
} else {
minAxis = ab.getXMin();
maxAxis = ab.getXMax();
}
DbU::Unit trackAxis = lg->getTrackPosition( minAxis
, lg->getTrackIndex( minAxis
, maxAxis
, axis
, mode ) );
return trackAxis;
}
Point Session::_getNearestGridPoint ( Point p, Box constraint ) Point Session::_getNearestGridPoint ( Point p, Box constraint )
{ {
Box ab = _anabatic->getCell()->getAbutmentBox(); Box ab = _anabatic->getCell()->getAbutmentBox();

View File

@ -14,16 +14,20 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_ANABATIC_ENGINE_H
#define ANABATIC_ANABATIC_ENGINE_H
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
#include <set> #include <set>
#include "hurricane/NetRoutingProperty.h" #include "hurricane/NetRoutingProperty.h"
namespace Hurricane { namespace Hurricane {
class Instance; class Instance;
class CellViewer; class CellViewer;
} }
#include "crlcore/ToolEngine.h" #include "crlcore/ToolEngine.h"
#include "anabatic/Configuration.h" #include "anabatic/Configuration.h"
#include "anabatic/Matrix.h" #include "anabatic/Matrix.h"
@ -64,8 +68,6 @@ namespace Anabatic {
}; };
public: public:
RawGCellsUnder ( const AnabaticEngine*, Segment* ); RawGCellsUnder ( const AnabaticEngine*, Segment* );
RawGCellsUnder ( const AnabaticEngine*, Point source, Point target );
void commonCtor ( const AnabaticEngine*, Point source, Point target );
inline bool empty () const; inline bool empty () const;
inline size_t size () const; inline size_t size () const;
inline GCell* gcellAt ( size_t ) const; inline GCell* gcellAt ( size_t ) const;
@ -100,10 +102,9 @@ namespace Anabatic {
class NetData { class NetData {
public: public:
NetData ( Net*, AnabaticEngine* ); NetData ( Net* );
inline bool isGlobalEstimated () const; inline bool isGlobalEstimated () const;
inline bool isGlobalRouted () const; inline bool isGlobalRouted () const;
inline bool isGlobalFixed () const;
inline bool isMixedPreRoute () const; inline bool isMixedPreRoute () const;
inline bool isFixed () const; inline bool isFixed () const;
inline bool isExcluded () const; inline bool isExcluded () const;
@ -112,13 +113,11 @@ namespace Anabatic {
inline const Box& getSearchArea () const; inline const Box& getSearchArea () const;
inline DbU::Unit getHalfPerimeter () const; inline DbU::Unit getHalfPerimeter () const;
inline size_t getRpCount () const; inline size_t getRpCount () const;
inline size_t getDiodeRpCount () const;
inline DbU::Unit getSparsity () const; inline DbU::Unit getSparsity () const;
inline void setNetRoutingState ( NetRoutingState* ); inline void setNetRoutingState ( NetRoutingState* );
inline void setSearchArea ( Box ); inline void setSearchArea ( Box );
inline void setGlobalEstimated ( bool ); inline void setGlobalEstimated ( bool );
inline void setGlobalRouted ( bool ); inline void setGlobalRouted ( bool );
inline void setGlobalFixed ( bool );
inline void setExcluded ( bool ); inline void setExcluded ( bool );
inline void setRpCount ( size_t ); inline void setRpCount ( size_t );
private: private:
@ -130,7 +129,6 @@ namespace Anabatic {
NetRoutingState* _state; NetRoutingState* _state;
Box _searchArea; Box _searchArea;
size_t _rpCount; size_t _rpCount;
size_t _diodeCount;
DbU::Unit _sparsity; DbU::Unit _sparsity;
Flags _flags; Flags _flags;
}; };
@ -138,7 +136,6 @@ namespace Anabatic {
inline bool NetData::isGlobalEstimated () const { return _flags & Flags::GlobalEstimated; } inline bool NetData::isGlobalEstimated () const { return _flags & Flags::GlobalEstimated; }
inline bool NetData::isGlobalRouted () const { return _flags & Flags::GlobalRouted; } inline bool NetData::isGlobalRouted () const { return _flags & Flags::GlobalRouted; }
inline bool NetData::isGlobalFixed () const { return _flags & Flags::GlobalFixed; }
inline bool NetData::isMixedPreRoute () const { return (_state) ? _state->isMixedPreRoute() : false; } inline bool NetData::isMixedPreRoute () const { return (_state) ? _state->isMixedPreRoute() : false; }
inline bool NetData::isFixed () const { return (_state) ? _state->isFixed () : false; } inline bool NetData::isFixed () const { return (_state) ? _state->isFixed () : false; }
inline bool NetData::isExcluded () const { return _flags & Flags::ExcludeRoute; } inline bool NetData::isExcluded () const { return _flags & Flags::ExcludeRoute; }
@ -147,12 +144,10 @@ namespace Anabatic {
inline const Box& NetData::getSearchArea () const { return _searchArea; } inline const Box& NetData::getSearchArea () const { return _searchArea; }
inline DbU::Unit NetData::getHalfPerimeter () const { return (_searchArea.isEmpty()) ? 0.0 : (_searchArea.getWidth()+_searchArea.getHeight()); } inline DbU::Unit NetData::getHalfPerimeter () const { return (_searchArea.isEmpty()) ? 0.0 : (_searchArea.getWidth()+_searchArea.getHeight()); }
inline size_t NetData::getRpCount () const { return _rpCount; } inline size_t NetData::getRpCount () const { return _rpCount; }
inline size_t NetData::getDiodeRpCount () const { return _diodeCount; }
inline void NetData::setNetRoutingState ( NetRoutingState* state ) { _state=state; } inline void NetData::setNetRoutingState ( NetRoutingState* state ) { _state=state; }
inline DbU::Unit NetData::getSparsity () const { return _sparsity; } inline DbU::Unit NetData::getSparsity () const { return _sparsity; }
inline void NetData::setGlobalEstimated ( bool state ) { _flags.set(Flags::GlobalEstimated,state); } inline void NetData::setGlobalEstimated ( bool state ) { _flags.set(Flags::GlobalEstimated,state); }
inline void NetData::setGlobalRouted ( bool state ) { _flags.set(Flags::GlobalRouted ,state); } inline void NetData::setGlobalRouted ( bool state ) { _flags.set(Flags::GlobalRouted ,state); }
inline void NetData::setGlobalFixed ( bool state ) { _flags.set(Flags::GlobalFixed ,state); }
inline void NetData::setExcluded ( bool state ) { _flags.set(Flags::ExcludeRoute ,state); } inline void NetData::setExcluded ( bool state ) { _flags.set(Flags::ExcludeRoute ,state); }
inline void NetData::setRpCount ( size_t count ) { _rpCount=count; _update(); } inline void NetData::setRpCount ( size_t count ) { _rpCount=count; _update(); }
@ -166,11 +161,6 @@ namespace Anabatic {
inline bool operator() ( const NetData* lhs, const NetData* rhs ) const inline bool operator() ( const NetData* lhs, const NetData* rhs ) const
{ {
if (lhs->isMixedPreRoute() != rhs->isMixedPreRoute()) return lhs->isMixedPreRoute(); if (lhs->isMixedPreRoute() != rhs->isMixedPreRoute()) return lhs->isMixedPreRoute();
if ((lhs->getRpCount() > 10) or (rhs->getRpCount() > 10)) {
if (lhs->getRpCount() != rhs->getRpCount())
return lhs->getRpCount() > rhs->getRpCount();
}
if (lhs->getSparsity() != rhs->getSparsity() ) return lhs->getSparsity() < rhs->getSparsity(); if (lhs->getSparsity() != rhs->getSparsity() ) return lhs->getSparsity() < rhs->getSparsity();
return lhs->getNet()->getId() < rhs->getNet()->getId(); return lhs->getNet()->getId() < rhs->getNet()->getId();
} }
@ -202,7 +192,6 @@ namespace Anabatic {
static const Name& staticGetName (); static const Name& staticGetName ();
virtual const Name& getName () const; virtual const Name& getName () const;
virtual Configuration* getConfiguration (); virtual Configuration* getConfiguration ();
virtual const Configuration* getConfiguration () const;
inline uint64_t getDensityMode () const; inline uint64_t getDensityMode () const;
inline CellViewer* getViewer () const; inline CellViewer* getViewer () const;
inline void setViewer ( CellViewer* ); inline void setViewer ( CellViewer* );
@ -214,7 +203,6 @@ namespace Anabatic {
inline GCell* getGCellUnder ( DbU::Unit x, DbU::Unit y ) const; inline GCell* getGCellUnder ( DbU::Unit x, DbU::Unit y ) const;
inline GCell* getGCellUnder ( Point ) const; inline GCell* getGCellUnder ( Point ) const;
inline GCellsUnder getGCellsUnder ( Segment* ) const; inline GCellsUnder getGCellsUnder ( Segment* ) const;
inline GCellsUnder getGCellsUnder ( Point source, Point target ) const;
inline Edges getEdgesUnderPath ( GCell* source, GCell* target, Flags pathFlags=Flags::NorthPath ) const; inline Edges getEdgesUnderPath ( GCell* source, GCell* target, Flags pathFlags=Flags::NorthPath ) const;
Interval getUSide ( Flags direction ) const; Interval getUSide ( Flags direction ) const;
int getCapacity ( Interval, Flags ) const; int getCapacity ( Interval, Flags ) const;
@ -230,7 +218,6 @@ namespace Anabatic {
void exclude ( const Name& netName ); void exclude ( const Name& netName );
void exclude ( Net* ); void exclude ( Net* );
void updateMatrix (); void updateMatrix ();
bool checkPlacement () const;
// Dijkstra related functions. // Dijkstra related functions.
inline int getStamp () const; inline int getStamp () const;
inline int incStamp (); inline int incStamp ();
@ -248,13 +235,10 @@ namespace Anabatic {
inline bool doDestroyBaseContact () const; inline bool doDestroyBaseContact () const;
inline bool doDestroyBaseSegment () const; inline bool doDestroyBaseSegment () const;
inline bool doDestroyTool () const; inline bool doDestroyTool () const;
inline DbU::Unit getAntennaGateMaxWL () const;
inline DbU::Unit getAntennaDiodeMaxWL () const;
inline DbU::Unit getGlobalThreshold () const; inline DbU::Unit getGlobalThreshold () const;
inline float getSaturateRatio () const; inline float getSaturateRatio () const;
inline size_t getSaturateRp () const; inline size_t getSaturateRp () const;
inline DbU::Unit getExtensionCap () const; inline DbU::Unit getExtensionCap () const;
inline Cell* getDiodeCell () const;
inline Net* getBlockageNet () const; inline Net* getBlockageNet () const;
inline const ChipTools& getChipTools () const; inline const ChipTools& getChipTools () const;
inline const vector<NetData*>& getNetOrdering () const; inline const vector<NetData*>& getNetOrdering () const;
@ -266,9 +250,6 @@ namespace Anabatic {
inline void setSaturateRp ( size_t ); inline void setSaturateRp ( size_t );
inline void setBlockageNet ( Net* ); inline void setBlockageNet ( Net* );
void chipPrep (); void chipPrep ();
void computeEdgeCapacities ( int maxHCap, int maxVCap, int termSatThreshold, int maxTermSat );
void antennaProtect ( Net*, uint32_t& failed, uint32_t& total );
void antennaProtect ();
void setupSpecialNets (); void setupSpecialNets ();
size_t setupPreRouteds (); size_t setupPreRouteds ();
void loadGlobalRouting ( uint32_t method ); void loadGlobalRouting ( uint32_t method );
@ -278,7 +259,6 @@ namespace Anabatic {
bool moveUpNetTrunk ( AutoSegment*, set<Net*>& globalNets, GCell::Set& invalidateds ); bool moveUpNetTrunk ( AutoSegment*, set<Net*>& globalNets, GCell::Set& invalidateds );
void layerAssign ( uint32_t method ); void layerAssign ( uint32_t method );
void finalizeLayout (); void finalizeLayout ();
void exportExternalNets ();
inline const AutoContactLut& _getAutoContactLut () const; inline const AutoContactLut& _getAutoContactLut () const;
inline const AutoSegmentLut& _getAutoSegmentLut () const; inline const AutoSegmentLut& _getAutoSegmentLut () const;
void _link ( AutoContact* ); void _link ( AutoContact* );
@ -347,7 +327,6 @@ namespace Anabatic {
AutoContactLut _autoContactLut; AutoContactLut _autoContactLut;
EdgeCapacityLut _edgeCapacitiesLut; EdgeCapacityLut _edgeCapacitiesLut;
Net* _blockageNet; Net* _blockageNet;
Cell* _diodeCell;
}; };
@ -362,7 +341,6 @@ namespace Anabatic {
inline GCell* AnabaticEngine::getGCellUnder ( DbU::Unit x, DbU::Unit y ) const { return _matrix.getUnder(x,y); } inline GCell* AnabaticEngine::getGCellUnder ( DbU::Unit x, DbU::Unit y ) const { return _matrix.getUnder(x,y); }
inline GCell* AnabaticEngine::getGCellUnder ( Point p ) const { return _matrix.getUnder(p); } inline GCell* AnabaticEngine::getGCellUnder ( Point p ) const { return _matrix.getUnder(p); }
inline GCellsUnder AnabaticEngine::getGCellsUnder ( Segment* s ) const { return std::shared_ptr<RawGCellsUnder>( new RawGCellsUnder(this,s) ); } inline GCellsUnder AnabaticEngine::getGCellsUnder ( Segment* s ) const { return std::shared_ptr<RawGCellsUnder>( new RawGCellsUnder(this,s) ); }
inline GCellsUnder AnabaticEngine::getGCellsUnder ( Point source, Point target ) const { return std::shared_ptr<RawGCellsUnder>( new RawGCellsUnder(this,source,target) ); }
inline Edges AnabaticEngine::getEdgesUnderPath ( GCell* source, GCell* target, Flags pathFlags ) const { return new Path_Edges(source,target,pathFlags); } inline Edges AnabaticEngine::getEdgesUnderPath ( GCell* source, GCell* target, Flags pathFlags ) const { return new Path_Edges(source,target,pathFlags); }
inline uint64_t AnabaticEngine::getDensityMode () const { return _densityMode; } inline uint64_t AnabaticEngine::getDensityMode () const { return _densityMode; }
inline void AnabaticEngine::setDensityMode ( uint64_t mode ) { _densityMode=mode; } inline void AnabaticEngine::setDensityMode ( uint64_t mode ) { _densityMode=mode; }
@ -377,14 +355,11 @@ namespace Anabatic {
inline bool AnabaticEngine::doWarnOnGCellOverload () const { return _flags & Flags::WarnOnGCellOverload; } inline bool AnabaticEngine::doWarnOnGCellOverload () const { return _flags & Flags::WarnOnGCellOverload; }
inline bool AnabaticEngine::isInDemoMode () const { return _flags & Flags::DemoMode; } inline bool AnabaticEngine::isInDemoMode () const { return _flags & Flags::DemoMode; }
inline bool AnabaticEngine::isChip () const { return _chipTools.isChip(); } inline bool AnabaticEngine::isChip () const { return _chipTools.isChip(); }
inline DbU::Unit AnabaticEngine::getAntennaGateMaxWL () const { return getConfiguration()->getAntennaGateMaxWL(); }
inline DbU::Unit AnabaticEngine::getAntennaDiodeMaxWL () const { return getConfiguration()->getAntennaDiodeMaxWL(); }
inline DbU::Unit AnabaticEngine::getGlobalThreshold () const { return _configuration->getGlobalThreshold(); } inline DbU::Unit AnabaticEngine::getGlobalThreshold () const { return _configuration->getGlobalThreshold(); }
inline float AnabaticEngine::getSaturateRatio () const { return _configuration->getSaturateRatio(); } inline float AnabaticEngine::getSaturateRatio () const { return _configuration->getSaturateRatio(); }
inline size_t AnabaticEngine::getSaturateRp () const { return _configuration->getSaturateRp(); } inline size_t AnabaticEngine::getSaturateRp () const { return _configuration->getSaturateRp(); }
inline void AnabaticEngine::setSaturateRatio ( float ratio ) { _configuration->setSaturateRatio(ratio); } inline void AnabaticEngine::setSaturateRatio ( float ratio ) { _configuration->setSaturateRatio(ratio); }
inline void AnabaticEngine::setSaturateRp ( size_t threshold ) { _configuration->setSaturateRp(threshold); } inline void AnabaticEngine::setSaturateRp ( size_t threshold ) { _configuration->setSaturateRp(threshold); }
inline Cell* AnabaticEngine::getDiodeCell () const { return _diodeCell; }
inline Net* AnabaticEngine::getBlockageNet () const { return _blockageNet; } inline Net* AnabaticEngine::getBlockageNet () const { return _blockageNet; }
inline const ChipTools& AnabaticEngine::getChipTools () const { return _chipTools; } inline const ChipTools& AnabaticEngine::getChipTools () const { return _chipTools; }
inline const vector<NetData*>& AnabaticEngine::getNetOrdering () const { return _netOrdering; } inline const vector<NetData*>& AnabaticEngine::getNetOrdering () const { return _netOrdering; }
@ -432,3 +407,5 @@ namespace Anabatic {
INSPECTOR_P_SUPPORT(Anabatic::AnabaticEngine); INSPECTOR_P_SUPPORT(Anabatic::AnabaticEngine);
#endif // ANABATIC_ANABATIC_ENGINE_H

View File

@ -71,8 +71,6 @@ namespace Anabatic {
, CntOnVertical = (1 << 14) , CntOnVertical = (1 << 14)
, CntOnHorizontal = (1 << 15) , CntOnHorizontal = (1 << 15)
, CntDrag = (1 << 16) , CntDrag = (1 << 16)
, CntHDogleg = (1 << 17)
, CntVDogleg = (1 << 18)
}; };
class AutoContact { class AutoContact {
@ -121,9 +119,6 @@ namespace Anabatic {
inline bool isVTee () const; inline bool isVTee () const;
inline bool isFixed () const; inline bool isFixed () const;
inline bool isUserNativeConstraints () const; inline bool isUserNativeConstraints () const;
inline bool isHDogleg () const;
inline bool isVDogleg () const;
virtual bool isOnPin () const;
inline bool hasBadTopology () const; inline bool hasBadTopology () const;
bool canDestroy ( Flags flags=Flags::NoFlags ) const; bool canDestroy ( Flags flags=Flags::NoFlags ) const;
bool canMoveUp ( const AutoSegment* moved ) const; bool canMoveUp ( const AutoSegment* moved ) const;
@ -164,7 +159,6 @@ namespace Anabatic {
virtual void cacheDetach ( AutoSegment* ) = 0; virtual void cacheDetach ( AutoSegment* ) = 0;
virtual void cacheAttach ( AutoSegment* ) = 0; virtual void cacheAttach ( AutoSegment* ) = 0;
virtual void updateCache () = 0; virtual void updateCache () = 0;
void updateLayer ();
void updateSize (); void updateSize ();
virtual void updateGeometry () = 0; virtual void updateGeometry () = 0;
virtual void updateTopology () = 0; virtual void updateTopology () = 0;
@ -265,8 +259,6 @@ namespace Anabatic {
inline bool AutoContact::isTerminal () const { return _flags&CntTerminal; } inline bool AutoContact::isTerminal () const { return _flags&CntTerminal; }
inline bool AutoContact::isHTee () const { return _flags&CntHTee; } inline bool AutoContact::isHTee () const { return _flags&CntHTee; }
inline bool AutoContact::isVTee () const { return _flags&CntVTee; } inline bool AutoContact::isVTee () const { return _flags&CntVTee; }
inline bool AutoContact::isHDogleg () const { return _flags&CntHDogleg; }
inline bool AutoContact::isVDogleg () const { return _flags&CntVDogleg; }
inline bool AutoContact::hasBadTopology () const { return _flags&CntBadTopology; } inline bool AutoContact::hasBadTopology () const { return _flags&CntBadTopology; }
inline bool AutoContact::canDrag () const { return _flags&CntDrag; } inline bool AutoContact::canDrag () const { return _flags&CntDrag; }
inline size_t AutoContact::getId () const { return _id; } inline size_t AutoContact::getId () const { return _id; }

View File

@ -60,7 +60,6 @@ namespace Anabatic {
virtual void _invalidate ( Flags flags ); virtual void _invalidate ( Flags flags );
public: public:
bool isEndPoint () const; bool isEndPoint () const;
virtual bool isOnPin () const;
virtual Box getNativeConstraintBox () const; virtual Box getNativeConstraintBox () const;
RoutingPad* getRoutingPad () const; RoutingPad* getRoutingPad () const;
inline AutoSegment* getSegment () const; inline AutoSegment* getSegment () const;

View File

@ -58,10 +58,11 @@ namespace Anabatic {
class AutoHorizontal; class AutoHorizontal;
class AutoVertical; class AutoVertical;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "AutoSegment". // Class : "AutoSegment".
class AutoSegment { class AutoSegment {
friend class AutoHorizontal; friend class AutoHorizontal;
friend class AutoVertical; friend class AutoVertical;
@ -105,9 +106,6 @@ namespace Anabatic {
static const uint64_t SegAnalog = (1L<<33); static const uint64_t SegAnalog = (1L<<33);
static const uint64_t SegWide = (1L<<34); static const uint64_t SegWide = (1L<<34);
static const uint64_t SegShortNet = (1L<<35); static const uint64_t SegShortNet = (1L<<35);
static const uint64_t SegUnbreakable = (1L<<36);
static const uint64_t SegNonPref = (1L<<37);
static const uint64_t SegAtMinArea = (1L<<38);
// Masks. // Masks.
static const uint64_t SegWeakTerminal = SegStrongTerminal|SegWeakTerminal1|SegWeakTerminal2; static const uint64_t SegWeakTerminal = SegStrongTerminal|SegWeakTerminal1|SegWeakTerminal2;
static const uint64_t SegNotAligned = SegNotSourceAligned|SegNotTargetAligned; static const uint64_t SegNotAligned = SegNotSourceAligned|SegNotTargetAligned;
@ -142,7 +140,6 @@ namespace Anabatic {
inline static DbU::Unit getViaToTopCap ( size_t depth ); inline static DbU::Unit getViaToTopCap ( size_t depth );
inline static DbU::Unit getViaToBottomCap ( size_t depth ); inline static DbU::Unit getViaToBottomCap ( size_t depth );
inline static DbU::Unit getViaToSameCap ( size_t depth ); inline static DbU::Unit getViaToSameCap ( size_t depth );
inline static DbU::Unit getMinimalLength ( size_t depth );
static AutoSegment* create ( AutoContact* source static AutoSegment* create ( AutoContact* source
, AutoContact* target , AutoContact* target
, Segment* hurricaneSegment , Segment* hurricaneSegment
@ -173,8 +170,6 @@ namespace Anabatic {
inline DbU::Unit getWidth () const; inline DbU::Unit getWidth () const;
inline DbU::Unit getContactWidth () const; inline DbU::Unit getContactWidth () const;
inline DbU::Unit getLength () const; inline DbU::Unit getLength () const;
inline DbU::Unit getSpanLength () const;
inline DbU::Unit getAnchoredLength () const;
inline DbU::Unit getSourcePosition () const; inline DbU::Unit getSourcePosition () const;
inline DbU::Unit getTargetPosition () const; inline DbU::Unit getTargetPosition () const;
inline DbU::Unit getSourceX () const; inline DbU::Unit getSourceX () const;
@ -199,10 +194,7 @@ namespace Anabatic {
inline bool isWeakTerminal1 () const; inline bool isWeakTerminal1 () const;
inline bool isWeakTerminal2 () const; inline bool isWeakTerminal2 () const;
inline bool isTerminal () const; inline bool isTerminal () const;
inline bool isUnbreakable () const;
inline bool isNonPref () const;
inline bool isDrag () const; inline bool isDrag () const;
inline bool isAtMinArea () const;
inline bool isNotSourceAligned () const; inline bool isNotSourceAligned () const;
inline bool isNotTargetAligned () const; inline bool isNotTargetAligned () const;
inline bool isNotAligned () const; inline bool isNotAligned () const;
@ -210,12 +202,10 @@ namespace Anabatic {
inline bool isSourceTerminal () const; inline bool isSourceTerminal () const;
inline bool isTargetTerminal () const; inline bool isTargetTerminal () const;
inline bool isLayerChange () const; inline bool isLayerChange () const;
inline bool isStackedStrap () const;
inline bool isSpinTop () const; inline bool isSpinTop () const;
inline bool isSpinBottom () const; inline bool isSpinBottom () const;
inline bool isSpinTopOrBottom () const; inline bool isSpinTopOrBottom () const;
inline bool isReduced () const; inline bool isReduced () const;
bool isUnderMinLength () const;
inline bool isStrap () const; inline bool isStrap () const;
inline bool isDogleg () const; inline bool isDogleg () const;
inline bool isUnbound () const; inline bool isUnbound () const;
@ -226,14 +216,13 @@ namespace Anabatic {
inline bool isUnsetAxis () const; inline bool isUnsetAxis () const;
inline bool isSlackened () const; inline bool isSlackened () const;
inline bool isUserDefined () const; inline bool isUserDefined () const;
bool isMiddleStack () const;
bool isReduceCandidate () const; bool isReduceCandidate () const;
bool isUTurn () const; bool isUTurn () const;
inline bool isAnalog () const; inline bool isAnalog () const;
inline bool isWide () const; inline bool isWide () const;
inline bool isShortNet () const; inline bool isShortNet () const;
virtual bool _canSlacken () const = 0; virtual bool _canSlacken () const = 0;
bool canReduce ( Flags flags=Flags::WithPerpands ) const; bool canReduce () const;
bool mustRaise () const; bool mustRaise () const;
Flags canDogleg ( Interval ); Flags canDogleg ( Interval );
virtual bool canMoveULeft ( float reserve=0.0 ) const = 0; virtual bool canMoveULeft ( float reserve=0.0 ) const = 0;
@ -256,7 +245,6 @@ namespace Anabatic {
AutoContact* getOppositeAnchor ( AutoContact* ) const; AutoContact* getOppositeAnchor ( AutoContact* ) const;
size_t getPerpandicularsBound ( set<AutoSegment*>& ); size_t getPerpandicularsBound ( set<AutoSegment*>& );
inline AutoSegment* getParent () const; inline AutoSegment* getParent () const;
inline unsigned int getRpDistance () const;
inline unsigned int getDepth () const; inline unsigned int getDepth () const;
inline DbU::Unit getPitch () const; inline DbU::Unit getPitch () const;
DbU::Unit getPPitch () const; DbU::Unit getPPitch () const;
@ -290,13 +278,10 @@ namespace Anabatic {
virtual AutoSegment* getCanonical ( DbU::Unit& min , DbU::Unit& max ); virtual AutoSegment* getCanonical ( DbU::Unit& min , DbU::Unit& max );
inline AutoSegment* getCanonical ( Interval& i ); inline AutoSegment* getCanonical ( Interval& i );
float getMaxUnderDensity ( Flags flags ); float getMaxUnderDensity ( Flags flags );
inline uint32_t getReduceds () const;
uint32_t getNonReduceds ( Flags flags=Flags::WithPerpands ) const;
// Modifiers. // Modifiers.
inline void unsetFlags ( uint64_t ); inline void unsetFlags ( uint64_t );
inline void setFlags ( uint64_t ); inline void setFlags ( uint64_t );
void setFlagsOnAligneds ( uint64_t ); void setFlagsOnAligneds ( uint64_t );
inline void setRpDistance ( unsigned int );
inline void incReduceds (); inline void incReduceds ();
inline void decReduceds (); inline void decReduceds ();
virtual void setDuSource ( DbU::Unit du ) = 0; virtual void setDuSource ( DbU::Unit du ) = 0;
@ -335,11 +320,8 @@ namespace Anabatic {
bool moveUp ( Flags flags=Flags::NoFlags ); bool moveUp ( Flags flags=Flags::NoFlags );
bool moveDown ( Flags flags=Flags::NoFlags ); bool moveDown ( Flags flags=Flags::NoFlags );
bool reduceDoglegLayer (); bool reduceDoglegLayer ();
bool bloatStackedStrap (); bool reduce ();
bool reduce ( Flags flags=Flags::WithPerpands );
bool raise (); bool raise ();
bool expandToMinLength ( Interval );
bool unexpandToMinLength ();
// Canonical Modifiers. // Canonical Modifiers.
AutoSegment* canonize ( Flags flags=Flags::NoFlags ); AutoSegment* canonize ( Flags flags=Flags::NoFlags );
virtual void invalidate ( Flags flags=Flags::Propagate ); virtual void invalidate ( Flags flags=Flags::Propagate );
@ -383,7 +365,7 @@ namespace Anabatic {
static bool _analogMode; static bool _analogMode;
static bool _shortNetMode; static bool _shortNetMode;
static bool _initialized; static bool _initialized;
static vector< array<DbU::Unit*,4> > _extensionCaps; static vector< array<DbU::Unit*,3> > _extensionCaps;
// Internal: Attributes. // Internal: Attributes.
const unsigned long _id; const unsigned long _id;
GCell* _gcell; GCell* _gcell;
@ -392,7 +374,6 @@ namespace Anabatic {
unsigned int _optimalMin :16; unsigned int _optimalMin :16;
unsigned int _optimalMax :16; unsigned int _optimalMax :16;
unsigned int _reduceds : 2; unsigned int _reduceds : 2;
unsigned int _rpDistance : 4;
DbU::Unit _sourcePosition; DbU::Unit _sourcePosition;
DbU::Unit _targetPosition; DbU::Unit _targetPosition;
Interval _userConstraints; Interval _userConstraints;
@ -433,13 +414,6 @@ namespace Anabatic {
struct CompareBySourceU : public binary_function<AutoSegment*,AutoSegment*,bool> { struct CompareBySourceU : public binary_function<AutoSegment*,AutoSegment*,bool> {
bool operator() ( AutoSegment* lhs, AutoSegment* rhs ) const; bool operator() ( AutoSegment* lhs, AutoSegment* rhs ) const;
}; };
public:
struct CompareByRevalidate : public binary_function<AutoSegment*,AutoSegment*,bool> {
bool operator() ( AutoSegment* lhs, AutoSegment* rhs ) const;
};
struct CompareByReduceds : public binary_function<AutoSegment*,AutoSegment*,bool> {
bool operator() ( AutoSegment* lhs, AutoSegment* rhs ) const;
};
public: public:
typedef std::set<AutoSegment*,CompareByDepthLength> DepthLengthSet; typedef std::set<AutoSegment*,CompareByDepthLength> DepthLengthSet;
typedef std::set<AutoSegment*,CompareId> IdSet; typedef std::set<AutoSegment*,CompareId> IdSet;
@ -484,7 +458,6 @@ namespace Anabatic {
inline DbU::Unit AutoSegment::getViaToTopCap ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][0]) : 0; } inline DbU::Unit AutoSegment::getViaToTopCap ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][0]) : 0; }
inline DbU::Unit AutoSegment::getViaToBottomCap ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][1]) : 0; } inline DbU::Unit AutoSegment::getViaToBottomCap ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][1]) : 0; }
inline DbU::Unit AutoSegment::getViaToSameCap ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][2]) : 0; } inline DbU::Unit AutoSegment::getViaToSameCap ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][2]) : 0; }
inline DbU::Unit AutoSegment::getMinimalLength ( size_t depth ) { return (depth < _extensionCaps.size()) ? *(_extensionCaps[depth][3]) : 0; }
inline unsigned long AutoSegment::getId () const { return _id; } inline unsigned long AutoSegment::getId () const { return _id; }
inline Cell* AutoSegment::getCell () const { return base()->getCell(); } inline Cell* AutoSegment::getCell () const { return base()->getCell(); }
inline Net* AutoSegment::getNet () const { return base()->getNet(); } inline Net* AutoSegment::getNet () const { return base()->getNet(); }
@ -511,7 +484,6 @@ namespace Anabatic {
inline bool AutoSegment::getConstraints ( Interval& i ) const { return getConstraints(i.getVMin(),i.getVMax()); } inline bool AutoSegment::getConstraints ( Interval& i ) const { return getConstraints(i.getVMin(),i.getVMax()); }
inline AutoSegment* AutoSegment::getCanonical ( Interval& i ) { return getCanonical(i.getVMin(),i.getVMax()); } inline AutoSegment* AutoSegment::getCanonical ( Interval& i ) { return getCanonical(i.getVMin(),i.getVMax()); }
inline unsigned int AutoSegment::getDepth () const { return _depth; } inline unsigned int AutoSegment::getDepth () const { return _depth; }
inline unsigned int AutoSegment::getRpDistance () const { return _rpDistance; }
inline DbU::Unit AutoSegment::getPitch () const { return Session::getPitch(getDepth(),Flags::NoFlags); } inline DbU::Unit AutoSegment::getPitch () const { return Session::getPitch(getDepth(),Flags::NoFlags); }
inline DbU::Unit AutoSegment::getAxis () const { return isHorizontal()?base()->getY():base()->getX(); } inline DbU::Unit AutoSegment::getAxis () const { return isHorizontal()?base()->getY():base()->getX(); }
inline DbU::Unit AutoSegment::getOrigin () const { return isHorizontal()?_gcell->getYMin():_gcell->getXMin(); } inline DbU::Unit AutoSegment::getOrigin () const { return isHorizontal()?_gcell->getYMin():_gcell->getXMin(); }
@ -522,7 +494,6 @@ namespace Anabatic {
inline DbU::Unit AutoSegment::getNativeMax () const { return _nativeConstraints.getVMax(); } inline DbU::Unit AutoSegment::getNativeMax () const { return _nativeConstraints.getVMax(); }
inline const Interval& AutoSegment::getUserConstraints () const { return _userConstraints; } inline const Interval& AutoSegment::getUserConstraints () const { return _userConstraints; }
inline const Interval& AutoSegment::getNativeConstraints () const { return _nativeConstraints; } inline const Interval& AutoSegment::getNativeConstraints () const { return _nativeConstraints; }
inline uint32_t AutoSegment::getReduceds () const { return _reduceds; }
inline bool AutoSegment::isHorizontal () const { return _flags & SegHorizontal; } inline bool AutoSegment::isHorizontal () const { return _flags & SegHorizontal; }
inline bool AutoSegment::isVertical () const { return not (_flags & SegHorizontal); } inline bool AutoSegment::isVertical () const { return not (_flags & SegHorizontal); }
@ -532,17 +503,14 @@ namespace Anabatic {
inline bool AutoSegment::isWeakGlobal () const { return _flags & SegWeakGlobal; } inline bool AutoSegment::isWeakGlobal () const { return _flags & SegWeakGlobal; }
inline bool AutoSegment::isLongLocal () const { return _flags & SegLongLocal; } inline bool AutoSegment::isLongLocal () const { return _flags & SegLongLocal; }
inline bool AutoSegment::isLocal () const { return not (_flags & SegGlobal); } inline bool AutoSegment::isLocal () const { return not (_flags & SegGlobal); }
inline bool AutoSegment::isUnbreakable () const { return _flags & SegUnbreakable; }
inline bool AutoSegment::isNonPref () const { return _flags & SegNonPref; }
inline bool AutoSegment::isBipoint () const { return _flags & SegBipoint; } inline bool AutoSegment::isBipoint () const { return _flags & SegBipoint; }
inline bool AutoSegment::isWeakTerminal () const { return (_rpDistance < 2); } inline bool AutoSegment::isWeakTerminal () const { return _flags & SegWeakTerminal; }
inline bool AutoSegment::isWeakTerminal1 () const { return (_rpDistance == 1); } inline bool AutoSegment::isWeakTerminal1 () const { return _flags & SegWeakTerminal1; }
inline bool AutoSegment::isWeakTerminal2 () const { return (_rpDistance == 2); } inline bool AutoSegment::isWeakTerminal2 () const { return _flags & SegWeakTerminal2; }
inline bool AutoSegment::isSourceTerminal () const { return _flags & SegSourceTerminal; } inline bool AutoSegment::isSourceTerminal () const { return _flags & SegSourceTerminal; }
inline bool AutoSegment::isTargetTerminal () const { return _flags & SegTargetTerminal; } inline bool AutoSegment::isTargetTerminal () const { return _flags & SegTargetTerminal; }
inline bool AutoSegment::isTerminal () const { return (_rpDistance == 0); } inline bool AutoSegment::isTerminal () const { return _flags & SegStrongTerminal; }
inline bool AutoSegment::isDrag () const { return _flags & SegDrag; } inline bool AutoSegment::isDrag () const { return _flags & SegDrag; }
inline bool AutoSegment::isAtMinArea () const { return _flags & SegAtMinArea; }
inline bool AutoSegment::isNotSourceAligned () const { return _flags & SegNotSourceAligned; } inline bool AutoSegment::isNotSourceAligned () const { return _flags & SegNotSourceAligned; }
inline bool AutoSegment::isNotTargetAligned () const { return _flags & SegNotTargetAligned; } inline bool AutoSegment::isNotTargetAligned () const { return _flags & SegNotTargetAligned; }
inline bool AutoSegment::isNotAligned () const { return (_flags & SegNotAligned) == SegNotAligned; } inline bool AutoSegment::isNotAligned () const { return (_flags & SegNotAligned) == SegNotAligned; }
@ -569,7 +537,6 @@ namespace Anabatic {
inline uint64_t AutoSegment::getFlags () const { return _flags; } inline uint64_t AutoSegment::getFlags () const { return _flags; }
inline uint64_t AutoSegment::_getFlags () const { return _flags; } inline uint64_t AutoSegment::_getFlags () const { return _flags; }
inline void AutoSegment::setRpDistance ( unsigned int distance ) { _rpDistance=distance; }
inline void AutoSegment::incReduceds () { if (_reduceds<3) ++_reduceds; } inline void AutoSegment::incReduceds () { if (_reduceds<3) ++_reduceds; }
inline void AutoSegment::decReduceds () { if (_reduceds>0) --_reduceds; } inline void AutoSegment::decReduceds () { if (_reduceds>0) --_reduceds; }
inline void AutoSegment::setLayer ( const Layer* layer ) { base()->setLayer(layer); _depth=Session::getLayerDepth(layer); _flags|=SegInvalidatedLayer; } inline void AutoSegment::setLayer ( const Layer* layer ) { base()->setLayer(layer); _depth=Session::getLayerDepth(layer); _flags|=SegInvalidatedLayer; }
@ -581,7 +548,7 @@ namespace Anabatic {
inline void AutoSegment::resetNativeConstraints ( DbU::Unit min, DbU::Unit max ) { _nativeConstraints = Interval( min, max ); } inline void AutoSegment::resetNativeConstraints ( DbU::Unit min, DbU::Unit max ) { _nativeConstraints = Interval( min, max ); }
//inline void AutoSegment::mergeUserConstraints ( const Interval& constraints ) { _userConstraints.intersection(constraints); } //inline void AutoSegment::mergeUserConstraints ( const Interval& constraints ) { _userConstraints.intersection(constraints); }
inline void AutoSegment::resetUserConstraints () { _userConstraints = Interval(false); } inline void AutoSegment::resetUserConstraints () { _userConstraints = Interval(false); }
inline DbU::Unit AutoSegment::getAnchoredLength () const { return std::abs(getTargetU() - getSourceU()); }
inline void AutoSegment::setLayer ( size_t depth ) inline void AutoSegment::setLayer ( size_t depth )
{ {
@ -593,13 +560,10 @@ namespace Anabatic {
_flags|=SegInvalidatedLayer; _flags|=SegInvalidatedLayer;
} }
inline DbU::Unit AutoSegment::getContactWidth () const inline DbU::Unit AutoSegment::getContactWidth () const
{ return getWidth() + Session::getViaWidth(getLayer()) - Session::getWireWidth(getLayer()); } { return getWidth() + Session::getViaWidth(getLayer()) - Session::getWireWidth(getLayer()); }
inline DbU::Unit AutoSegment::getSpanLength () const
{ return getAnchoredLength() + getExtensionCap( Flags::Source|Flags::LayerCapOnly|Flags::NoMinLength )
+ getExtensionCap( Flags::Target|Flags::LayerCapOnly|Flags::NoMinLength );
}
inline void AutoSegment::setParent ( AutoSegment* parent ) inline void AutoSegment::setParent ( AutoSegment* parent )
{ {

View File

@ -14,7 +14,9 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_CHIP_TOOLS_H
#define ANABATIC_CHIP_TOOLS_H
#include <string> #include <string>
#include "hurricane/DbU.h" #include "hurricane/DbU.h"
#include "hurricane/Torus.h" #include "hurricane/Torus.h"
@ -111,4 +113,6 @@ namespace Anabatic {
} // Anabatic namespace. } // Anabatic namespace.
INSPECTOR_PR_SUPPORT(Anabatic::ChipTools); INSPECTOR_PV_SUPPORT(Anabatic::ChipTools);
#endif // ANABATIC_CHIP_TOOLS_H

View File

@ -14,7 +14,9 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_CONFIGURATION_H
#define ANABATIC_CONFIGURATION_H
#include <string> #include <string>
#include <vector> #include <vector>
@ -62,7 +64,6 @@ namespace Anabatic {
virtual ~Configuration (); virtual ~Configuration ();
virtual Configuration* clone () const; virtual Configuration* clone () const;
// Methods. // Methods.
inline bool isGLayer ( const Layer* ) const;
bool isGMetal ( const Layer* ) const; bool isGMetal ( const Layer* ) const;
bool isGContact ( const Layer* ) const; bool isGContact ( const Layer* ) const;
bool isTwoMetals () const; bool isTwoMetals () const;
@ -78,13 +79,11 @@ namespace Anabatic {
inline size_t getDVerticalDepth () const; inline size_t getDVerticalDepth () const;
inline const Layer* getDVerticalLayer () const; inline const Layer* getDVerticalLayer () const;
inline DbU::Unit getDVerticalWidth () const; inline DbU::Unit getDVerticalWidth () const;
inline DbU::Unit getDPVerticalWidth () const;
inline DbU::Unit getDVerticalPitch () const; inline DbU::Unit getDVerticalPitch () const;
inline DbU::Unit getDVerticalOffset () const; inline DbU::Unit getDVerticalOffset () const;
inline size_t getDHorizontalDepth () const; inline size_t getDHorizontalDepth () const;
inline const Layer* getDHorizontalLayer () const; inline const Layer* getDHorizontalLayer () const;
inline DbU::Unit getDHorizontalWidth () const; inline DbU::Unit getDHorizontalWidth () const;
inline DbU::Unit getDPHorizontalWidth () const;
inline DbU::Unit getDHorizontalPitch () const; inline DbU::Unit getDHorizontalPitch () const;
inline DbU::Unit getDHorizontalOffset () const; inline DbU::Unit getDHorizontalOffset () const;
inline size_t getDContactDepth () const; inline size_t getDContactDepth () const;
@ -104,20 +103,15 @@ namespace Anabatic {
DbU::Unit getPitch ( size_t depth, Flags flags ) const; DbU::Unit getPitch ( size_t depth, Flags flags ) const;
DbU::Unit getOffset ( size_t depth ) const; DbU::Unit getOffset ( size_t depth ) const;
DbU::Unit getWireWidth ( size_t depth ) const; DbU::Unit getWireWidth ( size_t depth ) const;
DbU::Unit getPWireWidth ( size_t depth ) const;
DbU::Unit getExtensionCap ( size_t depth ) const; DbU::Unit getExtensionCap ( size_t depth ) const;
Flags getDirection ( size_t depth ) const; Flags getDirection ( size_t depth ) const;
DbU::Unit getPitch ( const Layer*, Flags flags ) const; DbU::Unit getPitch ( const Layer*, Flags flags ) const;
DbU::Unit getOffset ( const Layer* ) const; DbU::Unit getOffset ( const Layer* ) const;
DbU::Unit getWireWidth ( const Layer* ) const; DbU::Unit getWireWidth ( const Layer* ) const;
DbU::Unit getPWireWidth ( const Layer* ) const;
DbU::Unit getExtensionCap ( const Layer* ) const; DbU::Unit getExtensionCap ( const Layer* ) const;
Flags getDirection ( const Layer* ) const; Flags getDirection ( const Layer* ) const;
float getSaturateRatio () const; float getSaturateRatio () const;
size_t getSaturateRp () const; size_t getSaturateRp () const;
inline std::string getDiodeName () const;
inline DbU::Unit getAntennaGateMaxWL () const;
inline DbU::Unit getAntennaDiodeMaxWL () const;
DbU::Unit getGlobalThreshold () const; DbU::Unit getGlobalThreshold () const;
void setAllowedDepth ( size_t ); void setAllowedDepth ( size_t );
void setSaturateRatio ( float ); void setSaturateRatio ( float );
@ -160,16 +154,12 @@ namespace Anabatic {
float _edgeHInc; float _edgeHInc;
float _edgeHScaling; float _edgeHScaling;
int _globalIterations; int _globalIterations;
std::string _diodeName;
DbU::Unit _antennaGateMaxWL;
DbU::Unit _antennaDiodeMaxWL;
private: private:
Configuration& operator= ( const Configuration& ) = delete; Configuration& operator= ( const Configuration& ) = delete;
void _setTopRoutingLayer ( Name name ); void _setTopRoutingLayer ( Name name );
}; };
inline bool Configuration::isGLayer ( const Layer* layer ) const { return isGMetal(layer) or isGContact(layer); }
inline size_t Configuration::getGHorizontalDepth () const { return _gdepthh; } inline size_t Configuration::getGHorizontalDepth () const { return _gdepthh; }
inline size_t Configuration::getGVerticalDepth () const { return _gdepthv; } inline size_t Configuration::getGVerticalDepth () const { return _gdepthv; }
inline DbU::Unit Configuration::getGHorizontalPitch () const { return getPitch( getGHorizontalDepth(), Flags::NoFlags ); } inline DbU::Unit Configuration::getGHorizontalPitch () const { return getPitch( getGHorizontalDepth(), Flags::NoFlags ); }
@ -177,25 +167,22 @@ namespace Anabatic {
inline size_t Configuration::getDVerticalDepth () const { return _ddepthv; } inline size_t Configuration::getDVerticalDepth () const { return _ddepthv; }
inline const Layer* Configuration::getDVerticalLayer () const { return getRoutingLayer( getDVerticalDepth() ); } inline const Layer* Configuration::getDVerticalLayer () const { return getRoutingLayer( getDVerticalDepth() ); }
inline DbU::Unit Configuration::getDVerticalWidth () const { return getWireWidth ( getDVerticalDepth() ); } inline DbU::Unit Configuration::getDVerticalWidth () const { return getWireWidth ( getDVerticalDepth() ); }
inline DbU::Unit Configuration::getDPVerticalWidth () const { return getPWireWidth ( getDVerticalDepth() ); }
inline DbU::Unit Configuration::getDVerticalPitch () const { return getPitch ( getDVerticalDepth(), Flags::NoFlags ); } inline DbU::Unit Configuration::getDVerticalPitch () const { return getPitch ( getDVerticalDepth(), Flags::NoFlags ); }
inline DbU::Unit Configuration::getDVerticalOffset () const { return getOffset ( getDVerticalDepth() ); } inline DbU::Unit Configuration::getDVerticalOffset () const { return getOffset ( getDVerticalDepth() ); }
inline size_t Configuration::getDHorizontalDepth () const { return _ddepthh; } inline size_t Configuration::getDHorizontalDepth () const { return _ddepthh; }
inline const Layer* Configuration::getDHorizontalLayer () const { return getRoutingLayer( getDHorizontalDepth() ); } inline const Layer* Configuration::getDHorizontalLayer () const { return getRoutingLayer( getDHorizontalDepth() ); }
inline DbU::Unit Configuration::getDHorizontalWidth () const { return getWireWidth ( getDHorizontalDepth() ); } inline DbU::Unit Configuration::getDHorizontalWidth () const { return getWireWidth ( getDHorizontalDepth() ); }
inline DbU::Unit Configuration::getDPHorizontalWidth () const { return getPWireWidth ( getDHorizontalDepth() ); }
inline DbU::Unit Configuration::getDHorizontalPitch () const { return getPitch ( getDHorizontalDepth(), Flags::NoFlags ); } inline DbU::Unit Configuration::getDHorizontalPitch () const { return getPitch ( getDHorizontalDepth(), Flags::NoFlags ); }
inline DbU::Unit Configuration::getDHorizontalOffset () const { return getOffset ( getDHorizontalDepth() ); } inline DbU::Unit Configuration::getDHorizontalOffset () const { return getOffset ( getDHorizontalDepth() ); }
inline size_t Configuration::getDContactDepth () const { return _ddepthc; } inline size_t Configuration::getDContactDepth () const { return _ddepthc; }
inline const Layer* Configuration::getDContactLayer () const { return getContactLayer( getDContactDepth() ); } inline const Layer* Configuration::getDContactLayer () const { return getContactLayer( getDContactDepth() ); }
inline DbU::Unit Configuration::getDContactWidth () const { return getWireWidth ( getDContactDepth() ); } inline DbU::Unit Configuration::getDContactWidth () const { return getWireWidth ( getDContactDepth() ); }
inline DbU::Unit Configuration::getDContactPitch () const { return getPitch ( getDContactDepth(), Flags::NoFlags ); } inline DbU::Unit Configuration::getDContactPitch () const { return getPitch ( getDContactDepth(), Flags::NoFlags ); }
inline std::string Configuration::getDiodeName () const { return _diodeName; }
inline DbU::Unit Configuration::getAntennaGateMaxWL () const { return _antennaGateMaxWL; }
inline DbU::Unit Configuration::getAntennaDiodeMaxWL () const { return _antennaDiodeMaxWL; }
} // Anabatic namespace. } // Anabatic namespace.
INSPECTOR_P_SUPPORT(Anabatic::Configuration); INSPECTOR_P_SUPPORT(Anabatic::Configuration);
#endif // ANABATIC_CONFIGURATION_H

View File

@ -14,7 +14,9 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_CONSTANTS_H
#define ANABATIC_CONSTANTS_H
#include "hurricane/Flags.h" #include "hurricane/Flags.h"
namespace Anabatic { namespace Anabatic {
@ -41,7 +43,6 @@ namespace Anabatic {
static const BaseFlags ChannelRow ; // = (1 << 13); static const BaseFlags ChannelRow ; // = (1 << 13);
static const BaseFlags HRailGCell ; // = (1 << 14); static const BaseFlags HRailGCell ; // = (1 << 14);
static const BaseFlags VRailGCell ; // = (1 << 15); static const BaseFlags VRailGCell ; // = (1 << 15);
static const BaseFlags GoStraight ; // = (1 << 16);
// Flags for Edge objects states only. // Flags for Edge objects states only.
static const BaseFlags NullCapacity ; // = (1 << 5); static const BaseFlags NullCapacity ; // = (1 << 5);
static const BaseFlags InfiniteCapacity ; // = (1 << 6); static const BaseFlags InfiniteCapacity ; // = (1 << 6);
@ -52,11 +53,9 @@ namespace Anabatic {
static const BaseFlags DestroyBaseContact ; // = (1 << 8); static const BaseFlags DestroyBaseContact ; // = (1 << 8);
static const BaseFlags DestroyBaseSegment ; // = (1 << 9); static const BaseFlags DestroyBaseSegment ; // = (1 << 9);
// Flags for NetDatas objects states only. // Flags for NetDatas objects states only.
static const BaseFlags GlobalFixed ; // = (1 << 5); static const BaseFlags GlobalRouted ; // = (1 << 5);
static const BaseFlags GlobalEstimated ; // = (1 << 6); static const BaseFlags GlobalEstimated ; // = (1 << 6);
static const BaseFlags GlobalRouted ; // = (1 << 7); static const BaseFlags ExcludeRoute ; // = (1 << 7);
static const BaseFlags DetailRouted ; // = (1 << 8);
static const BaseFlags ExcludeRoute ; // = (1 << 9);
// Masks. // Masks.
static const BaseFlags WestSide ; // = Horizontal|Target; static const BaseFlags WestSide ; // = Horizontal|Target;
static const BaseFlags EastSide ; // = Horizontal|Source; static const BaseFlags EastSide ; // = Horizontal|Source;
@ -100,12 +99,6 @@ namespace Anabatic {
static const BaseFlags CheckLowUpDensity ; static const BaseFlags CheckLowUpDensity ;
static const BaseFlags NoUpdate ; static const BaseFlags NoUpdate ;
static const BaseFlags NorthPath ; static const BaseFlags NorthPath ;
static const BaseFlags UseNonPref ;
static const BaseFlags Force ;
static const BaseFlags LayerCapOnly ;
static const BaseFlags NoMinLength ;
static const BaseFlags NoSegExt ;
static const BaseFlags NullLength ;
public: public:
inline Flags ( uint64_t flags = NoFlags ); inline Flags ( uint64_t flags = NoFlags );
inline Flags ( const Hurricane::BaseFlags& ); inline Flags ( const Hurricane::BaseFlags& );
@ -152,4 +145,6 @@ namespace Anabatic {
} // Anabatic namespace. } // Anabatic namespace.
INSPECTOR_PR_SUPPORT(Anabatic::Flags); INSPECTOR_PV_SUPPORT(Anabatic::Flags)
#endif // ANABATIC_CONSTANTS_H

View File

@ -14,7 +14,9 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_DIJKSTRA_H
#define ANABATIC_DIJKSTRA_H
#include <set> #include <set>
#include <iomanip> #include <iomanip>
#include "hurricane/Observer.h" #include "hurricane/Observer.h"
@ -187,7 +189,6 @@ namespace Anabatic {
, iHorizontal = (1<<7) , iHorizontal = (1<<7)
, iVertical = (1<<8) , iVertical = (1<<8)
, iSet = (1<<9) , iSet = (1<<9)
, Driver = (1<<10)
}; };
public: public:
static DbU::Unit unreached; static DbU::Unit unreached;
@ -199,7 +200,6 @@ namespace Anabatic {
inline Vertex ( GCell* ); inline Vertex ( GCell* );
//inline Vertex ( size_t id ); //inline Vertex ( size_t id );
inline ~Vertex (); inline ~Vertex ();
inline bool isDriver () const;
inline bool isAnalog () const; inline bool isAnalog () const;
inline bool hasDoneAllRps () const; inline bool hasDoneAllRps () const;
inline Contact* hasGContact ( Net* ) const; inline Contact* hasGContact ( Net* ) const;
@ -220,7 +220,6 @@ namespace Anabatic {
Edge* getFrom () const; Edge* getFrom () const;
inline Vertex* getPredecessor () const; inline Vertex* getPredecessor () const;
inline Vertex* getNeighbor ( Edge* ) const; inline Vertex* getNeighbor ( Edge* ) const;
inline void setDriver ( bool state );
inline void setDistance ( DbU::Unit ); inline void setDistance ( DbU::Unit );
inline void setStamp ( int ); inline void setStamp ( int );
inline void setConnexId ( int ); inline void setConnexId ( int );
@ -334,7 +333,6 @@ namespace Anabatic {
inline Vertex* Vertex::lookup ( GCell* gcell ) { return gcell->getObserver<Vertex>(GCell::Observable::Vertex); } inline Vertex* Vertex::lookup ( GCell* gcell ) { return gcell->getObserver<Vertex>(GCell::Observable::Vertex); }
inline Vertex::~Vertex () { _gcell->setObserver( GCell::Observable::Vertex, NULL ); } inline Vertex::~Vertex () { _gcell->setObserver( GCell::Observable::Vertex, NULL ); }
inline bool Vertex::isDriver () const { return _flags & Driver; }
inline bool Vertex::isAnalog () const { return _gcell->isAnalog(); } inline bool Vertex::isAnalog () const { return _gcell->isAnalog(); }
inline Box Vertex::getBoundingBox () const { return _gcell->getBoundingBox(); } inline Box Vertex::getBoundingBox () const { return _gcell->getBoundingBox(); }
inline Edges Vertex::getEdges ( Flags sides ) const { return _gcell->getEdges(sides); } inline Edges Vertex::getEdges ( Flags sides ) const { return _gcell->getEdges(sides); }
@ -371,12 +369,6 @@ namespace Anabatic {
return (gcell) ? gcell->getObserver<Vertex>(GCell::Observable::Vertex) : NULL; return (gcell) ? gcell->getObserver<Vertex>(GCell::Observable::Vertex) : NULL;
} }
inline void Vertex::setDriver ( bool state )
{
if (state) _flags |= Driver;
else _flags &= ~Driver;
}
inline bool Vertex::CompareById::operator() ( const Vertex* lhs, const Vertex* rhs ) const inline bool Vertex::CompareById::operator() ( const Vertex* lhs, const Vertex* rhs ) const
{ return lhs->getId() < rhs->getId(); } { return lhs->getId() < rhs->getId(); }
@ -522,13 +514,11 @@ namespace Anabatic {
inline bool isSourceVertex ( Vertex* ) const; inline bool isSourceVertex ( Vertex* ) const;
inline Net* getNet () const; inline Net* getNet () const;
inline bool isTargetVertex ( Vertex* ) const; inline bool isTargetVertex ( Vertex* ) const;
DbU::Unit getAntennaGateMaxWL () const;
inline DbU::Unit getSearchAreaHalo () const; inline DbU::Unit getSearchAreaHalo () const;
template<typename DistanceT> template<typename DistanceT>
inline DistanceT* setDistance ( DistanceT ); inline DistanceT* setDistance ( DistanceT );
inline void setSearchAreaHalo ( DbU::Unit ); inline void setSearchAreaHalo ( DbU::Unit );
void load ( Net* net ); void load ( Net* net );
void loadFixedGlobal ( Net* net );
void run ( Mode mode=Mode::Standart ); void run ( Mode mode=Mode::Standart );
inline const VertexSet& getSources () const; inline const VertexSet& getSources () const;
private: private:
@ -603,4 +593,6 @@ namespace Anabatic {
GETSTRING_POINTER_SUPPORT(Anabatic::Vertex); GETSTRING_POINTER_SUPPORT(Anabatic::Vertex);
IOSTREAM_POINTER_SUPPORT(Anabatic::Vertex); IOSTREAM_POINTER_SUPPORT(Anabatic::Vertex);
INSPECTOR_PR_SUPPORT(Anabatic::Dijkstra::Mode); INSPECTOR_PV_SUPPORT(Anabatic::Dijkstra::Mode);
#endif // ANABATIC_DIJKSTRA_H

View File

@ -14,7 +14,9 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_EDGE_H
#define ANABATIC_EDGE_H
#include <string> #include <string>
#include "hurricane/Name.h" #include "hurricane/Name.h"
#include "hurricane/Interval.h" #include "hurricane/Interval.h"
@ -58,7 +60,6 @@ namespace Anabatic {
inline bool isHorizontal () const; inline bool isHorizontal () const;
inline bool hasNet ( const Net* ) const; inline bool hasNet ( const Net* ) const;
inline unsigned int getCapacity () const; inline unsigned int getCapacity () const;
inline unsigned int getRawCapacity () const;
inline unsigned int getReservedCapacity () const; inline unsigned int getReservedCapacity () const;
inline unsigned int getCapacity ( size_t depth ) const; inline unsigned int getCapacity ( size_t depth ) const;
inline unsigned int getRealOccupancy () const; inline unsigned int getRealOccupancy () const;
@ -135,8 +136,8 @@ namespace Anabatic {
inline bool Edge::isVertical () const { return _flags.isset(Flags::Vertical); } inline bool Edge::isVertical () const { return _flags.isset(Flags::Vertical); }
inline bool Edge::isHorizontal () const { return _flags.isset(Flags::Horizontal); } inline bool Edge::isHorizontal () const { return _flags.isset(Flags::Horizontal); }
inline bool Edge::hasNet ( const Net* owner ) const { return getSegment(owner); } inline bool Edge::hasNet ( const Net* owner ) const { return getSegment(owner); }
inline unsigned int Edge::getCapacity () const { return (_capacities) ? _capacities->getCapacity()-_reservedCapacity : 0; }
inline unsigned int Edge::getCapacity ( size_t depth ) const { return (_capacities) ? _capacities->getCapacity(depth) : 0; } inline unsigned int Edge::getCapacity ( size_t depth ) const { return (_capacities) ? _capacities->getCapacity(depth) : 0; }
inline unsigned int Edge::getRawCapacity () const { return (_capacities) ? _capacities->getCapacity() : 0; }
inline unsigned int Edge::getReservedCapacity () const { return _reservedCapacity; } inline unsigned int Edge::getReservedCapacity () const { return _reservedCapacity; }
inline unsigned int Edge::getRealOccupancy () const { return _realOccupancy; } inline unsigned int Edge::getRealOccupancy () const { return _realOccupancy; }
inline float Edge::getEstimateOccupancy () const { return _estimateOccupancy; } inline float Edge::getEstimateOccupancy () const { return _estimateOccupancy; }
@ -156,13 +157,9 @@ namespace Anabatic {
inline Flags& Edge::setFlags ( Flags mask ) { _flags |= mask; return _flags; } inline Flags& Edge::setFlags ( Flags mask ) { _flags |= mask; return _flags; }
inline void Edge::reserveCapacity ( int delta ) { _reservedCapacity = ((int)_reservedCapacity+delta > 0) ? _reservedCapacity+delta : 0; } inline void Edge::reserveCapacity ( int delta ) { _reservedCapacity = ((int)_reservedCapacity+delta > 0) ? _reservedCapacity+delta : 0; }
inline unsigned int Edge::getCapacity () const
{
if (not _capacities) return 0;
return (_capacities->getCapacity() > (int)_reservedCapacity) ? _capacities->getCapacity()-_reservedCapacity : 0;
}
} // Anabatic namespace. } // Anabatic namespace.
INSPECTOR_P_SUPPORT(Anabatic::Edge); INSPECTOR_P_SUPPORT(Anabatic::Edge);
#endif // ANABATIC_EDGE_H

View File

@ -14,9 +14,10 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_GCELL_H
#define ANABATIC_GCELL_H
#include <vector> #include <vector>
#include <queue>
#include <string> #include <string>
#include <set> #include <set>
#include <functional> #include <functional>
@ -114,21 +115,13 @@ namespace Anabatic {
public: public:
class Key { class Key {
public: public:
inline Key ( const GCell*, size_t depth ); inline Key ( GCell*, size_t depth );
inline ~Key ();
inline float getDensity () const; inline float getDensity () const;
inline const GCell* getGCell () const; inline GCell* getGCell () const;
inline bool isActive () const;
inline bool isSaturated () const;
inline void update ( size_t depth ); inline void update ( size_t depth );
friend bool operator< ( const Key&, const Key& ); friend bool operator< ( const Key&, const Key& );
public:
class Compare {
public:
inline bool operator() ( const Key*, const Key* );
};
private: private:
const GCell* _gcell; GCell* _gcell;
float _density; float _density;
}; };
public: public:
@ -154,7 +147,6 @@ namespace Anabatic {
inline bool isMatrix () const; inline bool isMatrix () const;
inline bool isRow () const; inline bool isRow () const;
inline bool isIoPad () const; inline bool isIoPad () const;
inline bool isGoStraight () const;
inline bool isHRail () const; inline bool isHRail () const;
inline bool isVRail () const; inline bool isVRail () const;
inline bool isStdCellRow () const; inline bool isStdCellRow () const;
@ -163,7 +155,6 @@ namespace Anabatic {
bool isEast ( GCell* ) const; bool isEast ( GCell* ) const;
bool isNorth ( GCell* ) const; bool isNorth ( GCell* ) const;
bool isSouth ( GCell* ) const; bool isSouth ( GCell* ) const;
bool hasNet ( const Net* ) const;
Contact* hasGContact ( const Contact* ) const; Contact* hasGContact ( const Contact* ) const;
Contact* hasGContact ( const Net* ) const; Contact* hasGContact ( const Net* ) const;
bool isHorizontalPlane ( size_t depth ) const; bool isHorizontalPlane ( size_t depth ) const;
@ -215,8 +206,7 @@ namespace Anabatic {
bool doGrid (); bool doGrid ();
Contact* getGContact ( Net* ); Contact* getGContact ( Net* );
inline const vector<Contact*>& getGContacts () const; inline const vector<Contact*>& getGContacts () const;
Segment* hasGoThrough ( Net* ) const; Contact* breakGoThrough ( Net* net );
Contact* breakGoThrough ( Net* );
bool unrefContact ( Contact* ); bool unrefContact ( Contact* );
void setSouthWestCorner ( DbU::Unit x, DbU::Unit y ); void setSouthWestCorner ( DbU::Unit x, DbU::Unit y );
void cleanupGlobal (); void cleanupGlobal ();
@ -226,7 +216,6 @@ namespace Anabatic {
bool hasFreeTrack ( size_t depth, float reserve ) const; bool hasFreeTrack ( size_t depth, float reserve ) const;
inline size_t getDepth () const; inline size_t getDepth () const;
size_t getNetCount () const; size_t getNetCount () const;
inline int getRpCount () const;
int getHCapacity () const; int getHCapacity () const;
int getVCapacity () const; int getVCapacity () const;
int getCapacity ( size_t depth ) const; int getCapacity ( size_t depth ) const;
@ -251,9 +240,6 @@ namespace Anabatic {
inline AutoSegments getStopSegments ( Flags direction ); inline AutoSegments getStopSegments ( Flags direction );
size_t getRoutingPads ( set<RoutingPad*>& ); size_t getRoutingPads ( set<RoutingPad*>& );
inline const Key& getKey () const; inline const Key& getKey () const;
inline Key* cloneKey ( size_t depth ) const;
inline Key* getLastClonedKey () const;
inline void clearClonedKey () const;
size_t checkDensity () const; size_t checkDensity () const;
bool checkEdgeSaturation ( size_t hreserved, size_t vreserved) const; bool checkEdgeSaturation ( size_t hreserved, size_t vreserved) const;
void setType ( Flags ); void setType ( Flags );
@ -277,7 +263,7 @@ namespace Anabatic {
bool stepNetDesaturate ( size_t depth bool stepNetDesaturate ( size_t depth
, set<Net*>& globalNets , set<Net*>& globalNets
, Set& invalidateds ); , Set& invalidateds );
inline void incRpCount ( int );
void forceEdgesCapacities ( unsigned int hcapacities, unsigned int vcapacities ); void forceEdgesCapacities ( unsigned int hcapacities, unsigned int vcapacities );
// Misc. functions. // Misc. functions.
inline const Flags& flags () const; inline const Flags& flags () const;
@ -334,7 +320,6 @@ namespace Anabatic {
vector<AutoContact*> _contacts; vector<AutoContact*> _contacts;
size_t _depth; size_t _depth;
size_t _pinDepth; size_t _pinDepth;
int _rpCount;
DbU::Unit* _blockages; DbU::Unit* _blockages;
float _cDensity; float _cDensity;
float* _densities; float* _densities;
@ -342,7 +327,6 @@ namespace Anabatic {
float* _fragmentations; float* _fragmentations;
float* _globalsCount; float* _globalsCount;
Key _key; Key _key;
mutable Key* _lastClonedKey;
}; };
@ -357,7 +341,6 @@ namespace Anabatic {
inline bool GCell::isMatrix () const { return _flags & Flags::MatrixGCell; } inline bool GCell::isMatrix () const { return _flags & Flags::MatrixGCell; }
inline bool GCell::isRow () const { return _flags & Flags::RowGCellMask; } inline bool GCell::isRow () const { return _flags & Flags::RowGCellMask; }
inline bool GCell::isIoPad () const { return _flags & Flags::IoPadGCell; } inline bool GCell::isIoPad () const { return _flags & Flags::IoPadGCell; }
inline bool GCell::isGoStraight () const { return _flags & Flags::GoStraight; }
inline bool GCell::isHRail () const { return _flags & Flags::HRailGCell; } inline bool GCell::isHRail () const { return _flags & Flags::HRailGCell; }
inline bool GCell::isVRail () const { return _flags & Flags::VRailGCell; } inline bool GCell::isVRail () const { return _flags & Flags::VRailGCell; }
inline bool GCell::isStdCellRow () const { return _flags & Flags::StdCellRow; } inline bool GCell::isStdCellRow () const { return _flags & Flags::StdCellRow; }
@ -390,7 +373,6 @@ namespace Anabatic {
inline GCell* GCell::getUnder ( Point p ) const { return getUnder(p.getX(),p.getY()); } inline GCell* GCell::getUnder ( Point p ) const { return getUnder(p.getX(),p.getY()); }
inline const vector<Contact*>& GCell::getGContacts () const { return _gcontacts; } inline const vector<Contact*>& GCell::getGContacts () const { return _gcontacts; }
inline size_t GCell::getDepth () const { return _depth; } inline size_t GCell::getDepth () const { return _depth; }
inline int GCell::getRpCount () const { return _rpCount; }
const vector<AutoSegment*>& GCell::getVSegments () const { return _vsegments; } const vector<AutoSegment*>& GCell::getVSegments () const { return _vsegments; }
inline const vector<AutoSegment*>& GCell::getHSegments () const { return _hsegments; } inline const vector<AutoSegment*>& GCell::getHSegments () const { return _hsegments; }
inline const vector<AutoContact*>& GCell::getContacts () const { return _contacts; } inline const vector<AutoContact*>& GCell::getContacts () const { return _contacts; }
@ -400,9 +382,6 @@ namespace Anabatic {
inline float GCell::getDensity ( size_t depth ) const { return (depth<_depth) ? _densities[depth] : 0.0; } inline float GCell::getDensity ( size_t depth ) const { return (depth<_depth) ? _densities[depth] : 0.0; }
inline const GCell::Key& GCell::getKey () const { return _key; } inline const GCell::Key& GCell::getKey () const { return _key; }
inline GCell::Key* GCell::cloneKey ( size_t depth ) const { _lastClonedKey = new Key(this,depth); return _lastClonedKey; }
inline void GCell::clearClonedKey () const { _lastClonedKey=NULL; }
inline GCell::Key* GCell::getLastClonedKey () const { return _lastClonedKey; }
inline void GCell::setType ( Flags type ) { _flags.reset(Flags::GCellTypeMask); _flags |= (type&Flags::GCellTypeMask); }; inline void GCell::setType ( Flags type ) { _flags.reset(Flags::GCellTypeMask); _flags |= (type&Flags::GCellTypeMask); };
inline void GCell::updateKey ( size_t depth ) { _key.update(depth); } inline void GCell::updateKey ( size_t depth ) { _key.update(depth); }
inline const Flags& GCell::flags () const { return _flags; } inline const Flags& GCell::flags () const { return _flags; }
@ -437,10 +416,6 @@ namespace Anabatic {
return Interval( getXMin(), getConstraintXMax(shrink) ); return Interval( getXMin(), getConstraintXMax(shrink) );
} }
inline void GCell::incRpCount ( int delta )
{ _rpCount = (_rpCount + delta > 0) ? (_rpCount + delta) : 0; }
inline void GCell::setObserver ( size_t slot, BaseObserver* observer ) inline void GCell::setObserver ( size_t slot, BaseObserver* observer )
{ _observable.setObserver( slot, observer ); } { _observable.setObserver( slot, observer ); }
@ -494,25 +469,17 @@ namespace Anabatic {
return lhs.getId() < rhs.getId(); return lhs.getId() < rhs.getId();
} }
// GCell::CompareByKey Inline Functions. // GCell::CompareByKey Inline Functions.
inline bool GCell::CompareByKey::operator() ( const GCell* lhs, const GCell* rhs ) inline bool GCell::CompareByKey::operator() ( const GCell* lhs, const GCell* rhs )
{ return lhs->getKey() < rhs->getKey(); } { return lhs->getKey() < rhs->getKey(); }
// GCell::Key Inline Functions. // GCell::Key Inline Functions.
inline GCell::Key::Key ( const GCell* owner, size_t depth ) inline GCell::Key::Key ( GCell* owner, size_t depth ) : _gcell(owner), _density(owner->getWDensity(depth,Flags::NoUpdate)) {}
: _gcell(owner)
, _density(owner->getWDensity(depth,Flags::NoUpdate))
{ }
inline GCell::Key::~Key ()
{ if (isActive()) _gcell->clearClonedKey(); }
inline float GCell::Key::getDensity () const { return _density; } inline float GCell::Key::getDensity () const { return _density; }
inline const GCell* GCell::Key::getGCell () const { return _gcell; } inline GCell* GCell::Key::getGCell () const { return _gcell; }
inline void GCell::Key::update ( size_t depth ) { _density=_gcell->getWDensity(depth); } inline void GCell::Key::update ( size_t depth ) { _density=_gcell->getWDensity(depth); }
inline bool GCell::Key::isActive () const { return (this == _gcell->getLastClonedKey()); }
inline bool GCell::Key::isSaturated () const { return _gcell->isSaturated(); }
inline bool operator< ( const GCell::Key& lhs, const GCell::Key& rhs ) inline bool operator< ( const GCell::Key& lhs, const GCell::Key& rhs )
{ {
@ -522,22 +489,6 @@ namespace Anabatic {
return lhs._gcell->getId() < rhs._gcell->getId(); return lhs._gcell->getId() < rhs._gcell->getId();
} }
inline bool GCell::Key::Compare::operator() ( const GCell::Key* lhs, const GCell::Key* rhs )
{
//if (lhs->isSaturated() xor rhs->isSaturated()) return lhs->isSaturated();
float difference = lhs->_density - rhs->_density;
if (difference != 0.0) return (difference < 0.0);
return lhs->_gcell->getId() < rhs->_gcell->getId();
}
// -------------------------------------------------------------------
// Class : "GCellKeyQueue".
typedef std::priority_queue< GCell::Key*, std::vector<GCell::Key*>, GCell::Key::Compare > GCellKeyQueue;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "GCellDensitySet". // Class : "GCellDensitySet".
@ -582,3 +533,5 @@ namespace Anabatic {
INSPECTOR_P_SUPPORT(Anabatic::GCell); INSPECTOR_P_SUPPORT(Anabatic::GCell);
#endif // ANABATIC_GCELL_H

View File

@ -98,9 +98,6 @@ namespace Anabatic {
, WestBound = (1 << 14) , WestBound = (1 << 14)
, EastBound = (1 << 15) , EastBound = (1 << 15)
, Middle = (1 << 16) , Middle = (1 << 16)
, UseNonPref = (1 << 17)
, NoProtect = (1 << 18)
, HBothAccess = HAccess|HAccessEW
, SouthWest = SouthBound|WestBound , SouthWest = SouthBound|WestBound
, NorthEast = NorthBound|EastBound , NorthEast = NorthBound|EastBound
}; };
@ -205,8 +202,6 @@ namespace Anabatic {
virtual bool _do_xG (); virtual bool _do_xG ();
virtual bool _do_2G (); virtual bool _do_2G ();
virtual bool _do_xG_1Pad (); virtual bool _do_xG_1Pad ();
virtual bool _do_1G_1PinM1 ();
virtual bool _do_2G_1PinM1 ();
virtual bool _do_1G_1PinM2 (); virtual bool _do_1G_1PinM2 ();
virtual bool _do_xG_1PinM2 (); virtual bool _do_xG_1PinM2 ();
virtual bool _do_1G_1PinM3 (); virtual bool _do_1G_1PinM3 ();
@ -221,11 +216,6 @@ namespace Anabatic {
virtual bool _do_xG_xM2 (); virtual bool _do_xG_xM2 ();
virtual bool _do_1G_1M3 (); virtual bool _do_1G_1M3 ();
virtual bool _do_xG_xM3 (); virtual bool _do_xG_xM3 ();
virtual bool _do_1G_xM1_1PinM2 ();
virtual bool _do_2G_xM1_1PinM2 ();
virtual bool _do_1G_1M1_1PinM3 ();
virtual bool _do_2G_xM1_1PinM3 ();
virtual bool _do_3G_xM1_1PinM3 ();
virtual bool _do_globalSegment (); virtual bool _do_globalSegment ();
virtual void singleGCell ( AnabaticEngine*, Net* ); virtual void singleGCell ( AnabaticEngine*, Net* );
AutoContact* _doHChannel (); AutoContact* _doHChannel ();
@ -260,10 +250,6 @@ namespace Anabatic {
, Conn_1G_3M1 = CONNEXITY_VALUE( 1, 3, 0, 0, 0 , 0 ) , Conn_1G_3M1 = CONNEXITY_VALUE( 1, 3, 0, 0, 0 , 0 )
, Conn_1G_4M1 = CONNEXITY_VALUE( 1, 4, 0, 0, 0 , 0 ) , Conn_1G_4M1 = CONNEXITY_VALUE( 1, 4, 0, 0, 0 , 0 )
, Conn_1G_5M1 = CONNEXITY_VALUE( 1, 5, 0, 0, 0 , 0 ) , Conn_1G_5M1 = CONNEXITY_VALUE( 1, 5, 0, 0, 0 , 0 )
, Conn_1G_6M1 = CONNEXITY_VALUE( 1, 6, 0, 0, 0 , 0 )
, Conn_1G_7M1 = CONNEXITY_VALUE( 1, 7, 0, 0, 0 , 0 )
, Conn_1G_8M1 = CONNEXITY_VALUE( 1, 8, 0, 0, 0 , 0 )
, Conn_1G_9M1 = CONNEXITY_VALUE( 1, 9, 0, 0, 0 , 0 )
, Conn_1G_1M2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 0 ) , Conn_1G_1M2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 0 )
, Conn_1G_2M2 = CONNEXITY_VALUE( 1, 0, 2, 0, 0 , 0 ) , Conn_1G_2M2 = CONNEXITY_VALUE( 1, 0, 2, 0, 0 , 0 )
, Conn_1G_3M2 = CONNEXITY_VALUE( 1, 0, 3, 0, 0 , 0 ) , Conn_1G_3M2 = CONNEXITY_VALUE( 1, 0, 3, 0, 0 , 0 )
@ -280,10 +266,6 @@ namespace Anabatic {
, Conn_2G_3M1 = CONNEXITY_VALUE( 2, 3, 0, 0, 0 , 0 ) , Conn_2G_3M1 = CONNEXITY_VALUE( 2, 3, 0, 0, 0 , 0 )
, Conn_2G_4M1 = CONNEXITY_VALUE( 2, 4, 0, 0, 0 , 0 ) , Conn_2G_4M1 = CONNEXITY_VALUE( 2, 4, 0, 0, 0 , 0 )
, Conn_2G_5M1 = CONNEXITY_VALUE( 2, 5, 0, 0, 0 , 0 ) , Conn_2G_5M1 = CONNEXITY_VALUE( 2, 5, 0, 0, 0 , 0 )
, Conn_2G_6M1 = CONNEXITY_VALUE( 2, 6, 0, 0, 0 , 0 )
, Conn_2G_7M1 = CONNEXITY_VALUE( 2, 7, 0, 0, 0 , 0 )
, Conn_2G_8M1 = CONNEXITY_VALUE( 2, 8, 0, 0, 0 , 0 )
, Conn_2G_9M1 = CONNEXITY_VALUE( 2, 9, 0, 0, 0 , 0 )
, Conn_2G_1M2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 0 ) , Conn_2G_1M2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 0 )
, Conn_2G_2M2 = CONNEXITY_VALUE( 2, 0, 2, 0, 0 , 0 ) , Conn_2G_2M2 = CONNEXITY_VALUE( 2, 0, 2, 0, 0 , 0 )
, Conn_2G_3M2 = CONNEXITY_VALUE( 2, 0, 3, 0, 0 , 0 ) , Conn_2G_3M2 = CONNEXITY_VALUE( 2, 0, 3, 0, 0 , 0 )
@ -298,11 +280,6 @@ namespace Anabatic {
, Conn_3G_2M1 = CONNEXITY_VALUE( 3, 2, 0, 0, 0 , 0 ) , Conn_3G_2M1 = CONNEXITY_VALUE( 3, 2, 0, 0, 0 , 0 )
, Conn_3G_3M1 = CONNEXITY_VALUE( 3, 3, 0, 0, 0 , 0 ) , Conn_3G_3M1 = CONNEXITY_VALUE( 3, 3, 0, 0, 0 , 0 )
, Conn_3G_4M1 = CONNEXITY_VALUE( 3, 4, 0, 0, 0 , 0 ) , Conn_3G_4M1 = CONNEXITY_VALUE( 3, 4, 0, 0, 0 , 0 )
, Conn_3G_5M1 = CONNEXITY_VALUE( 3, 5, 0, 0, 0 , 0 )
, Conn_3G_6M1 = CONNEXITY_VALUE( 3, 6, 0, 0, 0 , 0 )
, Conn_3G_7M1 = CONNEXITY_VALUE( 3, 7, 0, 0, 0 , 0 )
, Conn_3G_8M1 = CONNEXITY_VALUE( 3, 8, 0, 0, 0 , 0 )
, Conn_3G_9M1 = CONNEXITY_VALUE( 3, 9, 0, 0, 0 , 0 )
, Conn_3G_1M2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 0 ) , Conn_3G_1M2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 0 )
, Conn_3G_2M2 = CONNEXITY_VALUE( 3, 0, 2, 0, 0 , 0 ) , Conn_3G_2M2 = CONNEXITY_VALUE( 3, 0, 2, 0, 0 , 0 )
, Conn_3G_1M3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 0 ) , Conn_3G_1M3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 0 )
@ -314,35 +291,17 @@ namespace Anabatic {
, Conn_4G_2M1 = CONNEXITY_VALUE( 4, 2, 0, 0, 0 , 0 ) , Conn_4G_2M1 = CONNEXITY_VALUE( 4, 2, 0, 0, 0 , 0 )
, Conn_4G_3M1 = CONNEXITY_VALUE( 4, 3, 0, 0, 0 , 0 ) , Conn_4G_3M1 = CONNEXITY_VALUE( 4, 3, 0, 0, 0 , 0 )
, Conn_4G_4M1 = CONNEXITY_VALUE( 4, 4, 0, 0, 0 , 0 ) , Conn_4G_4M1 = CONNEXITY_VALUE( 4, 4, 0, 0, 0 , 0 )
, Conn_4G_5M1 = CONNEXITY_VALUE( 4, 5, 0, 0, 0 , 0 )
, Conn_4G_6M1 = CONNEXITY_VALUE( 4, 6, 0, 0, 0 , 0 )
, Conn_4G_7M1 = CONNEXITY_VALUE( 4, 7, 0, 0, 0 , 0 )
, Conn_4G_8M1 = CONNEXITY_VALUE( 4, 8, 0, 0, 0 , 0 )
, Conn_4G_9M1 = CONNEXITY_VALUE( 4, 9, 0, 0, 0 , 0 )
, Conn_4G_1M2 = CONNEXITY_VALUE( 4, 0, 1, 0, 0 , 0 ) , Conn_4G_1M2 = CONNEXITY_VALUE( 4, 0, 1, 0, 0 , 0 )
, Conn_4G_1M3 = CONNEXITY_VALUE( 4, 0, 0, 1, 0 , 0 ) , Conn_4G_1M3 = CONNEXITY_VALUE( 4, 0, 0, 1, 0 , 0 )
, Conn_1G_1Pad = CONNEXITY_VALUE( 1, 0, 0, 0, 1 , 0 ) , Conn_1G_1Pad = CONNEXITY_VALUE( 1, 0, 0, 0, 1 , 0 )
, Conn_2G_1Pad = CONNEXITY_VALUE( 2, 0, 0, 0, 1 , 0 ) , Conn_2G_1Pad = CONNEXITY_VALUE( 2, 0, 0, 0, 1 , 0 )
, Conn_3G_1Pad = CONNEXITY_VALUE( 3, 0, 0, 0, 1 , 0 ) , Conn_3G_1Pad = CONNEXITY_VALUE( 3, 0, 0, 0, 1 , 0 )
, Conn_1G_1PinM1 = CONNEXITY_VALUE( 1, 1, 0, 0, 0 , 1 )
, Conn_2G_1PinM1 = CONNEXITY_VALUE( 2, 1, 0, 0, 0 , 1 )
, Conn_1G_1PinM2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 1 ) , Conn_1G_1PinM2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 1 )
, Conn_2G_1PinM2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 1 ) , Conn_2G_1PinM2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 1 )
, Conn_3G_1PinM2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 1 ) , Conn_3G_1PinM2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 1 )
, Conn_1G_1M1_1PinM2 = CONNEXITY_VALUE( 1, 1, 1, 0, 0 , 1 )
, Conn_1G_2M1_1PinM2 = CONNEXITY_VALUE( 1, 2, 1, 0, 0 , 1 )
, Conn_2G_1M1_1PinM2 = CONNEXITY_VALUE( 2, 1, 1, 0, 0 , 1 )
, Conn_2G_2M1_1PinM2 = CONNEXITY_VALUE( 2, 2, 1, 0, 0 , 1 )
, Conn_1G_1PinM3 = CONNEXITY_VALUE( 1, 0, 0, 1, 0 , 1 ) , Conn_1G_1PinM3 = CONNEXITY_VALUE( 1, 0, 0, 1, 0 , 1 )
, Conn_2G_1PinM3 = CONNEXITY_VALUE( 2, 0, 0, 1, 0 , 1 ) , Conn_2G_1PinM3 = CONNEXITY_VALUE( 2, 0, 0, 1, 0 , 1 )
, Conn_3G_1PinM3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 1 ) , Conn_3G_1PinM3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 1 )
, Conn_1G_1M1_1PinM3 = CONNEXITY_VALUE( 1, 1, 0, 1, 0 , 1 )
, Conn_2G_1M1_1PinM3 = CONNEXITY_VALUE( 2, 1, 0, 1, 0 , 1 )
, Conn_2G_2M1_1PinM3 = CONNEXITY_VALUE( 2, 2, 0, 1, 0 , 1 )
, Conn_2G_3M1_1PinM3 = CONNEXITY_VALUE( 2, 3, 0, 1, 0 , 1 )
, Conn_3G_1M1_1PinM3 = CONNEXITY_VALUE( 3, 1, 0, 1, 0 , 1 )
, Conn_3G_2M1_1PinM3 = CONNEXITY_VALUE( 3, 2, 0, 1, 0 , 1 )
, Conn_3G_3M1_1PinM3 = CONNEXITY_VALUE( 3, 3, 0, 1, 0 , 1 )
}; };
#undef CONNEXITY_VALUE #undef CONNEXITY_VALUE

View File

@ -25,15 +25,12 @@ namespace Anabatic {
// ----------------------------------------------------------------- // -----------------------------------------------------------------
// Class : "NetBuilderHV". // Class : "NetBuilderHV".
class NetBuilderHV : public NetBuilder { class NetBuilderHV : public NetBuilder {
public: public:
NetBuilderHV (); NetBuilderHV ();
virtual ~NetBuilderHV (); virtual ~NetBuilderHV ();
virtual void doRp_AutoContacts ( GCell*, Component*, AutoContact*& source, AutoContact*& target, uint64_t flags ); virtual void doRp_AutoContacts ( GCell*, Component*, AutoContact*& source, AutoContact*& target, uint64_t flags );
virtual AutoContact* doRp_Access ( GCell*, Component*, uint64_t flags ); virtual AutoContact* doRp_Access ( GCell*, Component*, uint64_t flags );
AutoContact* doRp_AccessNorthPin ( GCell*, RoutingPad* );
AutoContact* doRp_AccessEastWestPin ( GCell*, RoutingPad* );
private: private:
virtual bool _do_1G_1M1 (); virtual bool _do_1G_1M1 ();
virtual bool _do_1G_xM1 (); virtual bool _do_1G_xM1 ();
@ -41,8 +38,6 @@ namespace Anabatic {
virtual bool _do_2G (); virtual bool _do_2G ();
virtual bool _do_2G_1M1 (); virtual bool _do_2G_1M1 ();
virtual bool _do_xG_1Pad (); virtual bool _do_xG_1Pad ();
virtual bool _do_1G_1PinM1 ();
virtual bool _do_2G_1PinM1 ();
virtual bool _do_1G_1PinM2 (); virtual bool _do_1G_1PinM2 ();
virtual bool _do_xG_1PinM2 (); virtual bool _do_xG_1PinM2 ();
virtual bool _do_1G_1PinM3 (); virtual bool _do_1G_1PinM3 ();
@ -54,13 +49,7 @@ namespace Anabatic {
virtual bool _do_xG_xM2 (); virtual bool _do_xG_xM2 ();
virtual bool _do_1G_1M3 (); virtual bool _do_1G_1M3 ();
virtual bool _do_xG_xM3 (); virtual bool _do_xG_xM3 ();
virtual bool _do_1G_xM1_1PinM2 ();
virtual bool _do_2G_xM1_1PinM2 ();
virtual bool _do_1G_1M1_1PinM3 ();
virtual bool _do_2G_xM1_1PinM3 ();
virtual bool _do_3G_xM1_1PinM3 ();
virtual bool _do_globalSegment (); virtual bool _do_globalSegment ();
virtual void singleGCell ( AnabaticEngine*, Net* );
public: public:
virtual string getTypeName () const; virtual string getTypeName () const;
}; };

View File

@ -41,7 +41,6 @@ namespace Anabatic {
virtual bool _do_2G_1M1 (); virtual bool _do_2G_1M1 ();
virtual bool _do_xG_xM1_xM3 (); virtual bool _do_xG_xM1_xM3 ();
virtual bool _do_xG (); virtual bool _do_xG ();
virtual bool _do_2G ();
virtual bool _do_globalSegment (); virtual bool _do_globalSegment ();
virtual void singleGCell ( AnabaticEngine*, Net* ); virtual void singleGCell ( AnabaticEngine*, Net* );
public: public:

View File

@ -14,7 +14,9 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#pragma once #ifndef ANABATIC_SESSION_H
#define ANABATIC_SESSION_H
#include <string> #include <string>
#include <vector> #include <vector>
#include <set> #include <set>
@ -22,7 +24,6 @@
#include <boost/function.hpp> #include <boost/function.hpp>
#include "hurricane/Commons.h" #include "hurricane/Commons.h"
#include "hurricane/Box.h" #include "hurricane/Box.h"
#include "hurricane/DBo.h"
#include "crlcore/CellGauge.h" #include "crlcore/CellGauge.h"
#include "crlcore/RoutingGauge.h" #include "crlcore/RoutingGauge.h"
#include "anabatic/Constants.h" #include "anabatic/Constants.h"
@ -54,7 +55,6 @@ namespace Anabatic {
using Hurricane::DbU; using Hurricane::DbU;
using Hurricane::Point; using Hurricane::Point;
using Hurricane::Box; using Hurricane::Box;
using Hurricane::DBo;
using Hurricane::Net; using Hurricane::Net;
using Hurricane::Contact; using Hurricane::Contact;
using Hurricane::Segment; using Hurricane::Segment;
@ -95,13 +95,11 @@ namespace Anabatic {
static inline size_t getDVerticalDepth (); static inline size_t getDVerticalDepth ();
static inline const Layer* getDVerticalLayer (); static inline const Layer* getDVerticalLayer ();
static inline DbU::Unit getDVerticalWidth (); static inline DbU::Unit getDVerticalWidth ();
static inline DbU::Unit getDPVerticalWidth ();
static inline DbU::Unit getDVerticalPitch (); static inline DbU::Unit getDVerticalPitch ();
static inline DbU::Unit getDVerticalOffset (); static inline DbU::Unit getDVerticalOffset ();
static inline size_t getDHorizontalDepth (); static inline size_t getDHorizontalDepth ();
static inline const Layer* getDHorizontalLayer (); static inline const Layer* getDHorizontalLayer ();
static inline DbU::Unit getDHorizontalWidth (); static inline DbU::Unit getDHorizontalWidth ();
static inline DbU::Unit getDPHorizontalWidth ();
static inline DbU::Unit getDHorizontalPitch (); static inline DbU::Unit getDHorizontalPitch ();
static inline DbU::Unit getDHorizontalOffset (); static inline DbU::Unit getDHorizontalOffset ();
static inline size_t getDContactDepth (); static inline size_t getDContactDepth ();
@ -109,11 +107,6 @@ namespace Anabatic {
static inline DbU::Unit getDContactWidth (); static inline DbU::Unit getDContactWidth ();
static inline DbU::Unit getDContactPitch (); static inline DbU::Unit getDContactPitch ();
static inline RoutingGauge* getRoutingGauge (); static inline RoutingGauge* getRoutingGauge ();
static inline bool isGLayer ( const Layer* );
static inline bool isGMetal ( const Layer* );
static inline bool isGContact ( const Layer* );
static inline bool isGaugeLayer ( const Layer* );
static inline RoutingLayerGauge* getLayerGauge ( const Layer* );
static inline RoutingLayerGauge* getLayerGauge ( size_t depth ); static inline RoutingLayerGauge* getLayerGauge ( size_t depth );
static inline size_t getDepth (); static inline size_t getDepth ();
static inline size_t getViaDepth ( const Layer* layer ); static inline size_t getViaDepth ( const Layer* layer );
@ -124,7 +117,6 @@ namespace Anabatic {
static inline DbU::Unit getPitch ( size_t depth, Flags flags ); static inline DbU::Unit getPitch ( size_t depth, Flags flags );
static inline DbU::Unit getOffset ( size_t depth ); static inline DbU::Unit getOffset ( size_t depth );
static inline DbU::Unit getWireWidth ( size_t depth ); static inline DbU::Unit getWireWidth ( size_t depth );
static inline DbU::Unit getPWireWidth ( size_t depth );
static inline DbU::Unit getViaWidth ( size_t depth ); static inline DbU::Unit getViaWidth ( size_t depth );
static inline Flags getDirection ( const Layer* ); static inline Flags getDirection ( const Layer* );
static inline DbU::Unit getPitch ( const Layer*, Flags flags ); static inline DbU::Unit getPitch ( const Layer*, Flags flags );
@ -132,7 +124,6 @@ namespace Anabatic {
static inline DbU::Unit getWireWidth ( const Layer* ); static inline DbU::Unit getWireWidth ( const Layer* );
static inline DbU::Unit getViaWidth ( const Layer* ); static inline DbU::Unit getViaWidth ( const Layer* );
static inline DbU::Unit getExtensionCap ( const Layer* ); static inline DbU::Unit getExtensionCap ( const Layer* );
static inline DbU::Unit getNearestTrackAxis ( const Layer*, DbU::Unit, uint32_t mode );
static inline Point getNearestGridPoint ( Point, Box constraints ); static inline Point getNearestGridPoint ( Point, Box constraints );
static inline size_t getSegmentStackSize (); static inline size_t getSegmentStackSize ();
static inline size_t getContactStackSize (); static inline size_t getContactStackSize ();
@ -140,7 +131,7 @@ namespace Anabatic {
static inline const vector<AutoSegment*>& getRevalidateds (); static inline const vector<AutoSegment*>& getRevalidateds ();
static inline const set<AutoSegment*>& getDestroyeds (); static inline const set<AutoSegment*>& getDestroyeds ();
static inline const vector<AutoSegment*>& getDoglegs (); static inline const vector<AutoSegment*>& getDoglegs ();
static inline const set<Net*,DBo::CompareById>& getNetsModificateds (); static inline const set<Net*>& getNetsModificateds ();
static void close (); static void close ();
static void setAnabaticFlags ( Flags ); static void setAnabaticFlags ( Flags );
static inline void dogleg ( AutoSegment* ); static inline void dogleg ( AutoSegment* );
@ -174,7 +165,6 @@ namespace Anabatic {
void _revalidateTopology (); void _revalidateTopology ();
virtual size_t _revalidate (); virtual size_t _revalidate ();
DbU::Unit _getPitch ( size_t depth, Flags flags ) const; DbU::Unit _getPitch ( size_t depth, Flags flags ) const;
DbU::Unit _getNearestTrackAxis ( const Layer*, DbU::Unit, uint32_t mode );
Point _getNearestGridPoint ( Point, Box constraints ); Point _getNearestGridPoint ( Point, Box constraints );
Record* _getRecord () const; Record* _getRecord () const;
string _getString () const; string _getString () const;
@ -190,8 +180,8 @@ namespace Anabatic {
vector<AutoSegment*> _doglegs; vector<AutoSegment*> _doglegs;
vector<AutoSegment*> _segmentInvalidateds; vector<AutoSegment*> _segmentInvalidateds;
vector<AutoSegment*> _segmentRevalidateds; vector<AutoSegment*> _segmentRevalidateds;
set<Net*,DBo::CompareById> _netInvalidateds; set<Net*> _netInvalidateds;
set<Net*,DBo::CompareById> _netRevalidateds; set<Net*> _netRevalidateds;
set<AutoSegment*> _destroyedSegments; set<AutoSegment*> _destroyedSegments;
// Constructors. // Constructors.
@ -224,7 +214,7 @@ namespace Anabatic {
inline const vector<AutoSegment*>& Session::getRevalidateds () { return get("getRevalidateds()")->_segmentRevalidateds; } inline const vector<AutoSegment*>& Session::getRevalidateds () { return get("getRevalidateds()")->_segmentRevalidateds; }
inline const set<AutoSegment*>& Session::getDestroyeds () { return get("getDestroyeds()")->_destroyedSegments; } inline const set<AutoSegment*>& Session::getDestroyeds () { return get("getDestroyeds()")->_destroyedSegments; }
inline const vector<AutoSegment*>& Session::getDoglegs () { return get("getDoglegs()")->_doglegs; } inline const vector<AutoSegment*>& Session::getDoglegs () { return get("getDoglegs()")->_doglegs; }
inline const set<Net*,DBo::CompareById>& Session::getNetsModificateds () { return get("getNetsModificateds()")->_netRevalidateds; } inline const set<Net*>& Session::getNetsModificateds () { return get("getNetsModificateds()")->_netRevalidateds; }
inline void Session::doglegReset () { return get("doglegReset()")->_doglegReset (); } inline void Session::doglegReset () { return get("doglegReset()")->_doglegReset (); }
inline void Session::invalidate ( Net* net ) { return get("invalidate(Net*)")->_invalidate(net); } inline void Session::invalidate ( Net* net ) { return get("invalidate(Net*)")->_invalidate(net); }
inline void Session::invalidate ( AutoContact* autoContact ) { return get("invalidate(AutoContact*)")->_invalidate(autoContact); } inline void Session::invalidate ( AutoContact* autoContact ) { return get("invalidate(AutoContact*)")->_invalidate(autoContact); }
@ -243,24 +233,17 @@ namespace Anabatic {
inline size_t Session::getDVerticalDepth () { return getConfiguration()->getDVerticalDepth(); } inline size_t Session::getDVerticalDepth () { return getConfiguration()->getDVerticalDepth(); }
inline const Layer* Session::getDVerticalLayer () { return getConfiguration()->getDVerticalLayer(); } inline const Layer* Session::getDVerticalLayer () { return getConfiguration()->getDVerticalLayer(); }
inline DbU::Unit Session::getDVerticalWidth () { return getConfiguration()->getDVerticalWidth(); } inline DbU::Unit Session::getDVerticalWidth () { return getConfiguration()->getDVerticalWidth(); }
inline DbU::Unit Session::getDPVerticalWidth () { return getConfiguration()->getDPVerticalWidth(); }
inline DbU::Unit Session::getDVerticalPitch () { return getConfiguration()->getDVerticalPitch(); } inline DbU::Unit Session::getDVerticalPitch () { return getConfiguration()->getDVerticalPitch(); }
inline DbU::Unit Session::getDVerticalOffset () { return getConfiguration()->getDVerticalOffset(); } inline DbU::Unit Session::getDVerticalOffset () { return getConfiguration()->getDVerticalOffset(); }
inline size_t Session::getDHorizontalDepth () { return getConfiguration()->getDHorizontalDepth(); } inline size_t Session::getDHorizontalDepth () { return getConfiguration()->getDHorizontalDepth(); }
inline const Layer* Session::getDHorizontalLayer () { return getConfiguration()->getDHorizontalLayer(); } inline const Layer* Session::getDHorizontalLayer () { return getConfiguration()->getDHorizontalLayer(); }
inline DbU::Unit Session::getDHorizontalWidth () { return getConfiguration()->getDHorizontalWidth(); } inline DbU::Unit Session::getDHorizontalWidth () { return getConfiguration()->getDHorizontalWidth(); }
inline DbU::Unit Session::getDPHorizontalWidth () { return getConfiguration()->getDPHorizontalWidth(); }
inline DbU::Unit Session::getDHorizontalPitch () { return getConfiguration()->getDHorizontalPitch(); } inline DbU::Unit Session::getDHorizontalPitch () { return getConfiguration()->getDHorizontalPitch(); }
inline DbU::Unit Session::getDHorizontalOffset () { return getConfiguration()->getDHorizontalOffset(); } inline DbU::Unit Session::getDHorizontalOffset () { return getConfiguration()->getDHorizontalOffset(); }
inline size_t Session::getDContactDepth () { return getConfiguration()->getDContactDepth(); } inline size_t Session::getDContactDepth () { return getConfiguration()->getDContactDepth(); }
inline const Layer* Session::getDContactLayer () { return getConfiguration()->getDContactLayer(); } inline const Layer* Session::getDContactLayer () { return getConfiguration()->getDContactLayer(); }
inline DbU::Unit Session::getDContactWidth () { return getConfiguration()->getDContactWidth(); } inline DbU::Unit Session::getDContactWidth () { return getConfiguration()->getDContactWidth(); }
inline DbU::Unit Session::getDContactPitch () { return getConfiguration()->getDContactPitch(); } inline DbU::Unit Session::getDContactPitch () { return getConfiguration()->getDContactPitch(); }
inline bool Session::isGLayer ( const Layer* layer ) { return getConfiguration()->isGLayer(layer); }
inline bool Session::isGMetal ( const Layer* layer ) { return getConfiguration()->isGMetal(layer); }
inline bool Session::isGContact ( const Layer* layer ) { return getConfiguration()->isGContact(layer); }
inline bool Session::isGaugeLayer ( const Layer* layer ) { return getRoutingGauge()->hasLayer(layer); }
inline RoutingLayerGauge* Session::getLayerGauge ( const Layer* layer ) { return getRoutingGauge()->getLayerGauge(layer); }
inline RoutingLayerGauge* Session::getLayerGauge ( size_t depth ) { return getRoutingGauge()->getLayerGauge(depth); } inline RoutingLayerGauge* Session::getLayerGauge ( size_t depth ) { return getRoutingGauge()->getLayerGauge(depth); }
inline size_t Session::getDepth () { return getRoutingGauge()->getDepth(); } inline size_t Session::getDepth () { return getRoutingGauge()->getDepth(); }
inline size_t Session::getViaDepth ( const Layer* layer ) { return getRoutingGauge()->getViaDepth(layer); } inline size_t Session::getViaDepth ( const Layer* layer ) { return getRoutingGauge()->getViaDepth(layer); }
@ -270,7 +253,6 @@ namespace Anabatic {
inline DbU::Unit Session::getPitch ( size_t depth, Flags flags=Flags::NoFlags ) { return get("getPitch(depth,flags)")->_getPitch( depth, flags ); } inline DbU::Unit Session::getPitch ( size_t depth, Flags flags=Flags::NoFlags ) { return get("getPitch(depth,flags)")->_getPitch( depth, flags ); }
inline DbU::Unit Session::getOffset ( size_t depth ) { return getRoutingGauge()->getLayerOffset(depth); } inline DbU::Unit Session::getOffset ( size_t depth ) { return getRoutingGauge()->getLayerOffset(depth); }
inline DbU::Unit Session::getWireWidth ( size_t depth ) { return getRoutingGauge()->getLayerWireWidth(depth); } inline DbU::Unit Session::getWireWidth ( size_t depth ) { return getRoutingGauge()->getLayerWireWidth(depth); }
inline DbU::Unit Session::getPWireWidth ( size_t depth ) { return getRoutingGauge()->getLayerPWireWidth(depth); }
inline DbU::Unit Session::getViaWidth ( size_t depth ) { return getRoutingGauge()->getViaWidth(depth); } inline DbU::Unit Session::getViaWidth ( size_t depth ) { return getRoutingGauge()->getViaWidth(depth); }
inline DbU::Unit Session::getPitch ( const Layer* layer, Flags flags=Flags::NoFlags ) { return getPitch( getLayerDepth(layer), flags ); } inline DbU::Unit Session::getPitch ( const Layer* layer, Flags flags=Flags::NoFlags ) { return getPitch( getLayerDepth(layer), flags ); }
inline DbU::Unit Session::getOffset ( const Layer* layer ) { return getOffset ( getLayerDepth(layer) ); } inline DbU::Unit Session::getOffset ( const Layer* layer ) { return getOffset ( getLayerDepth(layer) ); }
@ -279,7 +261,6 @@ namespace Anabatic {
inline DbU::Unit Session::getExtensionCap ( const Layer* layer ) { return getConfiguration()->getExtensionCap(layer); } inline DbU::Unit Session::getExtensionCap ( const Layer* layer ) { return getConfiguration()->getExtensionCap(layer); }
inline Flags Session::getDirection ( const Layer* layer ) { return getDirection( getLayerDepth(layer) ); } inline Flags Session::getDirection ( const Layer* layer ) { return getDirection( getLayerDepth(layer) ); }
inline Point Session::getNearestGridPoint ( Point p, Box b ) { return get("getNearestGridPoint()")->_getNearestGridPoint(p,b); } inline Point Session::getNearestGridPoint ( Point p, Box b ) { return get("getNearestGridPoint()")->_getNearestGridPoint(p,b); }
inline DbU::Unit Session::getNearestTrackAxis ( const Layer* layer, DbU::Unit axis, uint32_t mode ) { return get("getNearestTrackAxis()")->_getNearestTrackAxis(layer,axis,mode); }
inline void Session::_dogleg ( AutoSegment* segment ) { _doglegs.push_back(segment); } inline void Session::_dogleg ( AutoSegment* segment ) { _doglegs.push_back(segment); }
inline void Session::_doglegReset () { _doglegs.clear(); } inline void Session::_doglegReset () { _doglegs.clear(); }
@ -293,3 +274,6 @@ namespace Anabatic {
INSPECTOR_P_SUPPORT(Anabatic::Session); INSPECTOR_P_SUPPORT(Anabatic::Session);
#endif // ANABATIC_SESSION_H

View File

@ -5,7 +5,7 @@
cmake_minimum_required(VERSION 2.4.0) cmake_minimum_required(VERSION 2.4.0)
set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") set(ignoreVariables "${BUILD_DOC}")
add_subdirectory(cmake_modules) add_subdirectory(cmake_modules)

View File

@ -1,19 +0,0 @@
#!/bin/bash
srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src
commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared
buildDir=${commonRoot}/build
installDir=${commonRoot}/install
export ALLIANCE_TOP=${installDir}
export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH}
cd ${srcDir}
# Skip doc generation to avoid pulling TeXLive in docker images.
sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff
./autostuff clean
./autostuff
mkdir -p ${buildDir}
cd ${buildDir}
${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared
make -j1 install

View File

@ -14,17 +14,17 @@ projects = [
, { 'name' : "coriolis" , { 'name' : "coriolis"
, 'tools' : [ "bootstrap" , 'tools' : [ "bootstrap"
, "lefdef" , "lefdef"
, "coloquinte" , "flute"
, "vlsisapd" , "vlsisapd"
, "hurricane" , "hurricane"
, "crlcore" , "crlcore"
, "flute"
, "etesian"
, "anabatic" , "anabatic"
, "katana" , "katana"
, "knik" , "knik"
, "katabatic" , "katabatic"
, "kite" , "kite"
, "coloquinte"
, "etesian"
, "equinox" , "equinox"
, "solstice" , "solstice"
, "oroshi" , "oroshi"

View File

@ -38,7 +38,6 @@ class Builder:
self._noSystemBoost = False self._noSystemBoost = False
self._macports = False self._macports = False
self._devtoolset = 0 self._devtoolset = 0
self._llvmtoolset = 0
self._qt5 = False self._qt5 = False
self._openmp = False self._openmp = False
self._enableShared = "ON" self._enableShared = "ON"
@ -70,8 +69,6 @@ class Builder:
elif attribute == "devtoolset": elif attribute == "devtoolset":
self._devtoolset = value self._devtoolset = value
if value: self._noSystemBoost = True if value: self._noSystemBoost = True
elif attribute == "llvmtoolset":
self._llvmtoolset = value
elif attribute == "qt5": self._qt5 = value elif attribute == "qt5": self._qt5 = value
elif attribute == "openmp": self._openmp = value elif attribute == "openmp": self._openmp = value
elif attribute == "enableDoc": self._enableDoc = value elif attribute == "enableDoc": self._enableDoc = value
@ -135,24 +132,17 @@ class Builder:
def _execute ( self, command, error ): def _execute ( self, command, error ):
collections = []
if self._devtoolset: if self._devtoolset:
collections.append( 'devtoolset-%d' % self._devtoolset )
print 'Using devtoolset-%(v)d (scl enable devtoolset-%(v)d ...)' % {'v':self._devtoolset} print 'Using devtoolset-%(v)d (scl enable devtoolset-%(v)d ...)' % {'v':self._devtoolset}
if self._llvmtoolset:
collections.append( 'llvm-toolset-%d' % self._llvmtoolset )
print 'Using llvm-toolset-%(v)d (scl enable llvm-toolset-%(v)d ...)' % {'v':self._llvmtoolset}
if collections:
commandAsString = '' commandAsString = ''
for i in range(len(command)): for i in range(len(command)):
if i: commandAsString += ' ' if i: commandAsString += ' '
if ' ' in command[i]: commandAsString += '"'+command[i]+'"' if ' ' in command[i]: commandAsString += '"'+command[i]+'"'
else: commandAsString += command[i] else: commandAsString += command[i]
command = [ 'scl', 'enable' ] command = [ 'scl', 'enable', 'devtoolset-%d' % self._devtoolset
command += collections , commandAsString ]
command.append( commandAsString )
#print command
sys.stdout.flush () sys.stdout.flush ()
sys.stderr.flush () sys.stderr.flush ()
child = subprocess.Popen ( command, env=self._environment, stdout=None ) child = subprocess.Popen ( command, env=self._environment, stdout=None )
@ -185,10 +175,9 @@ class Builder:
command = [ 'cmake' ] command = [ 'cmake' ]
if self._ninja: command += [ "-G", "Ninja" ] if self._ninja: command += [ "-G", "Ninja" ]
if self._macports: command += [ "-D", "WITH_MACPORTS:STRING=TRUE" ]
if self._noSystemBoost: command += [ "-D", "Boost_NO_SYSTEM_PATHS:STRING=TRUE" if self._noSystemBoost: command += [ "-D", "Boost_NO_SYSTEM_PATHS:STRING=TRUE"
#, "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost169" , "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost157"
#, "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib64/boost169" , "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib/boost157"
] ]
if self._qt5: command += [ "-D", "WITH_QT5:STRING=TRUE" ] if self._qt5: command += [ "-D", "WITH_QT5:STRING=TRUE" ]
if self._openmp: command += [ "-D", "WITH_OPENMP:STRING=TRUE" ] if self._openmp: command += [ "-D", "WITH_OPENMP:STRING=TRUE" ]
@ -198,7 +187,6 @@ class Builder:
, "-D", "CMAKE_INSTALL_PREFIX:STRING=%s" % self.installDir , "-D", "CMAKE_INSTALL_PREFIX:STRING=%s" % self.installDir
, "-D", "CMAKE_INSTALL_DIR:STRING=%s" % cmakeInstallDir , "-D", "CMAKE_INSTALL_DIR:STRING=%s" % cmakeInstallDir
#, "-D", "CMAKE_MODULE_PATH:STRING=%s" % cmakeModules #, "-D", "CMAKE_MODULE_PATH:STRING=%s" % cmakeModules
#, "-D", "Boost_DEBUG:STRING=TRUE"
, toolSourceDir ] , toolSourceDir ]
if not os.path.isdir(toolBuildDir): if not os.path.isdir(toolBuildDir):
@ -222,6 +210,8 @@ class Builder:
if self._checkDeterminism == 'ON': command += [ "-D", "CHECK_DETERMINISM:STRING=ON" ] if self._checkDeterminism == 'ON': command += [ "-D", "CHECK_DETERMINISM:STRING=ON" ]
command += [ toolSourceDir ] command += [ toolSourceDir ]
print self._noSystemBoost
print command
self._execute ( command, "Second CMake failed" ) self._execute ( command, "Second CMake failed" )
if self._doBuild: if self._doBuild:
@ -309,8 +299,8 @@ class Builder:
def _commandTemplate ( self, tools, projects, command ): def _commandTemplate ( self, tools, projects, command ):
if self._clang: if self._clang:
self._environment[ 'CC' ] = 'clang' self._environment[ 'CC' ] = '/usr/bin/clang'
self._environment[ 'CXX' ] = 'clang++' self._environment[ 'CXX' ] = '/usr/bin/clang++'
if self._devtoolset: if self._devtoolset:
self._environment[ 'BOOST_INCLUDEDIR' ] = '/opt/rh/devtoolset-%d/root/usr/include' % self._devtoolset self._environment[ 'BOOST_INCLUDEDIR' ] = '/opt/rh/devtoolset-%d/root/usr/include' % self._devtoolset
self._environment[ 'BOOST_LIBRARYDIR' ] = '/opt/rh/devtoolset-%d/root/usr/lib' % self._devtoolset self._environment[ 'BOOST_LIBRARYDIR' ] = '/opt/rh/devtoolset-%d/root/usr/lib' % self._devtoolset

View File

@ -208,8 +208,7 @@ parser.add_option ( "--no-build" , action="store_true" ,
parser.add_option ( "--no-cache" , action="store_true" , dest="noCache" , help="Remove previous CMake cache before building." ) parser.add_option ( "--no-cache" , action="store_true" , dest="noCache" , help="Remove previous CMake cache before building." )
parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove previous build directoty before building." ) parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove previous build directoty before building." )
parser.add_option ( "--macports" , action="store_true" , dest="macports" , help="Build against MacPorts." ) parser.add_option ( "--macports" , action="store_true" , dest="macports" , help="Build against MacPorts." )
parser.add_option ( "--devtoolset" , action="store" , type="int" , dest="devtoolset" , help="Build against TUV Dev Toolset N." ) parser.add_option ( "--devtoolset" , action="store" , type="int" , dest="devtoolset" , help="Build against TUV Dev Toolset 8." )
parser.add_option ( "--llvm-toolset" , action="store" , type="int" , dest="llvmtoolset" , help="Build against TUV Dev LLVM Toolset N." )
parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." ) parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." )
parser.add_option ( "--openmp" , action="store_true" , dest="openmp" , help="Enable the use of OpenMP in Gcc." ) parser.add_option ( "--openmp" , action="store_true" , dest="openmp" , help="Enable the use of OpenMP in Gcc." )
parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." ) parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." )
@ -285,10 +284,9 @@ else:
if options.noCache: builder.noCache = True if options.noCache: builder.noCache = True
if options.rmBuild: builder.rmBuild = True if options.rmBuild: builder.rmBuild = True
if options.ninja: builder.ninja = True if options.ninja: builder.ninja = True
if options.clang or options.llvmtoolset: builder.clang = True if options.clang: builder.clang = True
if options.macports: builder.macports = True if options.macports: builder.macports = True
if options.devtoolset: builder.devtoolset = options.devtoolset if options.devtoolset: builder.devtoolset = options.devtoolset
if options.llvmtoolset: builder.llvmtoolset = options.llvmtoolset
if options.qt5: builder.qt5 = True if options.qt5: builder.qt5 = True
if options.openmp: builder.openmp = True if options.openmp: builder.openmp = True
if options.makeArguments: builder.makeArguments = options.makeArguments if options.makeArguments: builder.makeArguments = options.makeArguments

View File

@ -8,7 +8,6 @@
FindLibbfd.cmake FindLibbfd.cmake
FindQwt.cmake FindQwt.cmake
FindSphinx.cmake FindSphinx.cmake
FindPelican.cmake
GetGitRevisionDescription.cmake GetGitRevisionDescription.cmake
GetGitRevisionDescription.cmake.in GetGitRevisionDescription.cmake.in
) )

View File

@ -39,15 +39,6 @@
message("-- Distribution is ${DISTRIBUTION}") message("-- Distribution is ${DISTRIBUTION}")
endmacro(check_distribution) endmacro(check_distribution)
#
# Specific setup for MacOS X.
#
if(WITH_MACPORTS)
set(Boost_PYVER "27")
else()
set(Boost_PYVER "")
endif()
# #
# Get the svn revision version and configure a svn.h.in file based on this version # Get the svn revision version and configure a svn.h.in file based on this version
# The include directory name is passed as argument # The include directory name is passed as argument
@ -94,14 +85,10 @@
set(ADDTIONAL_FLAGS "") set(ADDTIONAL_FLAGS "")
set(CXX_STANDARD "c++11") set(CXX_STANDARD "c++11")
endif() endif()
set(CMAKE_C_FLAGS_DEBUG " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE) set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
#set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE)
set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE)
#set(CMAKE_C_FLAGS_RELEASE " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
#set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE) set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE)
#set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE)
# #
@ -188,22 +175,18 @@
endmacro(hurricane_check_libraries) endmacro(hurricane_check_libraries)
#
# Find Boost, checking different versions.
#
macro(setup_boost) macro(setup_boost)
#set(Boost_USE_STATIC_LIBS ON) #set(Boost_USE_STATIC_LIBS ON)
#message(STATUS "Always uses Boost static libraries.") #message(STATUS "Always uses Boost static libraries.")
if(ARGC LESS 1) if(ARGC LESS 1)
find_package(Boost 1.35.0 REQUIRED) find_package(Boost 1.33.1 REQUIRED)
else(ARGC LESS 1) else(ARGC LESS 1)
foreach(component ${ARGV}) find_package(Boost 1.35.0 COMPONENTS ${ARGV} system)
if(${component} STREQUAL "python")
set(component ${component}${Boost_PYVER})
endif()
set(components ${components} ${component})
endforeach()
find_package(Boost 1.35.0 COMPONENTS ${components} system)
if(NOT Boost_FOUND) if(NOT Boost_FOUND)
find_package(Boost 1.35.0 COMPONENTS ${components} REQUIRED) find_package(Boost 1.33.1 COMPONENTS ${ARGV} REQUIRED)
endif(NOT Boost_FOUND) endif(NOT Boost_FOUND)
endif(ARGC LESS 1) endif(ARGC LESS 1)
message(STATUS "Found Boost includes ${Boost_LIB_VERSION} in ${Boost_INCLUDE_DIR}") message(STATUS "Found Boost includes ${Boost_LIB_VERSION} in ${Boost_INCLUDE_DIR}")
@ -278,19 +261,15 @@
/usr/include /usr/include
PATH_SUFFIXES qwt ) PATH_SUFFIXES qwt )
find_library(QWT_LIBRARY NAMES qwt-qt5 qwt find_library(QWT_LIBRARY NAMES qwt-qt5 qwt
PATHS /usr/lib64 PATHS /usr/lib${LIB_SUFFIX} )
/usr/lib )
else() else()
find_path(QWT_INCLUDE_DIR NAMES qwt.h find_path(QWT_INCLUDE_DIR NAMES qwt.h
PATHS /usr/include/qwt-qt4 PATHS /usr/include/qwt-qt4
/opt/local/libexec/qt4/include
/usr/include/qt4 /usr/include/qt4
/usr/include /usr/include
PATH_SUFFIXES qwt ) PATH_SUFFIXES qwt )
find_library(QWT_LIBRARY NAMES qwt-qt4 qwt find_library(QWT_LIBRARY NAMES qwt-qt4 qwt
PATHS /opt/local/libexec/qt4/lib PATHS /usr/lib${LIB_SUFFIX} )
/usr/lib64
/usr/lib )
endif() endif()
if( QWT_INCLUDE_DIR AND QWT_LIBRARY) if( QWT_INCLUDE_DIR AND QWT_LIBRARY)
@ -419,7 +398,5 @@
target_link_libraries( ${pytarget} ${pyDeplibs} ) target_link_libraries( ${pytarget} ${pyDeplibs} )
install( TARGETS ${pytarget} DESTINATION ${PYTHON_SITE_PACKAGES} ) install( TARGETS ${pytarget} DESTINATION ${PYTHON_SITE_PACKAGES} )
if( NOT ("${pyIncludes}" STREQUAL "None") )
install( FILES ${pyIncludes} DESTINATION ${inc_install_dir} ) install( FILES ${pyIncludes} DESTINATION ${inc_install_dir} )
endif()
endmacro( add_python_module ) endmacro( add_python_module )

View File

@ -63,7 +63,7 @@ FIND_PROGRAM(FLEX_EXECUTABLE flex DOC "path to the flex executable")
MARK_AS_ADVANCED(FLEX_EXECUTABLE) MARK_AS_ADVANCED(FLEX_EXECUTABLE)
FIND_LIBRARY(FL_LIBRARY NAMES fl FIND_LIBRARY(FL_LIBRARY NAMES fl
PATHS /usr/lib64 lib DOC "path to the fl library") PATHS /usr/lib${LIB_SUFFIX} DOC "path to the fl library")
SET(FLEX_LIBRARIES ${FL_LIBRARY}) SET(FLEX_LIBRARIES ${FL_LIBRARY})
IF(FLEX_EXECUTABLE) IF(FLEX_EXECUTABLE)

View File

@ -92,7 +92,7 @@
find_path( LEFDEF_LIBRARY_DIR NAMES "libdef.so" find_path( LEFDEF_LIBRARY_DIR NAMES "libdef.so"
PATHS ${LEFDEF_SEARCH_PATH} PATHS ${LEFDEF_SEARCH_PATH}
PATH_SUFFIXES "lib64" "lib" PATH_SUFFIXES "lib${LIB_SUFFIX}"
DOC "The ${LEFDEF_LIBRARY_DIR_DESCRIPTION}" ) DOC "The ${LEFDEF_LIBRARY_DIR_DESCRIPTION}" )
message( STATUS "LEFDEF_LIBRARY_DIR: ${LEFDEF_LIBRARY_DIR}" ) message( STATUS "LEFDEF_LIBRARY_DIR: ${LEFDEF_LIBRARY_DIR}" )

View File

@ -1,10 +0,0 @@
find_program( PELICAN_EXECUTABLE NAMES pelican
HINTS $ENV{PELICAN_DIR}
PATH_SUFFIXES bin
DOC "Pelican blog generator"
)
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Pelican DEFAULT_MSG PELICAN_EXECUTABLE )
mark_as_advanced( PELICAN_EXECUTABLE )

View File

@ -67,41 +67,77 @@ def guessOs ():
uname = subprocess.Popen ( ["uname", "-srm"], stdout=subprocess.PIPE ) uname = subprocess.Popen ( ["uname", "-srm"], stdout=subprocess.PIPE )
lines = uname.stdout.readlines() lines = uname.stdout.readlines()
if osSlsoc7x_64.match(lines[0]): osType = "Linux.el7_64" libDir="lib"
if osSlsoc7x_64.match(lines[0]):
osType = "Linux.el7_64"
libDir = "lib64"
elif osSlsoc6x_64.match(lines[0]): elif osSlsoc6x_64.match(lines[0]):
osType = "Linux.slsoc6x_64" osType = "Linux.slsoc6x_64"
libDir = "lib64"
useDevtoolset = True useDevtoolset = True
elif osSlsoc6x.match(lines[0]): elif osSlsoc6x.match(lines[0]):
osType = "Linux.slsoc6x" osType = "Linux.slsoc6x"
useDevtoolset = True useDevtoolset = True
elif osSLSoC5x_64 .match(lines[0]): osType = "Linux.SLSoC5x_64" elif osSLSoC5x_64.match(lines[0]):
elif osSLSoC5x .match(lines[0]): osType = "Linux.SLSoC5x" osType = "Linux.SLSoC5x_64"
elif osFedora_64 .match(lines[0]): osType = "Linux.fc_64" libDir = "lib64"
elif osFedora .match(lines[0]): osType = "Linux.fc" elif osSLSoC5x.match(lines[0]):
elif osUbuntu1004 .match(lines[0]): osType = "Linux.Ubuntu1004" osType = "Linux.SLSoC5x"
elif osUbuntu1004_64 .match(lines[0]): osType = "Linux.Ubuntu1004_64" elif osFedora_64.match(lines[0]):
elif osLinux_64 .match(lines[0]): osType = "Linux.x86_64" osType = "Linux.fc_64"
elif osLinux .match(lines[0]): osType = "Linux.i386" libDir = "lib64"
elif osFreeBSD8x_64 .match(lines[0]): osType = "FreeBSD.8x.x86_64" elif osFedora.match(lines[0]):
elif osFreeBSD8x_amd64.match(lines[0]): osType = "FreeBSD.8x.amd64" osType = "Linux.fc"
elif osFreeBSD8x .match(lines[0]): osType = "FreeBSD.8x.i386" elif osUbuntu1004.match(lines[0]):
elif osDarwin .match(lines[0]): osType = "Darwin" osType = "Linux.Ubuntu1004"
elif osCygwinW7_64 .match(lines[0]): osType = "Cygwin.W7_64" elif osUbuntu1004_64.match(lines[0]):
elif osCygwinW7 .match(lines[0]): osType = "Cygwin.W7" osType = "Linux.Ubuntu1004_64"
elif osCygwinW8_64 .match(lines[0]): osType = "Cygwin.W8_64" libDir = "lib64"
elif osCygwinW8 .match(lines[0]): osType = "Cygwin.W8" elif osLinux_64.match(lines[0]):
elif osCygwinW10_64 .match(lines[0]): osType = "Cygwin.W10_64" osType = "Linux.x86_64"
elif osCygwinW10 .match(lines[0]): osType = "Cygwin.W10" if(os.path.exists("/usr/lib64/")):
libDir = "lib64"
elif osLinux.match(lines[0]):
osType = "Linux.i386"
elif osFreeBSD8x_64.match(lines[0]):
osType = "FreeBSD.8x.x86_64"
libDir = "lib64"
elif osFreeBSD8x_amd64.match(lines[0]):
osType = "FreeBSD.8x.amd64"
libDir = "lib64"
elif osFreeBSD8x.match(lines[0]):
osType = "FreeBSD.8x.i386"
elif osDarwin.match(lines[0]):
osType = "Darwin"
elif osCygwinW7_64.match(lines[0]):
osType = "Cygwin.W7_64"
libDir = "lib64"
elif osCygwinW7.match(lines[0]):
osType = "Cygwin.W7"
elif osCygwinW8_64.match(lines[0]):
osType = "Cygwin.W8_64"
libDir = "lib64"
elif osCygwinW8.match(lines[0]):
osType = "Cygwin.W8"
elif osCygwinW10_64.match(lines[0]):
osType = "Cygwin.W10_64"
libDir = "lib64"
elif osCygwinW10.match(lines[0]):
osType = "Cygwin.W10"
else: else:
uname = subprocess.Popen ( ["uname", "-sr"], stdout=subprocess.PIPE ) uname = subprocess.Popen ( ["uname", "-sr"], stdout=subprocess.PIPE )
osType = uname.stdout.readlines()[0][:-1] osType = uname.stdout.readlines()[0][:-1]
print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1] print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1]
print " (using: \"%s\")" % osType print " (using: \"%s\")" % osType
ldLibraryPath = os.getenv('LD_LIBRARY_PATH') ldLibraryPath = os.getenv('LD_LIBRARY_PATH')
if ldLibraryPath and 'devtoolset' in ldLibraryPath: useDevtoolset = False if ldLibraryPath and 'devtoolset' in ldLibraryPath: useDevtoolset = False
return (osType,useDevtoolset) if libDir == 'lib64' and not os.path.exists('/usr/lib64'):
libDir = 'lib'
return (osType,libDir,useDevtoolset)
def guessShell (): def guessShell ():
@ -134,7 +170,7 @@ def guessShell ():
if __name__ == "__main__": if __name__ == "__main__":
osType,useDevtoolset = guessOs() osType,libDir,useDevtoolset = guessOs()
buildType = "Release" buildType = "Release"
linkType = "Shared" linkType = "Shared"
rootDir = None rootDir = None
@ -151,7 +187,6 @@ if __name__ == "__main__":
parser.add_option ( "--shared" , action="store_true" , dest="shared" ) parser.add_option ( "--shared" , action="store_true" , dest="shared" )
parser.add_option ( "--no-python" , action="store_true" , dest="nopython" ) parser.add_option ( "--no-python" , action="store_true" , dest="nopython" )
parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" ) parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" )
parser.add_option ( "--remove" , action="store_true" , dest="remove" )
( options, args ) = parser.parse_args () ( options, args ) = parser.parse_args ()
if options.release: buildType = "Release" if options.release: buildType = "Release"
@ -172,32 +207,6 @@ if __name__ == "__main__":
strippedLibraryPath = scrubPath( "LD_LIBRARY_PATH" ) strippedLibraryPath = scrubPath( "LD_LIBRARY_PATH" )
strippedPythonPath = scrubPath( "PYTHONPATH" ) strippedPythonPath = scrubPath( "PYTHONPATH" )
if options.remove:
shellScript = 'echo "Removing Coriolis environment";'
if osType == "Darwin":
ldVar = 'DYLD_LIBRARY_PATH'
else:
ldVar = 'LD_LIBRARY_PATH'
if isBourneShell:
shellScript += 'export PATH={};hash -r;'.format(strippedPath)
shellScript += 'BOOTSTRAP_TOP="";CORIOLIS_TOP="";export -n BOOTSTRAP_TOP CORIOLIS_TOP;'
if strippedLibraryPath:
shellScript += 'export {}={};'.format(ldVar, strippedLibraryPath)
else:
shellScript += '{0}=""; export -n {0};'.format(ldVar)
else:
shellScript += 'setenv PATH {};rehash;'.format(strippedPath)
shellScript += 'unsetenv BOOTSTRAP_TOP CORIOLIS_TOP;'
if strippedLibraryPath:
shellScript += 'setenv {} {};'.format(ldVar, strippedLibraryPath)
else:
shellScript += 'unsetenv {};'.format(ldVar)
print(shellScript)
sys.exit(0)
shellScriptSh = \ shellScriptSh = \
'echo "%(MESSAGE)s";' \ 'echo "%(MESSAGE)s";' \
'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \ 'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \
@ -251,44 +260,35 @@ if __name__ == "__main__":
shellMessage = "Using user-selected Coriolis 2 (%s)" % rootDir shellMessage = "Using user-selected Coriolis 2 (%s)" % rootDir
if osType.startswith("Cygwin"): if osType.startswith("Cygwin"):
strippedPath = "%s/lib:%s" % ( coriolisTop, libDir, strippedPath ) strippedPath = "%s/%s:%s" % ( coriolisTop, libDir, strippedPath )
absLibDir = "%s/%s" % ( coriolisTop, libDir )
strippedPath = "%s/bin:%s" % ( coriolisTop, strippedPath )
strippedLibraryPath = "%s:%s" % ( absLibDir , strippedLibraryPath )
if not os.path.exists(coriolisTop): if not os.path.exists(coriolisTop):
print 'echo "[ERROR] coriolisEnv.py, top directory <%s> do not exists."' % coriolisTop print 'echo "[ERROR] coriolisEnv.py, top directory <%s> do not exists."' % coriolisTop
sys.exit( 1 ) sys.exit( 1 )
for lib in [ 'lib64', 'lib' ]:
libDir = lib
absLibDir = '{0}/{1}'.format( coriolisTop, lib )
if os.path.isdir(absLibDir): break
libDir = None
if libDir is None:
print 'echo "[ERROR] coriolisEnv.py, library directory not found."'
sys.exit( 1 )
strippedPath = "%s/bin:%s" % ( coriolisTop, strippedPath )
strippedLibraryPath = "%s:%s" % ( absLibDir , strippedLibraryPath )
if not options.nopython: if not options.nopython:
pyVersion = sys.version_info pyVersion = sys.version_info
version = "%d.%d" % (pyVersion[0],pyVersion[1]) version = "%d.%d" % (pyVersion[0],pyVersion[1])
if osType.startswith("Linux.SL") \
sitePackagesDir = "sitePackageDir_has_been_not_found" or osType.startswith("Linux.sl") \
for pyPackageDir in [ "%s/python%s/site-packages" % (absLibDir,version) or osType.startswith("Linux.el") \
, "%s/python%s/dist-packages" % (absLibDir,version) or osType.startswith("Linux.fc") \
, "%s/%s/site-packages" % (absLibDir,version) or osType.startswith("Cygwin"):
]: sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version)
if os.path.isdir(pyPackageDir): elif osType.startswith("Darwin"):
sitePackagesDir = pyPackageDir sitePackagesDir = "%s/%s/site-packages" % (absLibDir,version)
break else:
sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version)
strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath
strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath
strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/cumulus:" % (sitePackagesDir) + strippedPythonPath
strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath
strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath
strippedPythonPath = "%s:" % (sysconfDir) + strippedPythonPath
shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";' \ shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";' \
'export PYTHONPATH;' 'export PYTHONPATH;'

View File

@ -1,6 +0,0 @@
FROM debian10.coriolis
COPY root/dot.bashrc /root/.bashrc
CMD [ "/bin/bash", "-i" ]

View File

@ -1,10 +0,0 @@
FROM debian10.system
COPY root/socInstaller.py /root/socInstaller.py
RUN mkdir -p coriolis-2.x/src \
&& git clone https://github.com/m-labs/nmigen.git \
&& cd nmigen \
&& python3 setup.py develop \
&& /root/socInstaller.py --docker --profile=Debian10 --do-yosys --do-alliance --do-coriolis

View File

@ -1,4 +0,0 @@
FROM debian10.libresoc
CMD [ "/bin/bash", "-i" ]

View File

@ -1,12 +0,0 @@
FROM debian10.coriolis
# Cannot clone directly from LibreSOC repository as I need my
# ssh key that I cannot forward to the docker build process.
#
# git clone ssh://gitolite3@libre-riscv.org:922/soclayout.git
COPY ./root/soclayout /root/coriolis-2.x/src/soclayout
RUN cd /root/coriolis-2.x/src/soclayout \
&& git checkout 75e03eb

View File

@ -1,29 +0,0 @@
FROM debian:buster-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install build-essential binutils-dev \
git cmake bison flex gcc python-dev \
libboost-all-dev libboost-python-dev \
zlib1g-dev libxml2-dev rapidjson-dev libbz2-dev \
qt4-dev-tools libqwt-dev python-qt4 \
python3-setuptools \
\
autotools-dev automake \
libxt-dev libxpm-dev libmotif-dev \
\
tcl tcl-dev libffi6 libffi-dev libreadline-dev \
\
vim \
&& apt-get clean
# If you want to build Alliance documentation, install those LaTeX
# packages:
# transfig texlive texlive-latex-extra
# texlive-plain-generic texlive-pictures
# imagemagick
#
# The packaged yosys 0.8 is too old to work with nMigen, must be 0.9.
# yosys

View File

@ -1,4 +0,0 @@
systemImage="debian10.system"
coriolisImage="debian10.coriolis"
bashImage="debian10.bash"

View File

@ -1,19 +0,0 @@
#!/bin/bash
srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src
commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared
buildDir=${commonRoot}/build
installDir=${commonRoot}/install
export ALLIANCE_TOP=${installDir}
export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH}
cd ${srcDir}
# Skip doc generation to avoid pulling TeXLive in docker images.
sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff
./autostuff clean
./autostuff
mkdir -p ${buildDir}
cd ${buildDir}
${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared
make -j1 install

View File

@ -1,14 +0,0 @@
echo "Running /root/.bashrc"
for archDir in `ls /root/coriolis-2.x/`; do
if [ "$archDir" = "src" ]; then continue; fi
break
done
echo "Found Coriolis architecture directory \"${archDir}\"."
installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install"
. ${installDir}/etc/profile.d/alc_env.sh
eval `${installDir}/etc/coriolis2/coriolisEnv.py`
export QT_X11_NO_MITSHM=1

View File

@ -1,650 +0,0 @@
#!/usr/bin/env python
#
# -*- mode:Python -*-
#
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2015-2018, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | C o r i o l i s I n s t a l l e r |
# | |
# | Authors : Jean-Paul Chaput |
# | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
# | =============================================================== |
# | Python : "./socInstaller.py" |
# +-----------------------------------------------------------------+
#
# WARNING:
# This script has been designed only for internal use in the
# LIP6/CIAN department. If you want to use it you will need to
# change the hardwired configuration.
showTrace = True
try:
import sys
import os.path
import shutil
import optparse
import time
import traceback
import distutils.sysconfig
import subprocess
import socket
import re
import bz2
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
except ImportError, e:
module = str(e).split()[-1]
class ErrorMessage ( Exception ):
def __init__ ( self, code, *arguments ):
self._code = code
self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ]
text = None
if len(arguments) == 1:
if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n')
else:
self._errors = arguments[0]
elif len(arguments) > 1:
text = list(arguments)
if text:
self._errors = []
while len(text[0]) == 0: del text[0]
lstrip = 0
if text[0].startswith('[ERROR]'): lstrip = 8
for line in text:
if line[0:lstrip ] == ' '*lstrip or \
line[0:lstrip-1] == '[ERROR]':
self._errors += [ line[lstrip:] ]
else:
self._errors += [ line.lstrip() ]
return
def __str__ ( self ):
if not isinstance(self._errors,list):
return "[ERROR] %s" % self._errors
formatted = "\n"
for i in range(len(self._errors)):
if i == 0: formatted += "[ERROR] %s" % self._errors[i]
else: formatted += " %s" % self._errors[i]
if i+1 < len(self._errors): formatted += "\n"
return formatted
def addMessage ( self, message ):
if not isinstance(self._errors,list):
self._errors = [ self._errors ]
if isinstance(message,list):
for line in message:
self._errors += [ line ]
else:
self._errors += [ message ]
return
def terminate ( self ):
print self
sys.exit(self._code)
@property
def code ( self ): return self._code
class BadBinary ( ErrorMessage ):
def __init__ ( self, binary ):
ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary )
return
class BadReturnCode ( ErrorMessage ):
def __init__ ( self, status ):
ErrorMessage.__init__( self, 1, "Command returned status:%d." % status )
return
class Command ( object ):
def __init__ ( self, arguments, fdLog=None ):
self.arguments = arguments
self.fdLog = fdLog
if self.fdLog != None and not isinstance(self.fdLog,file):
print '[WARNING] Command.__init__(): <fdLog> is neither None or a file.'
return
def _argumentsToStr ( self, arguments ):
s = ''
for argument in arguments:
if argument.find(' ') >= 0: s += ' "' + argument + '"'
else: s += ' ' + argument
return s
def log ( self, text ):
print text[:-1]
sys.stdout.flush()
sys.stderr.flush()
if isinstance(self.fdLog,file):
self.fdLog.write( text )
self.fdLog.flush()
return
def execute ( self ):
global conf
sys.stdout.flush()
sys.stderr.flush()
homeDir = os.environ['HOME']
workDir = os.getcwd()
if homeDir.startswith(homeDir):
workDir = '~' + workDir[ len(homeDir) : ]
user = 'root'
if os.environ.has_key('USER'): user = os.environ['USER']
prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir)
try:
self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) )
print self.arguments
child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
while True:
line = child.stdout.readline()
if not line: break
self.log( line )
except OSError, e:
raise BadBinary( self.arguments[0] )
(pid,status) = os.waitpid( child.pid, 0 )
status >>= 8
if status != 0:
raise BadReturnCode( status )
return
class CommandArg ( object ):
def __init__ ( self, command, wd=None, host=None, fdLog=None ):
self.command = command
self.host = host
self.wd = wd
self.fdLog = fdLog
return
def __str__ ( self ):
s = ''
if self.wd: s = 'cd %s && ' % self.wd
for i in range(len(self.command)):
if i: s += ' '
s += self.command[i]
return s
def getArgs ( self ):
if not self.host: return self.command
return [ 'ssh', self.host, str(self) ]
def execute ( self ):
if not self.host and self.wd: os.chdir( self.wd )
Command( self.getArgs(), self.fdLog ).execute()
return
class YosysCommand ( CommandArg ):
def __init__ ( self, yosysBin, fdLog=None ):
CommandArg.__init__ ( self, [ yosysBin ], fdLog=fdLog )
return
class AllianceCommand ( CommandArg ):
def __init__ ( self, alcBin, fdLog=None ):
CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog )
return
class CoriolisCommand ( CommandArg ):
def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ):
CommandArg.__init__ ( self, [ ccbBin
, '--root='+rootDir
, '--project=coriolis'
, '--make=-j%d install' % threads
] + otherArgs
, fdLog=fdLog )
return
class BenchsCommand ( CommandArg ):
def __init__ ( self, benchsDir, fdLog=None ):
CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog )
return
class GitRepository ( object ):
@staticmethod
def getLocalRepository ( url ):
localRepo = url.split( '/' )[-1]
if localRepo.endswith('.git'):
localRepo = localRepo[:-4]
return localRepo
def __init__ ( self, url, cloneDir, fdLog=None ):
self.url = url
self.cloneDir = cloneDir
self.localRepo = GitRepository.getLocalRepository( url )
self.fdLog = fdLog
return
@property
def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo
def removeLocalRepo ( self ):
if os.path.isdir(self.localRepoDir):
print 'Removing Git local repository: <%s>' % self.localRepoDir
shutil.rmtree( self.localRepoDir )
return
def clone ( self ):
print 'Clone/pull from:', self.url
if not os.path.isdir(self.cloneDir):
os.makedirs( self.cloneDir )
if not os.path.isdir(self.localRepoDir):
os.chdir( self.cloneDir )
Command( [ 'git', 'clone', self.url ], self.fdLog ).execute()
else:
os.chdir( self.localRepoDir )
Command( [ 'git', 'pull' ], self.fdLog ).execute()
return
def checkout ( self, branch ):
os.chdir( self.localRepoDir )
Command( [ 'git', 'checkout', branch ], self.fdLog ).execute()
return
class Configuration ( object ):
PrimaryNames = \
[ 'sender' , 'receivers'
, 'coriolisRepo', 'benchsRepo' , 'supportRepos'
, 'homeDir' , 'masterHost'
, 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode'
, 'rmSource' , 'rmBuild'
, 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport'
, 'success' , 'rcode'
]
SecondaryNames = \
[ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'yosysBin', 'alcBin', 'ccbBin', 'benchsDir'
]
def __init__ ( self ):
self._sender = 'Jean-Paul.Chaput@soc.lip6.fr'
self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ]
self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ]
self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git'
self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git'
self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git'
self._homeDir = os.environ['HOME']
self._debugArg = ''
self._rmSource = False
self._rmBuild = False
self._doGit = True
self._doYosys = False
self._doAlliance = False
self._doCoriolis = False
self._doBenchs = False
self._doSendReport = False
self._nightlyMode = False
self._dockerMode = False
self._chrootMode = None
self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._ccbBin = None
self._benchsDir = None
self._masterHost = self._detectMasterHost()
self._success = False
self._rcode = 0
self._updateSecondaries()
return
def __setattr__ ( self, attribute, value ):
if attribute in Configuration.SecondaryNames:
print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute )
return
if attribute == 'masterHost' or attribute == '_masterHost':
if value == 'lepka':
print 'Never touch the Git tree when running on <lepka>.'
self._rmSource = False
self._rmBuild = False
self._doGit = False
self._doSendReport = False
if attribute[0] == '_':
self.__dict__[attribute] = value
return
if attribute == 'homeDir': value = os.path.expanduser(value)
self.__dict__['_'+attribute] = value
self._updateSecondaries()
return
def __getattr__ ( self, attribute ):
if attribute[0] != '_': attribute = '_'+attribute
if not self.__dict__.has_key(attribute):
raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute )
return self.__dict__[attribute]
def _updateSecondaries ( self ):
if self._nightlyMode:
self._rootDir = self._homeDir + '/nightly/coriolis-2.x'
else:
self._rootDir = self._homeDir + '/coriolis-2.x'
self._srcDir = self._rootDir + '/src'
self._logDir = self._srcDir + '/logs'
self._yosysBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/yosysInstaller.sh'
self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh'
self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py'
self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs'
self._masterHost = self._detectMasterHost()
return
def _detectMasterHost ( self ):
if self._chrootMode is None: return 'unknown'
if self._chrootMode: return 'chrooted-host'
masterHost = 'unknown'
hostname = socket.gethostname()
hostAddr = socket.gethostbyname(hostname)
if hostname == 'lepka' and hostAddr == '127.0.0.1':
masterHost = 'lepka'
else:
masterHost = hostname.split('.')[0]
return masterHost
def openLog ( self, stem ):
if not os.path.isdir(self._logDir):
os.makedirs( self._logDir )
index = 0
timeTag = time.strftime( "%Y.%m.%d" )
while True:
logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index))
if not os.path.isfile(logFile):
print "Report log: <%s>" % logFile
break
index += 1
fd = open( logFile, "w" )
self._logs[stem] = logFile
self._fds [stem] = fd
return
def closeLogs ( self ):
for fd in self._fds.values():
if fd: fd.close()
return
def compressLogs ( self ):
for log in self._logs.values():
if not log: continue
fd = open( log, 'r' )
bzfd = bz2.BZ2File( log+'.bz2', 'w' )
for line in fd.readlines(): bzfd.write( line )
bzfd.close()
fd.close()
os.unlink( log )
return
def getCommands ( self, target ):
commands = []
if self.doYosys:
if not os.path.isfile( self.yosysBin ):
raise ErrorMessage( 1, [ 'Cannot find <yosysInstaller.sh>, should be here:'
, ' <%s>' % self.yosysBin
] )
commands.append( YosysCommand( self.yosysBin, fdLog=self.fds['yosys'] ) )
if self.doAlliance:
if not os.path.isfile( self.alcBin ):
raise ErrorMessage( 1, [ 'Cannot find <allianceInstaller.sh>, should be here:'
, ' <%s>' % self.alcBin
] )
commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) )
if self.doCoriolis:
if not os.path.isfile( self.ccbBin ):
raise ErrorMessage( 1, [ 'Cannot find <ccb.py>, should be here:'
, ' <%s>' % self.ccbBin
] )
otherArgs = []
if self.debugArg: otherArgs.append( self.debugArg )
if target == 'SL7_64':
otherArgs.append( '--project=support' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'SL6_64' or target == 'SL6':
otherArgs.append( '--project=support' )
otherArgs.append( '--devtoolset=8' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'Ubuntu18' or target == 'Debian9' or target == 'Debian10':
if target == 'Ubuntu18': otherArgs.append( '--qt5' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) )
if self.doBenchs:
commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) )
return commands
class Report ( object ):
def __init__ ( self, conf ):
self.conf = conf
commaspace = ', '
date = time.strftime( "%A %d %B %Y" )
stateText = 'FAILED'
modeText = 'SoC installation'
if self.conf.success: stateText = 'SUCCESS'
if self.conf.nightlyMode: modeText = 'Nightly build'
self.message = MIMEMultipart()
self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date)
self.message['From' ] = self.conf.sender
self.message['To' ] = commaspace.join( self.conf.receivers )
self.attachements = []
self.mainText = '\n'
self.mainText += 'Salut le Crevard,\n'
self.mainText += '\n'
if self.conf.nightlyMode:
self.mainText += 'This is the nightly build report of Coriolis.\n'
else:
self.mainText += 'SoC installer report of Coriolis.\n'
self.mainText += '%s\n' % date
self.mainText += '\n'
if self.conf.success:
self.mainText += 'Build was SUCCESSFUL\n'
else:
self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n'
self.mainText += '\n'
self.mainText += 'Complete log file(s) can be found here:\n'
return
def attachLog ( self, logFile ):
if not logFile: return
fd = open( logFile, 'rb' )
try:
fd.seek( -1024*100, os.SEEK_END )
except IOError, e:
pass
tailLines = ''
for line in fd.readlines()[1:]:
tailLines += line
fd.close()
self.mainText += ' <%s>\n' % logFile
attachement = MIMEApplication(tailLines)
attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) )
self.attachements.append( attachement )
return
def send ( self ):
self.message.attach( MIMEText(self.mainText) )
for attachement in self.attachements:
self.message.attach( attachement )
print "Sending mail report to:"
for receiver in self.conf.receivers: print ' <%s>' % receiver
session = smtplib.SMTP( 'localhost' )
session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() )
session.quit()
return
# -------------------------------------------------------------------
# <socInstaller> Main Part.
parser = optparse.OptionParser ()
parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a <Debug> aka (-g) version." )
parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." )
parser.add_option ( "--do-yosys" , action="store_true" , dest="doYosys" , help="Rebuild Yosys." )
parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." )
parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." )
parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." )
parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." )
parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." )
parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." )
parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the <alliance-checker-toolkit> sanity benchs." )
parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." )
parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." )
parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." )
parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." )
parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." )
(options, args) = parser.parse_args ()
conf = Configuration()
try:
if options.debug: conf.debugArg = '--debug'
if options.nightly: conf.nightlyMode = True
if options.docker: conf.dockerMode = True
if options.chroot: conf.chrootMode = True
if options.noGit: conf.doGit = False
if options.doYosys: conf.doYosys = True
if options.doAlliance: conf.doAlliance = True
if options.doCoriolis: conf.doCoriolis = True
if options.benchs: conf.doBenchs = True
if options.doReport: conf.doSendReport = True
if options.rmSource or options.rmAll: conf.rmSource = True
if options.rmBuild or options.rmAll: conf.rmBuild = True
if conf.doYosys: conf.openLog( 'yosys' )
if conf.doAlliance: conf.openLog( 'alliance' )
if conf.doCoriolis: conf.openLog( 'coriolis' )
if conf.doBenchs: conf.openLog( 'benchs' )
if conf.dockerMode: os.environ['USER'] = 'root'
gitSupports = []
for supportRepo in conf.supportRepos:
gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) )
gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] )
gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] )
if conf.doAlliance:
gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] )
if conf.doGit:
for gitSupport in gitSupports:
if conf.rmSource: gitSupport.removeLocalRepo()
gitSupport.clone()
#if gitSupport.url.endswith('rapidjson'):
# gitSupport.checkout( 'a1c4f32' )
if conf.doAlliance:
if conf.rmSource: gitAlliance.removeLocalRepo()
gitAlliance.clone ()
#gitAlliance.checkout( 'devel' )
if conf.doCoriolis:
if conf.rmSource: gitCoriolis.removeLocalRepo()
gitCoriolis.clone ()
gitCoriolis.checkout( 'devel' )
if conf.rmSource: gitBenchs.removeLocalRepo()
gitBenchs.clone()
if conf.rmBuild:
for entry in os.listdir(conf.rootDir):
if entry.startswith('Linux.'):
buildDir = conf.rootDir+'/'+entry
print 'Removing OS build directory: <%s>' % buildDir
shutil.rmtree( buildDir )
commands = conf.getCommands( options.profile )
for command in commands:
if command.host:
print 'Executing command on remote host <%s>:' % host
else:
print 'Executing command on *local* host:'
print ' %s' % str(command)
command.execute()
conf.closeLogs()
conf.success = True
except ErrorMessage, e:
print e
conf.closeLogs()
conf.success = False
if showTrace:
print '\nPython stack trace:'
traceback.print_tb( sys.exc_info()[2] )
conf.rcode = e.code
if conf.doSendReport:
report = Report( conf )
report.attachLog( conf.logs['coriolis' ] )
report.attachLog( conf.logs['benchs' ] )
report.send()
conf.compressLogs()
sys.exit( conf.rcode )

@ -1 +0,0 @@
Subproject commit bd6b78003c0cc6579fbad73593e69f2714f3a770

View File

@ -1,6 +0,0 @@
FROM sl7.coriolis
COPY root/dot.bashrc /root/.bashrc
CMD [ "/bin/bash", "-i" ]

View File

@ -1,6 +0,0 @@
FROM sl7.system
COPY root/socInstaller.py /root/socInstaller.py
RUN /root/socInstaller.py --docker --profile=SL7_64 --do-alliance --do-coriolis --benchs

View File

@ -1,25 +0,0 @@
FROM scientificlinux/sl:latest
RUN yum -y update \
&& yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
&& yum -y install git cmake bison flex gcc-c++ libstdc++-devel \
make binutils-devel \
boost-devel boost-python boost-filesystem \
boost-regex boost-wave \
python-devel libxml2-devel bzip2-devel \
qt-devel PyQt4 \
\
autoconf automake libtool \
libX11-devel libXt-devel libXpm-devel \
motif motif-devel \
\
python36-six \
vim-x11 \
&& yum -y install http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/qwt-6.1.2-4.fc23.x86_64.rpm \
http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/qwt-devel-6.1.2-4.fc23.x86_64.rpm \
http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/yosys-0.9-1.el7.soc.x86_64.rpm \
http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/python3-pyvcd-0.1.7-git2302c99.1.el7.soc.x86_64.rpm \
http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/python3-nmigen-0.1-git57d95b7.1.el7.soc.x86_64.rpm \
&& yum clean all

View File

@ -1,4 +0,0 @@
systemImage="sl7.system"
coriolisImage="sl7.coriolis"
bashImage="sl7.bash"

View File

@ -1,18 +0,0 @@
#!/bin/bash
srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src
commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared
buildDir=${commonRoot}/build
installDir=${commonRoot}/install
export ALLIANCE_TOP=${installDir}
export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH}
cd ${srcDir}
sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff
./autostuff clean
./autostuff
mkdir -p ${buildDir}
cd ${buildDir}
${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared
make -j1 install

View File

@ -1,14 +0,0 @@
echo "Running /root/.bashrc"
for archDir in `ls /root/coriolis-2.x/`; do
if [ "$archDir" = "src" ]; then continue; fi
break
done
echo "Found Coriolis architecture directory \"${archDir}\"."
installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install"
. ${installDir}/etc/profile.d/alc_env.sh
eval `${installDir}/etc/coriolis2/coriolisEnv.py`
export QT_X11_NO_MITSHM=1

View File

@ -1,631 +0,0 @@
#!/usr/bin/env python
#
# -*- mode:Python -*-
#
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2015-2018, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | C o r i o l i s I n s t a l l e r |
# | |
# | Authors : Jean-Paul Chaput |
# | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
# | =============================================================== |
# | Python : "./socInstaller.py" |
# +-----------------------------------------------------------------+
#
# WARNING:
# This script has been designed only for internal use in the
# LIP6/CIAN department. If you want to use it you will need to
# change the hardwired configuration.
showTrace = True
try:
import sys
import os.path
import shutil
import optparse
import time
import traceback
import distutils.sysconfig
import subprocess
import socket
import re
import bz2
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
except ImportError, e:
module = str(e).split()[-1]
class ErrorMessage ( Exception ):
def __init__ ( self, code, *arguments ):
self._code = code
self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ]
text = None
if len(arguments) == 1:
if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n')
else:
self._errors = arguments[0]
elif len(arguments) > 1:
text = list(arguments)
if text:
self._errors = []
while len(text[0]) == 0: del text[0]
lstrip = 0
if text[0].startswith('[ERROR]'): lstrip = 8
for line in text:
if line[0:lstrip ] == ' '*lstrip or \
line[0:lstrip-1] == '[ERROR]':
self._errors += [ line[lstrip:] ]
else:
self._errors += [ line.lstrip() ]
return
def __str__ ( self ):
if not isinstance(self._errors,list):
return "[ERROR] %s" % self._errors
formatted = "\n"
for i in range(len(self._errors)):
if i == 0: formatted += "[ERROR] %s" % self._errors[i]
else: formatted += " %s" % self._errors[i]
if i+1 < len(self._errors): formatted += "\n"
return formatted
def addMessage ( self, message ):
if not isinstance(self._errors,list):
self._errors = [ self._errors ]
if isinstance(message,list):
for line in message:
self._errors += [ line ]
else:
self._errors += [ message ]
return
def terminate ( self ):
print self
sys.exit(self._code)
@property
def code ( self ): return self._code
class BadBinary ( ErrorMessage ):
def __init__ ( self, binary ):
ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary )
return
class BadReturnCode ( ErrorMessage ):
def __init__ ( self, status ):
ErrorMessage.__init__( self, 1, "Command returned status:%d." % status )
return
class Command ( object ):
def __init__ ( self, arguments, fdLog=None ):
self.arguments = arguments
self.fdLog = fdLog
if self.fdLog != None and not isinstance(self.fdLog,file):
print '[WARNING] Command.__init__(): <fdLog> is neither None or a file.'
return
def _argumentsToStr ( self, arguments ):
s = ''
for argument in arguments:
if argument.find(' ') >= 0: s += ' "' + argument + '"'
else: s += ' ' + argument
return s
def log ( self, text ):
print text[:-1]
sys.stdout.flush()
sys.stderr.flush()
if isinstance(self.fdLog,file):
self.fdLog.write( text )
self.fdLog.flush()
return
def execute ( self ):
global conf
sys.stdout.flush()
sys.stderr.flush()
homeDir = os.environ['HOME']
workDir = os.getcwd()
if homeDir.startswith(homeDir):
workDir = '~' + workDir[ len(homeDir) : ]
user = 'root'
if os.environ.has_key('USER'): user = os.environ['USER']
prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir)
try:
self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) )
print self.arguments
child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
while True:
line = child.stdout.readline()
if not line: break
self.log( line )
except OSError, e:
raise BadBinary( self.arguments[0] )
(pid,status) = os.waitpid( child.pid, 0 )
status >>= 8
if status != 0:
raise BadReturnCode( status )
return
class CommandArg ( object ):
def __init__ ( self, command, wd=None, host=None, fdLog=None ):
self.command = command
self.host = host
self.wd = wd
self.fdLog = fdLog
return
def __str__ ( self ):
s = ''
if self.wd: s = 'cd %s && ' % self.wd
for i in range(len(self.command)):
if i: s += ' '
s += self.command[i]
return s
def getArgs ( self ):
if not self.host: return self.command
return [ 'ssh', self.host, str(self) ]
def execute ( self ):
if not self.host and self.wd: os.chdir( self.wd )
Command( self.getArgs(), self.fdLog ).execute()
return
class AllianceCommand ( CommandArg ):
def __init__ ( self, alcBin, fdLog=None ):
CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog )
return
class CoriolisCommand ( CommandArg ):
def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ):
CommandArg.__init__ ( self, [ ccbBin
, '--root='+rootDir
, '--project=coriolis'
, '--make=-j%d install' % threads
] + otherArgs
, fdLog=fdLog )
return
class BenchsCommand ( CommandArg ):
def __init__ ( self, benchsDir, fdLog=None ):
CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog )
return
class GitRepository ( object ):
@staticmethod
def getLocalRepository ( url ):
localRepo = url.split( '/' )[-1]
if localRepo.endswith('.git'):
localRepo = localRepo[:-4]
return localRepo
def __init__ ( self, url, cloneDir, fdLog=None ):
self.url = url
self.cloneDir = cloneDir
self.localRepo = GitRepository.getLocalRepository( url )
self.fdLog = fdLog
return
@property
def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo
def removeLocalRepo ( self ):
if os.path.isdir(self.localRepoDir):
print 'Removing Git local repository: <%s>' % self.localRepoDir
shutil.rmtree( self.localRepoDir )
return
def clone ( self ):
print 'Clone/pull from:', self.url
if not os.path.isdir(self.cloneDir):
os.makedirs( self.cloneDir )
if not os.path.isdir(self.localRepoDir):
os.chdir( self.cloneDir )
Command( [ 'git', 'clone', self.url ], self.fdLog ).execute()
else:
os.chdir( self.localRepoDir )
Command( [ 'git', 'pull' ], self.fdLog ).execute()
return
def checkout ( self, branch ):
os.chdir( self.localRepoDir )
Command( [ 'git', 'checkout', branch ], self.fdLog ).execute()
return
class Configuration ( object ):
PrimaryNames = \
[ 'sender' , 'receivers'
, 'coriolisRepo', 'benchsRepo' , 'supportRepos'
, 'homeDir' , 'masterHost'
, 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode'
, 'rmSource' , 'rmBuild'
, 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport'
, 'success' , 'rcode'
]
SecondaryNames = \
[ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'alcBin', 'ccbBin', 'benchsDir'
]
def __init__ ( self ):
self._sender = 'Jean-Paul.Chaput@soc.lip6.fr'
self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ]
self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ]
self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git'
self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git'
self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git'
self._homeDir = os.environ['HOME']
self._debugArg = ''
self._rmSource = False
self._rmBuild = False
self._doGit = True
self._doCoriolis = False
self._doAlliance = False
self._doBenchs = False
self._doSendReport = False
self._nightlyMode = False
self._dockerMode = False
self._chrootMode = None
self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._ccbBin = None
self._benchsDir = None
self._masterHost = self._detectMasterHost()
self._success = False
self._rcode = 0
self._updateSecondaries()
return
def __setattr__ ( self, attribute, value ):
if attribute in Configuration.SecondaryNames:
print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute )
return
if attribute == 'masterHost' or attribute == '_masterHost':
if value == 'lepka':
print 'Never touch the Git tree when running on <lepka>.'
self._rmSource = False
self._rmBuild = False
self._doGit = False
self._doSendReport = False
if attribute[0] == '_':
self.__dict__[attribute] = value
return
if attribute == 'homeDir': value = os.path.expanduser(value)
self.__dict__['_'+attribute] = value
self._updateSecondaries()
return
def __getattr__ ( self, attribute ):
if attribute[0] != '_': attribute = '_'+attribute
if not self.__dict__.has_key(attribute):
raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute )
return self.__dict__[attribute]
def _updateSecondaries ( self ):
if self._nightlyMode:
self._rootDir = self._homeDir + '/nightly/coriolis-2.x'
else:
self._rootDir = self._homeDir + '/coriolis-2.x'
self._srcDir = self._rootDir + '/src'
self._logDir = self._srcDir + '/logs'
self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh'
self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py'
self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs'
self._masterHost = self._detectMasterHost()
return
def _detectMasterHost ( self ):
if self._chrootMode is None: return 'unknown'
if self._chrootMode: return 'chrooted-host'
masterHost = 'unknown'
hostname = socket.gethostname()
hostAddr = socket.gethostbyname(hostname)
if hostname == 'lepka' and hostAddr == '127.0.0.1':
masterHost = 'lepka'
else:
masterHost = hostname.split('.')[0]
return masterHost
def openLog ( self, stem ):
if not os.path.isdir(self._logDir):
os.makedirs( self._logDir )
index = 0
timeTag = time.strftime( "%Y.%m.%d" )
while True:
logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index))
if not os.path.isfile(logFile):
print "Report log: <%s>" % logFile
break
index += 1
fd = open( logFile, "w" )
self._logs[stem] = logFile
self._fds [stem] = fd
return
def closeLogs ( self ):
for fd in self._fds.values():
if fd: fd.close()
return
def compressLogs ( self ):
for log in self._logs.values():
if not log: continue
fd = open( log, 'r' )
bzfd = bz2.BZ2File( log+'.bz2', 'w' )
for line in fd.readlines(): bzfd.write( line )
bzfd.close()
fd.close()
os.unlink( log )
return
def getCommands ( self, target ):
commands = []
if self.doAlliance:
if not os.path.isfile( self.alcBin ):
raise ErrorMessage( 1, [ 'Cannot find <allianceInstaller.sh>, should be here:'
, ' <%s>' % self.alcBin
] )
commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) )
if self.doCoriolis:
if not os.path.isfile( self.ccbBin ):
raise ErrorMessage( 1, [ 'Cannot find <ccb.py>, should be here:'
, ' <%s>' % self.ccbBin
] )
otherArgs = []
if self.debugArg: otherArgs.append( self.debugArg )
if target == 'SL7_64':
otherArgs.append( '--project=support' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'SL6_64' or target == 'SL6':
otherArgs.append( '--project=support' )
otherArgs.append( '--devtoolset=8' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'Ubuntu18' or target == 'Debian9' or target == 'Debian10':
if target == 'Ubuntu18': otherArgs.append( '--qt5' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) )
if self.doBenchs:
commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) )
return commands
class Report ( object ):
def __init__ ( self, conf ):
self.conf = conf
commaspace = ', '
date = time.strftime( "%A %d %B %Y" )
stateText = 'FAILED'
modeText = 'SoC installation'
if self.conf.success: stateText = 'SUCCESS'
if self.conf.nightlyMode: modeText = 'Nightly build'
self.message = MIMEMultipart()
self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date)
self.message['From' ] = self.conf.sender
self.message['To' ] = commaspace.join( self.conf.receivers )
self.attachements = []
self.mainText = '\n'
self.mainText += 'Salut le Crevard,\n'
self.mainText += '\n'
if self.conf.nightlyMode:
self.mainText += 'This is the nightly build report of Coriolis.\n'
else:
self.mainText += 'SoC installer report of Coriolis.\n'
self.mainText += '%s\n' % date
self.mainText += '\n'
if self.conf.success:
self.mainText += 'Build was SUCCESSFUL\n'
else:
self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n'
self.mainText += '\n'
self.mainText += 'Complete log file(s) can be found here:\n'
return
def attachLog ( self, logFile ):
if not logFile: return
fd = open( logFile, 'rb' )
try:
fd.seek( -1024*100, os.SEEK_END )
except IOError, e:
pass
tailLines = ''
for line in fd.readlines()[1:]:
tailLines += line
fd.close()
self.mainText += ' <%s>\n' % logFile
attachement = MIMEApplication(tailLines)
attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) )
self.attachements.append( attachement )
return
def send ( self ):
self.message.attach( MIMEText(self.mainText) )
for attachement in self.attachements:
self.message.attach( attachement )
print "Sending mail report to:"
for receiver in self.conf.receivers: print ' <%s>' % receiver
session = smtplib.SMTP( 'localhost' )
session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() )
session.quit()
return
# -------------------------------------------------------------------
# <socInstaller> Main Part.
parser = optparse.OptionParser ()
parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a <Debug> aka (-g) version." )
parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." )
parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." )
parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." )
parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." )
parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." )
parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." )
parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." )
parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the <alliance-checker-toolkit> sanity benchs." )
parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." )
parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." )
parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." )
parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." )
parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." )
(options, args) = parser.parse_args ()
conf = Configuration()
try:
if options.debug: conf.debugArg = '--debug'
if options.nightly: conf.nightlyMode = True
if options.docker: conf.dockerMode = True
if options.chroot: conf.chrootMode = True
if options.noGit: conf.doGit = False
if options.doCoriolis: conf.doCoriolis = True
if options.doAlliance: conf.doAlliance = True
if options.benchs: conf.doBenchs = True
if options.doReport: conf.doSendReport = True
if options.rmSource or options.rmAll: conf.rmSource = True
if options.rmBuild or options.rmAll: conf.rmBuild = True
if conf.doAlliance: conf.openLog( 'alliance' )
if conf.doCoriolis: conf.openLog( 'coriolis' )
if conf.doBenchs: conf.openLog( 'benchs' )
if conf.dockerMode: os.environ['USER'] = 'root'
gitSupports = []
for supportRepo in conf.supportRepos:
gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) )
gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] )
gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] )
if conf.doAlliance:
gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] )
if conf.doGit:
for gitSupport in gitSupports:
if conf.rmSource: gitSupport.removeLocalRepo()
gitSupport.clone()
#if gitSupport.url.endswith('rapidjson'):
# gitSupport.checkout( 'a1c4f32' )
if conf.doCoriolis:
if conf.rmSource: gitCoriolis.removeLocalRepo()
gitCoriolis.clone ()
gitCoriolis.checkout( 'devel' )
if conf.doAlliance:
if conf.rmSource: gitAlliance.removeLocalRepo()
gitAlliance.clone ()
#gitAlliance.checkout( 'devel' )
if conf.rmSource: gitBenchs.removeLocalRepo()
gitBenchs.clone()
if conf.rmBuild:
for entry in os.listdir(conf.rootDir):
if entry.startswith('Linux.'):
buildDir = conf.rootDir+'/'+entry
print 'Removing OS build directory: <%s>' % buildDir
shutil.rmtree( buildDir )
commands = conf.getCommands( options.profile )
for command in commands:
if command.host:
print 'Executing command on remote host <%s>:' % host
else:
print 'Executing command on *local* host:'
print ' %s' % str(command)
command.execute()
conf.closeLogs()
conf.success = True
except ErrorMessage, e:
print e
conf.closeLogs()
conf.success = False
if showTrace:
print '\nPython stack trace:'
traceback.print_tb( sys.exc_info()[2] )
conf.rcode = e.code
if conf.doSendReport:
report = Report( conf )
report.attachLog( conf.logs['coriolis' ] )
report.attachLog( conf.logs['benchs' ] )
report.send()
conf.compressLogs()
sys.exit( conf.rcode )

View File

@ -1,6 +0,0 @@
FROM ubuntu18.coriolis
COPY root/dot.bashrc /root/.bashrc
CMD [ "/bin/bash", "-i" ]

View File

@ -1,10 +0,0 @@
FROM ubuntu18.system
COPY root/socInstaller.py /root/socInstaller.py
RUN mkdir -p coriolis-2.x/src \
&& git clone https://github.com/m-labs/nmigen.git \
&& cd nmigen \
&& python3 setup.py develop \
&& /root/socInstaller.py --docker --profile=Ubuntu18 --do-alliance --do-coriolis

View File

@ -1,26 +0,0 @@
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get -y install build-essential binutils-dev \
git cmake bison flex gcc python-dev \
libboost-all-dev libboost-python-dev \
zlib1g-dev libxml2-dev rapidjson-dev libbz2-dev \
qtbase5-dev libqt5svg5-dev libqwt-qt5-dev \
python-pyqt5 \
\
autotools-dev automake \
libxt-dev libxpm-dev libmotif-dev \
\
yosys \
python3-setuptools python3-pip python3-six \
python3-wheel \
\
vim \
&& apt-get clean \
&& pip3 install git+https://github.com/m-labs/nmigen.git
# For building with Qt 4 instead of Qt 5.
# qt4-dev-tools libqwt-dev python-qt4 \

View File

@ -1,4 +0,0 @@
systemImage="ubuntu18.system"
coriolisImage="ubuntu18.coriolis"
bashImage="ubuntu18.bash"

View File

@ -1,19 +0,0 @@
#!/bin/bash
srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src
commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared
buildDir=${commonRoot}/build
installDir=${commonRoot}/install
export ALLIANCE_TOP=${installDir}
export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH}
cd ${srcDir}
# Skip doc generation to avoid pulling TeXLive in docker images.
sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff
./autostuff clean
./autostuff
mkdir -p ${buildDir}
cd ${buildDir}
${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared
make -j1 install

View File

@ -1,14 +0,0 @@
echo "Running /root/.bashrc"
for archDir in `ls /root/coriolis-2.x/`; do
if [ "$archDir" = "src" ]; then continue; fi
break
done
echo "Found Coriolis architecture directory \"${archDir}\"."
installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install"
. ${installDir}/etc/profile.d/alc_env.sh
eval `${installDir}/etc/coriolis2/coriolisEnv.py`
export QT_X11_NO_MITSHM=1

View File

@ -1,650 +0,0 @@
#!/usr/bin/env python
#
# -*- mode:Python -*-
#
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2015-2018, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | C o r i o l i s I n s t a l l e r |
# | |
# | Authors : Jean-Paul Chaput |
# | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
# | =============================================================== |
# | Python : "./socInstaller.py" |
# +-----------------------------------------------------------------+
#
# WARNING:
# This script has been designed only for internal use in the
# LIP6/CIAN department. If you want to use it you will need to
# change the hardwired configuration.
showTrace = True
try:
import sys
import os.path
import shutil
import optparse
import time
import traceback
import distutils.sysconfig
import subprocess
import socket
import re
import bz2
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
except ImportError, e:
module = str(e).split()[-1]
class ErrorMessage ( Exception ):
def __init__ ( self, code, *arguments ):
self._code = code
self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ]
text = None
if len(arguments) == 1:
if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n')
else:
self._errors = arguments[0]
elif len(arguments) > 1:
text = list(arguments)
if text:
self._errors = []
while len(text[0]) == 0: del text[0]
lstrip = 0
if text[0].startswith('[ERROR]'): lstrip = 8
for line in text:
if line[0:lstrip ] == ' '*lstrip or \
line[0:lstrip-1] == '[ERROR]':
self._errors += [ line[lstrip:] ]
else:
self._errors += [ line.lstrip() ]
return
def __str__ ( self ):
if not isinstance(self._errors,list):
return "[ERROR] %s" % self._errors
formatted = "\n"
for i in range(len(self._errors)):
if i == 0: formatted += "[ERROR] %s" % self._errors[i]
else: formatted += " %s" % self._errors[i]
if i+1 < len(self._errors): formatted += "\n"
return formatted
def addMessage ( self, message ):
if not isinstance(self._errors,list):
self._errors = [ self._errors ]
if isinstance(message,list):
for line in message:
self._errors += [ line ]
else:
self._errors += [ message ]
return
def terminate ( self ):
print self
sys.exit(self._code)
@property
def code ( self ): return self._code
class BadBinary ( ErrorMessage ):
def __init__ ( self, binary ):
ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary )
return
class BadReturnCode ( ErrorMessage ):
def __init__ ( self, status ):
ErrorMessage.__init__( self, 1, "Command returned status:%d." % status )
return
class Command ( object ):
def __init__ ( self, arguments, fdLog=None ):
self.arguments = arguments
self.fdLog = fdLog
if self.fdLog != None and not isinstance(self.fdLog,file):
print '[WARNING] Command.__init__(): <fdLog> is neither None or a file.'
return
def _argumentsToStr ( self, arguments ):
s = ''
for argument in arguments:
if argument.find(' ') >= 0: s += ' "' + argument + '"'
else: s += ' ' + argument
return s
def log ( self, text ):
print text[:-1]
sys.stdout.flush()
sys.stderr.flush()
if isinstance(self.fdLog,file):
self.fdLog.write( text )
self.fdLog.flush()
return
def execute ( self ):
global conf
sys.stdout.flush()
sys.stderr.flush()
homeDir = os.environ['HOME']
workDir = os.getcwd()
if homeDir.startswith(homeDir):
workDir = '~' + workDir[ len(homeDir) : ]
user = 'root'
if os.environ.has_key('USER'): user = os.environ['USER']
prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir)
try:
self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) )
print self.arguments
child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
while True:
line = child.stdout.readline()
if not line: break
self.log( line )
except OSError, e:
raise BadBinary( self.arguments[0] )
(pid,status) = os.waitpid( child.pid, 0 )
status >>= 8
if status != 0:
raise BadReturnCode( status )
return
class CommandArg ( object ):
def __init__ ( self, command, wd=None, host=None, fdLog=None ):
self.command = command
self.host = host
self.wd = wd
self.fdLog = fdLog
return
def __str__ ( self ):
s = ''
if self.wd: s = 'cd %s && ' % self.wd
for i in range(len(self.command)):
if i: s += ' '
s += self.command[i]
return s
def getArgs ( self ):
if not self.host: return self.command
return [ 'ssh', self.host, str(self) ]
def execute ( self ):
if not self.host and self.wd: os.chdir( self.wd )
Command( self.getArgs(), self.fdLog ).execute()
return
class YosysCommand ( CommandArg ):
def __init__ ( self, yosysBin, fdLog=None ):
CommandArg.__init__ ( self, [ yosysBin ], fdLog=fdLog )
return
class AllianceCommand ( CommandArg ):
def __init__ ( self, alcBin, fdLog=None ):
CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog )
return
class CoriolisCommand ( CommandArg ):
def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ):
CommandArg.__init__ ( self, [ ccbBin
, '--root='+rootDir
, '--project=coriolis'
, '--make=-j%d install' % threads
] + otherArgs
, fdLog=fdLog )
return
class BenchsCommand ( CommandArg ):
def __init__ ( self, benchsDir, fdLog=None ):
CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog )
return
class GitRepository ( object ):
@staticmethod
def getLocalRepository ( url ):
localRepo = url.split( '/' )[-1]
if localRepo.endswith('.git'):
localRepo = localRepo[:-4]
return localRepo
def __init__ ( self, url, cloneDir, fdLog=None ):
self.url = url
self.cloneDir = cloneDir
self.localRepo = GitRepository.getLocalRepository( url )
self.fdLog = fdLog
return
@property
def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo
def removeLocalRepo ( self ):
if os.path.isdir(self.localRepoDir):
print 'Removing Git local repository: <%s>' % self.localRepoDir
shutil.rmtree( self.localRepoDir )
return
def clone ( self ):
print 'Clone/pull from:', self.url
if not os.path.isdir(self.cloneDir):
os.makedirs( self.cloneDir )
if not os.path.isdir(self.localRepoDir):
os.chdir( self.cloneDir )
Command( [ 'git', 'clone', self.url ], self.fdLog ).execute()
else:
os.chdir( self.localRepoDir )
Command( [ 'git', 'pull' ], self.fdLog ).execute()
return
def checkout ( self, branch ):
os.chdir( self.localRepoDir )
Command( [ 'git', 'checkout', branch ], self.fdLog ).execute()
return
class Configuration ( object ):
PrimaryNames = \
[ 'sender' , 'receivers'
, 'coriolisRepo', 'benchsRepo' , 'supportRepos'
, 'homeDir' , 'masterHost'
, 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode'
, 'rmSource' , 'rmBuild'
, 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport'
, 'success' , 'rcode'
]
SecondaryNames = \
[ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'yosysBin', 'alcBin', 'ccbBin', 'benchsDir'
]
def __init__ ( self ):
self._sender = 'Jean-Paul.Chaput@soc.lip6.fr'
self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ]
self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ]
self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git'
self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git'
self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git'
self._homeDir = os.environ['HOME']
self._debugArg = ''
self._rmSource = False
self._rmBuild = False
self._doGit = True
self._doYosys = False
self._doAlliance = False
self._doCoriolis = False
self._doBenchs = False
self._doSendReport = False
self._nightlyMode = False
self._dockerMode = False
self._chrootMode = None
self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._ccbBin = None
self._benchsDir = None
self._masterHost = self._detectMasterHost()
self._success = False
self._rcode = 0
self._updateSecondaries()
return
def __setattr__ ( self, attribute, value ):
if attribute in Configuration.SecondaryNames:
print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute )
return
if attribute == 'masterHost' or attribute == '_masterHost':
if value == 'lepka':
print 'Never touch the Git tree when running on <lepka>.'
self._rmSource = False
self._rmBuild = False
self._doGit = False
self._doSendReport = False
if attribute[0] == '_':
self.__dict__[attribute] = value
return
if attribute == 'homeDir': value = os.path.expanduser(value)
self.__dict__['_'+attribute] = value
self._updateSecondaries()
return
def __getattr__ ( self, attribute ):
if attribute[0] != '_': attribute = '_'+attribute
if not self.__dict__.has_key(attribute):
raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute )
return self.__dict__[attribute]
def _updateSecondaries ( self ):
if self._nightlyMode:
self._rootDir = self._homeDir + '/nightly/coriolis-2.x'
else:
self._rootDir = self._homeDir + '/coriolis-2.x'
self._srcDir = self._rootDir + '/src'
self._logDir = self._srcDir + '/logs'
self._yosysBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/yosysInstaller.sh'
self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh'
self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py'
self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs'
self._masterHost = self._detectMasterHost()
return
def _detectMasterHost ( self ):
if self._chrootMode is None: return 'unknown'
if self._chrootMode: return 'chrooted-host'
masterHost = 'unknown'
hostname = socket.gethostname()
hostAddr = socket.gethostbyname(hostname)
if hostname == 'lepka' and hostAddr == '127.0.0.1':
masterHost = 'lepka'
else:
masterHost = hostname.split('.')[0]
return masterHost
def openLog ( self, stem ):
if not os.path.isdir(self._logDir):
os.makedirs( self._logDir )
index = 0
timeTag = time.strftime( "%Y.%m.%d" )
while True:
logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index))
if not os.path.isfile(logFile):
print "Report log: <%s>" % logFile
break
index += 1
fd = open( logFile, "w" )
self._logs[stem] = logFile
self._fds [stem] = fd
return
def closeLogs ( self ):
for fd in self._fds.values():
if fd: fd.close()
return
def compressLogs ( self ):
for log in self._logs.values():
if not log: continue
fd = open( log, 'r' )
bzfd = bz2.BZ2File( log+'.bz2', 'w' )
for line in fd.readlines(): bzfd.write( line )
bzfd.close()
fd.close()
os.unlink( log )
return
def getCommands ( self, target ):
commands = []
if self.doYosys:
if not os.path.isfile( self.yosysBin ):
raise ErrorMessage( 1, [ 'Cannot find <yosysInstaller.sh>, should be here:'
, ' <%s>' % self.yosysBin
] )
commands.append( YosysCommand( self.yosysBin, fdLog=self.fds['yosys'] ) )
if self.doAlliance:
if not os.path.isfile( self.alcBin ):
raise ErrorMessage( 1, [ 'Cannot find <allianceInstaller.sh>, should be here:'
, ' <%s>' % self.alcBin
] )
commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) )
if self.doCoriolis:
if not os.path.isfile( self.ccbBin ):
raise ErrorMessage( 1, [ 'Cannot find <ccb.py>, should be here:'
, ' <%s>' % self.ccbBin
] )
otherArgs = []
if self.debugArg: otherArgs.append( self.debugArg )
if target == 'SL7_64':
otherArgs.append( '--project=support' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'SL6_64' or target == 'SL6':
otherArgs.append( '--project=support' )
otherArgs.append( '--devtoolset=8' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'Ubuntu18' or target == 'Debian9' or target == 'Debian10':
if target == 'Ubuntu18': otherArgs.append( '--qt5' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) )
if self.doBenchs:
commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) )
return commands
class Report ( object ):
def __init__ ( self, conf ):
self.conf = conf
commaspace = ', '
date = time.strftime( "%A %d %B %Y" )
stateText = 'FAILED'
modeText = 'SoC installation'
if self.conf.success: stateText = 'SUCCESS'
if self.conf.nightlyMode: modeText = 'Nightly build'
self.message = MIMEMultipart()
self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date)
self.message['From' ] = self.conf.sender
self.message['To' ] = commaspace.join( self.conf.receivers )
self.attachements = []
self.mainText = '\n'
self.mainText += 'Salut le Crevard,\n'
self.mainText += '\n'
if self.conf.nightlyMode:
self.mainText += 'This is the nightly build report of Coriolis.\n'
else:
self.mainText += 'SoC installer report of Coriolis.\n'
self.mainText += '%s\n' % date
self.mainText += '\n'
if self.conf.success:
self.mainText += 'Build was SUCCESSFUL\n'
else:
self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n'
self.mainText += '\n'
self.mainText += 'Complete log file(s) can be found here:\n'
return
def attachLog ( self, logFile ):
if not logFile: return
fd = open( logFile, 'rb' )
try:
fd.seek( -1024*100, os.SEEK_END )
except IOError, e:
pass
tailLines = ''
for line in fd.readlines()[1:]:
tailLines += line
fd.close()
self.mainText += ' <%s>\n' % logFile
attachement = MIMEApplication(tailLines)
attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) )
self.attachements.append( attachement )
return
def send ( self ):
self.message.attach( MIMEText(self.mainText) )
for attachement in self.attachements:
self.message.attach( attachement )
print "Sending mail report to:"
for receiver in self.conf.receivers: print ' <%s>' % receiver
session = smtplib.SMTP( 'localhost' )
session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() )
session.quit()
return
# -------------------------------------------------------------------
# <socInstaller> Main Part.
parser = optparse.OptionParser ()
parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a <Debug> aka (-g) version." )
parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." )
parser.add_option ( "--do-yosys" , action="store_true" , dest="doYosys" , help="Rebuild Yosys." )
parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." )
parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." )
parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." )
parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." )
parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." )
parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." )
parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the <alliance-checker-toolkit> sanity benchs." )
parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." )
parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." )
parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." )
parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." )
parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." )
(options, args) = parser.parse_args ()
conf = Configuration()
try:
if options.debug: conf.debugArg = '--debug'
if options.nightly: conf.nightlyMode = True
if options.docker: conf.dockerMode = True
if options.chroot: conf.chrootMode = True
if options.noGit: conf.doGit = False
if options.doYosys: conf.doYosys = True
if options.doAlliance: conf.doAlliance = True
if options.doCoriolis: conf.doCoriolis = True
if options.benchs: conf.doBenchs = True
if options.doReport: conf.doSendReport = True
if options.rmSource or options.rmAll: conf.rmSource = True
if options.rmBuild or options.rmAll: conf.rmBuild = True
if conf.doYosys: conf.openLog( 'yosys' )
if conf.doAlliance: conf.openLog( 'alliance' )
if conf.doCoriolis: conf.openLog( 'coriolis' )
if conf.doBenchs: conf.openLog( 'benchs' )
if conf.dockerMode: os.environ['USER'] = 'root'
gitSupports = []
for supportRepo in conf.supportRepos:
gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) )
gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] )
gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] )
if conf.doAlliance:
gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] )
if conf.doGit:
for gitSupport in gitSupports:
if conf.rmSource: gitSupport.removeLocalRepo()
gitSupport.clone()
#if gitSupport.url.endswith('rapidjson'):
# gitSupport.checkout( 'a1c4f32' )
if conf.doAlliance:
if conf.rmSource: gitAlliance.removeLocalRepo()
gitAlliance.clone ()
#gitAlliance.checkout( 'devel' )
if conf.doCoriolis:
if conf.rmSource: gitCoriolis.removeLocalRepo()
gitCoriolis.clone ()
gitCoriolis.checkout( 'devel' )
if conf.rmSource: gitBenchs.removeLocalRepo()
gitBenchs.clone()
if conf.rmBuild:
for entry in os.listdir(conf.rootDir):
if entry.startswith('Linux.'):
buildDir = conf.rootDir+'/'+entry
print 'Removing OS build directory: <%s>' % buildDir
shutil.rmtree( buildDir )
commands = conf.getCommands( options.profile )
for command in commands:
if command.host:
print 'Executing command on remote host <%s>:' % host
else:
print 'Executing command on *local* host:'
print ' %s' % str(command)
command.execute()
conf.closeLogs()
conf.success = True
except ErrorMessage, e:
print e
conf.closeLogs()
conf.success = False
if showTrace:
print '\nPython stack trace:'
traceback.print_tb( sys.exc_info()[2] )
conf.rcode = e.code
if conf.doSendReport:
report = Report( conf )
report.attachLog( conf.logs['coriolis' ] )
report.attachLog( conf.logs['benchs' ] )
report.send()
conf.compressLogs()
sys.exit( conf.rcode )

View File

@ -1,133 +0,0 @@
#!/bin/bash
showHelp=0
showError=0
doBuildSystem=0
doBuildCoriolis=0
doBuildBash=0
doBuild=0
doRun=0
doRemove=0
if [ ! -f "./docker-conf.sh" ]; then
echo "[ERROR] Missing \"./docker-conf.sh\"."
echo " (wd:\"`pwd`\")"
exit 1
fi
. "./docker-conf.sh"
dockerImages="${systemImage},${coriolisImage},${bashImage}"
while [ $# -gt 0 ]; do
case $1 in
--help) showHelp=1;;
--build-system) doBuildSystem=1;;
--build-coriolis) doBuildCoriolis=1;;
--build-bash) doBuildBash=1;;
--run) doRun=1;;
--remove) doRemove=1;;
-*) NB=2; CH=`echo $1 | cut -c$NB`
while [ "$CH" != "" ]; do
case $CH in
h) showHelp=1;;
s) doBuildSystem=1;;
c) doBuildCoriolis=1;;
b) doBuildBash=1;;
r) doRun=1;;
*) showError=1; badOption="$1";;
esac
NB=`expr $NB + 1`
CH=`echo $1 | cut -c$NB`
done;;
*) showError=1; badOption="$1";;
esac
shift
done
if [ ${showError} -ne 0 ]; then
echo "[ERROR] Unknown argument \"${badOption}\"."
exit 1
fi
if [ ${showHelp} -ne 0 ]; then
echo "Usage: ./manager.sh [options]"
echo "Options:"
echo " * [-h|--help]: Print this help."
echo " * [-s|--build-system]: Rebuild the whole OS image."
echo " * [-c|--build-coriolis]: Rebuild the Coriolis image. It will remove the previous"
echo " images (${dockerImages})."
echo " * [-b|--build-bash]: Rebuild the Bash (shell) image. It will remove the previous"
echo " image (${bashImage})."
echo " * [-r|--run]: Recompile Alliance, Coriolis & perform benchs."
echo " * [--remove]: Remove container(s) & image(s)."
exit 0
fi
if [ ${doBuildSystem} -ne 0 ]; then
doBuildBash=1
doBuildCoriolis=1
doBuild=1
doRemove=1
fi
if [ ${doBuildCoriolis} -ne 0 ]; then
doBuildBash=1
doBuild=1
doRemove=1
fi
if [ ${doBuildBash} -ne 0 ]; then
doBuild=1
doRemove=1
fi
if [ ${doRemove} -ne 0 ]; then
if [ ${doBuildBash} -ne 0 ]; then
echo "Removing \"${bashImage}\" docker container."
docker rm ${bashImage}
docker rmi ${bashImage}
fi
if [ ${doBuildCoriolis} -ne 0 ]; then
echo "Removing \"${coriolisImage}\" docker image."
docker rm ${coriolisImage}
docker rmi ${coriolisImage}
fi
if [ ${doBuildSystem} -ne 0 ]; then
echo "Removing \"${systemImage}\" docker image."
docker rm ${systemImage}
docker rmi ${systemImage}
fi
fi
if [ ${doBuild} -ne 0 ]; then
echo "Synching Alliance & Coriolis builder scripts."
cp ../../socInstaller.py ./root
cp ../../dot.bashrc ./root
if [ ${doBuildSystem} -ne 0 ]; then
echo "Build \"${systemImage}\" docker image."
docker build -f Dockerfile.system -t ${systemImage} .
fi
if [ ${doBuildCoriolis} -ne 0 ]; then
echo "Build \"${coriolisImage}\" docker image."
docker build -f Dockerfile.coriolis -t ${coriolisImage} .
fi
if [ ${doBuildBash} -ne 0 ]; then
echo "Build \"${bashImage}\" docker image."
docker build -f Dockerfile.bash -t ${bashImage} .
fi
fi
if [ ${doRun} -ne 0 ]; then
docker run --rm --net=host -e DISPLAY=:0 -ti --name ${bashImage} ${bashImage}
fi

View File

@ -1,14 +0,0 @@
echo "Running /root/.bashrc"
for archDir in `ls /root/coriolis-2.x/`; do
if [ "$archDir" = "src" ]; then continue; fi
break
done
echo "Found Coriolis architecture directory \"${archDir}\"."
installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install"
. ${installDir}/etc/profile.d/alc_env.sh
eval `${installDir}/etc/coriolis2/coriolisEnv.py`
export QT_X11_NO_MITSHM=1

View File

@ -1,31 +0,0 @@
#!/usr/bin/bash
docDirs=""
docDirs="${docDirs} hurricane/doc/analog"
docDirs="${docDirs} hurricane/doc/hurricane"
docDirs="${docDirs} hurricane/doc/viewer"
docDirs="${docDirs} crlcore/doc/crlcore"
docDirs="${docDirs} katabatic/doc"
docDirs="${docDirs} kite/doc"
docDirs="${docDirs} oroshi/doc"
docDirs="${docDirs} unicorn/doc/unicorn"
docDirs="${docDirs} vlsisapd/doc"
docDirs="${docDirs} vlsisapd/doc"
resetDir ()
{
directory="$1"
echo "Resetting \"${directory} ..."
if [ -d "${directory}" ]; then
rm -rf "${directory}"
git checkout "${directory}"
fi
}
for docDir in ${docDirs}; do
resetDir "${docDir}/html"
resetDir "${docDir}/latex"
resetDir "${docDir}/man"
resetDir "${docDir}/rtf"
done
resetDir "documentation/output/pdfs"

View File

@ -150,13 +150,10 @@ class Command ( object ):
workDir = os.getcwd() workDir = os.getcwd()
if homeDir.startswith(homeDir): if homeDir.startswith(homeDir):
workDir = '~' + workDir[ len(homeDir) : ] workDir = '~' + workDir[ len(homeDir) : ]
user = 'root' prompt = '%s@%s:%s$' % (os.environ['USER'],conf.masterHost,workDir)
if os.environ.has_key('USER'): user = os.environ['USER']
prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir)
try: try:
self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) ) self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) )
print self.arguments
child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT )
while True: while True:
@ -175,68 +172,6 @@ class Command ( object ):
return return
class CommandArg ( object ):
def __init__ ( self, command, wd=None, host=None, fdLog=None ):
self.command = command
self.host = host
self.wd = wd
self.fdLog = fdLog
return
def __str__ ( self ):
s = ''
if self.wd: s = 'cd %s && ' % self.wd
for i in range(len(self.command)):
if i: s += ' '
s += self.command[i]
return s
def getArgs ( self ):
if not self.host: return self.command
return [ 'ssh', self.host, str(self) ]
def execute ( self ):
if not self.host and self.wd: os.chdir( self.wd )
Command( self.getArgs(), self.fdLog ).execute()
return
class YosysCommand ( CommandArg ):
def __init__ ( self, yosysBin, fdLog=None ):
CommandArg.__init__ ( self, [ yosysBin ], fdLog=fdLog )
return
class AllianceCommand ( CommandArg ):
def __init__ ( self, alcBin, fdLog=None ):
CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog )
return
class CoriolisCommand ( CommandArg ):
def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ):
CommandArg.__init__ ( self, [ ccbBin
, '--root='+rootDir
, '--project=coriolis'
, '--make=-j%d install' % threads
] + otherArgs
, fdLog=fdLog )
return
class BenchsCommand ( CommandArg ):
def __init__ ( self, benchsDir, fdLog=None ):
CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog )
return
class GitRepository ( object ): class GitRepository ( object ):
@staticmethod @staticmethod
@ -287,39 +222,31 @@ class Configuration ( object ):
[ 'sender' , 'receivers' [ 'sender' , 'receivers'
, 'coriolisRepo', 'benchsRepo', 'supportRepos' , 'coriolisRepo', 'benchsRepo', 'supportRepos'
, 'homeDir' , 'masterHost' , 'homeDir' , 'masterHost'
, 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode' , 'debugArg' , 'nightlyMode'
, 'rmSource' , 'rmBuild' , 'rmSource' , 'rmBuild', 'doGit', 'doBuild', 'doBenchs', 'doSendReport'
, 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport'
, 'success' , 'rcode' , 'success' , 'rcode'
] ]
SecondaryNames = \ SecondaryNames = \
[ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'yosysBin', 'alcBin', 'ccbBin', 'benchsDir' [ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds'
] ]
def __init__ ( self ): def __init__ ( self ):
self._sender = 'Jean-Paul.Chaput@soc.lip6.fr' self._sender = 'Jean-Paul.Chaput@soc.lip6.fr'
self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ] self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ]
self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ] self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ]
self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git' self._coriolisRepo = 'https://www-soc.lip6.fr/git/coriolis.git'
self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git' self._benchsRepo = 'https://www-soc.lip6.fr/git/alliance-check-toolkit.git'
self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git'
self._homeDir = os.environ['HOME'] self._homeDir = os.environ['HOME']
self._debugArg = '' self._debugArg = ''
self._rmSource = False self._rmSource = False
self._rmBuild = False self._rmBuild = False
self._doGit = True self._doGit = True
self._doYosys = False self._doBuild = True
self._doAlliance = False
self._doCoriolis = False
self._doBenchs = False self._doBenchs = False
self._doSendReport = False self._doSendReport = True
self._nightlyMode = False self._nightlyMode = False
self._dockerMode = False self._logs = { 'build':None, 'benchs':None }
self._chrootMode = None self._fds = { 'build':None, 'benchs':None }
self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None }
self._ccbBin = None
self._benchsDir = None
self._masterHost = self._detectMasterHost() self._masterHost = self._detectMasterHost()
self._success = False self._success = False
self._rcode = 0 self._rcode = 0
@ -339,6 +266,15 @@ class Configuration ( object ):
self._rmBuild = False self._rmBuild = False
self._doGit = False self._doGit = False
self._doSendReport = False self._doSendReport = False
self._targets = { 'SL6' :None
, 'SL6_64':None
, 'SL7_64':'lepka'
}
else:
self._targets = { 'SL6' :None
, 'SL6_64':None
, 'SL7_64':'bop'
}
if attribute[0] == '_': if attribute[0] == '_':
self.__dict__[attribute] = value self.__dict__[attribute] = value
@ -358,22 +294,17 @@ class Configuration ( object ):
def _updateSecondaries ( self ): def _updateSecondaries ( self ):
if self._nightlyMode: if self._nightlyMode:
self._targets['SL6'] = None
self._rootDir = self._homeDir + '/nightly/coriolis-2.x' self._rootDir = self._homeDir + '/nightly/coriolis-2.x'
else: else:
if self._masterHost != 'lepka':
self._targets['SL6'] = None
self._rootDir = self._homeDir + '/coriolis-2.x' self._rootDir = self._homeDir + '/coriolis-2.x'
self._srcDir = self._rootDir + '/src' self._srcDir = self._rootDir + '/src'
self._logDir = self._srcDir + '/logs' self._logDir = self._srcDir + '/logs'
self._yosysBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/yosysInstaller.sh'
self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh'
self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py'
self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs'
self._masterHost = self._detectMasterHost()
return return
def _detectMasterHost ( self ): def _detectMasterHost ( self ):
if self._chrootMode is None: return 'unknown'
if self._chrootMode: return 'chrooted-host'
masterHost = 'unknown' masterHost = 'unknown'
hostname = socket.gethostname() hostname = socket.gethostname()
hostAddr = socket.gethostbyname(hostname) hostAddr = socket.gethostbyname(hostname)
@ -421,49 +352,6 @@ class Configuration ( object ):
os.unlink( log ) os.unlink( log )
return return
def getCommands ( self, target ):
commands = []
if self.doYosys:
if not os.path.isfile( self.yosysBin ):
raise ErrorMessage( 1, [ 'Cannot find <yosysInstaller.sh>, should be here:'
, ' <%s>' % self.yosysBin
] )
commands.append( YosysCommand( self.yosysBin, fdLog=self.fds['yosys'] ) )
if self.doAlliance:
if not os.path.isfile( self.alcBin ):
raise ErrorMessage( 1, [ 'Cannot find <allianceInstaller.sh>, should be here:'
, ' <%s>' % self.alcBin
] )
commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) )
if self.doCoriolis:
if not os.path.isfile( self.ccbBin ):
raise ErrorMessage( 1, [ 'Cannot find <ccb.py>, should be here:'
, ' <%s>' % self.ccbBin
] )
otherArgs = []
if self.debugArg: otherArgs.append( self.debugArg )
if target == 'SL7_64':
otherArgs.append( '--project=support' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'SL6_64' or target == 'SL6':
otherArgs.append( '--project=support' )
otherArgs.append( '--devtoolset=8' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) )
elif target == 'Ubuntu18' or target == 'Debian9' or target == 'Debian10':
if target == 'Ubuntu18': otherArgs.append( '--qt5' )
commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) )
if self.doBenchs:
commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) )
return commands
class Report ( object ): class Report ( object ):
@ -540,68 +428,44 @@ class Report ( object ):
parser = optparse.OptionParser () parser = optparse.OptionParser ()
parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a <Debug> aka (-g) version." ) parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a <Debug> aka (-g) version." )
parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." ) parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." )
parser.add_option ( "--do-yosys" , action="store_true" , dest="doYosys" , help="Rebuild Yosys." ) parser.add_option ( "--no-build" , action="store_true" , dest="noBuild" , help="Do not rebuild the tools, must have already be done." )
parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." ) parser.add_option ( "--no-report" , action="store_true" , dest="noReport" , help="Do not send a final report." )
parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." )
parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." )
parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." ) parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." )
parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." )
parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." )
parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the <alliance-checker-toolkit> sanity benchs." ) parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the <alliance-checker-toolkit> sanity benchs." )
parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." ) parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." )
parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." ) parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." )
parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." ) parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." )
parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." ) parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." )
parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." )
(options, args) = parser.parse_args () (options, args) = parser.parse_args ()
conf = Configuration() conf = Configuration()
try: try:
if options.debug: conf.debugArg = '--debug' if options.debug: conf.debugArg = '--debug'
if options.nightly: conf.nightlyMode = True if options.nightly: conf.nightlyMode = True
if options.docker: conf.dockerMode = True
if options.chroot: conf.chrootMode = True
if options.noGit: conf.doGit = False if options.noGit: conf.doGit = False
if options.doYosys: conf.doYosys = True if options.noBuild: conf.doBuild = False
if options.doAlliance: conf.doAlliance = True
if options.doCoriolis: conf.doCoriolis = True
if options.benchs: conf.doBenchs = True if options.benchs: conf.doBenchs = True
if options.doReport: conf.doSendReport = True if options.noReport: conf.doSendReport = False
if options.rmSource or options.rmAll: conf.rmSource = True if options.rmSource or options.rmAll: conf.rmSource = True
if options.rmBuild or options.rmAll: conf.rmBuild = True if options.rmBuild or options.rmAll: conf.rmBuild = True
if conf.doBuild: conf.openLog( 'build' )
if conf.doYosys: conf.openLog( 'yosys' )
if conf.doAlliance: conf.openLog( 'alliance' )
if conf.doCoriolis: conf.openLog( 'coriolis' )
if conf.doBenchs: conf.openLog( 'benchs' ) if conf.doBenchs: conf.openLog( 'benchs' )
if conf.dockerMode: os.environ['USER'] = 'root'
gitSupports = [] gitSupports = []
for supportRepo in conf.supportRepos: for supportRepo in conf.supportRepos:
gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) ) gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) )
gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] ) gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['build'] )
gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] ) gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['build'] )
if conf.doAlliance:
gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] )
if conf.doGit: if conf.doGit:
for gitSupport in gitSupports: for gitSupport in gitSupports:
if conf.rmSource: gitSupport.removeLocalRepo() if conf.rmSource: gitSupport.removeLocalRepo()
gitSupport.clone() gitSupport.clone()
if gitSupport.url.endswith('rapidjson'): #if gitSupport.url.endswith('rapidjson'):
gitSupport.checkout( 'b1a4d91' ) # gitSupport.checkout( 'a1c4f32' )
if conf.doAlliance:
if conf.rmSource: gitAlliance.removeLocalRepo()
gitAlliance.clone ()
#gitAlliance.checkout( 'devel' )
if conf.doCoriolis:
if conf.rmSource: gitCoriolis.removeLocalRepo() if conf.rmSource: gitCoriolis.removeLocalRepo()
gitCoriolis.clone () gitCoriolis.clone ()
gitCoriolis.checkout( 'devel' ) gitCoriolis.checkout( 'devel' )
@ -616,14 +480,33 @@ try:
print 'Removing OS build directory: <%s>' % buildDir print 'Removing OS build directory: <%s>' % buildDir
shutil.rmtree( buildDir ) shutil.rmtree( buildDir )
commands = conf.getCommands( options.profile ) ccbBin = gitCoriolis.localRepoDir+'/bootstrap/ccb.py'
for command in commands: if not os.path.isfile( ccbBin ):
if command.host: raise ErrorMessage( 1, [ 'Cannot find <ccb.py>, should be here:'
print 'Executing command on remote host <%s>:' % host , ' <%s>' % ccbBin
else: ] )
print 'Executing command on *local* host:'
print ' %s' % str(command) buildCommand = '%s --root=%s --project=support --project=coriolis --make="-j%%d install" %%s' \
command.execute() % (ccbBin,conf.rootDir)
benchsCommand = 'cd %s/benchs && ../bin/go.sh' % (gitBenchs.localRepoDir)
commands = \
[ ( conf.targets['SL7_64'], buildCommand % (6,conf.debugArg) , conf.fds['build' ] )
, ( conf.targets['SL7_64'], buildCommand % (1,conf.debugArg+' --doc') , conf.fds['build' ] )
, ( conf.targets['SL7_64'], benchsCommand , conf.fds['benchs'] )
#, ( conf.targets['SL6_64'], buildCommand % (6,conf.debugArg+' --devtoolset=8') , conf.fds['build' ] )
#, ( conf.targets['SL6_64'], buildCommand % (1,conf.debugArg+' --devtoolset=8 --doc'), conf.fds['build' ] )
#, ( conf.targets['SL6_64'], benchsCommand , conf.fds['benchs'] )
#, ( conf.targets['SL6'] , buildCommand % (2,conf.debugArg+' --devtoolset=8') , conf.fds['build' ] )
#, ( conf.targets['SL6'] , buildCommand % (1,conf.debugArg+' --devtoolset=8 --doc'), conf.fds['build' ] )
#, ( conf.targets['SL6'] , benchsCommand , conf.fds['benchs'] )
]
for host,command,fd in commands:
if host and fd:
print 'Executing command on <%s>:' % host
print ' %s' % command
Command( [ 'ssh', host, command ], fd ).execute()
conf.closeLogs() conf.closeLogs()
@ -641,7 +524,7 @@ except ErrorMessage, e:
if conf.doSendReport: if conf.doSendReport:
report = Report( conf ) report = Report( conf )
report.attachLog( conf.logs['coriolis' ] ) report.attachLog( conf.logs['build' ] )
report.attachLog( conf.logs['benchs'] ) report.attachLog( conf.logs['benchs'] )
report.send() report.send()

View File

@ -1,12 +0,0 @@
#!/bin/bash
srcDir=${HOME}
gitHash="6edca05"
cd ${srcDir}
git clone https://github.com/cliffordwolf/yosys.git
cd yosys
git checkout ${gitHash}
make config-gcc
make GIT_REV=${gitHash} -j4
make GIT_REV=${gitHash} install

View File

@ -7,7 +7,7 @@
cmake_minimum_required(VERSION 2.8.9) cmake_minimum_required(VERSION 2.8.9)
set(ignoreVariables "${BUILD_DOC} ${CMAKE_INSTALL_DIR}") set(ignoreVariables "${BUILD_DOC}")
list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/")
find_package(Bootstrap REQUIRED) find_package(Bootstrap REQUIRED)
@ -31,6 +31,5 @@
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

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

View File

@ -1,29 +0,0 @@
#!/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,7 +14,6 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#include <Python.h>
#include <sstream> #include <sstream>
#include <QAction> #include <QAction>
#include <QMenu> #include <QMenu>
@ -31,7 +30,6 @@
#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"
@ -44,16 +42,12 @@
#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;
@ -64,7 +58,6 @@ 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;
@ -94,7 +87,6 @@ namespace Bora {
void BoraEngine::_postCreate () void BoraEngine::_postCreate ()
{ {
Super::_postCreate(); Super::_postCreate();
_runBoraInit();
} }
@ -108,27 +100,6 @@ 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 ()
{ } { }
@ -250,7 +221,6 @@ 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

@ -16,8 +16,6 @@
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Cell.h"
#include "crlcore/RoutingGauge.h"
#include "bora/BoxSet.h" #include "bora/BoxSet.h"
@ -86,18 +84,8 @@ namespace Bora {
} }
size_t BoxSet::getIndex () const
{
cerr << Warning( "BoxSet::getIndex(): Only DBoxSet has parameter range indexes." ) << endl;
return 0;
}
void BoxSet::destroy() void BoxSet::destroy()
{ { delete this; }
if (_cpt < 2) delete this;
else --_cpt;
}
void BoxSet::setWidth ( DbU::Unit ) void BoxSet::setWidth ( DbU::Unit )
@ -108,21 +96,6 @@ namespace Bora {
{ cerr << Warning( "BoxSet::setWidth(): Must never be called." ) << endl; } { cerr << Warning( "BoxSet::setWidth(): Must never be called." ) << endl; }
string BoxSet::_getTypeName () const
{ return "BoxSet"; }
string BoxSet::_getString () const
{
string s = "<" + _getTypeName()
+ " refs:" + getString(_cpt)
+ " w:" + DbU::getValueString(getWidth ())
+ " h:" + DbU::getValueString(getHeight())
+ ">";
return s;
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::HVBoxSet". // Class : "Bora::HVBoxSet".
@ -130,17 +103,13 @@ namespace Bora {
HVBoxSet::HVBoxSet ( const vector<BoxSet*>& dimensionSet, DbU::Unit height, DbU::Unit width ) HVBoxSet::HVBoxSet ( const vector<BoxSet*>& dimensionSet, DbU::Unit height, DbU::Unit width )
: BoxSet(height,width) : BoxSet(height,width)
,_dimensionSet(dimensionSet) ,_dimensionSet(dimensionSet)
{ { }
for ( BoxSet* bs : _dimensionSet ) bs->incrementCpt();
}
HVBoxSet::HVBoxSet ( HVBoxSet* boxSet ) HVBoxSet::HVBoxSet ( HVBoxSet* boxSet )
: BoxSet( boxSet ) : BoxSet( boxSet )
, _dimensionSet( boxSet->getSet() ) , _dimensionSet( boxSet->getSet() )
{ { }
for ( BoxSet* bs : _dimensionSet ) bs->incrementCpt();
}
HVBoxSet::~HVBoxSet () HVBoxSet::~HVBoxSet ()
@ -155,10 +124,6 @@ namespace Bora {
} }
string HVBoxSet::_getTypeName () const
{ return "HVBoxSet"; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::HBoxSet". // Class : "Bora::HBoxSet".
@ -225,10 +190,6 @@ namespace Bora {
} }
string HBoxSet::_getTypeName () const
{ return "HBoxSet"; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::VBoxSet". // Class : "Bora::VBoxSet".
@ -296,10 +257,6 @@ namespace Bora {
} }
string VBoxSet::_getTypeName () const
{ return "VBoxSet"; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::DBoxSet". // Class : "Bora::DBoxSet".
@ -308,9 +265,9 @@ namespace Bora {
int DBoxSet::_countAll = 0; int DBoxSet::_countAll = 0;
DBoxSet::DBoxSet ( DbU::Unit height, DbU::Unit width, size_t index ) DBoxSet::DBoxSet ( DbU::Unit height, DbU::Unit width, int nfing )
: BoxSet( height, width ) : BoxSet( height, width )
, _index(index) , _nfing(nfing)
{ {
++_count; ++_count;
++_countAll; ++_countAll;
@ -319,7 +276,7 @@ namespace Bora {
DBoxSet::DBoxSet ( DBoxSet* boxSet ) DBoxSet::DBoxSet ( DBoxSet* boxSet )
: BoxSet( boxSet ) : BoxSet( boxSet )
, _index( boxSet->getIndex() ) , _nfing( boxSet->getNFing() )
{ } { }
@ -329,40 +286,15 @@ namespace Bora {
} }
DBoxSet* DBoxSet::create ( Cell* cell, int index, CRL::RoutingGauge* rg ) DBoxSet* DBoxSet::create ( DbU::Unit height, DbU::Unit width, int nfing )
{ {
DbU::Unit abHeight = cell->getAbutmentBox().getHeight(); return new DBoxSet( height, width, nfing );
DbU::Unit abWidth = cell->getAbutmentBox().getWidth();
if (rg) {
DbU::Unit h2pitch = rg->getHorizontalPitch()*2;
DbU::Unit v2pitch = rg->getVerticalPitch ()*2;
if (abHeight % h2pitch) {
cerr << Warning( "DBoxSet::create(): The height of device \"%s\" (%s) is not pitched on 2*%s (adjusted)."
, getString(cell->getName()).c_str()
, DbU::getValueString(abHeight ).c_str()
, DbU::getValueString(h2pitch/2).c_str()
) << endl;
abHeight += h2pitch - (abHeight % h2pitch);
}
if (abWidth % v2pitch) {
cerr << Warning( "DBoxSet::create(): The width of device \"%s\" (%s) is not pitched on 2*%s (adjusted)."
, getString(cell->getName()).c_str()
, DbU::getValueString(abWidth ).c_str()
, DbU::getValueString(v2pitch/2).c_str()
) << endl;
abWidth += v2pitch - (abWidth % v2pitch);
}
}
return new DBoxSet( abHeight, abWidth, index );
} }
DBoxSet* DBoxSet::clone () DBoxSet* DBoxSet::clone ()
{ {
return new DBoxSet( getHeight(), getWidth(), getNFing() ); return DBoxSet::create( getHeight(), getWidth(), getNFing() );
} }
@ -372,10 +304,6 @@ namespace Bora {
} }
string DBoxSet::_getTypeName () const
{ return "DBoxSet"; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::RHVBoxSet". // Class : "Bora::RHVBoxSet".
@ -417,10 +345,6 @@ namespace Bora {
} }
string RHVBoxSet::_getTypeName () const
{ return "RHVBoxSet"; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::RHBoxSet". // Class : "Bora::RHBoxSet".
@ -454,10 +378,6 @@ namespace Bora {
} }
string RHBoxSet::_getTypeName () const
{ return "RHBoxSet"; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Bora::RVBoxSet". // Class : "Bora::RVBoxSet".
@ -491,8 +411,4 @@ namespace Bora {
} }
string RVBoxSet::_getTypeName () const
{ return "RVBoxSet"; }
} // Bora namespace. } // Bora namespace.

View File

@ -10,7 +10,6 @@
${PYTHON_INCLUDE_PATH} ${PYTHON_INCLUDE_PATH}
) )
set( includes bora/Constants.h set( includes bora/Constants.h
bora/ParameterRange.h
bora/BoxSet.h bora/BoxSet.h
bora/NodeSets.h bora/NodeSets.h
bora/HVSetState.h bora/HVSetState.h
@ -28,10 +27,7 @@
bora/BoraEngine.h bora/BoraEngine.h
) )
set( pyIncludes bora/PyParameterRange.h set( pyIncludes bora/PySlicingNode.h
bora/PyStepParameterRange.h
bora/PyMatrixParameterRange.h
bora/PySlicingNode.h
bora/PyDSlicingNode.h bora/PyDSlicingNode.h
bora/PyHSlicingNode.h bora/PyHSlicingNode.h
bora/PyVSlicingNode.h bora/PyVSlicingNode.h
@ -48,7 +44,6 @@
) )
set( cpps BoxSet.cpp set( cpps BoxSet.cpp
NodeSets.cpp NodeSets.cpp
ParameterRange.cpp
HVSetState.cpp HVSetState.cpp
SlicingNode.cpp SlicingNode.cpp
HVSlicingNode.cpp HVSlicingNode.cpp
@ -67,10 +62,7 @@
SlicingWidget.cpp SlicingWidget.cpp
GraphicBoraEngine.cpp GraphicBoraEngine.cpp
) )
set( pyCpps PyParameterRange.cpp set( pyCpps PySlicingNode.cpp
PyStepParameterRange.cpp
PyMatrixParameterRange.cpp
PySlicingNode.cpp
PyDSlicingNode.cpp PyDSlicingNode.cpp
PyHSlicingNode.cpp PyHSlicingNode.cpp
PyRHSlicingNode.cpp PyRHSlicingNode.cpp
@ -102,7 +94,7 @@
${PYTHON_LIBRARIES} -lutil ${PYTHON_LIBRARIES} -lutil
) )
add_library( bora ${cpps} ${mocCpps} ${pyCpps} ) add_library( bora ${cpps} ${mocCpps} )
set_target_properties( bora PROPERTIES VERSION 1.0 SOVERSION 1 ) set_target_properties( bora PROPERTIES VERSION 1.0 SOVERSION 1 )
target_link_libraries( bora ${depLibs} ) target_link_libraries( bora ${depLibs} )

View File

@ -23,7 +23,6 @@
#include "hurricane/analog/CommonSourcePair.h" #include "hurricane/analog/CommonSourcePair.h"
#include "hurricane/analog/DifferentialPair.h" #include "hurricane/analog/DifferentialPair.h"
#include "hurricane/analog/LayoutGenerator.h" #include "hurricane/analog/LayoutGenerator.h"
#include "hurricane/analog/MultiCapacitor.h"
#include "anabatic/Session.h" #include "anabatic/Session.h"
#include "bora/DSlicingNode.h" #include "bora/DSlicingNode.h"
@ -36,12 +35,10 @@ namespace Bora {
using Hurricane::Transformation; using Hurricane::Transformation;
using Analog::Device; using Analog::Device;
using Analog::FormFactorParameter; using Analog::FormFactorParameter;
using Analog::MatrixParameter;
using Analog::TransistorFamily; using Analog::TransistorFamily;
using Analog::Transistor; using Analog::Transistor;
using Analog::CommonSourcePair; using Analog::CommonSourcePair;
using Analog::DifferentialPair; using Analog::DifferentialPair;
using Analog::MultiCapacitor;
using Analog::LayoutGenerator; using Analog::LayoutGenerator;
using Anabatic::Session; using Anabatic::Session;
@ -91,7 +88,7 @@ namespace Bora {
else if (isAlignTop ()) cerr << "Alignment : Top" << endl; else if (isAlignTop ()) cerr << "Alignment : Top" << endl;
else if (isAlignBottom()) cerr << "Alignment : Bottom" << endl; else if (isAlignBottom()) cerr << "Alignment : Bottom" << endl;
else cerr << "Alignment : Unknown" << endl; else cerr << "Alignment : Unknown" << endl;
cerr << "BoxSetIndex : " << getBoxSetIndex() << endl; cerr << "NFingers : " << getNFing() << endl;
if (_instance) cerr << "Instance : " << _instance << endl; if (_instance) cerr << "Instance : " << _instance << endl;
else cerr << "Instance : None" << endl; else cerr << "Instance : None" << endl;
SlicingNode::print(); SlicingNode::print();
@ -112,12 +109,24 @@ namespace Bora {
} }
void DSlicingNode::setBoxSetIndex ( size_t index ) void DSlicingNode::setNFing ( int nfing )
{ _boxSet = _nodeSets->find( index ); } { _boxSet = _nodeSets->find( nfing ); }
size_t DSlicingNode::getBoxSetIndex () const int DSlicingNode::getNFing () const
{ return (_boxSet) ? _boxSet->getIndex() : 0 ; } { return (_boxSet) ? _boxSet->getNFing() : 1 ; }
double DSlicingNode::getStartParameter () const
{ return _nodeSets->getStartParameter(); }
double DSlicingNode::getStepParameter () const
{ return _nodeSets->getStepParameter(); }
double DSlicingNode::getCountParameter () const
{ return _nodeSets->getCountParameter(); }
void DSlicingNode::_place( DbU::Unit x, DbU::Unit y, bool replace ) void DSlicingNode::_place( DbU::Unit x, DbU::Unit y, bool replace )
@ -141,43 +150,16 @@ namespace Bora {
Device* device = dynamic_cast<Device*>( model ); Device* device = dynamic_cast<Device*>( model );
if (device) { if (device) {
unique_ptr<LayoutGenerator> layoutGenerator ( new LayoutGenerator() );
TransistorFamily* tf = dynamic_cast<TransistorFamily*>( device ); TransistorFamily* tf = dynamic_cast<TransistorFamily*>( device );
if (tf) { if (tf) {
StepParameterRange* stepRange = dynamic_cast<StepParameterRange*>( getNodeSets()->getRange() ); tf->setNfing( getNFing() );
if (not stepRange) { FormFactorParameter* pff = NULL;
throw Error( "DSlicingNode::_place(): Device \"%s\" must be associated with a StepParameterRange argument instead of %s." if ((pff = dynamic_cast<FormFactorParameter*>(tf->getParameter("M"))) != NULL)
, getString(device->getName()).c_str() pff->setValue( tf->getNfing() );
, getString(stepRange).c_str()
);
}
stepRange->setIndex( getBoxSet()->getIndex() );
int nfingers = stepRange->getValue();
tf->setNfing( nfingers ); shared_ptr<LayoutGenerator> layoutGenerator ( new LayoutGenerator() );
layoutGenerator->setDevice (device); layoutGenerator->setDevice (device);
layoutGenerator->drawLayout(); layoutGenerator->drawLayout();
} else {
MultiCapacitor* mcapacitor = dynamic_cast<MultiCapacitor *>( device );
MatrixParameterRange* matrixRange = dynamic_cast<MatrixParameterRange*>( getNodeSets()->getRange() );
if (mcapacitor) {
if (not matrixRange) {
throw Error( "DSlicingNode::create(): Device \"%s\" must be associated with a MatrixParameterRange argument instead of %s."
, getString(mcapacitor->getName()).c_str()
, getString(matrixRange).c_str()
);
}
matrixRange->setIndex( getBoxSet()->getIndex() );
MatrixParameter* mp = NULL;
if ( (mp = dynamic_cast<MatrixParameter*>(mcapacitor->getParameter("Matrix"))) != NULL )
mp->setMatrix( &matrixRange->getValue() );
layoutGenerator->setDevice( mcapacitor );
layoutGenerator->drawLayout();
}
} }
} }
_instance->setTransformation ( Transformation( _x - model->getAbutmentBox().getXMin() _instance->setTransformation ( Transformation( _x - model->getAbutmentBox().getXMin()

View File

@ -189,10 +189,7 @@ namespace Bora {
{ {
cdebug_log(535,1) << "HSlicingNode::updateGlobalsize() - " << this << endl; cdebug_log(535,1) << "HSlicingNode::updateGlobalsize() - " << this << endl;
for ( SlicingNode* child : _children ) { for ( SlicingNode* child : _children ) child->updateGlobalSize();
cdebug_log(535,0) << "child: " << child << endl;
child->updateGlobalSize();
}
if (not getMaster()) { if (not getMaster()) {
if (getNbChild() == 1) { if (getNbChild() == 1) {

View File

@ -154,6 +154,7 @@ namespace Bora {
cdebug_log(535,0) << "HVSetState::next(): counter_:" << _counter << endl; cdebug_log(535,0) << "HVSetState::next(): counter_:" << _counter << endl;
Symmetry symmetry; Symmetry symmetry;
vector<size_t>::iterator itpair = _nextSet.begin();
const VSlicingNodes& children = _HVSnode->getChildren(); const VSlicingNodes& children = _HVSnode->getChildren();
for ( size_t ichild=0 ; ichild<children.size() ; ++ichild ) { for ( size_t ichild=0 ; ichild<children.size() ; ++ichild ) {

View File

@ -377,14 +377,10 @@ namespace Bora {
if (getType() == HorizontalSNode) symmetryType = HSymmetry; if (getType() == HorizontalSNode) symmetryType = HSymmetry;
if (getType() == VerticalSNode ) symmetryType = VSymmetry; if (getType() == VerticalSNode ) symmetryType = VSymmetry;
if (not getChild(childIndex)->isSymmetric(getChild(copyIndex), symmetryType, ShowDiff)) { if (not getChild(childIndex)->isSymmetric(getChild(copyIndex), symmetryType, ShowDiff)) {
cerr << Warning( "HVSlicingNode::addSymmetry(int,int)): Children %d and %d are not the same, symmetry is ignored.\n" cerr << Warning( "HVSlicingNode::addSymmetry(int,int)): Children %d and %d are not the same, symmetry is ignored."
" child %d: %s\n" , childIndex, copyIndex ) << endl;
" child %d: %s"
, childIndex, copyIndex
, childIndex, getString(getChild(childIndex)).c_str()
, copyIndex , getString(getChild( copyIndex)).c_str()
) << endl;
return; return;
} }
@ -1132,9 +1128,6 @@ namespace Bora {
void HVSlicingNode::addSymmetryNet ( unsigned int type, Net* net1, Net* net2 ) void HVSlicingNode::addSymmetryNet ( unsigned int type, Net* net1, Net* net2 )
{ {
cerr << "HVSlicingNode::addSymmetryNet(): " << this << endl;
cerr << "* " << net1 << endl;
if (checkSymmetryNet(type,net1,net2)) { if (checkSymmetryNet(type,net1,net2)) {
cerr << Warning( "HVSlicingNode::addSymmetryNet(): Net symmetry already set." ) << endl; cerr << Warning( "HVSlicingNode::addSymmetryNet(): Net symmetry already set." ) << endl;
return; return;
@ -1208,13 +1201,6 @@ namespace Bora {
} }
for ( const NetSymmetry& symNet : _netSymmetries ) { for ( const NetSymmetry& symNet : _netSymmetries ) {
if (_symmetries.empty())
throw Error( "HVSlicingNode::updateSymNetAxis(): \n"
" Symmetry request for \"%s\" in non-symmetrical node \"%s\"."
, getString(get<1>(symNet)->getName()).c_str()
, getString(this).c_str()
);
SlicingNode* n1 = getChild( _symmetries.front().first ); SlicingNode* n1 = getChild( _symmetries.front().first );
SlicingNode* n2 = getChild( _symmetries.front().second ); SlicingNode* n2 = getChild( _symmetries.front().second );
DbU::Unit xCenter = (n1->getX() + n2->getX() + n2->getWidth())/2; DbU::Unit xCenter = (n1->getX() + n2->getX() + n2->getWidth())/2;
@ -1262,13 +1248,13 @@ namespace Bora {
} }
} }
} }
}
for ( SlicingNode* child : _children ) { for ( SlicingNode* child : _children ) {
if ( (child->getType() == HorizontalSNode) or (child->getType() == VerticalSNode) ) if ( (child->getType() == HorizontalSNode) or (child->getType() == VerticalSNode) )
child->updateSymNetAxis(); child->updateSymNetAxis();
} }
} }
}
void HVSlicingNode::flattenDigitalNets () void HVSlicingNode::flattenDigitalNets ()

View File

@ -18,8 +18,6 @@
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/analog/Device.h" #include "hurricane/analog/Device.h"
#include "hurricane/analog/TransistorFamily.h" #include "hurricane/analog/TransistorFamily.h"
#include "hurricane/analog/MultiCapacitor.h"
#include "hurricane/analog/Resistor.h"
#include "hurricane/analog/LayoutGenerator.h" #include "hurricane/analog/LayoutGenerator.h"
#include "crlcore/RoutingGauge.h" #include "crlcore/RoutingGauge.h"
@ -30,120 +28,115 @@ namespace Bora {
using namespace Analog; using namespace Analog;
NodeSets::NodeSets ( ParameterRange* range ) NodeSets::NodeSets ( double start, double step, double count )
: _boxSets() : _boxSets()
, _range (NULL) , _start ( start )
{ , _step ( step )
if (range) { , _count ( count )
_range = range->clone(); { }
_range->setNested();
}
}
NodeSets::NodeSets ( const NodeSets* from ) NodeSets::NodeSets ( const NodeSets* other )
: _boxSets( from->getBoxSets() ) : _boxSets( other->getBoxSets() )
, _range (NULL) , _start ( other->getStartParameter() )
{ , _step ( other->getStepParameter() )
if (from->_range) { , _count ( other->getCountParameter() )
_range = from->_range->clone(); { }
_range->setNested();
}
}
NodeSets::~NodeSets () NodeSets::~NodeSets ()
{ { }
if (_range) delete _range;
}
NodeSets* NodeSets::create ( Cell* cell NodeSets* NodeSets::create ( Cell* cell
, ParameterRange* range , double start
, double step
, double count
, CRL::RoutingGauge* rg ) , CRL::RoutingGauge* rg )
{ {
NodeSets* nodeset = new NodeSets( range ); NodeSets* nodeset = new NodeSets( start, step, count );
if (not cell) return nodeset; if (not cell) return nodeset;
unique_ptr<LayoutGenerator> layoutGenerator ( new LayoutGenerator() ); Device* dev = dynamic_cast<Device*>( cell );
if (dev) {
//cdebug_log(536,0) << "createNodeSets for an Analog Device" << endl;
TransistorFamily* tf = dynamic_cast<TransistorFamily*>(dev);
TransistorFamily* device = dynamic_cast<TransistorFamily *>( cell ); for ( int i = 0; i < count; ++i ) {
StepParameterRange* stepRange = dynamic_cast<StepParameterRange*>( nodeset->getRange() ); tf->setNfing( start + i*step );
if (device) {
cdebug_log(535,0) << "NodeSets:create(): for a Transistor Analog Device" << endl;
if (not stepRange) { FormFactorParameter* pff = NULL;
throw Error( "NodeSets::create(): Device \"%s\" must be associated with a StepParameterRange argument instead of %s." if ( (pff = dynamic_cast<FormFactorParameter*>(tf->getParameter("M"))) != NULL )
, getString(device->getName()).c_str() pff->setValue( tf->getNfing() );
, getString(stepRange).c_str()
);
}
stepRange->reset(); auto_ptr<LayoutGenerator> layoutGenerator ( new LayoutGenerator() );
do { layoutGenerator->setDevice( dev );
device->setNfing( stepRange->getValue() );
layoutGenerator->setDevice( device );
layoutGenerator->drawLayout(); layoutGenerator->drawLayout();
nodeset->push_back( DBoxSet::create( device, stepRange->getIndex(), rg ) ); if (rg) {
float h2pitch = rg->getHorizontalPitch()*2;
float v2pitch = rg->getVerticalPitch ()*2;
stepRange->progress(); float h = dev->getAbutmentBox().getHeight();
} while ( stepRange->isValid() ); float w = dev->getAbutmentBox().getWidth();
} else {
MultiCapacitor* mcapacitor = dynamic_cast<MultiCapacitor *>( cell );
MatrixParameterRange* matrixRange = dynamic_cast<MatrixParameterRange*>( nodeset->getRange() );
if (mcapacitor) { if (fmod(h,h2pitch) > 1e-06) {
cdebug_log(535,0) << "NodeSets::create(): for a Capacitor Analog Device" << endl; cerr << Warning( "NodeSets::create(): The height of device \"%s\" (%s) is not pitched on 2*%s (adjusted)."
, getString(dev->getName()).c_str()
if (not matrixRange) { , DbU::getValueString(dev->getAbutmentBox().getWidth()).c_str()
throw Error( "NodeSets::create(): Device \"%s\" must be associated with a MatrixParameterRange argument instead of %s." , DbU::getValueString(rg->getHorizontalPitch()*2).c_str()
, getString(mcapacitor->getName()).c_str() ) << endl;
, getString(stepRange).c_str() }
); if (fmod(w,v2pitch) > 1e-06) {
cerr << Warning( "NodeSets::create(): The width of device \"%s\" (%s) is not pitched on 2*%s (adjusted)."
, getString(dev->getName()).c_str()
, DbU::getValueString(dev->getAbutmentBox().getWidth()).c_str()
, DbU::getValueString(rg->getVerticalPitch()*2).c_str()
) << endl;
} }
matrixRange->reset(); nodeset->push_back( DBoxSet::create( ceil(h/h2pitch)*h2pitch
do { , ceil(w/v2pitch)*v2pitch
MatrixParameter* mp = NULL; , start + i*step
if ( (mp = dynamic_cast<MatrixParameter*>(mcapacitor->getParameter("matrix"))) != NULL ) ) );
mp->setMatrix( &matrixRange->getValue() );
layoutGenerator->setDevice( mcapacitor );
layoutGenerator->drawLayout();
nodeset->push_back( DBoxSet::create( mcapacitor, matrixRange->getIndex(), rg ) );
matrixRange->progress();
} while ( matrixRange->isValid() );
} else { } else {
ResistorFamily* device = dynamic_cast<ResistorFamily *>( cell ); nodeset->push_back( DBoxSet::create( dev->getAbutmentBox().getHeight()
StepParameterRange* stepRange = dynamic_cast<StepParameterRange*>( nodeset->getRange() ); , dev->getAbutmentBox().getWidth()
if (device) { , start + i*step
cdebug_log(535,0) << "NodeSets::create(): for a Resistor Analog Device" << endl; ) );
}
}
} else {
//cdebug_log(536,0) << "createNodeSets for a Digital Device: " << cell << endl;
if (rg) {
DbU::Unit h2pitch = rg->getHorizontalPitch()*2;
DbU::Unit v2pitch = rg->getVerticalPitch ()*2;
DbU::Unit h = cell->getAbutmentBox().getHeight();
DbU::Unit w = cell->getAbutmentBox().getWidth();
if (not stepRange) { if (h % h2pitch) {
throw Error( "NodeSets::create(): Device \"%s\" must be associated with a StepParameterRange argument instead of %s." cerr << Warning( "NodeSets::create(): The height of device \"%s\" (%s) is not pitched on %s*2 (adjusted)."
, getString(device->getName()).c_str() , getString(cell->getName()).c_str()
, getString(stepRange).c_str() , DbU::getValueString(cell->getAbutmentBox().getHeight()).c_str()
); , DbU::getValueString(rg->getHorizontalPitch()).c_str()
) << endl;
}
if (w % v2pitch) {
cerr << Warning( "NodeSets::create(): The width of device \"%s\" (%s) is not pitched on %s*2 (adjusted)."
, getString(cell->getName()).c_str()
, DbU::getValueString(cell->getAbutmentBox().getWidth()).c_str()
, DbU::getValueString(rg->getVerticalPitch()).c_str()
) << endl;
} }
stepRange->reset(); nodeset->push_back( DBoxSet::create( ceil(h/h2pitch)*h2pitch
do { , ceil(w/v2pitch)*v2pitch
device->setBends( stepRange->getValue() ); ) );
layoutGenerator->setDevice( device );
layoutGenerator->drawLayout();
nodeset->push_back( DBoxSet::create( device, stepRange->getIndex(), rg ) );
stepRange->progress();
} while ( stepRange->isValid() );
} else { } else {
nodeset->push_back( DBoxSet::create( cell, 0, rg ) ); nodeset->push_back( DBoxSet::create( cell->getAbutmentBox().getHeight()
} , cell->getAbutmentBox().getWidth()
) );
} }
} }
@ -280,11 +273,11 @@ namespace Bora {
} }
BoxSet* NodeSets::find ( size_t index ) BoxSet* NodeSets::find ( int nfing )
{ {
size_t i = 0; size_t i = 0;
for ( ; i<_boxSets.size() ; ++i ) { for ( ; i<_boxSets.size() ; ++i ) {
if (_boxSets[i]->getIndex() == index) if (_boxSets[i]->getNFing() == nfing)
return _boxSets[i]; return _boxSets[i];
} }
@ -362,7 +355,7 @@ namespace Bora {
NodeSets* NodeSets::clone() NodeSets* NodeSets::clone()
{ {
NodeSets* nodesets = new NodeSets( _range ); NodeSets* nodesets = new NodeSets( _start, _step, _count );
for ( BoxSet* bs : _boxSets ) _boxSets.push_back( bs->clone() ); for ( BoxSet* bs : _boxSets ) _boxSets.push_back( bs->clone() );
return nodesets; return nodesets;
} }

View File

@ -1,158 +0,0 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2016-2019, 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 : "./arameterRange.cpp" |
// +-----------------------------------------------------------------+
#include "bora/ParameterRange.h"
namespace Bora {
using namespace std;
// -------------------------------------------------------------------
// Class : "ParameterRange"
ParameterRange::ParameterRange ()
: _flags(0), _index(0)
{ }
ParameterRange::~ParameterRange ()
{ }
string ParameterRange::_getString () const
{ return "<" + _getTypeName() + ">"; }
Record* ParameterRange::_getRecord () const
{
Record* record = new Record( getString(this) );
record->add( getSlot("_index", _index) );
return record;
}
// -------------------------------------------------------------------
// Class : "StepParameterRange"
StepParameterRange::StepParameterRange ( double start, double step, double count )
: Super()
, _start(start)
, _step (step )
, _count(count)
{ }
StepParameterRange::~StepParameterRange ()
{ }
StepParameterRange* StepParameterRange::clone () const
{
return new StepParameterRange( _start, _step, _count );
}
size_t StepParameterRange::getSize () const
{ return size_t(_count); }
double StepParameterRange::getValue () const
{ return _start + getIndex() * _step; }
string StepParameterRange::_getTypeName () const
{ return "StepParameterRange"; }
string StepParameterRange::_getString () const
{
string s = Super::_getString();
s.insert( s.length() - 1, " [" + getString(_start));
s.insert( s.length() - 1, " +" + getString(_step ));
s.insert( s.length() - 1, " ," + getString(_count) + "]");
return s;
}
Record* StepParameterRange::_getRecord () const
{
Record* record = Super::_getRecord();
if (record) {
record->add( getSlot("_start", _start) );
record->add( getSlot("_step" , _step ) );
record->add( getSlot("_count", _count) );
}
return record;
}
// -------------------------------------------------------------------
// Class : "MatrixParameterRange"
MatrixParameterRange::MatrixParameterRange ()
: Super()
, _matrixes()
{ }
MatrixParameterRange::~MatrixParameterRange ()
{ }
MatrixParameterRange* MatrixParameterRange::clone () const
{
MatrixParameterRange* param = new MatrixParameterRange();
param->copy( this );
return param;
}
size_t MatrixParameterRange::getSize () const
{ return _matrixes.size(); }
const Matrix& MatrixParameterRange::getValue () const
{ return _matrixes[ getIndex() ]; }
string MatrixParameterRange::_getTypeName () const
{ return "MatrixParameterRange"; }
string MatrixParameterRange::_getString () const
{
string s = Super::_getString();
s.insert( s.length() - 1, " [" + getString(getSize()) + "]");
return s;
}
Record* MatrixParameterRange::_getRecord () const
{
Record* record = Super::_getRecord();
if (record) {
record->add( getSlot("_matrixes", &_matrixes) );
}
return record;
}
} // Bora namespace.

View File

@ -16,9 +16,6 @@
#include "hurricane/isobar/PyHurricane.h" #include "hurricane/isobar/PyHurricane.h"
#include "hurricane/isobar/PyCell.h" #include "hurricane/isobar/PyCell.h"
#include "bora/PyParameterRange.h"
#include "bora/PyStepParameterRange.h"
#include "bora/PyMatrixParameterRange.h"
#include "bora/PySlicingNode.h" #include "bora/PySlicingNode.h"
#include "bora/PyHSlicingNode.h" #include "bora/PyHSlicingNode.h"
#include "bora/PyVSlicingNode.h" #include "bora/PyVSlicingNode.h"
@ -34,7 +31,6 @@ namespace Bora {
using std::cerr; using std::cerr;
using std::endl; using std::endl;
using Hurricane::tab; using Hurricane::tab;
using Isobar::getPyHash;
using Isobar::__cs; using Isobar::__cs;
using CRL::PyTypeToolEngine; using CRL::PyTypeToolEngine;
using CRL::PyTypeGraphicTool; using CRL::PyTypeGraphicTool;
@ -70,9 +66,6 @@ extern "C" {
{ {
cdebug.log(61) << "initBora()" << endl; cdebug.log(61) << "initBora()" << endl;
PyParameterRange_LinkPyType();
PyStepParameterRange_LinkPyType();
PyMatrixParameterRange_LinkPyType();
PySlicingNode_LinkPyType(); PySlicingNode_LinkPyType();
PyHSlicingNode_LinkPyType(); PyHSlicingNode_LinkPyType();
PyVSlicingNode_LinkPyType(); PyVSlicingNode_LinkPyType();
@ -82,16 +75,13 @@ extern "C" {
PyBoraEngine_LinkPyType(); PyBoraEngine_LinkPyType();
PyGraphicBoraEngine_LinkPyType(); PyGraphicBoraEngine_LinkPyType();
PYTYPE_READY( ParameterRange )
PYTYPE_READY( SlicingNode ) PYTYPE_READY( SlicingNode )
PYTYPE_READY_SUB( StepParameterRange , ParameterRange ); PYTYPE_READY_SUB( HSlicingNode , SlicingNode )
PYTYPE_READY_SUB( MatrixParameterRange, ParameterRange ); PYTYPE_READY_SUB( VSlicingNode , SlicingNode )
PYTYPE_READY_SUB( HSlicingNode , SlicingNode ); PYTYPE_READY_SUB( DSlicingNode , SlicingNode )
PYTYPE_READY_SUB( VSlicingNode , SlicingNode ); PYTYPE_READY_SUB( RHSlicingNode , SlicingNode )
PYTYPE_READY_SUB( DSlicingNode , SlicingNode ); PYTYPE_READY_SUB( RVSlicingNode , SlicingNode )
PYTYPE_READY_SUB( RHSlicingNode , SlicingNode );
PYTYPE_READY_SUB( RVSlicingNode , SlicingNode );
PYTYPE_READY_SUB( BoraEngine , ToolEngine ); PYTYPE_READY_SUB( BoraEngine , ToolEngine );
PYTYPE_READY_SUB( GraphicBoraEngine, GraphicTool ); PYTYPE_READY_SUB( GraphicBoraEngine, GraphicTool );
@ -103,12 +93,6 @@ extern "C" {
return; return;
} }
Py_INCREF( &PyTypeParameterRange );
PyModule_AddObject( module, "ParameterRange" , (PyObject*)&PyTypeParameterRange );
Py_INCREF( &PyTypeStepParameterRange );
PyModule_AddObject( module, "StepParameterRange" , (PyObject*)&PyTypeStepParameterRange );
Py_INCREF( &PyTypeMatrixParameterRange );
PyModule_AddObject( module, "MatrixParameterRange", (PyObject*)&PyTypeMatrixParameterRange );
Py_INCREF( &PyTypeSlicingNode ); Py_INCREF( &PyTypeSlicingNode );
PyModule_AddObject( module, "SlicingNode" , (PyObject*)&PyTypeSlicingNode ); PyModule_AddObject( module, "SlicingNode" , (PyObject*)&PyTypeSlicingNode );
Py_INCREF( &PyTypeHSlicingNode ); Py_INCREF( &PyTypeHSlicingNode );

View File

@ -39,7 +39,6 @@ namespace Bora {
using Isobar::ConstructorError; using Isobar::ConstructorError;
using Isobar::HurricaneError; using Isobar::HurricaneError;
using Isobar::HurricaneWarning; using Isobar::HurricaneWarning;
using Isobar::getPyHash;
using Isobar::ParseOneArg; using Isobar::ParseOneArg;
using Isobar::ParseTwoArg; using Isobar::ParseTwoArg;
using Isobar::PyCell; using Isobar::PyCell;
@ -104,6 +103,8 @@ extern "C" {
static PyObject* PyBoraEngine_updatePlacement ( PyBoraEngine* self, PyObject* args ) static PyObject* PyBoraEngine_updatePlacement ( PyBoraEngine* self, PyObject* args )
{ {
unsigned int bsIndex = 0;
METHOD_HEAD( "BoraEngine.updatePlacement()" ) METHOD_HEAD( "BoraEngine.updatePlacement()" )
HTRY HTRY
PyObject* arg0; PyObject* arg0;

View File

@ -17,8 +17,6 @@
#include "hurricane/analog/PyDevice.h" #include "hurricane/analog/PyDevice.h"
#include "crlcore/PyRoutingGauge.h" #include "crlcore/PyRoutingGauge.h"
#include "bora/PyDSlicingNode.h" #include "bora/PyDSlicingNode.h"
#include "bora/PyStepParameterRange.h"
#include "bora/PyMatrixParameterRange.h"
namespace Bora { namespace Bora {
@ -58,47 +56,37 @@ extern "C" {
PyObject* pyInstance = NULL; PyObject* pyInstance = NULL;
PyObject* pyCell = NULL; PyObject* pyCell = NULL;
PyObject* pyRoutingGauge = NULL; PyObject* pyRoutingGauge = NULL;
PyObject* pyParameterRange = NULL; double start = 0.0;
double step = 0.0;
double count = 0.0;
DSlicingNode* node = NULL; DSlicingNode* node = NULL;
HTRY HTRY
if (not PyArg_ParseTuple( args,"SOO|O:DSlicingNode.create" if (not PyArg_ParseTuple( args,"SOddd|O:DSlicingNode.create"
, &pyInstance , &pyInstance
, &pyCell , &pyCell
, &pyParameterRange , &start
, &step
, &count
, &pyRoutingGauge ) ) { , &pyRoutingGauge ) ) {
PyErr_SetString ( ConstructorError, "DSlicingNode.create(): Invalid/bad number of parameters ." ); PyErr_SetString ( ConstructorError, "DSlicingNode.create(): Invalid/bad number of parameters ." );
return NULL; return NULL;
} }
if (not IsPyCell(pyCell)) { if (not IsPyCell(pyCell)) {
PyErr_SetString( ConstructorError, "DSlicingNode.create(): Second argument *must* be of type Cell." ); PyErr_SetString( ConstructorError, "DSlicingNode.create(): First argument *must* be of type Cell." );
return NULL;
}
if ( (pyParameterRange != Py_None)
and not IsPyStepParameterRange(pyParameterRange)
and not IsPyMatrixParameterRange(pyParameterRange)) {
PyErr_SetString( ConstructorError, "DSlicingNode.create(): Third argument *must* be of type StepParameterRange or MatrixParameterRange." );
return NULL; return NULL;
} }
if (pyRoutingGauge and not IsPyRoutingGauge(pyRoutingGauge)) { if (pyRoutingGauge and not IsPyRoutingGauge(pyRoutingGauge)) {
PyErr_SetString( ConstructorError, "DSlicingNode.create(): Fourth argument *must* be of type RoutingGauge." ); PyErr_SetString( ConstructorError, "DSlicingNode.create(): Fifth argument *must* be of type RoutingGauge." );
return NULL; return NULL;
} }
Cell* cell = PYCELL_O( pyCell ); Cell* cell = PYCELL_O( pyCell );
Instance* instance = cell->getInstance( PyString_AsString(pyInstance) ); Instance* instance = cell->getInstance( PyString_AsString(pyInstance) );
if (not instance) { //Device* device = dynamic_cast<Device*>( instance->getMasterCell() );
ostringstream message;
message << "DSlicingNode.create(): Cell \"" << cell->getName()
<< "\" has no instance named \"" << PyString_AsString(pyInstance) << "\".";
PyErr_SetString( ConstructorError, message.str().c_str() );
return NULL;
}
ParameterRange* range = ParameterRangeCast( pyParameterRange );
RoutingGauge* rg = (pyRoutingGauge) ? PYROUTINGGAUGE_O(pyRoutingGauge) : NULL; RoutingGauge* rg = (pyRoutingGauge) ? PYROUTINGGAUGE_O(pyRoutingGauge) : NULL;
node = DSlicingNode::create( NodeSets::create( instance->getMasterCell(), range, rg ) node = DSlicingNode::create( NodeSets::create( instance->getMasterCell(), start, step, count, rg )
, UnknownAlignment , UnknownAlignment
, instance ); , instance );
HCATCH HCATCH
@ -107,8 +95,8 @@ extern "C" {
} }
DirectGetIntAttribute(PyDSlicingNode_getBoxSetIndex,getBoxSetIndex,PyDSlicingNode,DSlicingNode) DirectGetIntAttribute(PyDSlicingNode_getNFing,getNFing,PyDSlicingNode,DSlicingNode)
DirectSetIntAttribute(PyDSlicingNode_setBoxSetIndex,setBoxSetIndex,PyDSlicingNode,DSlicingNode) DirectSetIntAttribute(PyDSlicingNode_setNFing,setNFing,PyDSlicingNode,DSlicingNode)
// Standart Destroy (Attribute). // Standart Destroy (Attribute).
@ -118,8 +106,8 @@ extern "C" {
PyMethodDef PyDSlicingNode_Methods[] = PyMethodDef PyDSlicingNode_Methods[] =
{ { "create" , (PyCFunction)PyDSlicingNode_create , METH_VARARGS|METH_STATIC { { "create" , (PyCFunction)PyDSlicingNode_create , METH_VARARGS|METH_STATIC
, "Create a new DSlicingNode." } , "Create a new DSlicingNode." }
, { "getBoxSetIndex" , (PyCFunction)PyDSlicingNode_getBoxSetIndex, METH_NOARGS , "To be documented." } , { "getNFing" , (PyCFunction)PyDSlicingNode_getNFing , METH_NOARGS , "To be documented." }
, { "setBoxSetIndex" , (PyCFunction)PyDSlicingNode_setBoxSetIndex, METH_VARARGS, "To be documented." } , { "setNFing" , (PyCFunction)PyDSlicingNode_setNFing , METH_VARARGS, "To be documented." }
, { NULL, NULL, 0, NULL } /* sentinel */ , { NULL, NULL, 0, NULL } /* sentinel */
}; };

View File

@ -1,146 +0,0 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2019-2019, 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/PyMatrixParameterRange.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/analog/PyMatrix.h"
#include "bora/PyMatrixParameterRange.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(MatrixParameterRange,range,function)
// +=================================================================+
// | "PyMatrixParameterRange" Python Module Code Part |
// +=================================================================+
#if defined(__PYTHON_MODULE__)
static PyObject* PyMatrixParameterRange_NEW ( PyObject* , PyObject* args )
{
MatrixParameterRange* range = NULL;
HTRY
range = new MatrixParameterRange();
HCATCH
return PyMatrixParameterRange_Link(range);
}
static int PyMatrixParameterRange_Init ( PyMatrixParameterRange* self, PyObject* args, PyObject* kwargs )
{
cdebug_log(20,0) << "PyMatrixParameterRange_Init(): " << (void*)self << endl;
return 0;
}
static PyObject* PyMatrixParameterRange_addValue ( PyMatrixParameterRange* self, PyObject* args )
{
PyObject* pyMatrix = NULL;
METHOD_HEAD( "MatrixParameterRange.addValue()" );
HTRY
if (not PyArg_ParseTuple( args,"O:MatrixParameterRange.addValue", &pyMatrix ) ) {
PyErr_SetString ( ConstructorError, "MatrixParameterRange.addValue(): Invalid/bad number of parameters ." );
return NULL;
}
if (not IsPyMatrix(pyMatrix)) {
if (not PyList_Check(pyMatrix)) {
PyErr_SetString( ConstructorError, "MatrixParameterRange.addValue(): Argument is neither of type Matrix not list of list." );
return NULL;
}
Matrix m = Matrix_FromListOfList( pyMatrix );
if (m.empty()) return NULL;
range->addValue( &m );
} else {
range->addValue( PYMATRIX_O(pyMatrix) );
}
HCATCH
Py_RETURN_NONE;
}
static PyObject* PyMatrixParameterRange_getValue ( PyMatrixParameterRange* self, PyObject* args )
{
PyMatrix* pyMatrix = NULL;
METHOD_HEAD( "MatrixParameterRange.getValue()" );
HTRY
pyMatrix = PyObject_NEW( PyMatrix, &PyTypeMatrix );
if (pyMatrix == NULL) { return NULL; }
pyMatrix->_object = new Matrix( range->getValue() );
HCATCH
return (PyObject*)pyMatrix;
}
DirectDeleteMethod(PyMatrixParameterRange_DeAlloc,PyMatrixParameterRange)
// ---------------------------------------------------------------
// PyMatrixParameterRange Attribute Method table.
PyMethodDef PyMatrixParameterRange_Methods[] =
{ { "getValue" , (PyCFunction)PyMatrixParameterRange_getValue , METH_NOARGS , "To be documented." }
, { "addValue" , (PyCFunction)PyMatrixParameterRange_addValue , METH_VARARGS, "To be documented." }
, { NULL, NULL, 0, NULL } /* sentinel */
};
// +-------------------------------------------------------------+
// | "PyMatrixParameterRange" Object Methods |
// +-------------------------------------------------------------+
PyTypeObjectLinkPyTypeNewInit(MatrixParameterRange)
#else // End of Python Module Code Part.
// +=================================================================+
// | "PyMatrixParameterRange" Shared Library Code Part |
// +=================================================================+
extern LinkCreateMethod(MatrixParameterRange);
PyTypeInheritedObjectDefinitions(MatrixParameterRange, ParameterRange)
#endif // End of Shared Library Code Part.
} // extern "C".
} // Bora namespace.

View File

@ -1,125 +0,0 @@
// -*- 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/PyParameterRange.cpp" |
// +-----------------------------------------------------------------+
#include "bora/PyParameterRange.h"
#include "bora/PyStepParameterRange.h"
#include "bora/PyMatrixParameterRange.h"
namespace Bora {
using namespace Hurricane;
using namespace Isobar;
extern "C" {
#define METHOD_HEAD(function) GENERIC_METHOD_HEAD(ParameterRange,range,function)
// +=================================================================+
// | "PyParameterRange" Python Module Code Part |
// +=================================================================+
#if defined(__PYTHON_MODULE__)
// Standart destroy (Attribute).
//DBoDestroyAttribute(PyParameterRange_destroy ,PyParameterRange)
// Standart Accessors (Attributes).
DirectGetBoolAttribute(PyParameterRange_isValid ,isValid ,PyParameterRange,ParameterRange)
DirectGetBoolAttribute(PyParameterRange_progress,progress,PyParameterRange,ParameterRange)
DirectGetUIntAttribute(PyParameterRange_getIndex,getIndex,PyParameterRange,ParameterRange)
DirectGetUIntAttribute(PyParameterRange_getSize ,getSize ,PyParameterRange,ParameterRange)
DirectSetIntAttribute (PyParameterRange_setIndex,setIndex,PyParameterRange,ParameterRange)
DirectVoidMethod(ParameterRange,range,reset)
// ---------------------------------------------------------------
// PyParameterRange Attribute Method table.
PyMethodDef PyParameterRange_Methods[] =
{ { "isValid" , (PyCFunction)PyParameterRange_isValid , METH_NOARGS , "To be documented." }
, { "getIndex" , (PyCFunction)PyParameterRange_getIndex , METH_NOARGS , "To be documented." }
, { "getSize" , (PyCFunction)PyParameterRange_getSize , METH_NOARGS , "To be documented." }
, { "progress" , (PyCFunction)PyParameterRange_progress , METH_NOARGS , "To be documented." }
, { "setIndex" , (PyCFunction)PyParameterRange_setIndex , METH_VARARGS, "To be documented." }
, { "reset" , (PyCFunction)PyParameterRange_reset , METH_NOARGS , "To be documented." }
//, { "destroy" , (PyCFunction)PyParameterRange_destroy , METH_NOARGS
// , "Destroy associated hurricane object, the python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */
};
PythonOnlyDeleteMethod(ParameterRange)
PyTypeObjectLinkPyType(ParameterRange)
#else // End of Python Module Code Part.
// +=================================================================+
// | "PyParameterRange" Shared Library Code Part |
// +=================================================================+
// ---------------------------------------------------------------
// Allocator Method : "PyParameterRange_NEW ()"
//
// No PyParameterRange should ever be created, it's not a terminal object
// of the class hierarchy. Instead create the real underlying PyObject.
PyObject* PyParameterRange_NEW ( ParameterRange* range ) {
if (not range) {
PyErr_SetString ( HurricaneError, "PyParameterRange_NEW(): NULL range argument." );
return NULL;
}
StepParameterRange* stepRange = dynamic_cast<StepParameterRange*>(range);
if (stepRange) return PyStepParameterRange_Link( stepRange );
Py_RETURN_NONE;
}
PyTypeRootObjectDefinitions(ParameterRange)
#endif // Shared Library Code Part.
} // extern "C".
// +=================================================================+
// | "PyParameterRange" Shared Library Code Part |
// +=================================================================+
# if !defined(__PYTHON_MODULE__)
ParameterRange* ParameterRangeCast ( PyObject* derivedObject ) {
if (not derivedObject or (derivedObject == Py_None)) return NULL;
if (IsPyStepParameterRange (derivedObject)) return PYSTEPPARAMETERRANGE_O (derivedObject);
if (IsPyMatrixParameterRange(derivedObject)) return PYMATRIXPARAMETERRANGE_O(derivedObject);
return NULL;
}
#endif
} // Bora namespace.

View File

@ -1,123 +0,0 @@
// -*- 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/PyStepParameterRange.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/analog/PyDevice.h"
#include "crlcore/PyRoutingGauge.h"
#include "bora/PyStepParameterRange.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(StepParameterRange,node,function)
// +=================================================================+
// | "PyStepParameterRange" Python Module Code Part |
// +=================================================================+
#if defined(__PYTHON_MODULE__)
static PyObject* PyStepParameterRange_NEW ( PyObject* , PyObject* args )
{
double start = 0.0;
double step = 0.0;
double count = 0.0;
StepParameterRange* range = NULL;
HTRY
if (not PyArg_ParseTuple( args, "ddd:StepParameterRange_NEW", &start, &step, &count ) ) {
PyErr_SetString ( ConstructorError, "StepParameterRange.create(): Invalid/bad number of parameters ." );
return NULL;
}
range = new StepParameterRange( start, step, count );
HCATCH
return PyStepParameterRange_Link(range);
}
static int PyStepParameterRange_Init ( PyStepParameterRange* self, PyObject* args, PyObject* kwargs )
{
cdebug_log(20,0) << "PyStepParameterRange_Init(): " << (void*)self << endl;
return 0;
}
static void PyStepParameterRange_DeAlloc ( PyStepParameterRange* self )
{
cdebug_log(20,0) << "PyStepParameterRange_DeAlloc(" << (void*)self << ") "
<< (void*)(self->ACCESS_OBJECT) << ":" << self->ACCESS_OBJECT << endl;
if (self->ACCESS_OBJECT and not self->ACCESS_OBJECT->isNested()) {
cdebug_log(20,0) << "C++ object := " << &(self->ACCESS_OBJECT) << endl;
delete self->ACCESS_OBJECT;
}
PyObject_DEL( self );
}
DirectGetDoubleAttribute(PyStepParameterRange_getValue,getValue,PyStepParameterRange,StepParameterRange)
// Standart Destroy (Attribute).
// ---------------------------------------------------------------
// PyStepParameterRange Attribute Method table.
PyMethodDef PyStepParameterRange_Methods[] =
{ { "getValue" , (PyCFunction)PyStepParameterRange_getValue , METH_NOARGS , "To be documented." }
, { NULL, NULL, 0, NULL } /* sentinel */
};
// +-------------------------------------------------------------+
// | "PyStepParameterRange" Object Methods |
// +-------------------------------------------------------------+
PyTypeObjectLinkPyTypeNewInit(StepParameterRange)
#else // End of Python Module Code Part.
// +=================================================================+
// | "PyStepParameterRange" Shared Library Code Part |
// +=================================================================+
extern LinkCreateMethod(StepParameterRange);
PyTypeInheritedObjectDefinitions(StepParameterRange, ParameterRange)
#endif // End of Shared Library Code Part.
} // extern "C".
} // Bora namespace.

View File

@ -81,7 +81,8 @@ namespace Bora {
case 2: return QVariant( DbU::toPhysical(nodeSets[row]->getWidth() , DbU::Micro) ); case 2: return QVariant( DbU::toPhysical(nodeSets[row]->getWidth() , DbU::Micro) );
case 3: return QVariant( nodeSets[row]->getOccupationArea() ); case 3: return QVariant( nodeSets[row]->getOccupationArea() );
case 4: return QVariant( nodeSets[row]->getCpt() ); case 4: return QVariant( nodeSets[row]->getCpt() );
case 5: return QVariant( nodeSets[row]->getRatio() ); case 5: return QVariant( (double) ( nodeSets[row]->getWidth()
/ nodeSets[row]->getHeight()) );
case 6: return QVariant( DbU::getPhysical( nodeSets[row]->getWidth() ,DbU::Micro) case 6: return QVariant( DbU::getPhysical( nodeSets[row]->getWidth() ,DbU::Micro)
* DbU::getPhysical( nodeSets[row]->getHeight(),DbU::Micro) ); * DbU::getPhysical( nodeSets[row]->getHeight(),DbU::Micro) );
default: default:

View File

@ -80,7 +80,7 @@ namespace Bora {
: Super() : Super()
, _parent (NULL) , _parent (NULL)
, _flags (0) , _flags (0)
, _nodeSets(NodeSets::create( NULL, NULL)) , _nodeSets(NodeSets::create( NULL, 0.0, 0.0, 0.0 ))
, _x (0) , _x (0)
, _y (0) , _y (0)
, _boxSet (NULL) , _boxSet (NULL)
@ -489,12 +489,6 @@ namespace Bora {
} }
void SlicingNode::_setGlobalSize ( DbU::Unit, DbU::Unit )
{
cerr << Error( "SlicingNode::_setGlobalSize(): Must not be called on \"%s\"." , _getTypeName().c_str() ) << endl;
}
void SlicingNode::preDestroy () void SlicingNode::preDestroy ()
{ {
if (_parent) _parent->removeNode(this); if (_parent) _parent->removeNode(this);
@ -698,9 +692,6 @@ namespace Bora {
for ( RoutingPad* rp : net->getRoutingPads() ) rps.push_back( rp ); for ( RoutingPad* rp : net->getRoutingPads() ) rps.push_back( rp );
for ( RoutingPad* rp : rps ) rp->destroy(); for ( RoutingPad* rp : rps ) rp->destroy();
} }
_cell->getFlags().reset( Cell::Flags::FlattenedNets|Cell::Flags::Routed );
_cell->setTerminalNetlist( false );
} }
@ -821,17 +812,38 @@ namespace Bora {
} }
void SlicingNode::setBoxSetIndex ( size_t ) void SlicingNode::setNFing ( int )
{ cerr << Error( "SlicingNode::setBoxSetIndex(): Base class method must never be called." ) << endl; } { cerr << Error( "SlicingNode::setNFing(): Base class method must never be called." ) << endl; }
size_t SlicingNode::getBoxSetIndex () const int SlicingNode::getNFing () const
{ {
cerr << Error( "SlicingNode::getBoxSetIndex(): Base class method must never be called." ) << endl; cerr << Error( "SlicingNode::getNFing(): Base class method must never be called." ) << endl;
return 0; return 0;
} }
double SlicingNode::getStartParameter () const
{
cerr << Error( "SlicingNode::getStartParameter(): Base class method must never be called." ) << endl;
return 0.0;
}
double SlicingNode::getStepParameter () const
{
cerr << Error( "SlicingNode::getStepParameter(): Base class method must never be called." ) << endl;
return 0.0;
}
double SlicingNode::getCountParameter () const
{
cerr << Error( "SlicingNode::getCountParameter(): Base class method must never be called." ) << endl;
return 0.0;
}
Instance* SlicingNode::getInstance () const Instance* SlicingNode::getInstance () const
{ {
cerr << Error( "SlicingNode::getInstance(): Base class method must never be called." ) << endl; cerr << Error( "SlicingNode::getInstance(): Base class method must never be called." ) << endl;

View File

@ -399,13 +399,11 @@ namespace Bora {
if (device) { if (device) {
TransistorFamily* tf = dynamic_cast<TransistorFamily*>( device ); TransistorFamily* tf = dynamic_cast<TransistorFamily*>( device );
if (tf) { if (tf) _gridLabel[i+5]->setDynamicText ( QString("%1" ).arg( tf->getNfing() ) );
_gridLabel[i+5]->setDynamicText ( QString("%1" ).arg( tf->getNfing() ) ); }
i++; i++;
} }
} }
}
}
} // Bora namespace. } // Bora namespace.

Some files were not shown because too many files have changed in this diff Show More