Cell::flattenNets() is now able to work on one instance only.

* New: Occurrence_Contains filter that tells if an instance is part of
    an Occurrence. Checks for two cases:
      - The Instance is part of the *path* of the Occurrence.
      - The Instance is the associated entity itself.
* New: In Cell::flattenNets() adds a new parameter Instance* to
    allow partial flatten of one instance only.
* Bug: In Anabatic::Disjstra::_materialize() check that the
    NetRoutingState exists before trying to access it...
This commit is contained in:
Jean-Paul Chaput 2017-06-21 17:46:45 +02:00
parent 0eec3a90c3
commit d776996658
6 changed files with 135 additions and 52 deletions

View File

@ -1782,11 +1782,14 @@ namespace Anabatic {
if (sourceContact->getX() > targetContact->getX())
std::swap( sourceContact, targetContact );
DbU::Unit width = Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL2")); //DbU::fromLambda(2.0);
if (state) width *= state->getWPitch();
segment = Horizontal::create( sourceContact
, targetContact
, _anabatic->getConfiguration()->getGHorizontalLayer()
, constraint.getCenter()
, state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL2"))//DbU::fromLambda(2.0)
, width
);
for ( Edge* through : aligneds ) through->add( segment );
if (state){
@ -1796,11 +1799,14 @@ namespace Anabatic {
if (sourceContact->getY() > targetContact->getY())
std::swap( sourceContact, targetContact );
DbU::Unit width = Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL3")); //DbU::fromLambda(2.0);
if (state) width *= state->getWPitch();
segment = Vertical::create( sourceContact
, targetContact
, _anabatic->getConfiguration()->getGVerticalLayer()
, constraint.getCenter()
, state->getWPitch()*Session::getPitch(Hurricane::DataBase::getDB()->getTechnology()->getLayer("METAL3"))//DbU::fromLambda(2.0)
, width
);
for ( Edge* through : aligneds ) through->add( segment );
if (state){

View File

@ -171,6 +171,7 @@
SharedPath.cpp
Path.cpp
Occurrence.cpp
Occurrences.cpp
QuadTree.cpp
Slice.cpp
ExtensionSlice.cpp

View File

@ -813,9 +813,14 @@ DeepNet* Cell::getDeepNet ( Path path, const Net* leafNet ) const
return NULL;
}
void Cell::flattenNets (uint64_t flags )
// *************************************
{
flattenNets( NULL, flags );
}
void Cell::flattenNets(uint64_t flags)
// ***************************************
void Cell::flattenNets ( const Instance* instance, uint64_t flags )
// ****************************************************************
{
cdebug_log(18,0) << "Cell::flattenNets() flags:0x" << hex << flags << endl;
@ -828,7 +833,7 @@ void Cell::flattenNets(uint64_t flags)
vector<HyperNet> hyperNets;
vector<HyperNet> topHyperNets;
for ( Occurrence occurrence : getHyperNetRootNetOccurrences() ) {
for ( Occurrence occurrence : getHyperNetRootNetOccurrences().getSubSet(NotFilter<Occurrence>(Occurrence_Contains(instance))) ) {
Net* net = static_cast<Net*>(occurrence.getEntity());
if (net->isClock() and (flags & Flags::NoClockFlatten)) continue;

View File

@ -0,0 +1,63 @@
// -*- C++ -*-
//
// Copyright (c) BULL S.A. 2017-2017, All Rights Reserved
//
// This file is part of Hurricane.
//
// Hurricane is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// Hurricane is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
// General Public License for more details.
//
// You should have received a copy of the Lesser GNU General Public
// License along with Hurricane. If not, see
// <http://www.gnu.org/licenses/>.
//
// +-----------------------------------------------------------------+
// | 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@lip6.fr |
// | =============================================================== |
// | C++ Module : "./Occurrences.cpp" |
// +-----------------------------------------------------------------+
#include "hurricane/Occurrences.h"
#include "hurricane/Instance.h"
namespace Hurricane {
// -------------------------------------------------------------------
// Class : "Occurrence_Contains".
OccurrenceFilter* Occurrence_Contains::getClone () const
{ return new Occurrence_Contains(_instance); }
bool Occurrence_Contains::accept ( Occurrence occurrence ) const
{
if (not _instance) return false;
if (dynamic_cast<Instance*>(occurrence.getEntity()) == _instance) return true;
for ( Instance* instance : occurrence.getPath().getInstances() ) {
if (instance == _instance) return true;
}
return false;
}
string Occurrence_Contains::_getString () const
{ return "<Occurrence_Contains " + getString(_instance) + " >"; }
} // Hurricane namespace.

View File

@ -507,6 +507,7 @@ class Cell : public Entity {
public: void setPad(bool isPad) {_flags.set(Flags::Pad,isPad);};
public: void setFeed(bool isFeed) {_flags.set(Flags::Feed,isFeed);};
public: void flattenNets(uint64_t flags=Flags::BuildRings);
public: void flattenNets(const Instance* instance, uint64_t flags=Flags::BuildRings);
public: void createRoutingPadRings(uint64_t flags=Flags::BuildRings);
public: void setFlags(uint64_t flags) { _flags |= flags; }
public: void resetFlags(uint64_t flags) { _flags &= ~flags; }

View File

@ -1,21 +1,33 @@
// ****************************************************************************************************
// File: ./hurricane/Occurrences.h
// Authors: R. Escassut
// Copyright (c) BULL S.A. 2000-2016, All Rights Reserved
// -*- C++ -*-
//
// Copyright (c) BULL S.A. 2000-2017, All Rights Reserved
//
// This file is part of Hurricane.
//
// Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
// Lesser General Public License as published by the Free Software Foundation, either version 3 of the
// Hurricane is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
// Hurricane is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
// General Public License for more details.
//
// You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
// not, see <http://www.gnu.org/licenses/>.
// ****************************************************************************************************
// You should have received a copy of the Lesser GNU General Public
// License along with Hurricane. If not, see
// <http://www.gnu.org/licenses/>.
//
// +-----------------------------------------------------------------+
// | 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 : Rémy Escassut |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./Occurrences.cpp" |
// +-----------------------------------------------------------------+
#ifndef HURRICANE_OCCURENCES
#define HURRICANE_OCCURENCES
@ -25,52 +37,47 @@
namespace Hurricane {
class Instance;
typedef GenericCollection<Occurrence> Occurrences;
typedef GenericLocator<Occurrence> OccurrenceLocator;
typedef GenericFilter<Occurrence> OccurrenceFilter;
// ****************************************************************************************************
// Occurrences declaration
// ****************************************************************************************************
// -------------------------------------------------------------------
// Class : "Occurrence_Contains".
typedef GenericCollection<Occurrence> Occurrences;
class Occurrence_Contains : public OccurrenceFilter {
public:
inline Occurrence_Contains ( const Instance* );
inline Occurrence_Contains ( const Occurrence_Contains& );
virtual OccurrenceFilter* getClone () const;
virtual bool accept ( Occurrence ) const;
virtual string _getString () const;
protected:
const Instance* _instance;
};
Occurrence_Contains::Occurrence_Contains ( const Instance* instance )
: OccurrenceFilter()
, _instance(instance)
{ }
// ****************************************************************************************************
// OccurrenceLocator declaration
// ****************************************************************************************************
typedef GenericLocator<Occurrence> OccurrenceLocator;
Occurrence_Contains::Occurrence_Contains ( const Occurrence_Contains& other )
: OccurrenceFilter()
, _instance(other._instance)
{ }
// ****************************************************************************************************
// OccurrenceFilter declaration
// ****************************************************************************************************
typedef GenericFilter<Occurrence> OccurrenceFilter;
// ****************************************************************************************************
// for_each_occurrence declaration
// ****************************************************************************************************
#define for_each_occurrence(occurrence, occurrences)\
/************************************************/\
{\
OccurrenceLocator _locator = occurrences.getLocator();\
while (_locator.isValid()) {\
Occurrence occurrence = _locator.getElement();\
#define for_each_occurrence(occurrence, occurrences) \
{ \
OccurrenceLocator _locator = occurrences.getLocator(); \
while (_locator.isValid()) { \
Occurrence occurrence = _locator.getElement(); \
_locator.progress();
} // End of Hurricane namespace.
} // Hurricane namespace.
#endif // HURRICANE_OCCURENCES
// ****************************************************************************************************
// Copyright (c) BULL S.A. 2000-2016, All Rights Reserved
// ****************************************************************************************************