in CMakeLists:

- (Add) HurricaneAMS includes

in Dijkstra:
- (Add+Modify) Handle restriction rules in Vertex for analog devices

in GCell:
- (Add) Check neighboring cells (North/South/East/West)
This commit is contained in:
EricLaoGitHub 2016-06-20 18:36:00 +02:00
parent fbfeb2eec1
commit da423ab308
5 changed files with 68 additions and 7 deletions

View File

@ -22,6 +22,7 @@
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(HURRICANEAMS REQUIRED)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(cmake_modules) add_subdirectory(cmake_modules)

View File

@ -11,6 +11,7 @@ endif ( CHECK_DETERMINISM )
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${QtX_INCLUDE_DIR} ${QtX_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH} ${PYTHON_INCLUDE_PATH}
${HURRICANEAMS_INCLUDE_DIR}
) )
set( includes anabatic/Constants.h set( includes anabatic/Constants.h
anabatic/Configuration.h anabatic/Configuration.h
@ -55,6 +56,7 @@ endif ( CHECK_DETERMINISM )
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${LIBXML2_LIBRARIES} ${LIBXML2_LIBRARIES}
${PYTHON_LIBRARIES} -lutil ${PYTHON_LIBRARIES} -lutil
${HURRICANEAMS_LIBRARIES}
) )
add_library( anabatic ${cpps} ${mocCpps} ) add_library( anabatic ${cpps} ${mocCpps} )

View File

