More robust deterministic netmap. Use classic string hash.
* Change: In Hurricane::Cell::NetMap, the hash function is now based on the string itself and not on the id of the SharedName. We now may remove the id attribute of the SharedName. This to ensure a more robust deterministic behavior. The sort order do not depend on whether we did use names before or not.
This commit is contained in:
parent
9f69230837
commit
e704306cad
|
@ -71,31 +71,43 @@ Instance* instance = cell->getSlaveInstances().getFirst();
|
||||||
*
|
*
|
||||||
* -# The netlist is fixed and generated (in C++) in the Transistor, by
|
* -# The netlist is fixed and generated (in C++) in the Transistor, by
|
||||||
* instanciating one MetaTransistor.
|
* instanciating one MetaTransistor.
|
||||||
|
*
|
||||||
* -# The layout is generated <em>on the fly</em> by calling the relevant
|
* -# The layout is generated <em>on the fly</em> by calling the relevant
|
||||||
* python sceript.
|
* python script.
|
||||||
|
*
|
||||||
* -# The parameters, which are commons to all the Transistor based
|
* -# The parameters, which are commons to all the Transistor based
|
||||||
* devices are created in TransistorFamily. The parameters are created
|
* devices are created in TransistorFamily. The parameters are created
|
||||||
* through the Device parameter factory and stored at the Device level.
|
* through the Device parameter factory and stored at the Device level.
|
||||||
* A pointer to the concrete type of Parameter is also kept at the
|
* A pointer to the concrete type of Parameter is also kept at the
|
||||||
* TransistorFamily level.
|
* TransistorFamily level.
|
||||||
|
*
|
||||||
* -# The Device::getParameters() method is implemented at this level
|
* -# The Device::getParameters() method is implemented at this level
|
||||||
* and returns a TransistorArguments pointer.
|
* and returns a reference to the set of parameters.
|
||||||
|
*
|
||||||
* -# Parameters are used to set up the Device characteristics, either
|
* -# Parameters are used to set up the Device characteristics, either
|
||||||
* programmatically or through the <code>Pharos</code> graphical
|
* programmatically or through the graphical interface.
|
||||||
* interface.
|
*
|
||||||
* -# <code>Arguments</code>, on the other hand, are mostly used to
|
* The layout Python generation scripts also uses the Parameter
|
||||||
* transmit the setting of a Device (i.e. it's Parameters values)
|
* to know the settings of a device.
|
||||||
* to the Python script in charge of the layout generation.
|
*
|
||||||
* Arguments have Python wrapper PyArguments, and it is copies of
|
* Deprecateds:
|
||||||
* the values that are transmitted.
|
*
|
||||||
|
* -# <code>Arguments</code> where fully redundant with Parameters, so
|
||||||
|
* we did remove them.
|
||||||
|
*
|
||||||
|
* <b>The Arguments must be removed from the UML schema.</b>
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* \subsection ssecOpenQuestions Open questions
|
* \subsection ssecOpenQuestions Open questions
|
||||||
*
|
*
|
||||||
* -# As Arguments are used to transmit parameters, why not simply
|
* -# In Bora::channelRouting, what is implemented is in fact an
|
||||||
* encapsulate Parameters in a Python wrapper? Thus completly
|
* interval tree (or segment tree). We should try to use their
|
||||||
* suppressing Arguments. And by the way, using pointers to
|
* \c Boost implementation.
|
||||||
* to make the relationship bi-directionnal (event if it's not
|
*
|
||||||
* needed now).
|
* -# In Bora::SlicingTree, whe should merge the list of user nodes
|
||||||
|
* (devices and hierarchical) with the routing nodes (channels and
|
||||||
|
* struts) to unify the underlying management. This sould enable
|
||||||
|
* us to move lots method implementation \e upward in the class
|
||||||
|
* hierarchy.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1584,7 +1584,21 @@ Name Cell::NetMap::_getKey(Net* net) const
|
||||||
unsigned Cell::NetMap::_getHashValue(Name name) const
|
unsigned Cell::NetMap::_getHashValue(Name name) const
|
||||||
// **************************************************
|
// **************************************************
|
||||||
{
|
{
|
||||||
return (unsigned int)name._getSharedName()->getId() / 8;
|
unsigned long hash = 0;
|
||||||
|
unsigned long sum4 = 0;
|
||||||
|
const string& s = name._getSharedName()->_getSString();
|
||||||
|
for ( size_t i=0 ; i<s.size() ; ++i ) {
|
||||||
|
sum4 |= ((unsigned long)s[i]) << ((i%4) * 8);
|
||||||
|
if (i%4 == 3) {
|
||||||
|
hash += sum4;
|
||||||
|
sum4 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hash += sum4;
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
|
||||||
|
//return (unsigned int)name._getSharedName()->getId() / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
Net* Cell::NetMap::_getNextElement(Net* net) const
|
Net* Cell::NetMap::_getNextElement(Net* net) const
|
||||||
|
|
|
@ -99,7 +99,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _idCounter++;
|
return ++_idCounter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,6 +130,14 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Entity::_postCreate()
|
||||||
|
{
|
||||||
|
Inherit::_postCreate();
|
||||||
|
|
||||||
|
//cerr << _getString() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Entity::_preDestroy()
|
void Entity::_preDestroy()
|
||||||
{
|
{
|
||||||
//ltrace(10) << "Entity::_preDestroy() - " << (void*)this << endl;
|
//ltrace(10) << "Entity::_preDestroy() - " << (void*)this << endl;
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace Hurricane {
|
||||||
static bool inForcedIdMode ();
|
static bool inForcedIdMode ();
|
||||||
static void enableForcedIdMode ();
|
static void enableForcedIdMode ();
|
||||||
static void disableForcedIdMode ();
|
static void disableForcedIdMode ();
|
||||||
|
static void useIdCounter2 ();
|
||||||
public:
|
public:
|
||||||
inline unsigned int getId () const;
|
inline unsigned int getId () const;
|
||||||
virtual Cell* getCell () const = 0;
|
virtual Cell* getCell () const = 0;
|
||||||
|
@ -63,6 +64,7 @@ namespace Hurricane {
|
||||||
Quark* _getQuark ( SharedPath* sharedPath = NULL ) const;
|
Quark* _getQuark ( SharedPath* sharedPath = NULL ) const;
|
||||||
protected:
|
protected:
|
||||||
Entity ();
|
Entity ();
|
||||||
|
virtual void _postCreate ();
|
||||||
virtual void _preDestroy ();
|
virtual void _preDestroy ();
|
||||||
private:
|
private:
|
||||||
static unsigned int _memoryLimit;
|
static unsigned int _memoryLimit;
|
||||||
|
|
Loading…
Reference in New Issue