coriolis/documentation/content/pages/python-tutorial/Collections.rst

94 lines
2.7 KiB
ReStructuredText
Raw Normal View History

Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
.. -*- Mode: rst -*-
.. include:: ../etc/definitions.rst
.. include:: ./definitions.rst
.. _2.1 The Alliance Framework: ./CellNetComponent.html#the-allianceframework-crl-core
4. Manipulating Cells, Nets and Components
==========================================
In this part, we will show how to navigate through the Nets_ and Components_ of a Cell_.
Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
4.1 Hurricane Collections
~~~~~~~~~~~~~~~~~~~~~~~~~
In |Hurricane| all kind of set of objects, whether organized in a real container
like a ``map<>`` (dictionary / ``dict``) or a ``vector<>`` (table / ``list``) or
an algorithmic walkthrough of the database can be accessed through a Collection_.
C++ Collections objects are exposed in |Python| through the *iterable* protocol,
Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
allowing to simply write:
.. code-block:: Python
for net in cell.getNets():
print 'Components of', net
for component in net.getComponents():
print '|', component
In C++ we would have written:
.. code-block:: C++
for ( Net* net : cell->getNets() ) {
cout << "Components of " << net << endl;
for ( Component* component : net->getComponents() ) {
cout << "| " << component << endl,
}
}
4.1.1 Restrictions about using Collections
------------------------------------------
**Never delete or create an element while you are iterating over a Collection.**
Results can be unpredictable, you may just end up with a core dump, but more
subtly, some element of the Collection_ may be skipped or processed twice.
If you want to create or delete an element, do it outside the collection
Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
loop. For example:
.. code-block:: Python
cellNets = []
for net in cell.getNets():
cellNets.append( net )
# Remove all the anonymous nets.
for net in cellNets:
if net.getName().endswith('nymous_'):
print 'Destroy', net
net.destroy()
4.2 Loading a Cell with AllianceFramework
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As presented in `2.1 The Alliance Framework`_, the Cell_ that will be returned by
the ``getCell()`` call wil be:
#. If a Cell_ of that name is already loaded into memory, it will be returned.
.. note:: It means that it shadows any modifications that could have been on
disk since it was first loaded. Conversely, if the Cell_ has been
modified in memory, you will get those modifications.
#. Search, in the ordered list of libraries, the first Cell_ that matches the
Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
requested name.
.. note:: It means that if cells with the same name exist in different
Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
libraries, only the one in the first library will be ever used.
Be also aware that cell files that may remain in the ``WORK_LIB``,
may unexpectedly shadow cells from the libraries.
Validating channel routing mode (two metals) on SNX. * New: In Hurricane::Entity, add an id counter limit and a memory size limit. The two limits are checked only when a new Entity object is created. This should help avoiding massive memory links. * New: In CRL Core, add a "crlcore.groundName" and a "crlcore.powerName" parameter to specify the name of the ground/power signals to be created if they are missing in a Cell. For Alliance libraries it would be "vss" & "vdd" (default values), but for real technologies, it is often "gnd!" & "vdd!". The Blif parser is modificated to make use of it. * Bug: In AnabaticEngine::unify(), set the resulting unified segment in the center of the GCells common side. Gcells under a segment are found by using the edge that cover the segment axis. When we have a "bend" GCell stack and the axis is wrong, they could be ommited. This was causing deleted segments to be not removed from some Edges, then core dump. * Change: In Anabatic::AutoSegment::create(), smarter choosing of the reference contact, select the fixed or terminal one instead of always the source one. * New: In Anabatic::Edge::isEnding(), new function to check if a segment going through an Edge is starting/ending in either source or target GCell of the edge (active only when running in channel mode). * New: In Anabatic::Edge::add(), a segment takes part in the occupancy only if it is not ending in either source or target (channel mode only). The occupancy due to terminal is pre-computed in Katana. * New: In Anabatic::Edge::ripup(), in channel mode, never ripup a segment which is ending in either source or target (we *have* to access this edge to connect to the terminal). * Bug: In Anabatic::GCell::hcut() and vcut(), force the update of the Edge which is on the side that will get splitted by the cut. It's capacity will be reduced to it must be updated. * Change: In Anabatic::GCell::updateGContacts() add a flag to conditionnally update horizontals or verticals only. We may require only a partial update when resizing the GCell in only one direction. This, again, related to the fact that we compute the GCells under a segment thanks to it's axis position, so we need to be very careful when modificating axis. * Change: In Katana::Block::resizeChannels(), only update GContact vertical position. Do not disturb X positions of segments. * Bug: In Katana::GlobalRoute::DigitalDistance, in channel mode, some Edges can have a zero capacity, but still be reachable if the net has a terminal in either source or target. Look for this case and return a distance of zero instead of "unreachable". This was causing the global routing not to complete in channel mode. For computing the edge distance, makes the vertical edges much more long (10 times) than the horizontal ones as the vertical capacity is very limited. Hard coded for now, should make it a parameter in the future. * Change: In KatanaEngine::annotateGlobalGraph(), decrease the capacity of edges with reserveCapacity for each terminal inside a GCell. Both north and south edges are decreased as we a terminal will block both north and south edges. As a counterpart, the Edge capacity is not decreased when the global router connect to a terminal. * Change: In Katana::RoutingEvent::revalidate(), when in repair stage, do not expand the slack for horizontal segments in channel mode. So they may not overlap the standard cell row. * Bug: In Stratus documentation, do not use the french option in babel, the documentation is in english! * New: In Documentation, added Hurricane/Python tutorial, part for drawing layout.
2018-03-16 10:20:04 -05:00
.. code-block:: Python
cell = af.getCell( 'inv_x1', Catalog.State.Views )