@ -47,6 +47,7 @@ namespace Anabatic {
DbU::Unit Vertex::unreached = std::numeric_limits<long>::max(); DbU::Unit Vertex::unreached = std::numeric_limits<long>::max();
DbU::Unit Vertex::unreachable = std::numeric_limits<long>::max()-1;
bool Vertex::hasValidStamp () const bool Vertex::hasValidStamp () const
@ -64,10 +65,14 @@ namespace Anabatic {
+ " @(" + DbU::getValueString(_gcell->getXMin()) + " @(" + DbU::getValueString(_gcell->getXMin())
+ "," + DbU::getValueString(_gcell->getYMin()) + ")" + "," + DbU::getValueString(_gcell->getYMin()) + ")"
+ " connexId:" + getString(_connexId) + " connexId:" + getString(_connexId)
+ " d:" + ((_distance == unreached) ? "unreached" : DbU::getValueString(_distance) ) + " d:" + ((_distance == unreached) ? "unreached" : ((_distance == unreachable) ? "unreachable" : DbU::getValueString(_distance)) )
+ "+" + getString(_branchId) + "+" + getString(_branchId)
+ " stamp:" + (hasValidStamp() ? "valid" : "outdated") + " stamp:" + (hasValidStamp() ? "valid" : "outdated")
+ " from:" + ((_from) ? "set" : "NULL") + " from:" + ((_from) ? "set" : "NULL")
+ " restricted:" + (isNRestricted() ? "N" : "-")
+ (isSRestricted() ? "S" : "-")
+ (isERestricted() ? "E" : "-")
+ (isWRestricted() ? "W" : "-")
+ ">"; + ">";
return s; return s;
} }
@ -107,6 +112,9 @@ namespace Anabatic {
{ {
DbU::Unit distance = a->getDistance() + e->getDistance(); DbU::Unit distance = a->getDistance() + e->getDistance();
if ( (a->isNotRestricted()) && (b->isNotRestricted()) ) { // A remplacer avec verification sur type IsDevice()?.
if (isRestricted(a, b)) distance = Vertex::unreachable;
}
// Edge* aFrom = a->getFrom(); // Edge* aFrom = a->getFrom();
// if (aFrom) { // if (aFrom) {
// distance += (aFrom->isHorizontal() xor e->isHorizontal()) ? 3.0 : 0.0; // distance += (aFrom->isHorizontal() xor e->isHorizontal()) ? 3.0 : 0.0;
@ -115,7 +123,7 @@ namespace Anabatic {
} }
bool Dijkstra::isRestricted ( const Vertex* v1, const Vertex* v2 ) const bool Dijkstra::isRestricted ( const Vertex* v1, const Vertex* v2 )
{ {
bool restricted = true; bool restricted = true;
GCell* c1 = v1->getGCell(); GCell* c1 = v1->getGCell();
@ -222,8 +230,32 @@ namespace Anabatic {
vertex->setBranchId( 0 ); vertex->setBranchId( 0 );
vertex->setFrom ( NULL ); vertex->setFrom ( NULL );
_targets.insert( vertex ); _targets.insert( vertex );
vertex->clearRestriction();
cdebug_log(112,0) << "Add Vertex: " << vertex << endl; cdebug_log(112,0) << "Add Vertex: " << vertex << endl;
} }
// Analog Restrictions
Plug* plug = dynamic_cast<Plug*>(rp->getPlugOccurrence().getEntity());
Cell* cell = plug->getInstance()->getMasterCell();
Device* dev = dynamic_cast<Device* >(cell);
TransistorFamily* tf = dynamic_cast<TransistorFamily*>(dev);
if (tf){
Transistor* t = dynamic_cast<Transistor* >(tf);
SimpleCurrentMirror* scm = dynamic_cast<SimpleCurrentMirror*>(tf);
DifferentialPair* dp = dynamic_cast<DifferentialPair* >(tf);
CommonSourcePair* csp = dynamic_cast<CommonSourcePair* >(tf);
unsigned int rule = 0;
if (t) { rule = t->getRestriction(plug->getMasterNet());
} else if (scm) { rule = scm->getRestriction(plug->getMasterNet());
} else if (dp) { rule = dp->getRestriction(plug->getMasterNet());
} else if (csp) { rule = csp->getRestriction(plug->getMasterNet());
}
if (!(rule&0x3 )) vertex->setWRestricted();
if (!(rule&0xC )) vertex->setERestricted();
if (!(rule&0x30)) vertex->setSRestricted();
if (!(rule&0xC0)) vertex->setNRestricted();
}
Contact* gcontact = vertex->getGContact( _net ); Contact* gcontact = vertex->getGContact( _net );
rp->getBodyHook()->detach(); rp->getBodyHook()->detach();

View File

@ -577,7 +577,7 @@ namespace Anabatic {
{ {
bool found = false; bool found = false;
for (vector<Edge*>::const_iterator it = _northEdges.begin(); it != _northEdges.end(); it++){ for (vector<Edge*>::const_iterator it = _northEdges.begin(); it != _northEdges.end(); it++){
if ( (*it)->getOpposite(this)->getId() == getId() ) { if ( (*it)->getOpposite(this)->getId() == c->getId() ) {
found = true; found = true;
break; break;
} }
@ -590,7 +590,7 @@ namespace Anabatic {
{ {
bool found = false; bool found = false;
for (vector<Edge*>::const_iterator it = _southEdges.begin(); it != _southEdges.end(); it++){ for (vector<Edge*>::const_iterator it = _southEdges.begin(); it != _southEdges.end(); it++){
if ( (*it)->getOpposite(this)->getId() == getId() ) { if ( (*it)->getOpposite(this)->getId() == c->getId() ) {
found = true; found = true;
break; break;
} }
@ -603,7 +603,7 @@ namespace Anabatic {
{ {
bool found = false; bool found = false;
for (vector<Edge*>::const_iterator it = _eastEdges.begin(); it != _eastEdges.end(); it++){ for (vector<Edge*>::const_iterator it = _eastEdges.begin(); it != _eastEdges.end(); it++){
if ( (*it)->getOpposite(this)->getId() == getId() ) { if ( (*it)->getOpposite(this)->getId() == c->getId() ) {
found = true; found = true;
break; break;
} }
@ -616,7 +616,7 @@ namespace Anabatic {
{ {
bool found = false; bool found = false;
for (vector<Edge*>::const_iterator it = _westEdges.begin(); it != _westEdges.end(); it++){ for (vector<Edge*>::const_iterator it = _westEdges.begin(); it != _westEdges.end(); it++){
if ( (*it)->getOpposite(this)->getId() == getId() ) { if ( (*it)->getOpposite(this)->getId() == c->getId() ) {
found = true; found = true;
break; break;
} }

View File

@ -25,6 +25,11 @@ namespace Hurricane {
class RoutingPad; class RoutingPad;
} }
#include "anabatic/GCell.h" #include "anabatic/GCell.h"
#include "hurricaneAMS/analogic/Device.h"
#include "hurricaneAMS/devices/Transistor.h"
#include "hurricaneAMS/devices/SimpleCurrentMirror.h"
#include "hurricaneAMS/devices/DifferentialPair.h"
#include "hurricaneAMS/devices/CommonSourcePair.h"
namespace Anabatic { namespace Anabatic {
@ -34,6 +39,7 @@ namespace Anabatic {
using Hurricane::Observer; using Hurricane::Observer;
using Hurricane::Net; using Hurricane::Net;
using Hurricane::RoutingPad; using Hurricane::RoutingPad;
using Hurricane::Plug;
class AnabaticEngine; class AnabaticEngine;
@ -55,6 +61,7 @@ namespace Anabatic {
}; };
public: public:
static DbU::Unit unreached; static DbU::Unit unreached;
static DbU::Unit unreachable;
public: public:
static void notify ( Vertex*, unsigned flags ); static void notify ( Vertex*, unsigned flags );
public: public:
@ -90,6 +97,15 @@ namespace Anabatic {
inline bool isSRestricted () const; inline bool isSRestricted () const;
inline bool isERestricted () const; inline bool isERestricted () const;
inline bool isWRestricted () const; inline bool isWRestricted () const;
inline bool isNotRestricted() const;
inline void setRestricted ();
inline void clearRestriction ();
inline void setNRestricted ();
inline void setSRestricted ();
inline void setERestricted ();
inline void setWRestricted ();
inline unsigned int getFlags () const;
// Inspector support. // Inspector support.
string _getString () const; string _getString () const;
@ -105,6 +121,7 @@ namespace Anabatic {
int _stamp; int _stamp;
DbU::Unit _distance; DbU::Unit _distance;
Edge* _from; Edge* _from;
unsigned int _flags;
}; };
@ -157,6 +174,15 @@ namespace Anabatic {
inline bool Vertex::isSRestricted () const { return (_flags & SRestricted); } inline bool Vertex::isSRestricted () const { return (_flags & SRestricted); }
inline bool Vertex::isERestricted () const { return (_flags & ERestricted); } inline bool Vertex::isERestricted () const { return (_flags & ERestricted); }
inline bool Vertex::isWRestricted () const { return (_flags & WRestricted); } inline bool Vertex::isWRestricted () const { return (_flags & WRestricted); }
inline bool Vertex::isNotRestricted () const { return ((!_flags) & 0xF); }
inline void Vertex::setRestricted () { _flags |= 0xF; }
inline void Vertex::clearRestriction () { _flags &= ~(0xF); }
inline void Vertex::setNRestricted () { _flags |= 0x1; }
inline void Vertex::setSRestricted () { _flags |= 0x2; }
inline void Vertex::setERestricted () { _flags |= 0x4; }
inline void Vertex::setWRestricted () { _flags |= 0x8; }
inline unsigned int Vertex::getFlags () const { return _flags; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -262,7 +288,7 @@ namespace Anabatic {
void _selectFirstSource (); void _selectFirstSource ();
void _toWires (); void _toWires ();
bool isRestricted ( const Vertex* v1, const Vertex* v2 ) const; static bool isRestricted ( const Vertex* v1, const Vertex* v2 );
private: private:
AnabaticEngine* _anabatic; AnabaticEngine* _anabatic;
vector<Vertex*> _vertexes; vector<Vertex*> _vertexes;