Correct loading of clock buffer in ClockTree plugin.

* Bug: In ClockTree plugin, only the logical view of the clock buffer
    was loaded, so no external components where found on the I/O nets.
    The external components are loaded only when the *physical* view
    is loaded. Didn't show on sxlib because the buffer was fulled
    loaded *before* running the ClockTree.
* Bug: In PyHurricane, in the various LocatorNextMethod() macros,
    sometimes an empty collection can be returned by Hurricane
    (GenericCollection()), which has a NULL locator. So check
    if the locator is *not* NULL before trying to access it...
* Change: In Chip, more accurate error messages related to the clock
    detecttion.
This commit is contained in:
Jean-Paul Chaput 2014-09-03 10:37:11 +02:00
parent ae4d938553
commit e6c809a12a
7 changed files with 27 additions and 32 deletions

View File

@ -60,7 +60,7 @@ def unicornHook ( **kw ):
def ScriptMain ( **kw ):
try:
helpers.staticInitialization( quiet=True )
helpers.setTraceLevel( 550 )
#helpers.setTraceLevel( 550 )
errorCode = 0

View File

@ -231,21 +231,31 @@ class Block ( chip.Configuration.ChipConfWrapper ):
% (self.path.getTailInstance().getName(),self.ck.getName()) )
return
plugs = []
htPlugs = []
ffPlugs = []
for plug in blockCk.getPlugs():
if plug.getInstance().getName() == 'ck_htree':
plugs.append( plug )
htPlugs.append( plug )
else:
if plug.getInstance().getMasterCell().isTerminal():
ffPlugs.append( plug )
if len(plugs) != 1:
if len(ffPlugs) > 0:
message = 'Clock <%s> of block <%s> is not organized as a H-Tree.' \
% (blockCk.getName(),self.path.getTailInstance().getName())
print ErrorMessage( 1, message )
return
if len(htPlugs) > 1:
message = 'Block <%s> has not exactly one H-Tree connecteds to the clock <%s>:' \
% (self.path.getTailInstance().getName(),blockCk.getName())
for plug in plugs:
for plug in htPlugs:
message += '\n - %s' % plug
print ErrorMessage( 1, message )
return
UpdateSession.open()
bufferRp = self.rpAccessByOccurrence( Occurrence(plugs[0], self.path), self.cko )
bufferRp = self.rpAccessByOccurrence( Occurrence(htPlugs[0], self.path), self.cko )
blockAb = self.block.getAbutmentBox()
self.path.getTransformation().applyOn( blockAb )
layerGauge = self.routingGauge.getLayerGauge(self.verticalDepth)

View File

@ -62,23 +62,12 @@ def getPlugByNet ( instance, net ):
def getRpBb ( instance, netName ):
print 'getRpBb()'
sys.stdout.flush()
bb = Box()
for net in instance.getMasterCell().getNets():
print net
sys.stdout.flush()
if net.isExternal() and net.getName() == netName:
print 'all components'
for component in net.getComponents():
print component
print 'external components'
for component in net.getExternalComponents():
print component
sys.stdout.flush()
if isinstance(component,Vertical):
bb = component.getBoundingBox()
print 'End of loop'
instance.getTransformation().applyOn( bb )
return bb

View File

@ -130,7 +130,7 @@ class HTree ( GaugeConfWrapper ):
def _getBufferIo ( self ):
self.bufferCell = self.framework.getCell( Cfg.getParamString('clockTree.buffer').asString()
, CRL.Catalog.State.Logical )
, CRL.Catalog.State.Views )
for net in self.bufferCell.getNets():
if not net.isExternal(): continue
if net.isGlobal(): continue

View File

@ -52,15 +52,13 @@ namespace Hurricane {
StandardRelation* NetExternalComponents::getRelation ( const Net* net )
{
Property* property = net->getProperty(_name);
if (!property) {
return NULL;
} else {
if (not property) return NULL;
StandardRelation* relation = dynamic_cast<StandardRelation*>(property);
if (!relation)
if (not relation)
throw Error("Bad Property type: Must be a Standard Relation");
return relation;
}
}
Components NetExternalComponents::get ( const Net* net )

View File

@ -284,9 +284,7 @@ extern "C" {
Components* components = new Components(NetExternalComponents::get(net));
pyComponentCollection = PyObject_NEW(PyComponentCollection, &PyTypeComponentCollection);
if (pyComponentCollection == NULL) {
return NULL;
}
if (pyComponentCollection == NULL) return NULL;
pyComponentCollection->_object = components;
HCATCH

View File

@ -727,7 +727,7 @@ extern "C" {
{ \
Locator<TYPE*>* locator = pyLocator->_object; \
HTRY \
if (locator->isValid()) { \
if (locator and locator->isValid()) { \
TYPE* object = locator->getElement(); \
locator->progress(); \
return Py##TYPE##_Link(object); \
@ -741,7 +741,7 @@ extern "C" {
{ \
Locator<TYPE*>* locator = pyLocator->_object; \
HTRY \
if (locator->isValid()) { \
if (locator and locator->isValid()) { \
Py##TYPE* pyObject = PyObject_NEW( Py##TYPE, &PyType##TYPE ); \
if (pyObject == NULL) return NULL; \
pyObject->_object = locator->getElement(); \
@ -757,7 +757,7 @@ extern "C" {
static PyObject* Py##TYPE##LocatorNext(Py##TYPE##CollectionLocator* pyLocator) { \
Locator<TYPE*>* locator = pyLocator->_object; \
HTRY \
if (locator->isValid()) { \
if (locator and locator->isValid()) { \
TYPE* object = locator->getElement(); \
locator->progress(); \
return PyEntity_NEW(object); \