Optimize Cell::getDeeNet() to fix the slow-down in PowerRails.
* New: In DeepNet, add an DeepNet::Uplink property on the HyperNet root net Occurrence so we have a direct two-way link between the top (flattened net) and the root of the HyperNet. Down link is ensured by the Occurrence, up link by the Uplink property. * Change: In Cell::getDeepNet(), now use the DeepNet Uplink property instead of looping over *all* top nets. This was the cause of the terrific slow down in PowerRails, especially on flatteneds designs.
This commit is contained in:
parent
ca499e024c
commit
966a25181f
|
@ -799,17 +799,10 @@ DeepNet* Cell::getDeepNet ( Path path, const Net* leafNet ) const
|
||||||
if (not (_flags.isset(Flags::FlattenedNets))) return NULL;
|
if (not (_flags.isset(Flags::FlattenedNets))) return NULL;
|
||||||
|
|
||||||
Occurrence rootNetOccurrence ( getHyperNetRootNetOccurrence(Occurrence(leafNet,path)) );
|
Occurrence rootNetOccurrence ( getHyperNetRootNetOccurrence(Occurrence(leafNet,path)) );
|
||||||
|
DeepNet::Uplink* uplink = static_cast<DeepNet::Uplink*>
|
||||||
forEach ( Net*, inet, getNets() ) {
|
( rootNetOccurrence.getProperty( DeepNet::Uplink::staticGetName() ));
|
||||||
DeepNet* deepNet = dynamic_cast<DeepNet*>( *inet );
|
if (not uplink) return NULL;
|
||||||
if (not deepNet) continue;
|
return uplink->getUplink();
|
||||||
|
|
||||||
Occurrence deepNetOccurrence = deepNet->getRootNetOccurrence();
|
|
||||||
if ( (rootNetOccurrence.getEntity() == deepNetOccurrence.getEntity())
|
|
||||||
and (rootNetOccurrence.getPath () == deepNetOccurrence.getPath ()) )
|
|
||||||
return deepNet;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cell::flattenNets (uint64_t flags )
|
void Cell::flattenNets (uint64_t flags )
|
||||||
|
|
|
@ -57,6 +57,7 @@ namespace Hurricane {
|
||||||
, _netOccurrence(netOccurrence)
|
, _netOccurrence(netOccurrence)
|
||||||
{
|
{
|
||||||
cdebug_log(18,0) << "DeepNet::DeepNet() " << getCell() << " " << this << endl;
|
cdebug_log(18,0) << "DeepNet::DeepNet() " << getCell() << " " << this << endl;
|
||||||
|
_netOccurrence.put( Uplink::create(this) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,6 +84,14 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DeepNet::_preDestroy ()
|
||||||
|
{
|
||||||
|
_netOccurrence.removeProperty( Uplink::staticGetName() );
|
||||||
|
Inherit::_preDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
size_t DeepNet::_createRoutingPads ( unsigned int flags )
|
size_t DeepNet::_createRoutingPads ( unsigned int flags )
|
||||||
{
|
{
|
||||||
cdebug_log(18,1) << "DeepNet::_createRoutingPads(): " << this << endl;
|
cdebug_log(18,1) << "DeepNet::_createRoutingPads(): " << this << endl;
|
||||||
|
@ -207,4 +216,55 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Uplink"
|
||||||
|
|
||||||
|
Name DeepNet::Uplink::_name = "DeepNet::Uplink";
|
||||||
|
|
||||||
|
|
||||||
|
DeepNet::Uplink* DeepNet::Uplink::create ( DeepNet* uplink )
|
||||||
|
{
|
||||||
|
Uplink *property = new Uplink( uplink );
|
||||||
|
property->_postCreate ();
|
||||||
|
return property;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DeepNet::Uplink::onReleasedBy ( DBo* owner )
|
||||||
|
{ PrivateProperty::onReleasedBy( owner ); }
|
||||||
|
|
||||||
|
|
||||||
|
Name DeepNet::Uplink::getPropertyName ()
|
||||||
|
{ return _name; }
|
||||||
|
|
||||||
|
|
||||||
|
Name DeepNet::Uplink::getName () const
|
||||||
|
{ return getPropertyName(); }
|
||||||
|
|
||||||
|
|
||||||
|
string DeepNet::Uplink::_getTypeName () const
|
||||||
|
{ return _TName( "DeepNet::Uplink" ); }
|
||||||
|
|
||||||
|
|
||||||
|
string DeepNet::Uplink::_getString () const
|
||||||
|
{
|
||||||
|
string s = PrivateProperty::_getString ();
|
||||||
|
s.insert ( s.length() - 1 , " " + getString(_uplink) );
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Record* DeepNet::Uplink::_getRecord () const
|
||||||
|
{
|
||||||
|
Record* record = PrivateProperty::_getRecord();
|
||||||
|
if (record) {
|
||||||
|
record->add( getSlot( "_name" , _name ) );
|
||||||
|
record->add( getSlot( "_uplink", _uplink ) );
|
||||||
|
}
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -29,9 +29,8 @@
|
||||||
// +-----------------------------------------------------------------+
|
// +-----------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
#ifndef HURRICANE_DEEPNET_H
|
#pragma once
|
||||||
#define HURRICANE_DEEPNET_H
|
#include "hurricane/Property.h"
|
||||||
|
|
||||||
#include "hurricane/Net.h"
|
#include "hurricane/Net.h"
|
||||||
#include "hurricane/HyperNet.h"
|
#include "hurricane/HyperNet.h"
|
||||||
#include "hurricane/Occurrence.h"
|
#include "hurricane/Occurrence.h"
|
||||||
|
@ -45,6 +44,23 @@ namespace Hurricane {
|
||||||
class DeepNet : public Net {
|
class DeepNet : public Net {
|
||||||
public:
|
public:
|
||||||
typedef Net Inherit;
|
typedef Net Inherit;
|
||||||
|
public:
|
||||||
|
class Uplink : public Hurricane::PrivateProperty {
|
||||||
|
static Name _name;
|
||||||
|
public:
|
||||||
|
static Uplink* create ( DeepNet* uplink );
|
||||||
|
static Name getPropertyName ();
|
||||||
|
virtual Name getName () const;
|
||||||
|
inline DeepNet* getUplink ();
|
||||||
|
virtual void onReleasedBy ( DBo* owner );
|
||||||
|
virtual std::string _getTypeName () const;
|
||||||
|
virtual std::string _getString () const;
|
||||||
|
virtual Record* _getRecord () const;
|
||||||
|
protected:
|
||||||
|
DeepNet* _uplink;
|
||||||
|
protected:
|
||||||
|
inline Uplink ( DeepNet* uplink );
|
||||||
|
};
|
||||||
public:
|
public:
|
||||||
static DeepNet* create ( HyperNet& hyperNet );
|
static DeepNet* create ( HyperNet& hyperNet );
|
||||||
inline Occurrence getRootNetOccurrence () const;
|
inline Occurrence getRootNetOccurrence () const;
|
||||||
|
@ -55,6 +71,7 @@ namespace Hurricane {
|
||||||
virtual void _toJson ( JsonWriter* ) const;
|
virtual void _toJson ( JsonWriter* ) const;
|
||||||
protected:
|
protected:
|
||||||
DeepNet ( Occurrence& netOccurrence );
|
DeepNet ( Occurrence& netOccurrence );
|
||||||
|
virtual void _preDestroy ();
|
||||||
protected:
|
protected:
|
||||||
Occurrence _netOccurrence;
|
Occurrence _netOccurrence;
|
||||||
|
|
||||||
|
@ -66,6 +83,14 @@ namespace Hurricane {
|
||||||
Net* getDeepNet(HyperNet& hyperNet);
|
Net* getDeepNet(HyperNet& hyperNet);
|
||||||
|
|
||||||
|
|
||||||
|
inline DeepNet::Uplink::Uplink ( DeepNet* uplink )
|
||||||
|
: PrivateProperty(), _uplink(uplink)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
inline DeepNet* DeepNet::Uplink::getUplink () { return _uplink; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "JsonDeepNet".
|
// Class : "JsonDeepNet".
|
||||||
|
|
||||||
|
@ -83,5 +108,3 @@ namespace Hurricane {
|
||||||
} // Hurricane namespace.
|
} // Hurricane namespace.
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::DeepNet);
|
INSPECTOR_P_SUPPORT(Hurricane::DeepNet);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in New Issue