Merge branch 'devel' of gitlab.lip6.fr:vlsi-eda/coriolis into devel

Conflicts:
	Seabreeze/src/Delay.cpp
This commit is contained in:
HoangAnhP 2022-07-22 12:50:41 +02:00
commit d16ec20966
12 changed files with 354 additions and 236 deletions

View File

@ -12,11 +12,17 @@
set( includes seabreeze/SeabreezeEngine.h
#seabreeze/GraphicSeabreezeEngine.h
)
set( pyIncludes seabreeze/PySeabreezeEngine.h
set( pyIncludes seabreeze/Configuration.h
seabreeze/Delay.h
seabreeze/Node.h
seabreeze/Tree.h
seabreeze/Elmore.h
seabreeze/PySeabreezeEngine.h
#seabreeze/PyGraphicSeabreezeEngine.h
)
#set( mocIncludes seabreeze/GraphicSeabreezeEngine.h )
set( cpps Configuration.cpp
Delay.cpp
Node.cpp
Tree.cpp
Elmore.cpp

View File

@ -15,6 +15,7 @@
#include <iostream>
#include <sstream>
#include <iomanip>
#include "hurricane/configuration/Configuration.h"
#include "hurricane/Warning.h"
@ -33,6 +34,7 @@
namespace Seabreeze {
using std::string;
using std::ostringstream;
using Hurricane::Warning;
using Hurricane::Error;
using Hurricane::Technology;
@ -73,22 +75,28 @@ namespace Seabreeze {
{ return new Configuration( *this ); }
/*
Record* Configuration::_getRecord () const
{
}
string Configuration::_getTypeName () const
{ return "Seabreeze::Configuration"; }
string Configuration::_getString () const
{
ostringstream os;
os << "<" << _getTypeName() << ">";
return os.str();
}
*/
string Configuration::_getTypeName () const
{ return "Configuration"; }
Record* Configuration::_getRecord () const
{
Record* record = new Record ( _getString() );
if (record != nullptr) {
record->add( getSlot("_Rct", _Rct) );
record->add( getSlot("_Rsm", _Rsm) );
record->add( getSlot("_Csm", _Csm) );
}
return record;
}
} // Seabreeze namespace.

View File

@ -1,71 +0,0 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) SU 2022-2022, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | S e a b r e e z e - Timing Analysis |
// | |
// | Author : Vu Hoang Anh PHAM |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./seabreeze/Delay.h" |
// +-----------------------------------------------------------------+
#include <map>
#include <iostream>
#include "hurricane/RoutingPad.h"
#include "seabreeze/Delay.h"
using namespace std;
namespace Seabreeze {
using Hurricane::RoutingPad;
//---------------------------------------------------------
// Class : Seabreeze::Delay
Delay::Delay()
: _values()
{}
Delay::~Delay()
{}
void Delay::addPair ( RoutingPad* driver, RoutingPad* sink, double delay)
{
if ( _values.count(driver) > 0 ) {
cerr << "Driver " << driver << " already exists." << endl
<< "If you want to add value, please use the function addValue( RoutingPad*, RoutingPad*, double)" << endl
<< "Example : addValue(driver, sink, delay)" << endl;
}
else {
map<RoutingPad*, double> val { {sink, delay}, };
_values.insert({driver, val});
}
}
void Delay::addValue ( RoutingPad* driver, RoutingPad* sink, double delay )
{
if ( _values[driver].count(sink) > 0 ) {
cerr << "Delay from " << driver << " to " << sink << " is already computed" << endl;
}
else {
_values[driver].insert({sink, delay});
}
}
void Delay::printDelays ()
{
for ( auto dmap : _values ) {
cerr << "Delay from : " << dmap.first << " to :" << endl;
map<RoutingPad*, double>& val = dmap.second;
for ( auto smap : val ) {
cerr << smap.first << " : " << smap.second << endl;
}
}
}
}

View File

@ -13,11 +13,13 @@
// | C++ Module : "./Elmore.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/Net.h"
#include "hurricane/Segment.h"
#include "hurricane/DebugSession.h"
#include "hurricane/Error.h"
#include "hurricane/Segment.h"
#include "hurricane/Plug.h"
#include "hurricane/Net.h"
#include "seabreeze/Elmore.h"
#include "seabreeze/Node.h"
#include "seabreeze/SeabreezeEngine.h"
namespace Seabreeze {
@ -26,6 +28,7 @@ namespace Seabreeze {
using Hurricane::Error;
using Hurricane::DBo;
using Hurricane::DbU;
using Hurricane::Plug;
using Hurricane::Net;
using Hurricane::Cell;
using Hurricane::Instance;
@ -41,15 +44,55 @@ namespace Seabreeze {
Elmore::Elmore ( Net* net )
: _seabreeze(nullptr)
, _contacts ()
, _checker ()
, _tree (new Tree())
, _net (net)
, _driver (nullptr)
, _tree (new Tree(this))
, _delays ()
{}
Elmore::~Elmore ()
{
cdebug_log(199,0) << "Elmore::~Elmore() " << endl;
delete _tree;
for ( Delay* delay : _delays ) delete delay;
}
void Elmore::setup ()
{
cdebug_log(199,1) << "Elmore::findDriver()" << endl;
for ( RoutingPad* rp : _net->getRoutingPads() ) {
Plug* plug = static_cast<Plug*>( rp->getPlugOccurrence().getEntity() );
if (plug->getMasterNet()->getDirection() & Net::Direction::DirOut) {
if (_driver) {
cerr << Error( "Elmore::setup(): %s has more than one driver:\n"
" * Using: %s\n"
" * Ignoring: %s"
, getString(_net).c_str()
, getString(_driver).c_str()
, getString(rp).c_str()
) << endl;
continue;
}
_driver = rp;
} else {
_delays.push_back( new Delay(this,rp) );
}
}
cdebug_log(199,0) << "Found " << _delays.size() << " sink points:" << endl;
for ( Delay* delay : _delays ) {
cdebug_log(199,0) << "| " << delay << endl;
}
if (not _driver) {
cerr << Error( "Elmore::_postCreate(): No driver found on %s, aborting."
, getString(_net).c_str() ) << endl;
cdebug_tabw(199,-1);
return;
}
cdebug_tabw(199,-1);
}
@ -57,27 +100,24 @@ namespace Seabreeze {
{ return _seabreeze->getConfiguration(); }
void Elmore::contFromNet ( Net* net )
Delay* Elmore::getDelay ( RoutingPad* rp ) const
{
for ( RoutingPad* rp : net->getRoutingPads() ) {
for ( Component* component : rp->getSlaveComponents() ) {
Contact* contact = dynamic_cast<Contact*>( component );
if (not contact) continue;
_contacts.insert( contact );
}
for ( Delay* delay : _delays ) {
if (delay->getSink() == rp) return delay;
}
return nullptr;
}
void Elmore::buildTree ( RoutingPad* rp )
void Elmore::buildTree ()
{
if (not rp) {
cerr << Error( "Elmore::buildTree(): NULL RoutingPad, aborting." ) << endl;
if (not _driver) {
cerr << Error( "Elmore::buildTree(): Net has no driver, aborting." ) << endl;
return;
}
Contact* rootContact = nullptr;
for ( Component* component : rp->getSlaveComponents() ) {
for ( Component* component : _driver->getSlaveComponents() ) {
Contact* contact = dynamic_cast<Contact*>(component);
if (contact) {
rootContact = contact;
@ -86,14 +126,13 @@ namespace Seabreeze {
}
if (not rootContact) {
cerr << Error( "Elmore::buildTree(): No Contact anchored on %s."
, getString(rp).c_str() ) << endl;
, getString(_driver).c_str() ) << endl;
return;
}
cdebug_log(199,1) << "Elmore::buildTree()" << endl;
cdebug_log(199,0) << "Root contact " << rootContact << endl;
_checker.insert( rootContact );
Node* rootNode = new Node( nullptr, rootContact );
double R = 0;
double C = 0;
@ -181,7 +220,7 @@ namespace Seabreeze {
}
cdebug_log(199,0) << "target=" << target << endl;
if (not _checker.count(target)) {
if (not _tree->isReached(target)) {
buildFromNode( node, segment);
}
}
@ -196,7 +235,7 @@ namespace Seabreeze {
cdebug_log(199,0) << "current=" << current << endl;
while ( true ) {
_checker.insert( current );
_tree->setReached( current );
int count = 0;
Segment* segment = nullptr;
for ( Component* component : current->getSlaveComponents() ) {
@ -204,7 +243,7 @@ namespace Seabreeze {
if (not segment) continue;
Contact* opposite = dynamic_cast<Contact*>( segment->getOppositeAnchor(current) );
if (opposite and (_checker.count(opposite)) != 0) {
if (opposite and _tree->isReached(opposite)) {
setRC( R, C, current, segment );
cdebug_log(199,0) << "current=" << current << endl;
cdebug_log(199,0) << "segment=" << segment << endl;
@ -233,7 +272,7 @@ namespace Seabreeze {
Contact* opposite = dynamic_cast<Contact*>( segment->getOppositeAnchor(current) );
cdebug_log(199,0) << "opposite=" << opposite << endl;
if (opposite and (_checker.count(opposite) == 0))
if (opposite and not _tree->isReached(opposite))
next = opposite;
}
@ -278,23 +317,41 @@ namespace Seabreeze {
*C += (Aseg) ? 1/(Cseg*Aseg) : 0.0;
}
}
void Elmore::clearTree ()
{
_tree->clear();
_checker.clear();
}
double Elmore::delayElmore ( RoutingPad* rp )
Delay* Elmore::delayElmore ( RoutingPad* rp )
{ return _tree->computeElmoreDelay( rp ); }
void Elmore::toTree ( ostream& os ) const
void Elmore::toTree ( ostream& os ) const
{ _tree->print( os ); }
string Elmore::_getTypeName () const
{ return "Seabreeze::Elmore"; }
string Elmore::_getString () const
{
string s = "<" + _getTypeName() + ">";
return s;
}
Record* Elmore::_getRecord () const
{
Record* record = new Record ( _getString() );
if (record != nullptr) {
record->add( getSlot("_seabreeze", _seabreeze) );
record->add( getSlot("_net" , _net ) );
record->add( getSlot("_driver" , _driver ) );
record->add( getSlot("_tree" , _tree ) );
record->add( getSlot("_delays" , &_delays ) );
}
return record;
}
//---------------------------------------------------------
// Class : "ElmoreProperty"
@ -313,7 +370,9 @@ namespace Seabreeze {
, getString(net->getCell()).c_str()) << endl;
}
_elmore.setSeabreeze( seabreeze );
_elmore.setup();
}
cdebug_log(199,0) << "ElmoreProperty::ElmoreProperty() on " << net << endl;
}
@ -337,25 +396,48 @@ namespace Seabreeze {
{ return "ElmoreProperty"; }
string ElmoreProperty::_getString () const
{
string s = PrivateProperty::_getString ();
s.insert ( s.length() - 1 , " " + getString(&_elmore) );
return s;
}
Record* ElmoreProperty::_getRecord () const
{
Record* record = PrivateProperty::_getRecord();
if ( record ) {
record->add( getSlot( "_name" , _name ) );
record->add( getSlot( "_elmore", &_elmore ) );
}
return record;
}
//---------------------------------------------------------
// Class : "ElmoreExtension"
Elmore* ElmoreExtension::create ( Net* net )
{
cdebug_log(199,1) << "ElmoreExtension::create() " << net << endl;
Elmore* elmore = get( net );
if (not elmore) {
ElmoreProperty* property = new ElmoreProperty( net );
net->put( property );
elmore = property->getElmore();
}
cdebug_tabw(199,-1);
return elmore;
}
void ElmoreExtension::destroy ( Net* net )
{
cdebug_log(199,1) << "ElmoreExtension::destroy() " << net << endl;
Property* property = net->getProperty( ElmoreProperty::staticGetName() );
if (property) net->remove( property );
cdebug_tabw(199,-1);
}

View File

@ -19,6 +19,8 @@
namespace Seabreeze {
using std::string;
Node::Node ()
: _R (0.0)
@ -50,4 +52,35 @@ namespace Seabreeze {
{ }
string Node::_getTypeName () const
{ return "Seabreeze::Node"; }
string Node::_getString () const
{
string s = "<Node ";
s += getString( _contact );
s += " R=" + getString( _R );
s += " C=" + getString( _C );
s += ">";
return s;
}
Record* Node::_getRecord () const
{
Record* record = new Record ( _getString() );
if (record != nullptr) {
record->add( getSlot("_R" , _R ) );
record->add( getSlot("_Rt" , _Rt ) );
record->add( getSlot("_C" , _C ) );
record->add( getSlot("_parent" , _parent ) );
record->add( getSlot("_childs" , &_childs ) );
record->add( getSlot("_contact", _contact) );
record->add( getSlot("_label" , _label ) );
record->add( getSlot("_ap" , _ap ) );
}
return record;
}
} // Seabreeze namespace.

View File

@ -36,6 +36,7 @@
#include "seabreeze/SeabreezeEngine.h"
#include "seabreeze/Elmore.h"
namespace Seabreeze {
using namespace std;
@ -89,29 +90,26 @@ namespace Seabreeze {
const Name& SeabreezeEngine::getName () const
{ return _toolName; };
Record* SeabreezeEngine::_getRecord () const
{
Record* record= Super::_getRecord ();
if ( record ) {
// Add new records here
}
return record;
}
string SeabreezeEngine::_getTypeName () const
{ return getString(_toolName); }
string SeabreezeEngine::_getString () const
{
ostringstream os;
os << "<" << "SeabreezeEngine " << _cell->getName() << ">";
os << "<" << _toolName << " " << _cell->getName() << ">";
return os.str();
}
string SeabreezeEngine::_getTypeName () const
{ return "Seabreeze::SeabreezeEngine"; }
Record* SeabreezeEngine::_getRecord () const
{
Record* record = Super::_getRecord();
record->add( getSlot("_configuration", _configuration) );
return record;
}
void SeabreezeEngine::buildElmore ( Net* net )
@ -120,41 +118,15 @@ namespace Seabreeze {
cdebug_log(199,1) << "SeabreezeEngine::buildElmore()" << endl;
cdebug_log(199,0) << "Run on " << net << endl;
RoutingPad* driver = nullptr;
for ( RoutingPad* rp : net->getRoutingPads() ) {
Plug* p = static_cast<Plug*>( rp->getPlugOccurrence().getEntity() );
if (p->getMasterNet()->getDirection() & Net::Direction::DirOut) {
driver = rp;
break;
}
}
Elmore* elmore = ElmoreProperty::create( net )->getElmore();
elmore->contFromNet( net );
cdebug_log(199,0) << "Found " << elmore->getContacts().size() << " RoutingPads:" << endl;
for ( Contact* contact : elmore->getContacts() ) {
cdebug_log(199,0) << "| " << contact << endl;
}
elmore->buildTree( driver );
Elmore* elmore = ElmoreExtension::create( net );
elmore->buildTree();
cerr << "Net has " << elmore->getDelays().size() << " sink(s)." << endl;
for ( RoutingPad* rp : net->getRoutingPads() ) {
Plug* plug = static_cast<Plug*>( rp->getPlugOccurrence().getEntity() );
if (plug->getMasterNet()->getDirection() & Net::Direction::DirOut) {
continue;
}
cdebug_log(199,0) << "| Elmore's delay: " << elmore->delayElmore(rp) << " " << rp << endl;
Contact* ct = nullptr;
for ( Component* comp : rp->getSlaveComponents() ) {
Contact* cont = dynamic_cast<Contact*>(comp);
if (cont) {
ct = cont;
break;
}
}
cerr << "| Elmore's delay: " << elmore->delayElmore(rp) << " " << ct << endl;
cerr << "| Elmore's delay: " << elmore->delayElmore(rp) << endl;
}
cdebug_tabw(199,-1);
DebugSession::close();
@ -182,6 +154,5 @@ namespace Seabreeze {
void SeabreezeEngine::_preDestroy ()
{}
} // Seabreeze namespace.

View File

@ -18,7 +18,12 @@
#include <iostream>
#include <algorithm>
#include "hurricane/Error.h"
#include "hurricane/RoutingPad.h"
#include "hurricane/Net.h"
#include "seabreeze/Elmore.h"
#include "seabreeze/Tree.h"
#include "seabreeze/Node.h"
#include "seabreeze/Delay.h"
namespace Seabreeze {
@ -30,10 +35,13 @@ namespace Seabreeze {
using std::endl;
using std::ostream;
using Hurricane::Error;
using Hurricane::Component;
Tree::Tree ()
: _nodes()
Tree::Tree ( Elmore* elmore )
: _elmore (elmore)
, _nodes ()
, _reacheds()
{}
@ -52,14 +60,12 @@ namespace Seabreeze {
}
void Tree::newNode ()
{ _nodes.push_back( new Node() ); }
void Tree::addNode ( Node* node )
{
if (find(_nodes.begin(), _nodes.end(), node) == _nodes.end())
if (find(_nodes.begin(), _nodes.end(), node) == _nodes.end()) {
setReached( node->contact() );
_nodes.push_back( node );
}
}
@ -88,11 +94,17 @@ namespace Seabreeze {
}
double Tree::computeElmoreDelay ( RoutingPad* rp )
Delay* Tree::computeElmoreDelay ( RoutingPad* rp )
{
if (not rp) {
cerr << Error( "Tree::computeDelay(): Sink RoutingPad argument is NULL." ) << endl;
return -1.0;
return nullptr;
}
Delay* delay = _elmore->getDelay( rp );
if (not delay) {
cerr << Error( "Tree::computeDelay(): No delay for %s, aborting."
, getString(rp).c_str() ) << endl;
return nullptr;
}
Contact* sink = nullptr;
@ -108,7 +120,7 @@ namespace Seabreeze {
" (on %s)"
, getString(rp).c_str()
) << endl;
return -1.0;
return nullptr;
}
cdebug_log(199,1) << "Tree::computeDelay()" << endl;
@ -136,9 +148,9 @@ namespace Seabreeze {
}
}
// Compute Elmore delay time
double delay = 0.0;
delay->setDelay( 0.0 );
for ( size_t k = 0; k < _nodes.size(); k++ ) {
delay += (_nodes[k]->Rt()) * (_nodes[k]->C());
delay->incDelay( (_nodes[k]->Rt()) * (_nodes[k]->C()) );
}
return delay;
@ -163,9 +175,25 @@ namespace Seabreeze {
}
void Tree::clear ()
string Tree::_getTypeName () const
{ return "Seabreeze::Tree"; }
string Tree::_getString () const
{
_nodes.clear();
string s = "<" + _getTypeName() + ">";
return s;
}
Record* Tree::_getRecord () const
{
Record* record = new Record ( _getString() );
if (record != nullptr) {
record->add( getSlot("_nodes" , &_nodes ) );
record->add( getSlot("_reacheds", &_reacheds) );
}
return record;
}

View File

@ -41,9 +41,9 @@ namespace Seabreeze {
inline double getRct () const;
inline double getRsm () const;
inline double getCsm () const;
//virtual Record* _getRecord () const;
//virtual string _getString () const;
virtual string _getTypeName () const;
string _getTypeName () const;
string _getString () const;
Record* _getRecord () const;
protected :
// Attributes
double _Rct;
@ -60,3 +60,5 @@ namespace Seabreeze {
} // Seabreeze namespace.
INSPECTOR_P_SUPPORT(Seabreeze::Configuration);

View File

@ -19,27 +19,46 @@
#include <iostream>
#include "hurricane/RoutingPad.h"
using namespace std;
namespace Seabreeze {
using Hurricane::Record;
using Hurricane::DBo;
using Hurricane::RoutingPad;
class Elmore;
//---------------------------------------------------------
// Class : Seabreeze::Delay
class Delay {
public:
Delay ();
~Delay ();
inline const map<RoutingPad*, map<RoutingPad*, double>>& getValues () const ;
void addPair ( RoutingPad*, RoutingPad*, double );
void addValue ( RoutingPad*, RoutingPad*, double );
void printDelays ();
Delay ( Elmore*, RoutingPad* );
~Delay ();
inline Elmore* getElmore () const;
inline RoutingPad* getSink () const;
inline double getDelay () const;
inline void setDelay ( double );
inline void incDelay ( double );
std::string _getTypeName () const;
std::string _getString () const;
Record* _getRecord () const;
private:
map<RoutingPad*, map<RoutingPad*, double>> _values;
Elmore* _elmore;
RoutingPad* _sink;
double _delay;
};
inline const map<RoutingPad*, map<RoutingPad*, double>>& Delay::getValues () const { return _values; }
}
inline Elmore* Delay::getElmore () const { return _elmore; }
inline RoutingPad* Delay::getSink () const { return _sink; }
inline double Delay::getDelay () const { return _delay; }
inline void Delay::setDelay ( double delay ) { _delay = delay; }
inline void Delay::incDelay ( double delay ) { _delay += delay; }
} // Seabreeze namespace.
INSPECTOR_P_SUPPORT(Seabreeze::Delay);

View File

@ -22,6 +22,7 @@
#include "hurricane/Segment.h"
#include "Configuration.h"
#include "Tree.h"
#include "Delay.h"
namespace Hurricane {
class Net;
@ -30,7 +31,6 @@ namespace Hurricane {
namespace Seabreeze {
using namespace std;
using Hurricane::Name;
using Hurricane::DBo;
using Hurricane::Net;
@ -41,40 +41,52 @@ namespace Seabreeze {
using Hurricane::Segment;
using Hurricane::PrivateProperty;
class SeabreezeEngine;
class ElmoreProperty;
//----------------------------------------------------------
// Class : Seabreeze::Elmore
class Elmore {
friend class ElmoreProperty;
public:
Elmore ( Net* );
~Elmore ();
inline SeabreezeEngine* getSeabreeze () const;
const Configuration* getConfiguration () const;
void contFromNet ( Net* );
void buildTree ( RoutingPad* );
void buildFromNode ( Node* source, Segment* );
Contact* buildBranch ( double* R, double* C, Contact* contact );
void setRC ( double* R, double* C, Contact* , Segment* );
void clearTree ();
inline Tree* getTree ();
inline const set<Contact*>& getContacts () const;
double delayElmore ( RoutingPad* );
void toTree ( ostream& ) const;
inline void setSeabreeze ( SeabreezeEngine* );
Elmore ( Net* );
~Elmore ();
inline SeabreezeEngine* getSeabreeze () const;
const Configuration* getConfiguration () const;
inline Net* getNet () const;
inline RoutingPad* getDriver () const;
Delay* getDelay ( RoutingPad* ) const;
inline const std::vector<Delay*>&
getDelays () const;
void buildTree ();
void buildFromNode ( Node* source, Segment* );
Contact* buildBranch ( double* R, double* C, Contact* contact );
void setRC ( double* R, double* C, Contact* , Segment* );
inline Tree* getTree ();
void setup ();
Delay* delayElmore ( RoutingPad* );
void toTree ( std::ostream& ) const;
inline void setSeabreeze ( SeabreezeEngine* );
Record* _getRecord () const;
std::string _getString () const;
std::string _getTypeName () const;
private:
SeabreezeEngine* _seabreeze;
set<Contact*> _contacts;
set<Contact*> _checker;
Tree* _tree;
private:
SeabreezeEngine* _seabreeze;
Net* _net;
RoutingPad* _driver;
Tree* _tree;
std::vector<Delay*> _delays;
};
inline SeabreezeEngine* Elmore::getSeabreeze () const { return _seabreeze; }
inline const set<Contact*>& Elmore::getContacts () const { return _contacts; }
inline Tree* Elmore::getTree () { return _tree; }
inline void Elmore::setSeabreeze ( SeabreezeEngine* seabreeze ) { _seabreeze = seabreeze; }
inline SeabreezeEngine* Elmore::getSeabreeze () const { return _seabreeze; }
inline Net* Elmore::getNet () const { return _net; }
inline RoutingPad* Elmore::getDriver () const { return _driver; }
inline Tree* Elmore::getTree () { return _tree; }
inline void Elmore::setSeabreeze ( SeabreezeEngine* seabreeze ) { _seabreeze = seabreeze; }
inline const std::vector<Delay*>& Elmore::getDelays () const { return _delays; }
//---------------------------------------------------------
@ -90,6 +102,8 @@ namespace Seabreeze {
Name getName () const;
inline Elmore* getElmore ();
virtual string _getTypeName () const;
virtual Record* _getRecord () const;
virtual std::string _getString () const;
protected:
Elmore _elmore;
protected:
@ -129,3 +143,7 @@ namespace Seabreeze {
} // Seabreeze Namespace
INSPECTOR_P_SUPPORT(Seabreeze::Elmore);
INSPECTOR_P_SUPPORT(Seabreeze::ElmoreProperty);

View File

@ -15,12 +15,12 @@
#pragma once
#include <vector>
namespace Hurricane {
class Contact;
}
#include "hurricane/Contact.h"
namespace Seabreeze {
using Hurricane::Record;
using Hurricane::Contact;
@ -29,23 +29,26 @@ namespace Seabreeze {
class Node {
public:
Node ();
Node ( Node* parent, Contact* );
~Node ();
inline double R () const;
inline double Rt () const;
inline double C () const;
inline int label () const;
inline int ap () const;
inline Contact* contact () const;
inline Node* parent () const;
inline const std::vector<Node*>& childs () const;
inline void addChild ( Node* );
inline void setLabel ( int );
inline void setAp ( int );
inline void setRt ( double );
inline void setR ( double );
inline void setC ( double );
Node ();
Node ( Node* parent, Contact* );
~Node ();
inline double R () const;
inline double Rt () const;
inline double C () const;
inline int label () const;
inline int ap () const;
inline Contact* contact () const;
inline Node* parent () const;
inline const std::vector<Node*>& childs () const;
inline void addChild ( Node* );
inline void setLabel ( int );
inline void setAp ( int );
inline void setRt ( double );
inline void setR ( double );
inline void setC ( double );
Record* _getRecord () const;
std::string _getString () const;
std::string _getTypeName () const;
private :
double _R;
double _Rt;
@ -75,3 +78,6 @@ namespace Seabreeze {
} // Seabreeze namespace;
INSPECTOR_P_SUPPORT(Seabreeze::Node);

View File

@ -18,17 +18,18 @@
#include <set>
#include <vector>
#include <iostream>
#include "hurricane/Contact.h"
#include "hurricane/RoutingPad.h"
#include "hurricane/Component.h"
#include "Node.h"
namespace Seabreeze {
using Hurricane::Record;
using Hurricane::DBo;
using Hurricane::Contact;
using Hurricane::RoutingPad;
using Hurricane::Component;
class Node;
class Delay;
class Elmore;
//---------------------------------------------------------
@ -36,26 +37,41 @@ namespace Seabreeze {
class Tree {
public:
Tree ();
typedef std::set<Contact*,DBo::CompareById> ContactSet;
public:
Tree ( Elmore* );
~Tree ();
inline bool isReached ( Contact* ) const;
inline Elmore* getElmore () const;
inline size_t getN ();
Node* getNode ( Contact* );
inline const std::vector<Node*>& getNodeList () const;
void newNode ();
inline void setReached ( Contact* );
void addNode ( Node* );
void markNodeAfter ( Node* );
void getBranch ( Contact* );
double computeElmoreDelay ( RoutingPad* );
Delay* computeElmoreDelay ( RoutingPad* );
void printNode ( std::ostream& , Node* , size_t depth );
void print ( std::ostream& );
void clear ();
private:
Record* _getRecord () const;
std::string _getString () const;
std::string _getTypeName () const;
private:
Elmore* _elmore;
std::vector<Node*> _nodes;
ContactSet _reacheds;
};
inline Elmore* Tree::getElmore () const { return _elmore; }
inline size_t Tree::getN () { return _nodes.size(); }
inline const std::vector<Node*>& Tree::getNodeList () const { return _nodes; }
inline void Tree::setReached ( Contact* contact ) { _reacheds.insert( contact ); }
inline bool Tree::isReached ( Contact* contact ) const { return _reacheds.count( contact ); }
} // Seabreeze namespace.
INSPECTOR_P_SUPPORT(Seabreeze::Tree);