From ae0e6aed2514762c1deb86ecc4e17501029db0fd Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 11 Mar 2016 14:04:31 +0100 Subject: [PATCH] Disable the merged quad-tree feature, no so bright an idea. * Bug: In Hurricane, In Cell, the quad-tree cannot be mergeds because when a geometrical search is performed, components, and even more importantly, instances from lower hierarchical levels will be reported. And there is no simple way to discriminate them. * Change: In Hurricane, Cell & Instance, change the flag of MergedQuadTree into SlavedAb. * Bug: In Hurricane, In Instance::slaveAbutmentBox(), the AB of the master model must be set before calling setPlacementStatus() otherwise the Instance do not get inserted into the quad-tree (empty AB). --- hurricane/src/hurricane/Cell.cpp | 9 +++++---- hurricane/src/hurricane/Instance.cpp | 14 +++++++------- hurricane/src/hurricane/SharedPath.cpp | 4 ++++ hurricane/src/hurricane/hurricane/Cell.h | 3 ++- hurricane/src/hurricane/hurricane/Query.h | 3 ++- hurricane/src/viewer/CellWidget.cpp | 12 ++++++++---- hurricane/src/viewer/SelectCommand.cpp | 17 ++++------------- 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index 06ee8db2..5a8e4ff1 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -572,7 +572,7 @@ void Cell::setAbutmentBox(const Box& abutmentBox) for ( Instance* instance : getInstances() ) { Cell* masterCell = instance->getMasterCell(); - if (masterCell->getFlags().isset(Flags::MergedQuadTree)) + if (masterCell->getFlags().isset(Flags::SlavedAb)) masterCell->setAbutmentBox( abutmentBox ); } } @@ -840,12 +840,13 @@ void Cell::unmaterialize() void Cell::slaveAbutmentBox ( Cell* topCell ) // ****************************************** { - if (_flags.isset(Flags::MergedQuadTree)) { + if (_flags.isset(Flags::SlavedAb)) { cerr << Error( "Cell::slaveAbutmentBox(): %s is already slaved, action cancelled." , getString(this).c_str() ) << endl; return; } + _flags.set( Flags::SlavedAb ); if (not isUnique()) { cerr << Error( "Cell::slaveAbutmentBox(): %s is *not* unique, action cancelled." , getString(this).c_str() ) << endl; @@ -885,11 +886,11 @@ void Cell::_slaveAbutmentBox ( Cell* topCell ) setAbutmentBox( topCell->getAbutmentBox() ); - _changeQuadTree( topCell ); +//_changeQuadTree( topCell ); for ( Instance* instance : getInstances() ) { Cell* masterCell = instance->getMasterCell(); - if (masterCell->getFlags().isset(Flags::MergedQuadTree)) + if (masterCell->getFlags().isset(Flags::SlavedAb)) masterCell->_slaveAbutmentBox( topCell ); } } diff --git a/hurricane/src/hurricane/Instance.cpp b/hurricane/src/hurricane/Instance.cpp index 67067f51..5a5385fd 100644 --- a/hurricane/src/hurricane/Instance.cpp +++ b/hurricane/src/hurricane/Instance.cpp @@ -410,18 +410,18 @@ void Instance::setTransformation(const Transformation& transformation) } } -void Instance::setPlacementStatus(const PlacementStatus& placementstatus) +void Instance::setPlacementStatus(const PlacementStatus& placementStatus) // ********************************************************************** { - if (placementstatus != _placementStatus) { + if (placementStatus != _placementStatus) { invalidate(true); - if (_placementStatus == PlacementStatus::UNPLACED) { + if (placementStatus & (PlacementStatus::PLACED|PlacementStatus::FIXED)) { materialize (); - } else if (placementstatus == PlacementStatus::UNPLACED) + } else if (placementStatus == PlacementStatus::UNPLACED) unmaterialize (); - _placementStatus = placementstatus; + _placementStatus = placementStatus; } } @@ -512,10 +512,10 @@ void Instance::slaveAbutmentBox() // ****************************** { if (not _masterCell->isUniquified()) uniquify(); + _masterCell->slaveAbutmentBox( getCell() ); +//_masterCell->_setShuntedPath( Path(getCell()->getShuntedPath(),this) ); setTransformation( Transformation() ); setPlacementStatus( Instance::PlacementStatus::PLACED ); - _masterCell->slaveAbutmentBox( getCell() ); - _masterCell->_setShuntedPath( Path(getCell()->getShuntedPath(),this) ); } Instance* Instance::getClone(Cell* cloneCell) const diff --git a/hurricane/src/hurricane/SharedPath.cpp b/hurricane/src/hurricane/SharedPath.cpp index 66ca6a50..5fb5a79a 100644 --- a/hurricane/src/hurricane/SharedPath.cpp +++ b/hurricane/src/hurricane/SharedPath.cpp @@ -122,9 +122,13 @@ SharedPath::SharedPath(Instance* headInstance, SharedPath* tailSharedPath) if (_tailSharedPath && (_tailSharedPath->getOwnerCell() != _headInstance->getMasterCell())) throw Error( "Can't create %s, incompatible tail path between:\n" + " - head instance %s\n" + " - tail path %s\n" " - head owner %s\n" " - tail owner %s\n" , _TName("SharedPath").c_str() + , getString(_headInstance ).c_str() + , getString(_tailSharedPath).c_str() , getString(_headInstance ->getMasterCell()).c_str() , getString(_tailSharedPath->getOwnerCell ()).c_str() ); diff --git a/hurricane/src/hurricane/hurricane/Cell.h b/hurricane/src/hurricane/hurricane/Cell.h index 9eb42919..7da52bbb 100644 --- a/hurricane/src/hurricane/hurricane/Cell.h +++ b/hurricane/src/hurricane/hurricane/Cell.h @@ -94,7 +94,8 @@ class Cell : public Entity { , Placed = 0x00020000 , Routed = 0x00040000 , MergedQuadTree = 0x00080000 - , Materialized = 0x00100000 + , SlavedAb = 0x00100000 + , Materialized = 0x00200000 }; public: diff --git a/hurricane/src/hurricane/hurricane/Query.h b/hurricane/src/hurricane/hurricane/Query.h index 5c4976f2..135dca32 100644 --- a/hurricane/src/hurricane/hurricane/Query.h +++ b/hurricane/src/hurricane/hurricane/Query.h @@ -210,7 +210,8 @@ namespace Hurricane { instance->getTransformation().getInvert().applyOn ( child->_area ); parent->_transformation.applyOn ( child->_transformation ); - child->_path = Path ( Path(parent->_path,instance->getCell()->getShuntedPath()) , instance ); + //child->_path = Path ( Path(parent->_path,instance->getCell()->getShuntedPath()) , instance ); + child->_path = Path ( parent->_path, instance ); } diff --git a/hurricane/src/viewer/CellWidget.cpp b/hurricane/src/viewer/CellWidget.cpp index b4535a5a..9930c223 100644 --- a/hurricane/src/viewer/CellWidget.cpp +++ b/hurricane/src/viewer/CellWidget.cpp @@ -2499,8 +2499,8 @@ namespace Hurricane { throw Error ( "Can't select occurrence : invalid occurrence" ); if ( occurrence.getOwnerCell() != getCell() ) { - string s1 = Graphics::toHtml ( getString(occurrence.getOwnerCell()) ); - string s2 = Graphics::toHtml ( getString(getCell()) ); + string s1 = Graphics::toHtml ( getString(getCell()) ); + string s2 = Graphics::toHtml ( getString(occurrence.getOwnerCell()) ); throw Error ( "Can't select occurrence : incompatible occurrence %s vs. %s" , s1.c_str(), s2.c_str() ); } @@ -2544,6 +2544,10 @@ namespace Hurricane { if ( criterion and (not criterion->isEnabled()) ) { criterion->enable(); + //for ( Occurrence occurrence : getOccurrencesUnder(selectArea) ) { + // cerr << "Selecting: " << occurrence << endl; + //} + forEach ( Occurrence, ioccurrence, getOccurrencesUnder(selectArea) ) select ( *ioccurrence ); } else @@ -2565,8 +2569,8 @@ namespace Hurricane { throw Error ( "Can't select occurrence : invalid occurrence" ); if ( occurrence.getOwnerCell() != getCell() ) { - string s1 = Graphics::toHtml ( getString(occurrence.getOwnerCell()) ); - string s2 = Graphics::toHtml ( getString(getCell()) ); + string s1 = Graphics::toHtml ( getString(getCell()) ); + string s2 = Graphics::toHtml ( getString(occurrence.getOwnerCell()) ); throw Error ( "Can't select occurrence : incompatible occurrence %s vs. %s" , s1.c_str(), s2.c_str() ); } diff --git a/hurricane/src/viewer/SelectCommand.cpp b/hurricane/src/viewer/SelectCommand.cpp index 36c9edef..3106585f 100644 --- a/hurricane/src/viewer/SelectCommand.cpp +++ b/hurricane/src/viewer/SelectCommand.cpp @@ -1,26 +1,17 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2016, All Rights Reserved +// Copyright (c) UPMC 2008-2016, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./SelectCommand.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include