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

82 lines
2.4 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 -*-
5. Make a script runnable through |cgt|
=======================================
To use your script you may run it directly like any other |Python| script.
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
But, for debugging purpose it may be helpful to run it through the
interactive layout viewer |cgt|.
For |cgt| to be able to run your script, you must add to your script
file a function named :cb:`ScriptMain()`, which takes a dictionary
as sole argument (:cb:`**kw`). The ``kw`` dictionary contains, in
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
particular, the CellViewer_ object we are running under with the
keyword ``editor``. You can then load your cell into the viewer
using the menu:
* :fboxtt:`Tools` |rightarrow| :fboxtt:`Python Script`. The script
file name must be given without the ``.py`` extension.
.. note:: If you use breakpoints and want to see the progress of your
script in the viewer, do not use the ``--script`` option of
|cgt|.
.. code-block:: console
ego@home:~> cgt -V --script=invertor
Because the script is run **before** the viewer is launched,
you will only see the end result of your script.
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
def buildInvertor ( editor ):
UpdateSession.open()
cell = AllianceFramework.get().createCell( 'invertor' )
cell.setTerminal( True )
cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) )
if editor:
UpdateSession.close()
editor.setCell( cell )
editor.fit()
UpdateSession.open()
# The rest of the script...
return
def ScriptMain ( **kw ):
editor = None
if kw.has_key('editor') and kw['editor']:
editor = kw['editor']
buildInvertor( editor )
return True
5.1 Using Breakpoints
~~~~~~~~~~~~~~~~~~~~~
It is possible to add breakpoints inside a script by calling the ``Breakpoint.stop()``
function. To be able to see exactly what has just been mofied, we must close 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
UpdateSession_ just before calling the breakpoint and reopen it just after.
The ``Breakpoint.stop()`` function takes two arguments:
#. The ``level`` above which it will be active.
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
#. An informative message about the purpose of the breakpoint.
We can create a little function to ease the work:
.. code-block:: Python
def doBreak ( level, message ):
UpdateSession.close()
Breakpoint.stop( level, message )
UpdateSession.open()