coriolis/tramontana/src/SweepLine.cpp

383 lines
13 KiB
C++
Raw Normal View History

// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) Sorbonne Université 2007-2023, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | T r a m o n t a n a - Extractor & LVX |
// | |
// | Algorithm : Christian MASSON |
// | First impl. : Yifei WU |
// | Second impl. : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./SweepLine.cpp" |
// +-----------------------------------------------------------------+
#include <iomanip>
#include "hurricane/utilities/Path.h"
#include "hurricane/DebugSession.h"
#include "hurricane/UpdateSession.h"
#include "hurricane/Bug.h"
#include "hurricane/Error.h"
#include "hurricane/Warning.h"
#include "hurricane/Breakpoint.h"
#include "hurricane/Timer.h"
#include "hurricane/DataBase.h"
#include "hurricane/Technology.h"
#include "hurricane/Layer.h"
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
#include "hurricane/ViaLayer.h"
#include "hurricane/Net.h"
#include "hurricane/Pad.h"
#include "hurricane/Plug.h"
#include "hurricane/Cell.h"
#include "hurricane/Instance.h"
#include "hurricane/Vertical.h"
#include "hurricane/Horizontal.h"
#include "hurricane/RoutingPad.h"
#include "crlcore/Utilities.h"
#include "tramontana/SweepLine.h"
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
#include "tramontana/QueryTiles.h"
namespace Tramontana {
using std::cout;
using std::cerr;
using std::endl;
using std::dec;
using std::setw;
using std::setfill;
using std::left;
using std::right;
using std::string;
using std::ostream;
using std::ofstream;
using std::ostringstream;
using std::setprecision;
using std::vector;
using std::make_pair;
using Hurricane::dbo_ptr;
using Hurricane::UpdateSession;
using Hurricane::DebugSession;
using Hurricane::tab;
using Hurricane::Bug;
using Hurricane::Error;
using Hurricane::Warning;
using Hurricane::Breakpoint;
using Hurricane::Interval;
using Hurricane::Box;
using Hurricane::DataBase;
using Hurricane::Technology;
using Hurricane::Layer;
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
using Hurricane::ViaLayer;
using Hurricane::Entity;
using Hurricane::Horizontal;
using Hurricane::Vertical;
using Hurricane::RoutingPad;
using Hurricane::Cell;
using Hurricane::Instance;
// -------------------------------------------------------------------
// Class : "Tramontana::SweepLine".
SweepLine::SweepLine ( TramontanaEngine* tramontana )
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
: _tramontana (tramontana)
, _extracteds ()
, _extractedsMask()
, _connexityMap ()
, _tiles ()
, _intervalTrees ()
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
{
for ( const BasicLayer* bl : DataBase::getDB()->getTechnology()->getBasicLayers() ) {
// HARDCODED. Should read the gauge.
if (getString(bl->getName()).substr(0,6) == "gmetal") continue;
Full transhierarchical implementation done. * New: Equipotential elements includes now: 1. Components at the top level (the cell owning the Equi). 2. Nets at the top level. If an equi include all the components of a Net, own the Net, not all it's individual components. 3. Other equipotentials from the Instances immediatey below. Thoses equis should be equivalents to the Plug of the Net. They are stored in the form of Occurrences <Instance,Equi>, the relation is stored on that Occurrence. * New: Equipotential::getFlatComponents(), a collection to recursively get all the *component* occurrences of the equi. Transhierarchically. Go through components, nets components, and recursively through the child equis. * New: EquipotentialRelation, the master of this relation is the Equipotential and the slaves, all its elements. * Change: In Tile, in case the tile is build on a deep component, we trace up the Equipotential it belongs to in the Instance level immediately belonging to the Cell under extraction. They must exists as we extract from bottom to top all the master cells. So we have, for that tile an Occurrence <Instance,Equi> that we can store in the current Equi level. * Change/Bug: In Tile, add an Id to be reliably sort the tiles in the IntervalTree. As we replaced the tile component occurrence by a <Instance,Equi> we were having multiple tiles with the same equi. This was causing havoc again in the IntervalTree. Should add a check in the RbTree for elements with the exact same key, but that would imply passing a new template parameter for the "equal" function.
2023-04-13 07:00:50 -05:00
if ( (bl->getMaterial() == BasicLayer::Material::metal)
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
or (bl->getMaterial() == BasicLayer::Material::poly)
or (bl->getMaterial() == BasicLayer::Material::cut)) {
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
_extracteds.push_back( bl );
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
_extractedsMask |= bl->getMask();
}
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
}
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
_buildCutConnexMap();
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
// _extracteds.push_back( DataBase::getDB()->getTechnology()->getBasicLayer( "metal5" ));
// _extracteds.push_back( DataBase::getDB()->getTechnology()->getBasicLayer( "metal4" ));
// _extracteds.push_back( DataBase::getDB()->getTechnology()->getBasicLayer( "metal3" ));
// _extracteds.push_back( DataBase::getDB()->getTechnology()->getBasicLayer( "metal2" ));
// _extracteds.push_back( DataBase::getDB()->getTechnology()->getBasicLayer( "metal1" ));
// _extracteds.push_back( DataBase::getDB()->getTechnology()->getBasicLayer( "poly" ));
}
SweepLine::~SweepLine ()
{ }
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
void SweepLine::_buildCutConnexMap ()
{
for ( const ViaLayer* viaLayer : DataBase::getDB()->getTechnology()->getViaLayers() ) {
const BasicLayer* cutLayer = nullptr;
for ( const BasicLayer* layer : viaLayer->getBasicLayers() ) {
if (layer->getMaterial() == BasicLayer::Material::cut) {
cutLayer = layer;
break;
}
}
if (not cutLayer) {
cerr << Error( "SweepLine::_buildConnexityMap(): ViaLayer \"%s\" does not contains any *cut* (ignored)."
, getString(viaLayer->getName()).c_str()
) << endl;
continue;
}
auto iCutMap = _connexityMap.find( cutLayer );
if (iCutMap == _connexityMap.end()) {
_connexityMap.insert( make_pair( cutLayer, LayerSet() ));
iCutMap = _connexityMap.find( cutLayer );
}
for ( const BasicLayer* layer : viaLayer->getBasicLayers() ) {
if ( (layer->getMaterial() != BasicLayer::Material::cut)
and (_extractedsMask.intersect(layer->getMask())) ) {
iCutMap->second.insert( layer );
}
}
}
// for ( auto item : _connexityMap ) {
// cerr << "BasicLayers connex to cut: " << item.first << endl;
// for ( const BasicLayer* bl : item.second ) {
// cerr << "| " << bl << endl;
// }
// }
}
const SweepLine::LayerSet& SweepLine::getCutConnexLayers ( const BasicLayer* cutLayer ) const
{
static LayerSet emptySet;
auto iCutMap = _connexityMap.find( cutLayer );
if (iCutMap == _connexityMap.end())
return emptySet;
return iCutMap->second;
}
void SweepLine::run ()
{
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
//DebugSession::open( 160, 169 );
cdebug_log(160,1) << "SweepLine::run()" << endl;
loadTiles();
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
//bool debugOn = false;
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
//bool written = false;
size_t processedTiles = 0;
for ( Element& element : _tiles ) {
processedTiles++;
if (tty::enabled()) {
cmess2 << " <tile:" << tty::bold << right << setw(10) << setfill('0')
<< processedTiles << tty::reset
<< " remains:" << right << setw(10) << setfill('0')
<< (_tiles.size() - processedTiles)
<< setfill(' ') << tty::reset << ">" << tty::cr;
cmess2.flush ();
}
Tile* tile = element.getTile();
TileIntv tileIntv ( tile, tile->getYMin(), tile->getYMax() );
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
// if (tile->getOccurrence().getEntity()->getId() == 3348) {
// DebugSession::open( 160, 169 );
// }
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
// if (getString(tile->getNet()->getName()) == "a(13)") {
// cerr << tile << endl;
// }
// if (not debugOn and (element.getX() == DbU::fromLambda(1724.0))) {
// debugOn = true;
// DebugSession::open( 0, 169 );
// }
// if (debugOn and (element.getX() > DbU::fromLambda(1726.0))) {
// debugOn = false;
// DebugSession::close();
// }
cdebug_log(160,1) << "X@ + " << DbU::getValueString(element.getX()) << " " << tile << endl;
auto intvTree = _intervalTrees.find( element.getMask() );
if (intvTree == _intervalTrees.end()) {
cerr << Error( "SweepLine::run(): Missing interval tree for layer(mask) %s."
" (for tile: %s)"
, getString(element.getMask()).c_str()
, getString(element.getTile()).c_str()
) << endl;
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
cdebug_tabw(160,-1);
continue;
}
if (element.isLeftEdge()) {
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
// if (tile->getOccurrence().getEntity()->getId() == 3348) {
// //if (not written) intvTree->second.write( "tree-before.gv" );
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
// cdebug_log(160,0) << " Interval tree *before* insertion." << endl;
// for ( auto elt : intvTree->second.getElements() ) {
// cdebug_log(160,0) << " | in tree:" << elt << endl;
// if (elt.getData()->getBoundingBox().getXMax() < tile->getLeftEdge())
// cdebug_log(160,0) << " * Should have been removed !" << endl;
// }
// }
for ( const TileIntv& overlap : intvTree->second.getOverlaps(
Interval(tile->getYMin(), tile->getYMax() ))) {
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
cdebug_log(160,0) << " | intersect " << overlap.getData() << endl;
tile->merge( overlap.getData() );
}
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
cdebug_log(160,0) << " | insert tile" << endl;
// if (tile->getId() == 60117) {
// cerr << " | insert in " << element.getMask() << endl;
// cerr << " | " << tile << endl;
// }
// if (tile->getId() == 46373) {
// cerr << " | insert " << tile << endl;
// }
intvTree->second.insert( tileIntv );
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
if (tile->getOccurrence().getEntity()->getId() == 3348) {
//if (not written) intvTree->second.write( "tree-after.gv" );
//written = true;
}
} else {
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
// if (tile->getId() == 289) {
// DebugSession::open( 0, 169 );
// }
// cdebug_log(160,0) << " | remove tile from " << element.getMask() << endl;
// cdebug_log(160,0) << " | " << tile << endl;
// if ((tile->getId() == 289) and not written) {
// cerr << "(before) written is " << written << endl;
// DebugSession::open( 0, 169 );
// intvTree->second.write( "tree-before.gv" );
// //DebugSession::close();
// for ( auto elt : intvTree->second.getElements() ) {
// cerr << " | in tree:" << elt << endl;
// }
// }
cdebug_log(160,0) << " | remove tile" << endl;
intvTree->second.remove( tileIntv );
Full transhierarchical implementation done. * New: Equipotential elements includes now: 1. Components at the top level (the cell owning the Equi). 2. Nets at the top level. If an equi include all the components of a Net, own the Net, not all it's individual components. 3. Other equipotentials from the Instances immediatey below. Thoses equis should be equivalents to the Plug of the Net. They are stored in the form of Occurrences <Instance,Equi>, the relation is stored on that Occurrence. * New: Equipotential::getFlatComponents(), a collection to recursively get all the *component* occurrences of the equi. Transhierarchically. Go through components, nets components, and recursively through the child equis. * New: EquipotentialRelation, the master of this relation is the Equipotential and the slaves, all its elements. * Change: In Tile, in case the tile is build on a deep component, we trace up the Equipotential it belongs to in the Instance level immediately belonging to the Cell under extraction. They must exists as we extract from bottom to top all the master cells. So we have, for that tile an Occurrence <Instance,Equi> that we can store in the current Equi level. * Change/Bug: In Tile, add an Id to be reliably sort the tiles in the IntervalTree. As we replaced the tile component occurrence by a <Instance,Equi> we were having multiple tiles with the same equi. This was causing havoc again in the IntervalTree. Should add a check in the RbTree for elements with the exact same key, but that would imply passing a new template parameter for the "equal" function.
2023-04-13 07:00:50 -05:00
// DebugSession::open( 0, 169 );
// intvTree->second.checkVMax();
// DebugSession::close();
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
// if ((tile->getId() == 289) and not written) {
// //DebugSession::open( 0, 169 );
// written = true;
// cerr << "(after) written is " << written << endl;
// intvTree->second.write( "tree-after.gv" );
// DebugSession::close();
// }
// if (intvTree->second.find( tileIntv ) != intvTree->second.end()) {
// cerr << "NOT Removed " << tileIntv << endl;
// }
// if (tile->getId() == 289) {
// cerr << " | removed " << tile << endl;
// intvTree->second.write( "tree.gv" );
// for ( auto elt : intvTree->second.getElements() ) {
// cerr << " | in tree:" << elt << endl;
// }
// DebugSession::close();
// }
// if (tile->getId() == 46055) {
// intvTree->second.write( "we_at_remove.gv" );
// for ( auto tile : intvTree->second.getElements() ) {
// cerr << "| in tree:" << tile << endl;
// }
// }
}
Full transhierarchical implementation done. * New: Equipotential elements includes now: 1. Components at the top level (the cell owning the Equi). 2. Nets at the top level. If an equi include all the components of a Net, own the Net, not all it's individual components. 3. Other equipotentials from the Instances immediatey below. Thoses equis should be equivalents to the Plug of the Net. They are stored in the form of Occurrences <Instance,Equi>, the relation is stored on that Occurrence. * New: Equipotential::getFlatComponents(), a collection to recursively get all the *component* occurrences of the equi. Transhierarchically. Go through components, nets components, and recursively through the child equis. * New: EquipotentialRelation, the master of this relation is the Equipotential and the slaves, all its elements. * Change: In Tile, in case the tile is build on a deep component, we trace up the Equipotential it belongs to in the Instance level immediately belonging to the Cell under extraction. They must exists as we extract from bottom to top all the master cells. So we have, for that tile an Occurrence <Instance,Equi> that we can store in the current Equi level. * Change/Bug: In Tile, add an Id to be reliably sort the tiles in the IntervalTree. As we replaced the tile component occurrence by a <Instance,Equi> we were having multiple tiles with the same equi. This was causing havoc again in the IntervalTree. Should add a check in the RbTree for elements with the exact same key, but that would imply passing a new template parameter for the "equal" function.
2023-04-13 07:00:50 -05:00
//intvTree->second.checkVMax();
Add Rectilinear & "cut" support to the extractor. Note about the managment of VIA & cuts: Components using a layer which is a ViaLayer, that is one containing more than one BasicLayer, multiple tiles are created in QueryTiles::goCallback(). Components that have a single BasicLayer of "cut" material will also have their multiples tiles created in QueryTiles::goCallback(). Rectilinear components will have their multiples tiles created in Tile::create(). Tile::create() return not all the tiles but the one used as root (for the union find). * New: In SweepLine::_buildCutConnexMap(), when using a "cut" layer in a standalone way, and not as part of a ViaLayer, we do not automatically know to which layer above & below they are connected. We build a table for each cut layer, based on the ViaLayer, to know all tops & belows layers they connect (this is cumulative, in the case of "cut" towards the substrate). Then in Tile::create(), we not only create the tile for the "cut" but also in thoses connected layers (and link them in the union find). * New: In Tile::create(), when we encounter a Rectilinear, break it into rectangles and make as many tiles. All tiles linked to the same root in the union find. * Bug: In Hurricane::Rectilinear, ambiguous specification of the set of points defining the shape. I did suppose that the start and and point where not the same the last edge being between them. But if FlexLib, it uses the GDSII inspired convention where the first and last point must be the same, to indicate a closed contour. This difference was not causing any difference with the drawing, but it was a problem for getAsRectangle(). This was creating a "false" extra vertical edge leading to a bigger rectangle. And this, in turn, was making "false" intersections in the tiling/sweepline of the extractor. Add a more thorough checking of the points vector.
2023-05-05 09:22:51 -05:00
// cdebug_tabw(160,-1);
// if (tile->getOccurrence().getEntity()->getId() == 3348) {
// DebugSession::close();
// }
cdebug_tabw(160,-1);
}
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
//if (debugOn) DebugSession::close();
cdebug_tabw(160,-1);
//DebugSession::close();
mergeEquipotentials();
deleteTiles();
}
void SweepLine::loadTiles ()
{
//cerr << "SweepLine::loadTiles()" << endl;
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
for ( const BasicLayer* layer : _extracteds ) {
_intervalTrees.insert( make_pair( layer->getMask(), TileIntvTree() ));
}
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
QueryTiles query ( this );
for ( const BasicLayer* layer : _extracteds ) {
query.setBasicLayer( layer );
query.doQuery();
}
cmess2 << " - Loaded " << _tiles.size() << " tiles (from "
<< query.getGoMatchCount() << " gos)." << endl;
Transhierarchical/flat extraction work, no netlist rebuild yet. * Bug: In Interval::intersect(), bad condition check in strict mode. * Change: In Occurrence::operator<(), change the sorting criterions so that the ones with no paths are "lower", then the one with no entities, then compare entities Id then Path hashes. * Change: In Occurrence::getCompactString(), to be more readable, suppress leading and ending "<>". * Change: In IntervalTree, now use an IntervalDataCompare to control the ordering of the nodes inside the tree. This may be needed when IntervalData is build upon a pointer, we don't want to sort on pointer values (non deterministic) . * Bug: In IntervalTree::postRemove(), there was an incorrect computation of the updated childsVMax. * Bug: In IntervalTree::beginOverlaps(), miscalculated leftmost interval overlapping. * Bug: In RbTree::remove(), when exchanging the removed node for a leaf, fully swap the nodes contents, was incompletly copied before. * New: In CellWidget, add new slots selectSet(OccurrenceSet&) and unselectSet(OccurrenceSet&), to be able to select/unselected sets of Occurrence (for use by TabEquipotentials). * Change: In EtesianEngine, no more need to remove leading/ending "<>". * New: In Tramontana, use a Query to find all the Occurrence under an area. Previously we were using Cell::getOccurrencesUnder() which *do not* return the components in instances, so we would have been unable to find trans-hierarchical shorts circuits. * New: In tramontana, now use a Relation to tag all the components belonging to an Equipotential. * Change: In Equipotential, store everything under the form of Occurrence, instead of Components. Due to the way the Occurrences are sorted, the one holding Components should be firts.
2023-04-02 16:02:46 -05:00
// for ( Occurrence occurrence : getCell()->getOccurrencesUnder( getCell()->getBoundingBox() ) ) {
// vector<Tile*> tiles;
// Component* component = dynamic_cast<Component*>( occurrence.getEntity() );
// if (occurrence.getPath().getInstances().getSize() > 0) {
// cerr << occurrence << endl;
// }
// if (not component) continue;
// for ( const BasicLayer* layer : extracteds ) {
// if (not component->getLayer()->getMask().intersect(layer->getMask())) continue;
// tiles.push_back( Tile::create( occurrence, layer ));
// _tiles.push_back( Element( tiles.back(), Tile::LeftEdge ) );
// _tiles.push_back( Element( tiles.back(), Tile::RightEdge ) );
// if (tiles.size() > 1)
// tiles.back()->setParent( tiles[0] );
// }
// tiles.clear();
// }
sort( _tiles.begin(), _tiles.end() );
}
void SweepLine::deleteTiles ()
{
Tile::deleteAllTiles();
}
void SweepLine::mergeEquipotentials ()
{
Full transhierarchical implementation done. * New: Equipotential elements includes now: 1. Components at the top level (the cell owning the Equi). 2. Nets at the top level. If an equi include all the components of a Net, own the Net, not all it's individual components. 3. Other equipotentials from the Instances immediatey below. Thoses equis should be equivalents to the Plug of the Net. They are stored in the form of Occurrences <Instance,Equi>, the relation is stored on that Occurrence. * New: Equipotential::getFlatComponents(), a collection to recursively get all the *component* occurrences of the equi. Transhierarchically. Go through components, nets components, and recursively through the child equis. * New: EquipotentialRelation, the master of this relation is the Equipotential and the slaves, all its elements. * Change: In Tile, in case the tile is build on a deep component, we trace up the Equipotential it belongs to in the Instance level immediately belonging to the Cell under extraction. They must exists as we extract from bottom to top all the master cells. So we have, for that tile an Occurrence <Instance,Equi> that we can store in the current Equi level. * Change/Bug: In Tile, add an Id to be reliably sort the tiles in the IntervalTree. As we replaced the tile component occurrence by a <Instance,Equi> we were having multiple tiles with the same equi. This was causing havoc again in the IntervalTree. Should add a check in the RbTree for elements with the exact same key, but that would imply passing a new template parameter for the "equal" function.
2023-04-13 07:00:50 -05:00
//DebugSession::open( 160, 169 );
cdebug_log(160,1) << "SweepLine::mergeEquipotentials()" << endl;
//cerr << "SweepLine::mergeEquipotentials()" << endl;
Tile::timeTick();
for ( Tile* tile : Tile::getAllTiles() ) {
tile->getRoot( Tile::MergeEqui|Tile::MakeLeafEqui );
}
Full transhierarchical implementation done. * New: Equipotential elements includes now: 1. Components at the top level (the cell owning the Equi). 2. Nets at the top level. If an equi include all the components of a Net, own the Net, not all it's individual components. 3. Other equipotentials from the Instances immediatey below. Thoses equis should be equivalents to the Plug of the Net. They are stored in the form of Occurrences <Instance,Equi>, the relation is stored on that Occurrence. * New: Equipotential::getFlatComponents(), a collection to recursively get all the *component* occurrences of the equi. Transhierarchically. Go through components, nets components, and recursively through the child equis. * New: EquipotentialRelation, the master of this relation is the Equipotential and the slaves, all its elements. * Change: In Tile, in case the tile is build on a deep component, we trace up the Equipotential it belongs to in the Instance level immediately belonging to the Cell under extraction. They must exists as we extract from bottom to top all the master cells. So we have, for that tile an Occurrence <Instance,Equi> that we can store in the current Equi level. * Change/Bug: In Tile, add an Id to be reliably sort the tiles in the IntervalTree. As we replaced the tile component occurrence by a <Instance,Equi> we were having multiple tiles with the same equi. This was causing havoc again in the IntervalTree. Should add a check in the RbTree for elements with the exact same key, but that would imply passing a new template parameter for the "equal" function.
2023-04-13 07:00:50 -05:00
cdebug_tabw(160,-1);
//DebugSession::close();
}
string SweepLine::_getTypeName () const
{ return "Tramontana::SweepLine"; }
string SweepLine::_getString () const
{
ostringstream os;
os << "<SweepLine \"" << _tramontana->getCell()->getName() << "\">";
return os.str();
}
Record* SweepLine::_getRecord () const
{
Record* record = new Record ( _getString() );
if (record) {
record->add( getSlot( "_tramontana" , &_tramontana ) );
record->add( getSlot( "_tiles" , &_tiles ) );
}
return record;
}
} // Tramontana namespace.