Support for full Database clear & restart.

* New: In CRL/etc/node600/phenitec, ported configuration of Phenitec 0.6um
    Compliant with DataBase reset.
* New: In CRL/python/helpers, added function "unloadUserSettings()" to
    unload Python modules prior to a full reset.
      Added "resetCoriolis()" to perform full DataBase reset.
* Change: In CRL::AllianceFramework, make it a derived class of DBo so
    the destroy() is now provided.
* Bug: In CRL::AllianceFramework::getCell(), do not attempt any load if
    the library list is empty. Should never occur except in case of a
    botched databse reset.
* New: In CRL::AllianceFramework, new method "saveCATAL()" to write back
    the catalog of a library and "saveCells()" to write back the cells.
      Note: only cells actually loaded in memory will be write back.
* New: In CRL::Catalog, add method "saveToFile()" to write back the CATAL
    of a library.
* Change: In CRL::ParserDriver, replace "const string&" by "string"
    (improved string support of the GNU STL).
* Change: In CRL::ParserSlot, use string instead of Name.
* Change: In CRL::ApParser, make _layerInformation an ordinary attribute
    instead of a static one. This allow for it's correct resetting
    across databas resets.
* Change: In CRL::VstParserGrammar, reinitialize Vst::framework at each
    parser call. Needed to support database reset.

* New: In Hurricane::DBo, add an object counter to be sure that when
    we perform a reset, no remaining DBo is allocated. This is different
    of the object id which is ever increasing.
      Note that, at reset, we check against "1" remaining element as at
    this point only Database is still allocated.
      Add a new "resetId()" method. MUST NEVER BE CALLED except by
    DataBase::_preDestroy().
* New: In Hurricane::Database, new clear() method to remove the Cells
    of all the libraries in reverse hierarchical depth order.
    Make use of the new CellsSort class.
* Change: In Hurricane::DataBase::_preDestroy(), call "clear()" and
    DBo::resetId().
* Change: In Hurricane::Breakpoint, change the default callback to be
    a static function. So we can restore it later.
* Bug: In Hurricane::Instance::_preDestroy(), there was yet another
    loop of deletion over a collection for the shared pathes.
      Replace it by the repetitive deletion of the first element.
* Bug: In Hurricane::Net::_preDestroy(), RoutingPads must be destroyed
    prior to any other component.
* New: In Hurricane::ColorScale, add a "qtFree()" method for freeing
    the Qt Brush, Pen & Color.
* New: In Hurricane::DrawingStyle, add a "qtFree()" method for freeing
    the Qt Brush, Pen & Color.
* New: In Hurricane::Graphics, add a "disable()" method to call the
    various "qtFree()" of the sub-objects.
This commit is contained in:
Jean-Paul Chaput 2020-02-29 16:55:14 +01:00
parent eab4a4aa7f
commit 757b95343b
56 changed files with 1668 additions and 419 deletions

View File

@ -5,4 +5,5 @@
install( DIRECTORY 180 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY 180 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
install( DIRECTORY 45 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY 45 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
install( DIRECTORY node180 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY node180 DESTINATION ${SYS_CONF_DIR}/coriolis2 )
install( DIRECTORY node600 DESTINATION ${SYS_CONF_DIR}/coriolis2 )

View File

View File

@ -0,0 +1,40 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/__init__.py" |
# +-----------------------------------------------------------------+
import Cfg
import helpers.io
helpers.io.vprint( 1, ' o Loading "node600/phenitec" technology.' )
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from Hurricane import DataBase
from CRL import System
Cfg.Configuration.pushDefaultPriority( Cfg.Parameter.Priority.ConfigurationFile )
if not DataBase.getDB(): DataBase.create()
System.get()
import node600.phenitec.misc
import node600.phenitec.technology
import node600.phenitec.display
import node600.phenitec.analog
import node600.phenitec.alliance
import node600.phenitec.etesian
import node600.phenitec.kite
import node600.phenitec.plugins
import node600.phenitec.stratus1
import node600.phenitec.devices
Cfg.Configuration.popDefaultPriority()

View File

@ -0,0 +1,59 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/alliance.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import os
import os.path
from CRL import Environment
from CRL import AllianceFramework
allianceTop = None
if os.environ.has_key('ALLIANCE_TOP'):
allianceTop = os.environ['ALLIANCE_TOP']
if not os.path.isdir(allianceTop):
allianceTop = None
if not allianceTop: allianceTop = '/soc/alliance'
cellsTop = None
if os.environ.has_key('CELLS_TOP'):
cellsTop = os.environ['CELLS_TOP']
if not os.path.isdir(cellsTop):
cellsTop = None
if not cellsTop:
cellsTop = allianceTop+'/cells'
af = AllianceFramework.get()
env = af.getEnvironment()
env.setSCALE_X ( 100 )
env.setCATALOG ( 'CATAL' )
env.setIN_LO ( 'vst' )
env.setIN_PH ( 'ap' )
env.setOUT_LO ( 'vst' )
env.setOUT_PH ( 'ap' )
env.setPOWER ( 'vdd' )
env.setGROUND ( 'vss' )
env.setCLOCK ( '.*ck.*|.*nck.*' )
env.setBLOCKAGE ( 'blockage[Nn]et.*' )
env.setPad ( '.*_sp$' )
env.setWORKING_LIBRARY( '.' )
env.addSYSTEM_LIBRARY ( library=cellsTop+'/nsxlib' , mode=Environment.Append )
env.addSYSTEM_LIBRARY ( library=cellsTop+'/phlib80', mode=Environment.Append )

View File

@ -0,0 +1,19 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/analog.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
#import common.analog

View File

@ -0,0 +1,138 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./node600/phenitec/devices.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.devices
from common.devices import addDevice
chamsDir = helpers.sysConfDir + '/share/coriolis2/'
spiceDir = chamsDir + 'spice/'
addDevice( name = 'DifferentialPairBulkConnected'
, spice = spiceDir+'DiffPairBulkConnected.spi'
, connectors = ( 'D1', 'D2', 'G1', 'G2', 'S' )
, layouts = ( ('Horizontal M2' , 'DP_horizontalM2.py' )
, ('Symmetrical' , 'DP_symmetrical.py' )
, ('Common centroid', 'DP_2DCommonCentroid.py')
, ('Interdigitated' , 'DP_interdigitated.py' )
, ('WIP DP' , 'WIP_DP.py' )
)
)
addDevice( name = 'DifferentialPairBulkUnconnected'
, spice = spiceDir+'DiffPairBulkUnconnected.spi'
, connectors = ( 'D1', 'D2', 'G1', 'G2', 'S', 'B' )
, layouts = ( ('Horizontal M2' , 'DP_horizontalM2.py' )
, ('Symmetrical' , 'DP_symmetrical.py' )
, ('Common centroid', 'DP_2DCommonCentroid.py')
, ('Interdigitated' , 'DP_interdigitated.py' )
, ('WIP DP' , 'WIP_DP.py' )
)
)
addDevice( name = 'LevelShifterBulkUnconnected'
, spice = spiceDir+'LevelShifterBulkUnconnected.spi'
, connectors = ( 'D1', 'D2', 'S1', 'S2', 'B' )
, layouts = ( ('Horizontal M2' , 'LS_horizontalM2.py' )
, ('Symmetrical' , 'LS_symmetrical.py' )
, ('Common centroid', 'LS_2DCommonCentroid.py')
, ('Interdigitated' , 'LS_interdigitated.py' )
)
)
addDevice( name = 'TransistorBulkConnected'
, spice = spiceDir+'TransistorBulkConnected.spi'
, connectors = ( 'D', 'G', 'S' )
, layouts = ( ('Rotate transistor', 'Transistor_rotate.py')
, ('Common transistor', 'Transistor_common.py')
, ('WIP Transistor' , 'WIP_Transistor.py' )
)
)
addDevice( name = 'TransistorBulkUnconnected'
, spice = spiceDir+'TransistorBulkUnconnected.spi'
, connectors = ( 'D', 'G', 'S', 'B' )
, layouts = ( ('Rotate transistor', 'Transistor_rotate.py')
, ('Common transistor', 'Transistor_common.py')
, ('WIP Transistor' , 'WIP_Transistor.py' )
)
)
addDevice( name = 'CrossCoupledPairBulkConnected'
, spice = spiceDir+'CCPairBulkConnected.spi'
, connectors = ( 'D1', 'D2', 'S' )
, layouts = ( ('Horizontal M2' , 'CCP_horizontalM2.py' )
, ('Symmetrical' , 'CCP_symmetrical.py' )
, ('Common centroid', 'CCP_2DCommonCentroid.py')
, ('Interdigitated' , 'CCP_interdigitated.py' )
)
)
addDevice( name = 'CrossCoupledPairBulkUnconnected'
, spice = spiceDir+'CCPairBulkUnconnected.spi'
, connectors = ( 'D1', 'D2', 'S', 'B' )
, layouts = ( ('Horizontal M2' , 'CCP_horizontalM2.py' )
, ('Symmetrical' , 'CCP_symmetrical.py' )
, ('Common centroid', 'CCP_2DCommonCentroid.py')
, ('Interdigitated' , 'CCP_interdigitated.py' )
)
)
addDevice( name = 'CommonSourcePairBulkConnected'
, spice = spiceDir+'CommonSourcePairBulkConnected.spi'
, connectors = ( 'D1', 'D2', 'S', 'G' )
, layouts = ( ('Horizontal M2' , 'CSP_horizontalM2.py' )
, ('Symmetrical' , 'CSP_symmetrical.py' )
, ('Interdigitated' , 'CSP_interdigitated.py' )
, ('WIP CSP' , 'WIP_CSP.py' )
)
)
addDevice( name = 'CommonSourcePairBulkUnconnected'
, spice = spiceDir+'CommonSourcePairBulkUnconnected.spi'
, connectors = ( 'D1', 'D2', 'S', 'G', 'B' )
, layouts = ( ('Horizontal M2' , 'CSP_horizontalM2.py' )
, ('Symmetrical' , 'CSP_symmetrical.py' )
, ('Interdigitated' , 'CSP_interdigitated.py' )
, ('WIP CSP' , 'WIP_CSP.py' )
)
)
addDevice( name = 'SimpleCurrentMirrorBulkConnected'
, spice = spiceDir+'CurrMirBulkConnected.spi'
, connectors = ( 'D1', 'D2', 'S' )
, layouts = ( ('Horizontal M2' , 'SCM_horizontalM2.py' )
, ('Symmetrical' , 'SCM_symmetrical.py' )
, ('Common centroid', 'SCM_2DCommonCentroid.py')
, ('Interdigitated' , 'SCM_interdigitated.py' )
)
)
addDevice( name = 'SimpleCurrentMirrorBulkUnconnected'
, spice = spiceDir+'CurrMirBulkUnconnected.spi'
, connectors = ( 'D1', 'D2', 'S', 'B' )
, layouts = ( ('Horizontal M2' , 'SCM_horizontalM2.py' )
, ('Symmetrical' , 'SCM_symmetrical.py' )
, ('Common centroid', 'SCM_2DCommonCentroid.py')
, ('Interdigitated' , 'SCM_interdigitated.py' )
)
)
addDevice( name = 'MultiCapacitor'
#, spice = spiceDir+'MIM_OneCapacitor.spi'
#, connectors = ( 'T1', 'B1' )
, layouts = ( ('Matrix', 'CapacitorMatrix.py' ),
)
)
addDevice( name = 'Resistor'
#, spice = spiceDir+'MIM_OneCapacitor.spi'
, connectors = ( 'PIN1', 'PIN2' )
, layouts = ( ('Snake', 'ResistorSnake.py' ),
)
)

View File

@ -0,0 +1,22 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/display.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.display
common.display.createStyles( scale=0.5 )

View File

@ -0,0 +1,19 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/etesian.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.etesian

View File

@ -0,0 +1,230 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/kite.py" |
# +-----------------------------------------------------------------+
import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from Hurricane import DataBase
from CRL import AllianceFramework
from CRL import RoutingGauge
from CRL import RoutingLayerGauge
from CRL import CellGauge
from helpers import l, n, u
import common.kite
p = Cfg.getParamDouble ( 'lefImport.minTerminalWidth' ).setDouble ( 0.0 )
p = Cfg.getParamString ( 'katabatic.routingGauge' ).setString ( 'nsxlib-3M' )
p = Cfg.getParamInt ( "katabatic.globalLengthThreshold" ).setInt ( 1450 )
p = Cfg.getParamPercentage( "katabatic.saturateRatio" ).setPercentage( 80 )
p = Cfg.getParamInt ( "katabatic.saturateRp" ).setInt ( 8 )
p = Cfg.getParamString ( 'katabatic.topRoutingLayer' ).setString ( 'METAL3' )
# Kite parameters.
p = Cfg.getParamInt( "kite.hTracksReservedLocal" ); p.setInt( 4 ); p.setMin( 0 ); p.setMax( 18 )
p = Cfg.getParamInt( "kite.vTracksReservedLocal" ); p.setInt( 3 ); p.setMin( 0 ); p.setMax( 18 )
p = Cfg.getParamInt( "kite.eventsLimit" ); p.setInt( 4000002 )
p = Cfg.getParamInt( "kite.ripupCost" ); p.setInt( 3 ); p.setMin( 0 )
p = Cfg.getParamInt( "kite.strapRipupLimit" ); p.setInt( 16 ); p.setMin( 1 )
p = Cfg.getParamInt( "kite.localRipupLimit" ); p.setInt( 9 ); p.setMin( 1 )
p = Cfg.getParamInt( "kite.globalRipupLimit" ); p.setInt( 5 ); p.setMin( 1 )
p = Cfg.getParamInt( "kite.longGlobalRipupLimit" ); p.setInt( 5 ); p.setMin( 1 )
# Anabatic & Katana parameters are temporarily hosted here.
p = Cfg.getParamString ( 'anabatic.routingGauge' ); p.setString ( 'nsxlib-3M' )
p = Cfg.getParamInt ( "anabatic.globalLengthThreshold" ); p.setInt ( 1450 )
p = Cfg.getParamPercentage( "anabatic.saturateRatio" ); p.setPercentage( 80 )
p = Cfg.getParamInt ( "anabatic.saturateRp" ); p.setInt ( 8 )
p = Cfg.getParamString ( 'anabatic.topRoutingLayer' ); p.setString ( 'METAL3' )
p = Cfg.getParamInt ( "anabatic.edgeLength" ); p.setInt ( 48 )
p = Cfg.getParamInt ( "anabatic.edgeWidth" ); p.setInt ( 8 )
p = Cfg.getParamDouble ( "anabatic.edgeCostH" ); p.setDouble ( 19.0 )
p = Cfg.getParamDouble ( "anabatic.edgeCostK" ); p.setDouble ( -60.0 )
p = Cfg.getParamDouble ( "anabatic.edgeHInc" ); p.setDouble ( 1.0 )
p = Cfg.getParamDouble ( "anabatic.edgeHScaling" ); p.setDouble ( 1.0 )
p = Cfg.getParamInt ( "anabatic.globalIterations" ); p.setInt ( 20 ); p.setMin(1); p.setMax(100)
p = Cfg.getParamEnumerate ( "anabatic.gcell.displayMode" ); p.setInt ( 1 )
p.addValue( "Boundary", 1 )
p.addValue( "Density" , 2 )
p = Cfg.getParamInt ( "katana.hTracksReservedLocal" ); p.setInt ( 5 ); p.setMin(0); p.setMax(20)
p = Cfg.getParamInt ( "katana.vTracksReservedLocal" ); p.setInt ( 3 ); p.setMin(0); p.setMax(20)
p = Cfg.getParamInt ( "katana.termSatReservedLocal" ); p.setInt ( 5 )
p = Cfg.getParamInt ( "katana.termSatThreshold" ); p.setInt ( 11 )
p = Cfg.getParamInt ( "katana.eventsLimit" ); p.setInt ( 4000002 )
p = Cfg.getParamInt ( "katana.ripupCost" ); p.setInt ( 3 ); p.setMin(0)
p = Cfg.getParamInt ( "katana.strapRipupLimit" ); p.setInt ( 16 ); p.setMin(1)
p = Cfg.getParamInt ( "katana.localRipupLimit" ); p.setInt ( 9 ); p.setMin(1)
p = Cfg.getParamInt ( "katana.globalRipupLimit" ); p.setInt ( 5 ); p.setMin(1)
p = Cfg.getParamInt ( "katana.longGlobalRipupLimit" ); p.setInt ( 5 ); p.setMin(1)
p = Cfg.getParamString( 'chip.padCoreSide' ); p.setString( 'South' )
tech = DataBase.getDB().getTechnology()
af = AllianceFramework.get()
rg = RoutingGauge.create( 'nsxlib-4M' )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL1') # metal.
, RoutingLayerGauge.Vertical # preferred routing direction.
, RoutingLayerGauge.PinOnly # layer usage.
, 0 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(2) # VIA side (that is VIA12).
, l(7) # obstacle dW.
) )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL2') # metal.
, RoutingLayerGauge.Horizontal # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 1 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(2) # VIA side (that is VIA23).
, l(8) # obstacle dW.
) )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL3') # metal.
, RoutingLayerGauge.Vertical # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 2 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(2) # VIA side (that is VIA34).
, l(8) # obstacle dW.
) )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL4') # metal.
, RoutingLayerGauge.Horizontal # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 3 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(15) # track pitch.
, l(6) # wire width.
, l(4) # VIA side (that is VIA23).
, l(8) # obstacle dW.
) )
af.addRoutingGauge( rg )
rg = RoutingGauge.create( 'nsxlib-3M' )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL1') # metal.
, RoutingLayerGauge.Vertical # preferred routing direction.
, RoutingLayerGauge.PinOnly # layer usage.
, 0 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(2) # VIA side (that is VIA12).
, l(7) # obstacle dW.
) )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL2') # metal.
, RoutingLayerGauge.Horizontal # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 1 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(2) # VIA side (that is VIA23).
, l(8) # obstacle dW.
) )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL3') # metal.
, RoutingLayerGauge.Vertical # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 2 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(2) # VIA side (that is VIA34).
, l(8) # obstacle dW.
) )
af.addRoutingGauge( rg )
rg = RoutingGauge.create( 'nsxlib-2M' )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL1') # metal.
, RoutingLayerGauge.Horizontal # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 0 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(3) # VIA side (that is VIA12).
, l(7) # obstacle dW.
) )
rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL2') # metal.
, RoutingLayerGauge.Vertical # preferred routing direction.
, RoutingLayerGauge.Default # layer usage.
, 1 # depth.
, 0.0 # density (deprecated).
, l(0) # track offset from AB.
, l(10) # track pitch.
, l(3) # wire width.
, l(3) # VIA side (that is VIA23).
, l(8) # obstacle dW.
) )
af.addRoutingGauge( rg )
af.setRoutingGauge( 'nsxlib-3M' )
# Gauge for standard cells.
cg = CellGauge.create( 'nsxlib-4M'
, 'metal2' # pin layer name.
, l( 10.0) # pitch.
, l(100.0) # cell slice height.
, l( 10.0) # cell slice step.
)
af.addCellGauge( cg )
cg = CellGauge.create( 'nsxlib-3M'
, 'metal2' # pin layer name.
, l( 10.0) # pitch.
, l(100.0) # cell slice height.
, l( 10.0) # cell slice step.
)
af.addCellGauge( cg )
cg = CellGauge.create( 'nsxlib-2M'
, 'metal2' # pin layer name.
, l( 10.0) # pitch.
, l(100.0) # cell slice height.
, l( 10.0) # cell slice step.
)
af.addCellGauge( cg )
# Gauge for Alliance symbolic I/O pads.
cg = CellGauge.create( 'phlib80'
, 'metal2' # pin layer name.
, l( 10.0) # pitch.
, l(312.0) # cell slice height.
, l(246.0) # cell slice step.
)
af.addCellGauge( cg )

View File

@ -0,0 +1,19 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/misc.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.misc

View File

@ -0,0 +1,19 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/patterns.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.patterns

View File

@ -0,0 +1,29 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/plugins.py" |
# +-----------------------------------------------------------------+
import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from helpers import l, u, n
Cfg.getParamInt ( "chip.block.rails.count" ).setInt ( 5 )
Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) )
Cfg.getParamInt ( "chip.block.rails.vWidth" ).setInt ( l( 24) )
Cfg.getParamInt ( "chip.block.rails.hSpacing" ).setInt ( l( 12) )
Cfg.getParamInt ( "chip.block.rails.vSpacing" ).setInt ( l( 12) )
Cfg.getParamInt ( 'clockTree.minimumSide' ).setInt ( l(1200) )
Cfg.getParamString( 'clockTree.buffer' ).setString( 'buf_x2')
Cfg.getParamString( 'clockTree.placerEngine' ).setString( 'Etesian')

View File

@ -0,0 +1,24 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/stratus1.py" |
# +-----------------------------------------------------------------+
import Cfg
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
import common.stratus1
Cfg.getParamString( "stratus1.format" ).setString( "vst" )
Cfg.getParamString( "stratus1.simulator" ).setString( "asimut" )

View File

@ -0,0 +1,183 @@
# This file is part of the Coriolis Software.
# Copyright (c) UPMC 2019-2019, All Rights Reserved
#
# +-----------------------------------------------------------------+
# | C O R I O L I S |
# | Alliance / Hurricane Interface |
# | |
# | Author : Jean-Paul CHAPUT |
# | E-mail : Jean-Paul.Chaput@lip6.fr |
# | =============================================================== |
# | Python : "./etc/node600/phenitec/technology.py" |
# +-----------------------------------------------------------------+
import helpers.io
helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) )
from helpers import l, u, n
from Hurricane import DbU
from Hurricane import DataBase
from Hurricane import Technology
tech = DataBase.getDB().getTechnology()
if tech:
print WarningMessage( 'cmos.technology: Technology already exists, "%s"' % tech.getName() )
else:
tech = Technology.create( DataBase.getDB(), 'phenitec06' )
DbU.setPrecision ( 2 )
DbU.setPhysicalsPerGrid ( 0.002, DbU.UnitPowerMicro )
DbU.setGridsPerLambda ( 150 )
DbU.setSymbolicSnapGridStep( DbU.fromLambda( 1.0) )
DbU.setPolygonStep ( DbU.fromGrid ( 150.0) )
import common
from common.technology import *
# Redefine all size from the "cmos" common part.
NWELL.setExtentionCap( nWell, l(4.0) )
PWELL.setExtentionCap( pWell, l(4.0) )
NTIE.setMinimalSize ( l( 3.0) )
NTIE.setExtentionCap ( nWell , l( 3.0) )
NTIE.setExtentionWidth( nWell , l( 2.0) )
NTIE.setExtentionCap ( nImplant, l( 2.5) )
NTIE.setExtentionWidth( nImplant, l( 1.5) )
NTIE.setExtentionCap ( active , l( 0.5) )
NTIE.setExtentionWidth( active , l(-0.5) )
PTIE.setMinimalSize ( l( 3.0) )
PTIE.setExtentionCap ( nWell , l( 3.0) )
PTIE.setExtentionWidth( nWell , l( 2.0) )
PTIE.setExtentionCap ( nImplant, l( 2.5) )
PTIE.setExtentionWidth( nImplant, l( 1.5) )
PTIE.setExtentionCap ( active , l( 0.5) )
PTIE.setExtentionWidth( active , l(-0.5) )
NDIF.setMinimalSize ( l(3.0) )
NDIF.setExtentionCap ( nImplant, l(4.0) )
NDIF.setExtentionWidth( nImplant, l(2.0) )
NDIF.setExtentionCap ( active , l(2.0) )
NDIF.setExtentionWidth( active , l(0.0) )
PDIF.setMinimalSize ( l(3.0) )
PDIF.setExtentionCap ( pImplant, l(4.0) )
PDIF.setExtentionWidth( pImplant, l(2.0) )
PDIF.setExtentionCap ( active , l(2.0) )
PDIF.setExtentionWidth( active , l(0.0) )
GATE.setMinimalSize ( l(2.0) )
GATE.setExtentionCap ( poly , l(2.5) )
NTRANS.setMinimalSize ( l( 2.0) )
NTRANS.setExtentionCap ( nImplant, l( 2.0) )
NTRANS.setExtentionWidth( nImplant, l( 7.0) )
NTRANS.setExtentionCap ( active , l( 0.0) )
NTRANS.setExtentionWidth( active , l( 3.0) )
NTRANS.setExtentionCap ( poly , l( 3.0) )
NTRANS.setExtentionWidth( poly , l( 0.0) )
PTRANS.setMinimalSize ( l( 2.0) )
PTRANS.setExtentionCap ( nWell , l( 2.5) )
PTRANS.setExtentionWidth( nWell , l( 7.5) )
PTRANS.setExtentionCap ( pImplant, l( 2.0) )
PTRANS.setExtentionWidth( pImplant, l( 7.0) )
PTRANS.setExtentionCap ( active , l( 0.0) )
PTRANS.setExtentionWidth( active , l( 3.0) )
PTRANS.setExtentionCap ( poly , l( 3.0) )
PTRANS.setExtentionWidth( poly , l( 0.0) )
POLY .setMinimalSize ( l(2.0) )
POLY .setExtentionCap ( poly , l(1.0) )
POLY2.setMinimalSize ( l(2.0) )
POLY2.setExtentionCap ( poly , l(1.0) )
# Routing Layers (symbolic).
METAL1 .setMinimalSize ( l( 2.0) )
METAL1 .setExtentionCap ( metal1 , l( 2.0) )
METAL1 .setExtentionWidth( metal1 , l( 1.0) )
METAL1 .setMinimalSpacing( l( 6.0) )
METAL2 .setMinimalSize ( l( 4.0) )
METAL2 .setExtentionCap ( metal2 , l( 2.0) )
METAL2 .setMinimalSpacing( l( 6.0) )
METAL3 .setMinimalSize ( l( 4.0) )
METAL3 .setExtentionCap ( metal3 , l( 2.0) )
METAL3 .setMinimalSpacing( l( 6.0) )
METAL4 .setMinimalSize ( l( 4.0) )
METAL4 .setExtentionCap ( metal4 , l( 2.0) )
METAL4 .setMinimalSpacing( l( 6.0) )
# Contacts (i.e. Active <--> Metal) (symbolic).
CONT_BODY_N.setMinimalSize( l( 2.0) )
CONT_BODY_N.setEnclosure ( nWell , l( 4.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_N.setEnclosure ( nImplant, l( 3.5), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_N.setEnclosure ( active , l( 1.5), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_N.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_P.setMinimalSize( l( 2.0) )
CONT_BODY_P.setEnclosure ( pWell , l( 4.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_P.setEnclosure ( pImplant, l( 3.5), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_P.setEnclosure ( active , l( 1.5), Layer.EnclosureH|Layer.EnclosureV )
CONT_BODY_P.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_DIF_N.setMinimalSize( l( 2.0) )
CONT_DIF_N.setEnclosure ( nImplant, l( 4.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_DIF_N.setEnclosure ( active , l( 2.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_DIF_N.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_DIF_P.setMinimalSize( l( 2.0) )
CONT_DIF_P.setEnclosure ( pImplant, l( 4.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_DIF_P.setEnclosure ( active , l( 2.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_DIF_P.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_POLY.setMinimalSize( l( 2.0) )
CONT_POLY.setEnclosure ( poly , l( 2.0), Layer.EnclosureH|Layer.EnclosureV )
CONT_POLY.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
# VIAs (i.e. Metal <--> Metal) (symbolic).
VIA12 .setMinimalSize( l( 2.0) )
VIA12 .setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
VIA12 .setEnclosure ( metal2 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
VIA23 .setMinimalSize( l( 2.0) )
VIA23 .setEnclosure ( metal2 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
VIA23 .setEnclosure ( metal3 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
VIA34 .setMinimalSize( l( 2.0) )
VIA34 .setEnclosure ( metal3 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
VIA34 .setEnclosure ( metal4 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV )
# Blockages (symbolic).
BLOCKAGE1 .setMinimalSize ( l( 4.0) )
BLOCKAGE1 .setExtentionCap ( blockage1 , l( 2.0) )
BLOCKAGE1 .setExtentionWidth( blockage1 , l( 0.5) )
BLOCKAGE2 .setMinimalSize ( l( 4.0) )
BLOCKAGE2 .setExtentionCap ( blockage2 , l( 2.0) )
BLOCKAGE3 .setMinimalSize ( l( 4.0) )
BLOCKAGE3 .setExtentionCap ( blockage3 , l( 2.0) )
BLOCKAGE4 .setMinimalSize ( l( 4.0) )
BLOCKAGE4 .setExtentionCap ( blockage4 , l( 2.0) )
gdsLayersTable = \
[ ("pWell" , "CWN" , 41, 0)
, ("nWell" , "CWP" , 42, 0)
, ("active" , "CAA" , 43, 0)
, ("pImplant", "CSP" , 44, 0)
, ("nImplant", "CSN" , 45, 0)
, ("poly" , "CPG" , 46, 0)
, ("poly2" , "CM1" , 49, 0) # poly2 is in fact metal1.
, ("cut0" , "CCC" , 25, 0)
, ("metal1" , "CM1" , 49, 0)
, ("cut1" , "CV1" , 50, 0)
, ("metal2" , "CM2" , 51, 0)
, ("cut2" , "CV2" , 61, 0)
, ("metal3" , "CM3" , 62, 0)
, ("cut3" , "CV3" , 30, 0)
, ("metal4" , "CM4" , 31, 0)
]
common.loadGdsLayers( gdsLayersTable )

View File

@ -20,7 +20,7 @@ allianceConfig = \
( ( 'CATALOG' , 'CATAL') ( ( 'CATALOG' , 'CATAL')
, ( 'WORKING_LIBRARY' , '.') , ( 'WORKING_LIBRARY' , '.')
, ( 'SYSTEM_LIBRARY' , ( (cellsTop+'/nsxlib' , Environment.Append) , ( 'SYSTEM_LIBRARY' , ( (cellsTop+'/nsxlib' , Environment.Append)
, (cellsTop+'/mpxlib' , Environment.Append)) ) , (cellsTop+'/phlib80' , Environment.Append)) )
, ( 'SCALE_X' , 100) , ( 'SCALE_X' , 100)
, ( 'IN_LO' , 'vst') , ( 'IN_LO' , 'vst')
, ( 'IN_PH' , 'ap') , ( 'IN_PH' , 'ap')
@ -33,7 +33,7 @@ allianceConfig = \
, ( 'PAD' , '.*_sp$') , ( 'PAD' , '.*_sp$')
# The following are only read by the Alliance tool wrappers. # The following are only read by the Alliance tool wrappers.
, ( 'ALLIANCE_TOP' , allianceTop) , ( 'ALLIANCE_TOP' , allianceTop)
, ( 'MBK_TARGET_LIB' , cellsTop+'/msxlib') , ( 'MBK_TARGET_LIB' , cellsTop+'/nsxlib')
, ( 'RDS_TECHNO_NAME' , allianceTop+'/etc/scn6m_deep_09.rds') , ( 'RDS_TECHNO_NAME' , allianceTop+'/etc/scn6m_deep_09.rds')
, ( 'GRAAL_TECHNO_NAME' , allianceTop+'/etc/graal.rds') , ( 'GRAAL_TECHNO_NAME' , allianceTop+'/etc/graal.rds')
) )

View File

@ -24,6 +24,8 @@ import os.path
import re import re
import traceback import traceback
import Hurricane import Hurricane
import Viewer
import CRL
import helpers.io import helpers.io
quiet = False quiet = False
@ -33,6 +35,7 @@ ndaDir = None
techno = 'symbolic/cmos' techno = 'symbolic/cmos'
technoDir = None technoDir = None
moduleGlobals = globals() moduleGlobals = globals()
confModules = [ ]
def stype ( o ): return str(type(o)).split("'")[1] def stype ( o ): return str(type(o)).split("'")[1]
@ -393,16 +396,60 @@ def netDirectionToStr ( netDir ):
setSysConfDir( False ) setSysConfDir( False )
def unloadUserSettings ():
print ' o Unloading Python user\'s modules.'
global confModules
for moduleName in confModules:
refcount = sys.getrefcount( sys.modules[moduleName] )
warning = ''
if refcount > 3:
warning = '(NOTE: More than 3 refcount %d)' % refcount
#print helpers.io.WarningMessage( [ 'Configuration module "%s" has more than 3 references (%d)".' \
# % (moduleName,refcount)
# , 'May be unable to unload it from the Python process.'
# ] )
print ' - %-34s %-35s' % ('"%s".'%moduleName, warning)
del sys.modules[ moduleName ]
confModules = []
return
def loadUserSettings (): def loadUserSettings ():
global confModules
rvalue = False
beforeModules = set()
for moduleName in sys.modules.keys(): beforeModules.add( moduleName )
if os.path.isfile('./coriolis2/settings.py'): if os.path.isfile('./coriolis2/settings.py'):
if os.path.isfile('./coriolis2/__init__.py'): if os.path.isfile('./coriolis2/__init__.py'):
sys.path.insert( 0, os.getcwd() ) sys.path.insert( 0, os.getcwd() )
import coriolis2.settings import coriolis2.settings
return True rvalue = True
else: else:
print helpers.io.WarningMessage( [ 'User\'s settings directory "%s" exists, but do not contains "__init__.py".' % './coriolis2/' print helpers.io.WarningMessage( [ 'User\'s settings directory "%s" exists, but do not contains "__init__.py".' % './coriolis2/'
, '(path:"%s")' % os.path.abspath(os.getcwd()) , '(path:"%s")' % os.path.abspath(os.getcwd())
] ) ] )
else:
import symbolic.cmos
import symbolic.cmos confModules = set()
return False for moduleName in sys.modules.keys():
if not (moduleName in beforeModules):
confModules.add( moduleName )
#print 'Configuration modules:'
#for moduleName in confModules:
# print '-', moduleName
return rvalue
def resetCoriolis ():
print ' o Full reset of Coriolis/Hurricane databases.'
CRL.AllianceFramework.get().destroy()
Viewer.Graphics.get().clear()
Hurricane.DataBase.getDB().destroy()
unloadUserSettings()
return

View File

@ -189,6 +189,7 @@ namespace CRL {
, _parsers () , _parsers ()
, _drivers () , _drivers ()
, _catalog () , _catalog ()
, _libraries ()
, _parentLibrary (NULL) , _parentLibrary (NULL)
, _routingGauges () , _routingGauges ()
, _defaultRoutingGauge(NULL) , _defaultRoutingGauge(NULL)
@ -203,9 +204,6 @@ namespace CRL {
_parentLibrary = rootLibrary->getLibrary( _parentLibraryName ); _parentLibrary = rootLibrary->getLibrary( _parentLibraryName );
if (not _parentLibrary ) _parentLibrary = Library::create( rootLibrary, _parentLibraryName ); if (not _parentLibrary ) _parentLibrary = Library::create( rootLibrary, _parentLibraryName );
db->put( AllianceFrameworkProperty::create(this) );
db->_setCellLoader( bind(&AllianceFramework::cellLoader,this,_1) );
} }
@ -249,7 +247,8 @@ namespace CRL {
if (not _singleton) { if (not _singleton) {
// Triggers System singleton creation. // Triggers System singleton creation.
System::get(); System::get();
_singleton = new AllianceFramework (); AllianceFramework* af = new AllianceFramework ();
af->_postCreate();
//if (not (flags & NoPythonInit)) //if (not (flags & NoPythonInit))
// System::runPythonInit(); // System::runPythonInit();
//_singleton->bindLibraries(); //_singleton->bindLibraries();
@ -263,9 +262,21 @@ namespace CRL {
{ return create(); } { return create(); }
void AllianceFramework::destroy () void AllianceFramework::_postCreate ()
{ {
delete this; Super::_postCreate();
_singleton = this;
DataBase* db = DataBase::getDB();
db->put( AllianceFrameworkProperty::create(this) );
db->_setCellLoader( bind(&AllianceFramework::cellLoader,this,_1) );
}
void AllianceFramework::_preDestroy ()
{
Super::_preDestroy();
_singleton = NULL;
} }
@ -336,62 +347,68 @@ namespace CRL {
Cell* AllianceFramework::getCell ( const string& name, unsigned int mode, unsigned int depth ) Cell* AllianceFramework::getCell ( const string& name, unsigned int mode, unsigned int depth )
{ {
bool createCell = false; bool createCell = false;
Catalog::State* state = _catalog.getState ( name ); Catalog::State* state = _catalog.getState( name );
ParserFormatSlot* parser; ParserFormatSlot* parser;
// The cell is not even in the Catalog : add an entry. if (not _libraries.empty()) {
if ( state == NULL ) state = _catalog.getState ( name, true ); // The cell is not even in the Catalog : add an entry.
if (state == NULL) state = _catalog.getState( name, true );
if ( state->isFlattenLeaf() ) depth = 0; if (state->isFlattenLeaf()) depth = 0;
state->setDepth ( depth ); state->setDepth( depth );
// Do not try to load. // Do not try to load.
if ( mode & Catalog::State::InMemory ) return state->getCell(); if (mode & Catalog::State::InMemory) return state->getCell();
unsigned int loadMode; unsigned int loadMode;
for ( int i=0 ; i<2 ; i++ ) { for ( int i=0 ; i<2 ; i++ ) {
// Check is the view is requested for loading or already loaded. // Check is the view is requested for loading or already loaded.
switch ( i ) { switch ( i ) {
case 0: loadMode = mode & Catalog::State::Logical; break; case 0: loadMode = mode & Catalog::State::Logical; break;
case 1: loadMode = mode & Catalog::State::Physical; break; case 1: loadMode = mode & Catalog::State::Physical; break;
} }
if ( loadMode == 0 ) continue; if (loadMode == 0) continue;
if ( state->getFlags(loadMode) != 0 ) continue; if (state->getFlags(loadMode) != 0) continue;
// Transmit all flags except thoses related to views. // Transmit all flags except thoses related to views.
loadMode |= (mode & (!Catalog::State::Views)); loadMode |= (mode & (!Catalog::State::Views));
parser = & ( _parsers.getParserSlot ( name, loadMode, _environment ) ); parser = & (_parsers.getParserSlot( name, loadMode, _environment ));
// Try to open cell file (file extention is supplied by the parser). // Try to open cell file (file extention is supplied by the parser).
if ( !_readLocate(name,loadMode) ) continue; if (not _readLocate(name,loadMode)) continue;
if ( state->getCell() == NULL ) { if (state->getCell() == NULL) {
state->setCell ( Cell::create ( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) ); state->setCell ( Cell::create( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) );
state->getCell ()->put ( CatalogProperty::create(state) ); state->getCell ()->put( CatalogProperty::create(state) );
state->getCell ()->setFlattenLeaf ( false ); state->getCell ()->setFlattenLeaf( false );
createCell = true; createCell = true;
}
try {
// Call the parser function.
(parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() );
} catch ( ... ) {
if (createCell)
//state->getCell()->destroy();
throw;
}
} }
try { // At least one view must have been loaded.
// Call the parser function. if (state->getFlags(Catalog::State::Views) != 0) {
(parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() ); state->setFlags( Catalog::State::InMemory, true );
} catch ( ... ) { return state->getCell();
if ( createCell )
//state->getCell()->destroy();
throw;
} }
// Delete the empty cell.
if (state->getCell()) state->getCell()->destroy();
_catalog.deleteState( name );
} else {
cerr << Warning( "AllianceFramework::getCell(): The library list is empty, while loading Cell \"%s\"."
, name.c_str()
) << endl;
} }
// At least one view must have been loaded.
if ( state->getFlags(Catalog::State::Views) != 0 ) {
state->setFlags( Catalog::State::InMemory, true );
return state->getCell();
}
// Delete the empty cell.
if ( state->getCell() ) state->getCell()->destroy ();
_catalog.deleteState ( name );
// Last resort, search through all Hurricane libraries. // Last resort, search through all Hurricane libraries.
if (mode & Catalog::State::Foreign) if (mode & Catalog::State::Foreign)
return DataBase::getDB()->getCell( name ); return DataBase::getDB()->getCell( name );
@ -801,20 +818,20 @@ namespace CRL {
} }
string AllianceFramework::_getString () const string AllianceFramework::_getTypeName () const
{ return "<AllianceFramework>"; } { return "AllianceFramework"; }
Record *AllianceFramework::_getRecord () const Record *AllianceFramework::_getRecord () const
{ {
Record* record = new Record ( "<AllianceFramework>" ); Record* record = Super::_getRecord();
record->add ( getSlot ( "_environment" , &_environment ) ); record->add( getSlot( "_environment" , &_environment ) );
record->add ( getSlot ( "_libraries" , &_libraries ) ); record->add( getSlot( "_libraries" , &_libraries ) );
record->add ( getSlot ( "_catalog" , &_catalog ) ); record->add( getSlot( "_catalog" , &_catalog ) );
record->add ( getSlot ( "_defaultRoutingGauge", _defaultRoutingGauge ) ); record->add( getSlot( "_defaultRoutingGauge", _defaultRoutingGauge ) );
record->add ( getSlot ( "_routingGauges" , &_routingGauges ) ); record->add( getSlot( "_routingGauges" , &_routingGauges ) );
record->add ( getSlot ( "_defaultCellGauge" , _defaultCellGauge ) ); record->add( getSlot( "_defaultCellGauge" , _defaultCellGauge ) );
record->add ( getSlot ( "_cellGauges" , &_cellGauges ) ); record->add( getSlot( "_cellGauges" , &_cellGauges ) );
return record; return record;
} }

View File

@ -70,6 +70,25 @@ namespace CRL {
} }
void AllianceLibrary::saveCells () const
{
cerr << "AllianceLibrary::saveCells() " << _path << " " << _library << endl;
AllianceFramework* af = AllianceFramework::get();
for ( Cell* cell : _library->getCells() ) {
cerr << "Saving " << cell << endl;
af->saveCell( cell, Catalog::State::Physical );
}
}
void AllianceLibrary::saveCATAL () const
{
Catalog* catalog = AllianceFramework::get()->getCatalog();
string catalFile = getString(_path)+"/CATAL";
catalog->saveToFile( catalFile, _library );
}
string AllianceLibrary::_getString () const string AllianceLibrary::_getString () const
{ {
return ( "<" + _TName("AllianceLibrary") + " " + getString(_library->getName()) + ">" ); return ( "<" + _TName("AllianceLibrary") + " " + getString(_library->getName()) + ">" );

View File

@ -14,7 +14,8 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
# include <iomanip> #include <fstream>
#include <iomanip>
using namespace std; using namespace std;
#include "hurricane/Initializer.h" #include "hurricane/Initializer.h"
@ -295,11 +296,27 @@ namespace CRL {
} }
void Catalog::saveToFile ( const string& path, Library* library )
{
ofstream of ( path, ios::out|ios::trunc );
for ( auto entry : _states ) {
State* state = entry.second;
if (state->getLibrary() != library) continue;
if (state->isFlattenLeaf()) of << setw(20) << left << entry.first << "C\n";
if (state->isFeed() ) of << setw(20) << left << entry.first << "F\n";
if (state->isGds() ) of << setw(20) << left << entry.first << "G\n";
}
of.close();
}
string Catalog::_getPrint () const string Catalog::_getPrint () const
{ {
map<Name,State*>::const_iterator it; map<Name,State*>::const_iterator it;
ostringstream s; ostringstream s;
s << "Catalog contents:" << endl;
for ( it=_states.begin() ; it!=_states.end() ; it++ ) { for ( it=_states.begin() ; it!=_states.end() ; it++ ) {
s << left << setw(30) << getString(it->first) << getString(it->second) << endl; s << left << setw(30) << getString(it->first) << getString(it->second) << endl;
} }

View File

@ -91,7 +91,7 @@ namespace CRL {
} }
void ParserFormatSlot::registerCell ( const string& tag, CellParser_t* p, const string& ext ) void ParserFormatSlot::registerCell ( string tag, CellParser_t* p, string ext )
{ {
ParserSlot slot ( tag, ext, (void*)p ); ParserSlot slot ( tag, ext, (void*)p );
ParserSlotIter it = _cells.begin(); ParserSlotIter it = _cells.begin();
@ -106,7 +106,7 @@ namespace CRL {
} }
void ParserFormatSlot::registerLib ( const string& tag, LibraryParser_t* p, const string& ext ) void ParserFormatSlot::registerLib ( string tag, LibraryParser_t* p, string ext )
{ {
ParserSlot slot ( tag, ext, (void*)p ); ParserSlot slot ( tag, ext, (void*)p );
ParserSlotIter it = _libs.begin(); ParserSlotIter it = _libs.begin();
@ -123,7 +123,7 @@ namespace CRL {
} }
bool ParserFormatSlot::unRegisterCell ( const Name& ext ) bool ParserFormatSlot::unRegisterCell ( string ext )
{ {
ParserSlotIter it = _cells.begin(); ParserSlotIter it = _cells.begin();
@ -140,7 +140,7 @@ namespace CRL {
} }
bool ParserFormatSlot::unRegisterLib ( const Name& ext ) bool ParserFormatSlot::unRegisterLib ( string ext )
{ {
ParserSlotIter it = _libs.begin(); ParserSlotIter it = _libs.begin();
@ -163,7 +163,7 @@ namespace CRL {
// Class : "ParsersMap" // Class : "ParsersMap"
ParsersMap::ParsersMap (): map<Name,ParserFormatSlot>() ParsersMap::ParsersMap (): map<std::string,ParserFormatSlot>()
{ {
// Register the Alliance default parsers. // Register the Alliance default parsers.
registerSlot ( "ap" , (CellParser_t*)apParser , "ap" ); registerSlot ( "ap" , (CellParser_t*)apParser , "ap" );
@ -177,12 +177,12 @@ namespace CRL {
} }
ParserFormatSlot& ParsersMap::getParserSlot ( const string& tag ) ParserFormatSlot& ParsersMap::getParserSlot ( string tag )
{ {
ParserFormatSlot* slot; ParserFormatSlot* slot;
iterator it; iterator it;
if ( ( it = find(Name(tag)) ) != end() ) { if ( ( it = find(tag) ) != end() ) {
slot = & ( it->second ); slot = & ( it->second );
} else { } else {
(*this)[tag] = ParserFormatSlot (); (*this)[tag] = ParserFormatSlot ();
@ -196,17 +196,17 @@ namespace CRL {
} }
ParserFormatSlot &ParsersMap::getParserSlot ( const string& name ParserFormatSlot &ParsersMap::getParserSlot ( string name
, unsigned int mode , unsigned int mode
, const Environment& environment ) , const Environment& environment )
{ {
// Look for the parser tag (i.e. file extention). // Look for the parser tag (i.e. file extention).
Name format; string format;
switch ( mode & (Catalog::State::Views) ) { switch ( mode & (Catalog::State::Views) ) {
case Catalog::State::Physical: format = environment.getIN_PH(); break; case Catalog::State::Physical: format = environment.getIN_PH(); break;
case Catalog::State::Logical: format = environment.getIN_LO(); break; case Catalog::State::Logical: format = environment.getIN_LO(); break;
default: default:
throw Error ( BadInputMode, "ParserMap::getParserSlot()", getString(name).c_str() ); throw Error ( BadInputMode, "ParserMap::getParserSlot()", name.c_str() );
} }
iterator it = find ( format ); iterator it = find ( format );
@ -220,12 +220,12 @@ namespace CRL {
} }
DriverSlot &DriversMap::getDriverSlot ( const string& name DriverSlot &DriversMap::getDriverSlot ( string name
, unsigned int mode , unsigned int mode
, const Environment& environment ) , const Environment& environment )
{ {
// Look for the parser tag (i.e. file extention). // Look for the parser tag (i.e. file extention).
Name format; string format;
switch ( mode & (Catalog::State::Views) ) { switch ( mode & (Catalog::State::Views) ) {
case Catalog::State::Physical: format = environment.getOUT_PH(); break; case Catalog::State::Physical: format = environment.getOUT_PH(); break;
case Catalog::State::Logical: format = environment.getOUT_LO(); break; case Catalog::State::Logical: format = environment.getOUT_LO(); break;
@ -244,7 +244,7 @@ namespace CRL {
} }
void ParsersMap::registerSlot ( const string& tag, CellParser_t* p, const string& ext ) void ParsersMap::registerSlot ( string tag, CellParser_t* p, string ext )
{ {
ParserFormatSlot& slot = getParserSlot ( tag ); ParserFormatSlot& slot = getParserSlot ( tag );
@ -252,7 +252,7 @@ namespace CRL {
} }
void ParsersMap::registerSlot ( const string& tag, LibraryParser_t* p, const string& ext ) void ParsersMap::registerSlot ( string tag, LibraryParser_t* p, string ext )
{ {
ParserFormatSlot& slot = getParserSlot ( tag ); ParserFormatSlot& slot = getParserSlot ( tag );
@ -260,7 +260,7 @@ namespace CRL {
} }
void ParsersMap::unRegisterSlot ( const Name& tag, const Name& ext, bool lib ) void ParsersMap::unRegisterSlot ( string tag, string ext, bool lib )
{ {
iterator it = find(tag); iterator it = find(tag);
@ -277,7 +277,7 @@ namespace CRL {
// Class : "DriversMap" // Class : "DriversMap"
DriversMap::DriversMap () : map<Name,DriverSlot>() DriversMap::DriversMap () : map<string,DriverSlot>()
{ {
// Register the Alliance default drivers. // Register the Alliance default drivers.
registerSlot ( "ap" , (CellDriver_t*)apDriver , "ap" ); registerSlot ( "ap" , (CellDriver_t*)apDriver , "ap" );
@ -288,13 +288,13 @@ namespace CRL {
} }
DriverSlot& DriversMap::getDriverSlot ( const string& tag ) DriverSlot& DriversMap::getDriverSlot ( string tag )
{ {
return (*this)[ tag ]; return (*this)[ tag ];
} }
void DriversMap::registerSlot ( const string& tag, LibraryDriver_t* d, const string& ext ) void DriversMap::registerSlot ( string tag, LibraryDriver_t* d, string ext )
{ {
iterator it = find ( tag ); iterator it = find ( tag );
DriverSlot* p; DriverSlot* p;
@ -310,7 +310,7 @@ namespace CRL {
} }
void DriversMap::registerSlot ( const string& tag, CellDriver_t* d, const string& ext ) void DriversMap::registerSlot ( string tag, CellDriver_t* d, string ext )
{ {
iterator it = find ( tag ); iterator it = find ( tag );
DriverSlot* p; DriverSlot* p;
@ -326,7 +326,7 @@ namespace CRL {
} }
void DriversMap::unRegisterSlot ( const Name& tag ) void DriversMap::unRegisterSlot ( string tag )
{ {
iterator it = find ( tag ); iterator it = find ( tag );

View File

@ -153,7 +153,7 @@ namespace {
, DirectionLeft =DirectionHorizontal|DirectionDecrease , DirectionLeft =DirectionHorizontal|DirectionDecrease
, DirectionRight =DirectionHorizontal|DirectionIncrease , DirectionRight =DirectionHorizontal|DirectionIncrease
}; };
static LayerInformations _layerInformations; LayerInformations _layerInformations;
AllianceFramework* _framework; AllianceFramework* _framework;
string _cellPath; string _cellPath;
Cell* _cell; Cell* _cell;
@ -165,7 +165,7 @@ namespace {
protected: protected:
// Internal: Methods. // Internal: Methods.
static LayerInformation* _getLayerInformation ( const Name& layerName ); LayerInformation* _getLayerInformation ( const Name& layerName );
inline DbU::Unit _getUnit ( long value ); inline DbU::Unit _getUnit ( long value );
inline DbU::Unit _getUnit ( const char* value ); inline DbU::Unit _getUnit ( const char* value );
vector<char*> _splitString ( char* s, char separator ); vector<char*> _splitString ( char* s, char separator );
@ -187,9 +187,6 @@ namespace {
}; };
LayerInformations ApParser::_layerInformations;
ApParser::ApParser ( AllianceFramework* framework ) ApParser::ApParser ( AllianceFramework* framework )
: _framework (framework) : _framework (framework)
, _cellPath () , _cellPath ()
@ -199,70 +196,68 @@ namespace {
, _parserState(StateVersion) , _parserState(StateVersion)
, _lineNumber (0) , _lineNumber (0)
{ {
if ( _layerInformations.empty() ) { _layerInformations.setTechnology ( DataBase::getDB()->getTechnology() );
_layerInformations.setTechnology ( DataBase::getDB()->getTechnology() );
_layerInformations.add ( "NWELL" , "NWELL" , false, false ); _layerInformations.add ( "NWELL" , "NWELL" , false, false );
_layerInformations.add ( "PWELL" , "PWELL" , false, false ); _layerInformations.add ( "PWELL" , "PWELL" , false, false );
_layerInformations.add ( "NTIE" , "NTIE" , false, false ); _layerInformations.add ( "NTIE" , "NTIE" , false, false );
_layerInformations.add ( "PTIE" , "PTIE" , false, false ); _layerInformations.add ( "PTIE" , "PTIE" , false, false );
_layerInformations.add ( "NDIF" , "NDIF" , false, false ); _layerInformations.add ( "NDIF" , "NDIF" , false, false );
_layerInformations.add ( "PDIF" , "PDIF" , false, false ); _layerInformations.add ( "PDIF" , "PDIF" , false, false );
_layerInformations.add ( "NTRANS" , "NTRANS" , false, false ); _layerInformations.add ( "NTRANS" , "NTRANS" , false, false );
_layerInformations.add ( "PTRANS" , "PTRANS" , false, false ); _layerInformations.add ( "PTRANS" , "PTRANS" , false, false );
_layerInformations.add ( "POLY" , "POLY" , false, false ); _layerInformations.add ( "POLY" , "POLY" , false, false );
_layerInformations.add ( "POLY2" , "POLY2" , false, false ); _layerInformations.add ( "POLY2" , "POLY2" , false, false );
_layerInformations.add ( "ALU1" , "METAL1" , false, false ); _layerInformations.add ( "ALU1" , "METAL1" , false, false );
_layerInformations.add ( "ALU2" , "METAL2" , false, false ); _layerInformations.add ( "ALU2" , "METAL2" , false, false );
_layerInformations.add ( "ALU3" , "METAL3" , false, false ); _layerInformations.add ( "ALU3" , "METAL3" , false, false );
_layerInformations.add ( "ALU4" , "METAL4" , false, false ); _layerInformations.add ( "ALU4" , "METAL4" , false, false );
_layerInformations.add ( "ALU5" , "METAL5" , false, false ); _layerInformations.add ( "ALU5" , "METAL5" , false, false );
_layerInformations.add ( "ALU6" , "METAL6" , false, false ); _layerInformations.add ( "ALU6" , "METAL6" , false, false );
_layerInformations.add ( "ALU7" , "METAL7" , false, false ); _layerInformations.add ( "ALU7" , "METAL7" , false, false );
_layerInformations.add ( "ALU8" , "METAL8" , false, false ); _layerInformations.add ( "ALU8" , "METAL8" , false, false );
_layerInformations.add ( "CALU1" , "METAL1" , true, false ); _layerInformations.add ( "CALU1" , "METAL1" , true, false );
_layerInformations.add ( "CALU2" , "METAL2" , true, false ); _layerInformations.add ( "CALU2" , "METAL2" , true, false );
_layerInformations.add ( "CALU3" , "METAL3" , true, false ); _layerInformations.add ( "CALU3" , "METAL3" , true, false );
_layerInformations.add ( "CALU4" , "METAL4" , true, false ); _layerInformations.add ( "CALU4" , "METAL4" , true, false );
_layerInformations.add ( "CALU5" , "METAL5" , true, false ); _layerInformations.add ( "CALU5" , "METAL5" , true, false );
_layerInformations.add ( "CALU6" , "METAL6" , true, false ); _layerInformations.add ( "CALU6" , "METAL6" , true, false );
_layerInformations.add ( "CALU7" , "METAL7" , true, false ); _layerInformations.add ( "CALU7" , "METAL7" , true, false );
_layerInformations.add ( "CALU8" , "METAL8" , true, false ); _layerInformations.add ( "CALU8" , "METAL8" , true, false );
_layerInformations.add ( "TALU1" , "BLOCKAGE1" , false, true ); _layerInformations.add ( "TALU1" , "BLOCKAGE1" , false, true );
_layerInformations.add ( "TALU2" , "BLOCKAGE2" , false, true ); _layerInformations.add ( "TALU2" , "BLOCKAGE2" , false, true );
_layerInformations.add ( "TALU3" , "BLOCKAGE3" , false, true ); _layerInformations.add ( "TALU3" , "BLOCKAGE3" , false, true );
_layerInformations.add ( "TALU4" , "BLOCKAGE4" , false, true ); _layerInformations.add ( "TALU4" , "BLOCKAGE4" , false, true );
_layerInformations.add ( "TALU5" , "BLOCKAGE5" , false, true ); _layerInformations.add ( "TALU5" , "BLOCKAGE5" , false, true );
_layerInformations.add ( "TALU6" , "BLOCKAGE6" , false, true ); _layerInformations.add ( "TALU6" , "BLOCKAGE6" , false, true );
_layerInformations.add ( "TALU7" , "BLOCKAGE7" , false, true ); _layerInformations.add ( "TALU7" , "BLOCKAGE7" , false, true );
_layerInformations.add ( "TALU8" , "BLOCKAGE8" , false, true ); _layerInformations.add ( "TALU8" , "BLOCKAGE8" , false, true );
_layerInformations.add ( "CONT_BODY_N", "CONT_BODY_N", false, false ); _layerInformations.add ( "CONT_BODY_N", "CONT_BODY_N", false, false );
_layerInformations.add ( "CONT_BODY_P", "CONT_BODY_P", false, false ); _layerInformations.add ( "CONT_BODY_P", "CONT_BODY_P", false, false );
_layerInformations.add ( "CONT_DIF_N" , "CONT_DIF_N" , false, false ); _layerInformations.add ( "CONT_DIF_N" , "CONT_DIF_N" , false, false );
_layerInformations.add ( "CONT_DIF_P" , "CONT_DIF_P" , false, false ); _layerInformations.add ( "CONT_DIF_P" , "CONT_DIF_P" , false, false );
_layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false ); _layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false );
_layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false ); _layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false );
_layerInformations.add ( "CONT_VIA" , "VIA12" , false, false ); _layerInformations.add ( "CONT_VIA" , "VIA12" , false, false );
_layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false ); _layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false );
_layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false ); _layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false );
_layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false ); _layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false );
_layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false ); _layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false );
_layerInformations.add ( "CONT_VIA5" , "VIA56" , false, false ); _layerInformations.add ( "CONT_VIA5" , "VIA56" , false, false );
_layerInformations.add ( "CONT_VIA6" , "VIA67" , false, false ); _layerInformations.add ( "CONT_VIA6" , "VIA67" , false, false );
_layerInformations.add ( "CONT_VIA7" , "VIA78" , false, false ); _layerInformations.add ( "CONT_VIA7" , "VIA78" , false, false );
_layerInformations.add ( "CONT_TURN1" , "METAL1" , false, false ); _layerInformations.add ( "CONT_TURN1" , "METAL1" , false, false );
_layerInformations.add ( "CONT_TURN2" , "METAL2" , false, false ); _layerInformations.add ( "CONT_TURN2" , "METAL2" , false, false );
_layerInformations.add ( "CONT_TURN3" , "METAL3" , false, false ); _layerInformations.add ( "CONT_TURN3" , "METAL3" , false, false );
_layerInformations.add ( "CONT_TURN4" , "METAL4" , false, false ); _layerInformations.add ( "CONT_TURN4" , "METAL4" , false, false );
_layerInformations.add ( "CONT_TURN5" , "METAL5" , false, false ); _layerInformations.add ( "CONT_TURN5" , "METAL5" , false, false );
_layerInformations.add ( "CONT_TURN6" , "METAL6" , false, false ); _layerInformations.add ( "CONT_TURN6" , "METAL6" , false, false );
_layerInformations.add ( "CONT_TURN7" , "METAL7" , false, false ); _layerInformations.add ( "CONT_TURN7" , "METAL7" , false, false );
_layerInformations.add ( "CONT_TURN8" , "METAL8" , false, false ); _layerInformations.add ( "CONT_TURN8" , "METAL8" , false, false );
}
} }

View File

@ -1369,8 +1369,8 @@ void vstParser ( const string cellPath, Cell *cell )
static bool firstCall = true; static bool firstCall = true;
if ( firstCall ) { if ( firstCall ) {
firstCall = false; firstCall = false;
Vst::framework = AllianceFramework::get ();
} }
Vst::framework = AllianceFramework::get ();
Vst::states.push_back ( new Vst::YaccState(cellPath) ); Vst::states.push_back ( new Vst::YaccState(cellPath) );

View File

@ -39,7 +39,8 @@ namespace CRL {
class CellGauge; class CellGauge;
class AllianceFramework { class AllianceFramework : public DBo {
typedef DBo Super;
public: public:
enum FunctionsFlags { NoFlags = 0 enum FunctionsFlags { NoFlags = 0
, NoPythonInit = (1<<0) , NoPythonInit = (1<<0)
@ -56,92 +57,90 @@ namespace CRL {
, ConfigChanged = (1<<2) , ConfigChanged = (1<<2)
}; };
public: public:
// Constructors. static AllianceFramework* create ( unsigned long flags=NoFlags );
static AllianceFramework* create ( unsigned long flags=NoFlags ); virtual void _postCreate ();
// Destructors. virtual void _preDestroy ();
void destroy ();
// Accessors. // Accessors.
static AllianceFramework* get (); static AllianceFramework* get ();
string getPrint () const; string getPrint () const;
// Predicates. // Predicates.
Catalog::State* isInCatalog ( const Name& ); Catalog::State* isInCatalog ( const Name& );
Catalog::State* isInCatalog ( string ); Catalog::State* isInCatalog ( string );
inline bool isPOWER ( const char* name ); inline bool isPOWER ( const char* name );
inline bool isPOWER ( const string& name ); inline bool isPOWER ( const string& name );
inline bool isPOWER ( const Name& name ); inline bool isPOWER ( const Name& name );
inline bool isGROUND ( const char* name ); inline bool isGROUND ( const char* name );
inline bool isGROUND ( const string& name ); inline bool isGROUND ( const string& name );
inline bool isGROUND ( const Name& name ); inline bool isGROUND ( const Name& name );
inline bool isCLOCK ( const char* name ); inline bool isCLOCK ( const char* name );
inline bool isCLOCK ( const string& name ); inline bool isCLOCK ( const string& name );
inline bool isCLOCK ( const Name& name ); inline bool isCLOCK ( const Name& name );
inline bool isBLOCKAGE ( const char* name ); inline bool isBLOCKAGE ( const char* name );
inline bool isBLOCKAGE ( const string& name ); inline bool isBLOCKAGE ( const string& name );
inline bool isBLOCKAGE ( const Name& name ); inline bool isBLOCKAGE ( const Name& name );
inline bool isBLOCKAGE ( const Net* net ); inline bool isBLOCKAGE ( const Net* net );
inline bool isPad ( const char* name ); inline bool isPad ( const char* name );
inline bool isPad ( const string& name ); inline bool isPad ( const string& name );
inline bool isPad ( const Name& name ); inline bool isPad ( const Name& name );
inline bool isPad ( const Cell* ); inline bool isPad ( const Cell* );
// Accessors. // Accessors.
inline Environment* getEnvironment (); inline Environment* getEnvironment ();
inline Catalog* getCatalog (); inline Catalog* getCatalog ();
inline const Name& getParentLibraryName () const; inline const Name& getParentLibraryName () const;
inline Library* getParentLibrary (); inline Library* getParentLibrary ();
Library* getLibrary ( unsigned int index ); Library* getLibrary ( unsigned int index );
Library* getLibrary ( const Name& libName ); Library* getLibrary ( const Name& libName );
AllianceLibrary* getAllianceLibrary ( unsigned int index ); AllianceLibrary* getAllianceLibrary ( unsigned int index );
AllianceLibrary* getAllianceLibrary ( const Name& libName, unsigned int flags ); AllianceLibrary* getAllianceLibrary ( const Name& libName, unsigned int flags );
AllianceLibrary* getAllianceLibrary ( Library* ); AllianceLibrary* getAllianceLibrary ( Library* );
AllianceLibrary* createLibrary ( const string& path, unsigned int flags, string libName="" ); AllianceLibrary* createLibrary ( const string& path, unsigned int flags, string libName="" );
inline const AllianceLibraries& getAllianceLibraries () const; inline const AllianceLibraries& getAllianceLibraries () const;
void saveLibrary ( Library* ); void saveLibrary ( Library* );
void saveLibrary ( AllianceLibrary* ); void saveLibrary ( AllianceLibrary* );
RoutingGauge* getRoutingGauge ( const Name& name="" ); RoutingGauge* getRoutingGauge ( const Name& name="" );
CellGauge* getCellGauge ( const Name& name="" ); CellGauge* getCellGauge ( const Name& name="" );
CellGauge* matchCellGauge ( DbU::Unit width, DbU::Unit height ) const; CellGauge* matchCellGauge ( DbU::Unit width, DbU::Unit height ) const;
CellGauge* matchCellGaugeByHeight ( DbU::Unit height ) const; CellGauge* matchCellGaugeByHeight ( DbU::Unit height ) const;
inline const Name getDefaultCGPinLayerName () const; inline const Name getDefaultCGPinLayerName () const;
// Modifiers. // Modifiers.
RoutingGauge* setRoutingGauge ( const Name& name="" ); RoutingGauge* setRoutingGauge ( const Name& name="" );
CellGauge* setCellGauge ( const Name& name="" ); CellGauge* setCellGauge ( const Name& name="" );
void addRoutingGauge ( RoutingGauge* ); void addRoutingGauge ( RoutingGauge* );
void addCellGauge ( CellGauge* ); void addCellGauge ( CellGauge* );
void addObserver ( BaseObserver* ); void addObserver ( BaseObserver* );
void removeObserver ( BaseObserver* ); void removeObserver ( BaseObserver* );
void notify ( unsigned int flags ); void notify ( unsigned int flags );
// Cell Management. // Cell Management.
Cell* cellLoader ( const string& rpath ); Cell* cellLoader ( const string& rpath );
Cell* getCell ( const string& name Cell* getCell ( const string& name
, unsigned int mode , unsigned int mode
, unsigned int depth=(unsigned int)-1 ); , unsigned int depth=(unsigned int)-1 );
Cell* createCell ( const string& name, AllianceLibrary* library=NULL ); Cell* createCell ( const string& name, AllianceLibrary* library=NULL );
void saveCell ( Cell* , unsigned int mode ); void saveCell ( Cell* , unsigned int mode );
void bindLibraries (); void bindLibraries ();
unsigned int loadLibraryCells ( Library* ); unsigned int loadLibraryCells ( Library* );
unsigned int loadLibraryCells ( const Name& ); unsigned int loadLibraryCells ( const Name& );
static size_t getInstancesCount ( Cell*, unsigned int flags ); static size_t getInstancesCount ( Cell*, unsigned int flags );
// Hurricane Managment. // Hurricane Managment.
void toJson ( JsonWriter* ) const; void toJson ( JsonWriter* ) const;
inline string _getTypeName () const; virtual string _getTypeName () const;
string _getString () const; virtual Record* _getRecord () const;
Record* _getRecord () const;
// Internals - Attributes. // Internals - Attributes.
protected: protected:
static const Name _parentLibraryName; static const Name _parentLibraryName;
static AllianceFramework* _singleton; static AllianceFramework* _singleton;
Observable _observers; Observable _observers;
Environment _environment; Environment _environment;
ParsersMap _parsers; ParsersMap _parsers;
DriversMap _drivers; DriversMap _drivers;
Catalog _catalog; Catalog _catalog;
AllianceLibraries _libraries; AllianceLibraries _libraries;
Library* _parentLibrary; Library* _parentLibrary;
map<Name,RoutingGauge*> _routingGauges; map<Name,RoutingGauge*> _routingGauges;
RoutingGauge* _defaultRoutingGauge; RoutingGauge* _defaultRoutingGauge;
map<Name,CellGauge*> _cellGauges; map<Name,CellGauge*> _cellGauges;
CellGauge* _defaultCellGauge; CellGauge* _defaultCellGauge;
// Internals - Constructors. // Internals - Constructors.
AllianceFramework (); AllianceFramework ();
@ -182,7 +181,6 @@ namespace CRL {
// TEMPORARY. // TEMPORARY.
inline const Name AllianceFramework::getDefaultCGPinLayerName inline const Name AllianceFramework::getDefaultCGPinLayerName
() const { return "CALU1"; } () const { return "CALU1"; }
inline string AllianceFramework::_getTypeName () const { return "AllianceFramework"; }
class JsonAllianceFramework : public JsonObject { class JsonAllianceFramework : public JsonObject {

View File

@ -44,23 +44,20 @@ namespace CRL {
class AllianceLibrary { class AllianceLibrary {
public: public:
// Constructors.
AllianceLibrary (); AllianceLibrary ();
AllianceLibrary ( const Name& path, Library* library=NULL ); AllianceLibrary ( const Name& path, Library* library=NULL );
// Operators
AllianceLibrary& operator= ( const AllianceLibrary& directory ); AllianceLibrary& operator= ( const AllianceLibrary& directory );
AllianceLibrary& operator= ( const std::string& path ); AllianceLibrary& operator= ( const std::string& path );
// Accessors
inline const Name& getPath () const; inline const Name& getPath () const;
inline Library* getLibrary () const; inline Library* getLibrary () const;
// Hurricane management. void saveCells () const;
void saveCATAL () const;
void toJson ( JsonWriter* ) const; void toJson ( JsonWriter* ) const;
inline std::string _getTypeName () const; inline std::string _getTypeName () const;
std::string _getString () const; std::string _getString () const;
Record* _getRecord () const; Record* _getRecord () const;
protected: protected:
// Internal - Attributes.
Name _path; Name _path;
Library* _library; Library* _library;

View File

@ -65,6 +65,7 @@ namespace CRL {
bool deleteState ( const Name& name ); bool deleteState ( const Name& name );
void clear (); void clear ();
bool loadFromFile ( const string& path, Library* library ); bool loadFromFile ( const string& path, Library* library );
void saveToFile ( const string& path, Library* library );
inline map<Name,State*>* getStates (); inline map<Name,State*>* getStates ();
string _getPrint () const; string _getPrint () const;
inline string _getTypeName () const; inline string _getTypeName () const;
@ -232,7 +233,7 @@ namespace CRL {
inline unsigned int Catalog::State::getDepth () const { return _depth; } inline unsigned int Catalog::State::getDepth () const { return _depth; }
inline string Catalog::State::_getTypeName () const { return _TName("Catalog::State"); } inline string Catalog::State::_getTypeName () const { return _TName("Catalog::State"); }
inline Catalog::Catalog () : _states() {} inline Catalog::Catalog () : _states() { }
inline map<Name,Catalog::State*>* inline map<Name,Catalog::State*>*
Catalog::getStates () { return &_states; } Catalog::getStates () { return &_states; }
inline string Catalog::_getTypeName () const { return _TName("Catalog"); } inline string Catalog::_getTypeName () const { return _TName("Catalog"); }

View File

@ -20,7 +20,6 @@
#include <string> #include <string>
#include <map> #include <map>
#include "hurricane/Name.h"
namespace Hurricane { namespace Hurricane {
class Library; class Library;
class Cell; class Cell;
@ -29,7 +28,6 @@ namespace Hurricane {
namespace CRL { namespace CRL {
using Hurricane::Name;
using Hurricane::Cell; using Hurricane::Cell;
using Hurricane::Library; using Hurricane::Library;
@ -51,9 +49,9 @@ namespace CRL {
// Struct : "CRL::ParserSlot". // Struct : "CRL::ParserSlot".
struct ParserSlot { struct ParserSlot {
Name _tag; std::string _tag;
Name _ext; std::string _ext;
void* _parser; void* _parser;
ParserSlot ( const string& t, const string& e, void* p ): _tag(t),_ext(e),_parser(p) {}; ParserSlot ( const string& t, const string& e, void* p ): _tag(t),_ext(e),_parser(p) {};
}; };
@ -73,15 +71,15 @@ namespace CRL {
inline ParserFormatSlot (); inline ParserFormatSlot ();
// Accessors. // Accessors.
inline bool loadByLib (); inline bool loadByLib ();
inline const Name& getTag (); inline std::string getTag ();
inline const Name& getExt (); inline std::string getExt ();
inline LibraryParser_t* getParsLib (); inline LibraryParser_t* getParsLib ();
inline CellParser_t* getParsCell (); inline CellParser_t* getParsCell ();
// Modifiers. // Modifiers.
void registerCell ( const std::string& tag, CellParser_t* p, const std::string& ext ); void registerCell ( std::string tag, CellParser_t* p, std::string ext );
void registerLib ( const std::string& tag, LibraryParser_t* p, const std::string& ext ); void registerLib ( std::string tag, LibraryParser_t* p, std::string ext );
bool unRegisterCell ( const Name& ext ); bool unRegisterCell ( std::string ext );
bool unRegisterLib ( const Name& ext ); bool unRegisterLib ( std::string ext );
// Iterators handling. // Iterators handling.
inline void cbegin (); inline void cbegin ();
inline void lbegin (); inline void lbegin ();
@ -101,8 +99,8 @@ namespace CRL {
inline ParserFormatSlot::ParserFormatSlot () : _loadByLib(false), _itset(false) { }; inline ParserFormatSlot::ParserFormatSlot () : _loadByLib(false), _itset(false) { };
inline bool ParserFormatSlot::loadByLib () { return ( _loadByLib ); } inline bool ParserFormatSlot::loadByLib () { return ( _loadByLib ); }
inline const Name& ParserFormatSlot::getTag () { return ( _it->_tag ); } inline std::string ParserFormatSlot::getTag () { return ( _it->_tag ); }
inline const Name& ParserFormatSlot::getExt () { return ( _it->_ext ); } inline std::string ParserFormatSlot::getExt () { return ( _it->_ext ); }
inline LibraryParser_t* ParserFormatSlot::getParsLib () { return ( (LibraryParser_t*)_it->_parser ); } inline LibraryParser_t* ParserFormatSlot::getParsLib () { return ( (LibraryParser_t*)_it->_parser ); }
inline CellParser_t* ParserFormatSlot::getParsCell () { return ( (CellParser_t* )_it->_parser ); } inline CellParser_t* ParserFormatSlot::getParsCell () { return ( (CellParser_t* )_it->_parser ); }
inline void ParserFormatSlot::cbegin () { _it = _cells.begin(); _itset = true; } inline void ParserFormatSlot::cbegin () { _it = _cells.begin(); _itset = true; }
@ -112,17 +110,17 @@ namespace CRL {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "CRL::ParsersMap". // Class : "CRL::ParsersMap".
class ParsersMap : public map<Name,ParserFormatSlot> { class ParsersMap : public map<std::string,ParserFormatSlot> {
public: public:
// Constructor. // Constructor.
ParsersMap (); ParsersMap ();
// Methods. // Methods.
ParserFormatSlot& getParserSlot ( const std::string& tag ); ParserFormatSlot& getParserSlot ( std::string tag );
ParserFormatSlot& getParserSlot ( const std::string& tag, unsigned int mode, const Environment& env ); ParserFormatSlot& getParserSlot ( std::string tag, unsigned int mode, const Environment& env );
void registerSlot ( const std::string& tag, LibraryParser_t* p, const std::string& ext ); void registerSlot ( std::string tag, LibraryParser_t* p, std::string ext );
void registerSlot ( const std::string& tag, CellParser_t* p, const std::string& ext ); void registerSlot ( std::string tag, CellParser_t* p, std::string ext );
void unRegisterSlot ( const Name& tag, const Name& ext, bool lib ); void unRegisterSlot ( std::string tag, std::string ext, bool lib );
}; };
@ -135,23 +133,23 @@ namespace CRL {
// Constructor. // Constructor.
inline DriverSlot ( string tag="unknown" ); inline DriverSlot ( string tag="unknown" );
// Accessors. // Accessors.
inline const Name& getTag (); inline std::string getTag ();
inline const Name& getExtLib (); inline std::string getExtLib ();
inline const Name& getExtCell (); inline std::string getExtCell ();
inline LibraryDriver_t* getDrivLib (); inline LibraryDriver_t* getDrivLib ();
inline CellDriver_t* getDrivCell (); inline CellDriver_t* getDrivCell ();
// Modifiers. // Modifiers.
inline void setExtLib ( const std::string &ext ); inline void setExtLib ( std::string ext );
inline void setExtCell ( const std::string &ext ); inline void setExtCell ( std::string ext );
inline void setDrivLib ( LibraryDriver_t *driv ); inline void setDrivLib ( LibraryDriver_t *driv );
inline void setDrivCell ( CellDriver_t *driv ); inline void setDrivCell ( CellDriver_t *driv );
private: private:
// Internal - Attributes. // Internal - Attributes.
Name _tag; std::string _tag;
Name _extLib; std::string _extLib;
Name _extCell; std::string _extCell;
LibraryDriver_t* _drivLib; LibraryDriver_t* _drivLib;
CellDriver_t* _drivCell; CellDriver_t* _drivCell;
}; };
@ -164,13 +162,13 @@ namespace CRL {
, _drivLib(NULL) , _drivLib(NULL)
, _drivCell(NULL) , _drivCell(NULL)
{ } { }
inline const Name& DriverSlot::getTag () { return ( _tag ); } inline std::string DriverSlot::getTag () { return ( _tag ); }
inline const Name& DriverSlot::getExtLib () { return ( _extLib ); } inline std::string DriverSlot::getExtLib () { return ( _extLib ); }
inline const Name& DriverSlot::getExtCell () { return ( _extCell ); } inline std::string DriverSlot::getExtCell () { return ( _extCell ); }
inline LibraryDriver_t* DriverSlot::getDrivLib () { return ( _drivLib ); } inline LibraryDriver_t* DriverSlot::getDrivLib () { return ( _drivLib ); }
inline CellDriver_t* DriverSlot::getDrivCell () { return ( _drivCell ); } inline CellDriver_t* DriverSlot::getDrivCell () { return ( _drivCell ); }
inline void DriverSlot::setExtLib ( const std::string& ext ) { _extLib = ext; } inline void DriverSlot::setExtLib ( std::string ext ) { _extLib = ext; }
inline void DriverSlot::setExtCell ( const std::string& ext ) { _extCell = ext; } inline void DriverSlot::setExtCell ( std::string ext ) { _extCell = ext; }
inline void DriverSlot::setDrivLib ( LibraryDriver_t* driv ) { _drivLib = driv; } inline void DriverSlot::setDrivLib ( LibraryDriver_t* driv ) { _drivLib = driv; }
inline void DriverSlot::setDrivCell ( CellDriver_t* driv ) { _drivCell = driv; } inline void DriverSlot::setDrivCell ( CellDriver_t* driv ) { _drivCell = driv; }
@ -180,17 +178,17 @@ namespace CRL {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "CRL::DriversMap". // Class : "CRL::DriversMap".
class DriversMap : public map<Name,DriverSlot> { class DriversMap : public map<string,DriverSlot> {
public: public:
// Constructor. // Constructor.
DriversMap (); DriversMap ();
// Methods. // Methods.
DriverSlot& getDriverSlot ( const std::string& tag ); DriverSlot& getDriverSlot ( std::string tag );
DriverSlot& getDriverSlot ( const std::string& tag, unsigned int mode, const Environment& env ); DriverSlot& getDriverSlot ( std::string tag, unsigned int mode, const Environment& env );
void registerSlot ( const std::string& tag, CellDriver_t *d, const std::string& ext ); void registerSlot ( std::string tag, CellDriver_t *d, std::string ext );
void registerSlot ( const std::string& tag, LibraryDriver_t *d, const std::string& ext ); void registerSlot ( std::string tag, LibraryDriver_t *d, std::string ext );
void unRegisterSlot ( const Name& tag ); void unRegisterSlot ( std::string tag );
}; };

View File

@ -70,25 +70,18 @@ extern "C" {
{ {
cdebug_log(30,0) << "PyAllianceFramework_create()" << endl; cdebug_log(30,0) << "PyAllianceFramework_create()" << endl;
AllianceFramework* af = NULL; AllianceFramework* af = NULL;
PyAllianceFramework* pyAf = NULL; unsigned long flags = AllianceFramework::NoFlags;
unsigned long flags = AllianceFramework::NoFlags;
HTRY HTRY
PyObject* arg0; PyObject* arg0;
if (ParseOneArg("AllianceFramework.create()", args, INT_ARG, &arg0)) { if (ParseOneArg("AllianceFramework.create()", args, INT_ARG, &arg0)) {
flags = PyInt_AsUnsignedLongMask(arg0); flags = PyInt_AsUnsignedLongMask(arg0);
} }
af = AllianceFramework::create( flags );
af = AllianceFramework::create( flags );
pyAf = PyObject_NEW( PyAllianceFramework, &PyTypeAllianceFramework );
if (pyAf == NULL) return NULL;
pyAf->_object = af;
HCATCH HCATCH
return (PyObject*)pyAf; return PyAllianceFramework_Link( af );
} }
@ -96,19 +89,11 @@ extern "C" {
{ {
cdebug_log(30,0) << "PyAllianceFramework_get()" << endl; cdebug_log(30,0) << "PyAllianceFramework_get()" << endl;
AllianceFramework* af = NULL; AllianceFramework* af = NULL;
PyAllianceFramework* pyAf = NULL;
HTRY HTRY
af = AllianceFramework::get(); af = AllianceFramework::get();
pyAf = PyObject_NEW( PyAllianceFramework, &PyTypeAllianceFramework );
if (pyAf == NULL) return NULL;
pyAf->_object = af;
HCATCH HCATCH
return PyAllianceFramework_Link( af );
return (PyObject*)pyAf;
} }
@ -520,7 +505,7 @@ extern "C" {
// Standart Destroy (Attribute). // Standart Destroy (Attribute).
// DBoDestroyAttribute(PyAllianceFramework_destroy,PyAllianceFramework) DBoDestroyAttribute(PyAllianceFramework_destroy,PyAllianceFramework)
PyMethodDef PyAllianceFramework_Methods[] = PyMethodDef PyAllianceFramework_Methods[] =
@ -562,13 +547,13 @@ extern "C" {
, "Get a routing gauge (without a name, return the default)." } , "Get a routing gauge (without a name, return the default)." }
, { "setRoutingGauge" , (PyCFunction)PyAllianceFramework_setRoutingGauge , METH_VARARGS , { "setRoutingGauge" , (PyCFunction)PyAllianceFramework_setRoutingGauge , METH_VARARGS
, "Select the default routing gauge." } , "Select the default routing gauge." }
//, { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS , { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS
// , "Destroy the associated hurricane object. The python object remains." } , "Destroy the Framework, Hurricane-level objects remains." }
, {NULL, NULL, 0, NULL} /* sentinel */ , {NULL, NULL, 0, NULL} /* sentinel */
}; };
PythonOnlyDeleteMethod(AllianceFramework) DBoDeleteMethod(AllianceFramework)
PyTypeObjectLinkPyType(AllianceFramework) PyTypeObjectLinkPyType(AllianceFramework)
@ -579,8 +564,8 @@ extern "C" {
// | "PyAllianceFramework" Shared Library Code Part | // | "PyAllianceFramework" Shared Library Code Part |
// x=================================================================x // x=================================================================x
// Link/Creation Method. // Link/Creation Method.
DBoLinkCreateMethod(AllianceFramework)
PyTypeObjectDefinitions(AllianceFramework) PyTypeObjectDefinitions(AllianceFramework)

View File

@ -58,34 +58,52 @@ extern "C" {
// +=================================================================+ // +=================================================================+
static PyObject* PyAllianceLibrary_getLibrary ( PyAllianceLibrary* self, PyObject* args ) static PyObject* PyAllianceLibrary_getLibrary ( PyAllianceLibrary* self, PyObject* )
{ {
cdebug_log(30,0) << "PyAllianceLibrary_getLibrary()" << endl; cdebug_log(30,0) << "PyAllianceLibrary_getLibrary()" << endl;
Library* lib = NULL; Library* lib = NULL;
HTRY HTRY
METHOD_HEAD("AllianceLibrary.getLibrary()") METHOD_HEAD("AllianceLibrary.getLibrary()")
lib = alib->getLibrary(); lib = alib->getLibrary();
HCATCH HCATCH
return PyLibrary_Link(lib); return PyLibrary_Link(lib);
} }
static PyObject* PyAllianceLibrary_getPath ( PyAllianceLibrary* self, PyObject* args ) static PyObject* PyAllianceLibrary_getPath ( PyAllianceLibrary* self, PyObject* )
{ {
cdebug_log(30,0) << "PyAllianceLibrary_getPath()" << endl; cdebug_log(30,0) << "PyAllianceLibrary_getPath()" << endl;
HTRY HTRY
METHOD_HEAD("AllianceLibrary.getPath()") METHOD_HEAD("AllianceLibrary.getPath()")
return PyString_FromString( getString(alib->getPath()).c_str() ); return PyString_FromString( getString(alib->getPath()).c_str() );
HCATCH HCATCH
return NULL; return NULL;
} }
static PyObject* PyAllianceLibrary_saveCells ( PyAllianceLibrary* self, PyObject* )
{
cdebug_log(30,0) << "PyAllianceLibrary_saveCells()" << endl;
HTRY
METHOD_HEAD("AllianceLibrary.saveCells()")
alib->saveCells();
HCATCH
Py_RETURN_NONE;
}
static PyObject* PyAllianceLibrary_saveCATAL ( PyAllianceLibrary* self, PyObject* )
{
cdebug_log(30,0) << "PyAllianceLibrary_saveCATAL()" << endl;
HTRY
METHOD_HEAD("AllianceLibrary.saveCATAL()")
alib->saveCATAL();
HCATCH
Py_RETURN_NONE;
}
static PyObject* PyAllianceLibrary_Repr ( PyAllianceLibrary* self ) static PyObject* PyAllianceLibrary_Repr ( PyAllianceLibrary* self )
{ {
if ( self->ACCESS_OBJECT == NULL ) if ( self->ACCESS_OBJECT == NULL )
@ -105,6 +123,10 @@ extern "C" {
, "Return the complete path of the library." } , "Return the complete path of the library." }
, { "getLibrary" , (PyCFunction)PyAllianceLibrary_getLibrary , METH_NOARGS , { "getLibrary" , (PyCFunction)PyAllianceLibrary_getLibrary , METH_NOARGS
, "Returns the associated Hurricane library." } , "Returns the associated Hurricane library." }
, { "saveCells" , (PyCFunction)PyAllianceLibrary_saveCells , METH_NOARGS
, "Save all the library cells." }
, { "saveCATAL" , (PyCFunction)PyAllianceLibrary_saveCATAL , METH_NOARGS
, "Rewrite the library CATAL file." }
//, { "destroy" , (PyCFunction)PyAllianceLibrary_destroy , METH_VARARGS //, { "destroy" , (PyCFunction)PyAllianceLibrary_destroy , METH_VARARGS
// , "Destroy the associated hurricane object. The python object remains." } // , "Destroy the associated hurricane object. The python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */ , {NULL, NULL, 0, NULL} /* sentinel */

View File

@ -138,8 +138,9 @@ extern "C" {
if ( self->ACCESS_OBJECT == NULL ) if ( self->ACCESS_OBJECT == NULL )
return PyString_FromString("<PyObject unbound>"); return PyString_FromString("<PyObject unbound>");
string s = "<Environment Alliance>"; ostringstream s;
return PyString_FromString(s.c_str()); s << "<Alliance Environment " << (void*)self->ACCESS_OBJECT << ">";
return PyString_FromString(s.str().c_str());
} }

View File

@ -237,7 +237,7 @@ class PlaceRoute ( object ):
katana.loadGlobalRouting ( Anabatic.EngineLoadGrByNet ) katana.loadGlobalRouting ( Anabatic.EngineLoadGrByNet )
katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) katana.layerAssign ( Anabatic.EngineNoNetLayerAssign )
katana.runNegociate ( Katana.Flags.NoFlags ) katana.runNegociate ( Katana.Flags.NoFlags )
success = katana.getToolSuccess() success = katana.getSuccessState()
katana.finalizeLayout() katana.finalizeLayout()
katana.destroy() katana.destroy()

View File

@ -643,6 +643,8 @@ namespace Etesian {
//cerr << "Outside Pin: " << pin << endl; //cerr << "Outside Pin: " << pin << endl;
} }
string topCellInstancePin = getString(getCell()->getName()) + ":C";
for ( RoutingPad* rp : net->getRoutingPads() ) { for ( RoutingPad* rp : net->getRoutingPads() ) {
if (getBlockInstance() and (rp->getOccurrence().getPath().getHeadInstance() != getBlockInstance())) { if (getBlockInstance() and (rp->getOccurrence().getPath().getHeadInstance() != getBlockInstance())) {
// For Gabriel Gouvine : if there are multiple blocks (i.e. we have a true // For Gabriel Gouvine : if there are multiple blocks (i.e. we have a true
@ -661,8 +663,9 @@ namespace Etesian {
int_t ypin = offset.getY() / hpitch; int_t ypin = offset.getY() / hpitch;
auto iid = _cellsToIds.find( insName ); auto iid = _cellsToIds.find( insName );
if (iid == _cellsToIds.end() ) { if (iid == _cellsToIds.end()) {
cerr << Error( "Unable to lookup instance <%s>.", insName.c_str() ) << endl; if (insName != topCellInstancePin)
cerr << Error( "Unable to lookup instance \"%s\".", insName.c_str() ) << endl;
} else { } else {
pins.push_back( temporary_pin( point<int_t>(xpin,ypin), (*iid).second, netId ) ); pins.push_back( temporary_pin( point<int_t>(xpin,ypin), (*iid).second, netId ) );
} }
@ -798,7 +801,7 @@ namespace Etesian {
ostringstream label; ostringstream label;
label.str(""); label.str("");
label << " [" << setw(3) << setfill('0') << i << "] Bipart."; label << " [" << setw(3) << setfill('0') << i << setfill(' ') << "] Bipart.";
_progressReport1(label.str() ); _progressReport1(label.str() );
upperWL = static_cast<float_t>(get_HPWL_wirelength(_circuit, _placementUB)); upperWL = static_cast<float_t>(get_HPWL_wirelength(_circuit, _placementUB));
@ -862,7 +865,7 @@ namespace Etesian {
for ( int i=0; i<iterations; ++i ){ for ( int i=0; i<iterations; ++i ){
ostringstream label; ostringstream label;
label.str(""); label.str("");
label << " [" << setw(3) << setfill('0') << i << "]"; label << " [" << setw(3) << setfill('0') << i << setfill(' ') << "]";
optimize_x_orientations( _circuit, _placementUB ); // Don't disrupt VDD/VSS connections in a row optimize_x_orientations( _circuit, _placementUB ); // Don't disrupt VDD/VSS connections in a row
_progressReport1(label.str() + " Oriented ......." ); _progressReport1(label.str() + " Oriented ......." );

View File

@ -34,39 +34,7 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
# include "hurricane/Breakpoint.h" #include "hurricane/Breakpoint.h"
namespace {
using namespace std;
using namespace Hurricane;
bool simpleStopCb ( const string& message )
{
cerr << "[STOP] " << message << endl;
char answer = '?';
while ( answer == '?' ) {
cerr << " Type <y> to continue, <n> to abort: (y) ";
cerr.flush ();
cin >> answer;
switch ( answer ) {
case 'Y':
case 'y': answer = 'y'; break;
case 'N':
case 'n': answer = 'n'; break;
default: answer = '?';
}
}
return (answer == 'y');
}
} // End of anonymous namespace.
namespace Hurricane { namespace Hurricane {
@ -136,6 +104,27 @@ namespace Hurricane {
} }
bool Breakpoint::simpleStopCb ( const string& message )
{
cerr << "[STOP] " << message << endl;
char answer = '?';
while ( answer == '?' ) {
cerr << " Type <y> to continue, <n> to abort: (y) ";
cerr.flush ();
cin >> answer;
switch ( answer ) {
case 'Y':
case 'y': answer = 'y'; break;
case 'N':
case 'n': answer = 'n'; break;
default: answer = '?';
}
}
return (answer == 'y');
}
} // End of Hurricane namespace. } // End of Hurricane namespace.

View File

@ -25,6 +25,7 @@
hurricane/Box.h hurricane/Boxes.h hurricane/Box.h hurricane/Boxes.h
hurricane/Torus.h hurricane/Torus.h
hurricane/Cell.h hurricane/Cells.h hurricane/Cell.h hurricane/Cells.h
hurricane/CellsSort.h
hurricane/Collection.h hurricane/Collection.h
hurricane/Commons.h hurricane/Commons.h
hurricane/Component.h hurricane/Components.h hurricane/Component.h hurricane/Components.h
@ -154,6 +155,7 @@
Entity.cpp Entity.cpp
Cell.cpp Cell.cpp
CellCollections.cpp CellCollections.cpp
CellsSort.cpp
NetAlias.cpp NetAlias.cpp
Net.cpp Net.cpp
DeepNet.cpp DeepNet.cpp

View File

@ -1198,7 +1198,6 @@ void Cell::_preDestroy()
Markers markers = getMarkers (); while ( markers .getFirst() ) markers .getFirst()->destroy(); Markers markers = getMarkers (); while ( markers .getFirst() ) markers .getFirst()->destroy();
Instances instances = getSlaveInstances(); while ( instances.getFirst() ) instances.getFirst()->destroy(); Instances instances = getSlaveInstances(); while ( instances.getFirst() ) instances.getFirst()->destroy();
instances = getInstances (); while ( instances.getFirst() ) instances.getFirst()->destroy();
Nets nets = getNets(); Nets nets = getNets();
while ( nets.getFirst() ) { while ( nets.getFirst() ) {
@ -1208,6 +1207,12 @@ void Cell::_preDestroy()
} }
for ( auto islave : _netAliasSet ) delete islave; for ( auto islave : _netAliasSet ) delete islave;
instances = getInstances();
vector<Instance*> inss;
for ( Instance* instance : getInstances() ) inss.push_back( instance );
for ( Instance* instance : inss ) instance->destroy();
//while ( instances.getFirst() ) instances.getFirst()->destroy();
for ( Slice* slice : getSlices() ) slice->_destroy(); for ( Slice* slice : getSlices() ) slice->_destroy();
while ( not _extensionSlices.empty() ) _removeSlice( _extensionSlices.begin()->second ); while ( not _extensionSlices.empty() ) _removeSlice( _extensionSlices.begin()->second );

View File

@ -0,0 +1,119 @@
// -*- C++ -*-
//
// Copyright (c) BULL S.A. 2000-2020, All Rights Reserved
//
// This file is part of Hurricane.
//
// Hurricane is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// Hurricane is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
// General Public License for more details.
//
// You should have received a copy of the Lesser GNU General Public
// License along with Hurricane. If not, see
// <http://www.gnu.org/licenses/>.
//
// +-----------------------------------------------------------------+
// | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e |
// | |
// | Author : Jean-Paul Chaput |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./CellsSort.cpp" |
// +-----------------------------------------------------------------+
#include <algorithm>
#include "hurricane/CellsSort.h"
#include "hurricane/Cells.h"
#include "hurricane/Library.h"
namespace Hurricane {
// -------------------------------------------------------------------
// Class : "DepthProperty".
template<>
Name DepthProperty::_name = "Hurricane::DepthProperty";
// -------------------------------------------------------------------
// Class : "CellsSort".
CellsSort::CellsSort ()
: _sortedCells ()
, _depthProperties()
{ }
void CellsSort::addLibrary ( Library* library )
{
for ( Cell* cell : library->getCells() ) {
if (cell->getProperty(DepthProperty::staticGetName())) continue;
DepthProperty* property = DepthProperty::create( 0 );
cell->put( property );
_depthProperties.push_back( property );
}
for ( Library* childLib : library->getLibraries() ) {
addLibrary( childLib );
}
}
void CellsSort::sort ()
{
for ( DepthProperty* property : _depthProperties ) {
Cell* cell = dynamic_cast<Cell*>( property->getOwner() );
// This is a terminal cell.
if (not cell->getInstances().getFirst()) continue;
// The depth of this cell has already been computed.
if (property->getValue()) continue;
_computeDepth( cell );
}
std::sort( _depthProperties.begin(), _depthProperties.end(), CompareByDepth() );
for ( DepthProperty* property : _depthProperties ) {
Cell* cell = dynamic_cast<Cell*>(property->getOwner());
_sortedCells.push_back( cell );
cell->remove( property );
}
std::vector<DepthProperty*>().swap( _depthProperties );
}
void CellsSort::_computeDepth ( Cell* cell )
{
size_t depth = 0;
DepthProperty* parentDepthProp = dynamic_cast<DepthProperty*>( cell->getProperty( DepthProperty::staticGetName() ));
for ( Instance* instance : cell->getInstances() ) {
Cell* masterCell = instance->getMasterCell();
DepthProperty* childDepthProp = dynamic_cast<DepthProperty*>( masterCell->getProperty(DepthProperty::staticGetName()) );
if (not childDepthProp) continue;
if (childDepthProp->getValue() == 0) {
_computeDepth( masterCell );
}
depth = std::max( depth, childDepthProp->getValue() + 1 );
}
parentDepthProp->setValue( depth );
}
} // Hurricane namespace.

View File

@ -36,6 +36,7 @@
#include "hurricane/Property.h" #include "hurricane/Property.h"
#include "hurricane/Quark.h" #include "hurricane/Quark.h"
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/Warning.h"
namespace Hurricane { namespace Hurricane {
@ -49,6 +50,7 @@ namespace Hurricane {
unsigned long DBo::_flags = 0; unsigned long DBo::_flags = 0;
unsigned int DBo::_nextId = 0; unsigned int DBo::_nextId = 0;
unsigned int DBo::_idCounterLimit = 0; unsigned int DBo::_idCounterLimit = 0;
unsigned int DBo::_idCount = 0;
unsigned int DBo::_idCounter = 1; unsigned int DBo::_idCounter = 1;
@ -64,6 +66,17 @@ namespace Hurricane {
{ return _idCounter; } { return _idCounter; }
void DBo::resetId ()
{
_idCounter = 1;
if (_idCount != 1) {
cerr << Error( "DBo::resetId(): Resetting the Id identifiers while there are still %d DBo objects."
, _idCount
) << endl;
}
}
bool DBo::inForcedIdMode () bool DBo::inForcedIdMode ()
{ return _flags & ForcedIdMode; } { return _flags & ForcedIdMode; }
@ -139,11 +152,18 @@ namespace Hurricane {
// } // }
// if (_id == 75060) // if (_id == 75060)
// cerr << "DBo::DBo() " << this << endl; // cerr << "DBo::DBo() " << this << endl;
++_idCount;
} }
DBo::~DBo () throw(Error) DBo::~DBo () throw(Error)
{ } {
if (_idCount) --_idCount;
else {
cerr << Warning( "BDo::~DBo(): _idCount is becoming negative. Severe database corruption ahead." ) << endl;
}
}
void DBo::_postCreate () void DBo::_postCreate ()
@ -160,7 +180,7 @@ namespace Hurricane {
void DBo::destroy () void DBo::destroy ()
{ {
cdebug_log(0,1) << "DBo::destroy() " << this << endl; cdebug_log(0,1) << "DBo::destroy() " << getId() << " " << this << endl;
_preDestroy(); _preDestroy();
cdebug_tabw(0,-1); cdebug_tabw(0,-1);
delete this; delete this;

View File

@ -21,11 +21,13 @@
#include "hurricane/Initializer.h" #include "hurricane/Initializer.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Error.h" #include "hurricane/Error.h"
#include "hurricane/SharedName.h"
#include "hurricane/SharedPath.h" #include "hurricane/SharedPath.h"
#include "hurricane/UpdateSession.h" #include "hurricane/UpdateSession.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
#include "hurricane/Technology.h" #include "hurricane/Technology.h"
#include "hurricane/Library.h" #include "hurricane/Library.h"
#include "hurricane/CellsSort.h"
namespace { namespace {
@ -149,6 +151,8 @@ void DataBase::_postCreate()
void DataBase::_preDestroy() void DataBase::_preDestroy()
// ************************ // ************************
{ {
clear();
UpdateSession::open(); UpdateSession::open();
Inherit::_preDestroy(); Inherit::_preDestroy();
@ -156,6 +160,7 @@ void DataBase::_preDestroy()
if (_technology) _technology->destroy(); if (_technology) _technology->destroy();
UpdateSession::close(); UpdateSession::close();
DBo::resetId();
_db = NULL; _db = NULL;
} }
@ -277,6 +282,22 @@ Cell* DataBase::getCell(string name)
return NULL; return NULL;
} }
void DataBase::clear()
// *******************
{
UpdateSession::open();
CellsSort cs = CellsSort();
cs.addLibrary( _rootLibrary );
cs.sort();
for ( Cell* cell : cs.getSortedCells() ) cell->destroy();
if (_rootLibrary) _rootLibrary->destroy();
UpdateSession::close();
//SharedName::dump();
}
void DataBase::_toJson(JsonWriter* w) const void DataBase::_toJson(JsonWriter* w) const
// **************************************** // ****************************************
{ {

View File

@ -59,9 +59,9 @@ namespace Hurricane {
SlaveEntityMap::iterator it; SlaveEntityMap::iterator it;
SlaveEntityMap::iterator end; SlaveEntityMap::iterator end;
getCell()->_getSlaveEntities(this,it,end); getCell()->_getSlaveEntities(this,it,end);
for(; it != end ; it++) for( ; it != end ; it++)
slaveEntities.push_back(it->second); slaveEntities.push_back(it->second);
for(; slaveEntities.size() ; slaveEntities.pop_back()) { for( ; slaveEntities.size() ; slaveEntities.pop_back()) {
slaveEntities.back()->destroy(); slaveEntities.back()->destroy();
} }
@ -69,21 +69,19 @@ namespace Hurricane {
if (quark) quark->destroy(); if (quark) quark->destroy();
stack<SharedPath*> sharedPathStack; stack<SharedPath*> sharedPathStack;
for_each_instance(instance, getCell()->getSlaveInstances()) { for ( Instance* instance : getCell()->getSlaveInstances() ) {
SharedPath* sharedPath = instance->_getSharedPath(NULL); SharedPath* sharedPath = instance->_getSharedPath(NULL);
if (sharedPath) sharedPathStack.push(sharedPath); if (sharedPath) sharedPathStack.push(sharedPath);
end_for;
} }
while (!sharedPathStack.empty()) { while (not sharedPathStack.empty()) {
SharedPath* sharedPath = sharedPathStack.top(); SharedPath* sharedPath = sharedPathStack.top();
sharedPathStack.pop(); sharedPathStack.pop();
Quark* quark = _getQuark(sharedPath); Quark* quark = _getQuark(sharedPath);
if (quark) quark->destroy(); if (quark) quark->destroy();
Cell* cell = sharedPath->getOwnerCell(); Cell* cell = sharedPath->getOwnerCell();
for_each_instance(instance, cell->getSlaveInstances()) { for ( Instance* instance : cell->getSlaveInstances() ) {
SharedPath* sharedPath2 = instance->_getSharedPath(sharedPath); SharedPath* sharedPath2 = instance->_getSharedPath(sharedPath);
if (sharedPath2) sharedPathStack.push(sharedPath2); if (sharedPath2) sharedPathStack.push(sharedPath2);
end_for;
} }
} }

View File

@ -596,7 +596,8 @@ void Instance::_postCreate()
void Instance::_preDestroy() void Instance::_preDestroy()
// ************************ // ************************
{ {
for ( SharedPath* sharedPath : _getSharedPathes() ) delete sharedPath; SharedPathes pathes = _getSharedPathes();
while ( pathes.getFirst() ) delete pathes.getFirst();
Inherit::_preDestroy(); Inherit::_preDestroy();

View File

@ -717,11 +717,13 @@ void Net::_preDestroy()
Inherit::_preDestroy(); Inherit::_preDestroy();
cdebug_log(18,0) << "Net::_preDestroy: " << this << " slave Plugs..." << endl;
Plugs plugs = getSlavePlugs(); Plugs plugs = getSlavePlugs();
while ( plugs.getFirst() ) plugs.getFirst()->_destroy(); while ( plugs.getFirst() ) plugs.getFirst()->_destroy();
unmaterialize(); unmaterialize();
cdebug_log(18,0) << "Net::_preDestroy: " << this << " slave Rubbers..." << endl;
Rubbers rubbers = getRubbers(); Rubbers rubbers = getRubbers();
while ( rubbers.getFirst() ) rubbers.getFirst()->_destroy(); while ( rubbers.getFirst() ) rubbers.getFirst()->_destroy();
@ -735,7 +737,13 @@ void Net::_preDestroy()
// over a collection as it is modificated/destroyed! // over a collection as it is modificated/destroyed!
} }
} }
cdebug_log(18,0) << "Net::_preDestroy: " << this << " RoutingPads..." << endl;
vector<RoutingPad*> rps;
for ( RoutingPad* rp : getRoutingPads() ) rps.push_back( rp );
for ( RoutingPad* rp : rps ) rp->destroy();
cdebug_log(18,0) << "Net::_preDestroy: " << this << " Components..." << endl;
Components components = getComponents(); Components components = getComponents();
while ( components.getFirst() ) { while ( components.getFirst() ) {
Component* component = components.getFirst(); Component* component = components.getFirst();
@ -743,6 +751,7 @@ void Net::_preDestroy()
else (static_cast<Plug*>(component))->setNet(NULL); else (static_cast<Plug*>(component))->setNet(NULL);
} }
cdebug_log(18,0) << "Net::_preDestroy: " << this << " Names/Aliases..." << endl;
_mainName.clear(); _mainName.clear();
_cell->_getNetMap()._remove(this); _cell->_getNetMap()._remove(this);

View File

@ -83,6 +83,14 @@ Record* SharedName::_getRecord() const
return record; return record;
} }
void SharedName::dump ()
// **********************
{
cerr << "_SHARED_NAME_MAP contents:" << endl;
for ( auto item : *_SHARED_NAME_MAP ) {
cerr << "- [" << item.first << "] = " << item.second << endl;
}
}
// **************************************************************************************************** // ****************************************************************************************************

View File

@ -43,6 +43,8 @@ namespace Hurricane {
public: public:
typedef bool ( StopCb_t )( const string& ); typedef bool ( StopCb_t )( const string& );
public:
static bool simpleStopCb ( const string& message );
public: public:
static Breakpoint* get (); static Breakpoint* get ();
static void setStopCb ( StopCb_t* ); static void setStopCb ( StopCb_t* );

View File

@ -0,0 +1,84 @@
// -*- C++ -*-
//
// Copyright (c) BULL S.A. 2000-2020, All Rights Reserved
//
// This file is part of Hurricane.
//
// Hurricane is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// Hurricane is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
// General Public License for more details.
//
// You should have received a copy of the Lesser GNU General Public
// License along with Hurricane. If not, see
// <http://www.gnu.org/licenses/>.
//
// +-----------------------------------------------------------------+
// | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e |
// | |
// | Author : Jean-Paul Chaput |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Header : "./hurricane/CellsSort.h" |
// +-----------------------------------------------------------------+
#ifndef HURRICANE_CELLS_SORT_H
#define HURRICANE_CELLS_SORT_H
#include <tuple>
#include <vector>
#include "hurricane/Property.h"
namespace Hurricane {
class Library;
class Cell;
// -------------------------------------------------------------------
// Class : "DepthProperty".
typedef StandardPrivateProperty<size_t> DepthProperty;
// -------------------------------------------------------------------
// Class : "CellsSort".
class CellsSort {
public:
class CompareByDepth {
public:
inline bool operator() ( const DepthProperty*, const DepthProperty* );
};
public:
CellsSort ();
void addLibrary ( Library* );
void sort ();
inline const std::vector<Cell*>& getSortedCells () const;
private:
void _computeDepth ( Cell* );
private:
std::vector<Cell*> _sortedCells;
std::vector<DepthProperty*> _depthProperties;
};
inline const std::vector<Cell*>& CellsSort::getSortedCells () const { return _sortedCells; }
inline bool CellsSort::CompareByDepth::operator() ( const DepthProperty* lhs, const DepthProperty* rhs )
{ return lhs->getValue() > rhs->getValue(); }
} // Hurricane namespace.
#endif // HURRICANE_CELLS_SORT_H

View File

@ -55,6 +55,7 @@ namespace Hurricane {
static unsigned int getIdCounter (); static unsigned int getIdCounter ();
unsigned int getNextId (); unsigned int getNextId ();
static void setNextId ( unsigned int ); static void setNextId ( unsigned int );
static void resetId ();
static bool inForcedIdMode (); static bool inForcedIdMode ();
static void enableForcedIdMode (); static void enableForcedIdMode ();
static void disableForcedIdMode (); static void disableForcedIdMode ();
@ -92,6 +93,7 @@ namespace Hurricane {
static unsigned int _memoryLimit; static unsigned int _memoryLimit;
static unsigned long _flags; static unsigned long _flags;
static unsigned int _nextId; static unsigned int _nextId;
static unsigned int _idCount;
static unsigned int _idCounter; static unsigned int _idCounter;
static unsigned int _idCounterLimit; static unsigned int _idCounterLimit;
unsigned int _id; unsigned int _id;

View File

@ -87,6 +87,7 @@ class DataBase : public DBo {
public: Library* getLibrary(string,unsigned int flags); public: Library* getLibrary(string,unsigned int flags);
public: Cell* getCell(string, unsigned int flags); public: Cell* getCell(string, unsigned int flags);
public: Cell* getCell(string); public: Cell* getCell(string);
public: void clear();
public: static DataBase* getDB(); public: static DataBase* getDB();
}; };

View File

@ -31,7 +31,8 @@ namespace Hurricane {
class SharedName { class SharedName {
friend class Name; friend class Name;
public:
static void dump ();
public: public:
inline unsigned long getHash () const; inline unsigned long getHash () const;
const string& _getSString () const { return _string; }; const string& _getSString () const { return _string; };

View File

@ -121,6 +121,7 @@ extern "C" {
// Standart Accessors (Attributes). // Standart Accessors (Attributes).
// Standart Destroy (Attribute). // Standart Destroy (Attribute).
DirectVoidMethod(DataBase,db,clear)
DBoDestroyAttribute(PyDataBase_destroy,PyDataBase) DBoDestroyAttribute(PyDataBase_destroy,PyDataBase)
@ -135,6 +136,7 @@ extern "C" {
, { "getTechnology" , (PyCFunction)PyDataBase_getTechnology , METH_NOARGS , "Return the Technology" } , { "getTechnology" , (PyCFunction)PyDataBase_getTechnology , METH_NOARGS , "Return the Technology" }
, { "getRootLibrary", (PyCFunction)PyDataBase_getRootLibrary, METH_NOARGS , "Return the root library" } , { "getRootLibrary", (PyCFunction)PyDataBase_getRootLibrary, METH_NOARGS , "Return the root library" }
, { "getCell" , (PyCFunction)PyDataBase_getCell , METH_VARARGS, "Return a Cell" } , { "getCell" , (PyCFunction)PyDataBase_getCell , METH_VARARGS, "Return a Cell" }
, { "clear" , (PyCFunction)PyDataBase_clear , METH_NOARGS , "Clear all the cells, keeps technology" }
, { "destroy" , (PyCFunction)PyDataBase_destroy , METH_NOARGS , { "destroy" , (PyCFunction)PyDataBase_destroy , METH_NOARGS
, "Destroy associated hurricane object The python object remains." } , "Destroy associated hurricane object The python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */ , {NULL, NULL, 0, NULL} /* sentinel */

View File

@ -924,7 +924,7 @@ namespace Hurricane {
void CellViewer::runStressScript () void CellViewer::runStressScript ()
{ {
for ( size_t i=0 ; i<1000 ; ++i ) { for ( size_t i=0 ; i<1000 ; ++i ) {
cerr << "Calling ./stressScript [" << setw(3) << right << setfill('0') << i << "]" << endl; cerr << "Calling ./stressScript [" << setw(3) << right << setfill('0') << i << "]" << setfill(' ') << endl;
ExceptionWidget::catchAllWrapper( std::bind( &CellViewer::_runScript, this, "stressScript.py" ) ); ExceptionWidget::catchAllWrapper( std::bind( &CellViewer::_runScript, this, "stressScript.py" ) );
} }
} }

View File

@ -1,15 +1,9 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2018, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2020, All Rights Reserved
// //
// =================================================================== // +-----------------------------------------------------------------+
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
@ -17,10 +11,7 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./ColorScale.cpp" | // | C++ Module : "./ColorScale.cpp" |
// | *************************************************************** | // +-----------------------------------------------------------------+
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include "hurricane/viewer/ColorScale.h" #include "hurricane/viewer/ColorScale.h"
@ -68,6 +59,20 @@ namespace Hurricane {
} }
void ColorScale::qtFree ()
{
if ( !_brush[0] ) {
for ( size_t i=0 ; i<256 ; i++ ) {
delete _brush[i];
delete _color[i];
_color[i] = NULL;
_brush[i] = NULL;
}
}
}
QBrush ColorScale::getBrush ( size_t i, const DisplayStyle::HSVr& darkening ) const QBrush ColorScale::getBrush ( size_t i, const DisplayStyle::HSVr& darkening ) const
{ {
assert ( _brush[i] != NULL ); assert ( _brush[i] != NULL );

View File

@ -76,11 +76,7 @@ namespace Hurricane {
RawDrawingStyle::~RawDrawingStyle () RawDrawingStyle::~RawDrawingStyle ()
{ {
if ( _color ) { qtFree();
delete _color;
delete _pen;
delete _brush;
}
} }
@ -111,18 +107,32 @@ namespace Hurricane {
void RawDrawingStyle::qtAllocate () void RawDrawingStyle::qtAllocate ()
{ {
if ( !_color ) { if (not _color) {
_color = new QColor ( _red, _green, _blue ); _color = new QColor ( _red, _green, _blue );
_pen = new QPen (); _pen = new QPen ();
if ( _borderWidth ) { if (_borderWidth) {
_pen->setStyle ( Qt::SolidLine ); _pen->setStyle( Qt::SolidLine );
_pen->setWidth ( _borderWidth ); _pen->setWidth( _borderWidth );
} else } else
_pen->setStyle ( Qt::NoPen ); _pen->setStyle( Qt::NoPen );
_pen->setColor ( *_color ); _pen->setColor( *_color );
_brush = Hurricane::getBrush ( _pattern, _red, _green, _blue ); _brush = Hurricane::getBrush( _pattern, _red, _green, _blue );
}
}
void RawDrawingStyle::qtFree ()
{
if (_color) {
delete _brush;
delete _pen;
delete _color;
_brush = NULL;
_pen = NULL;
_color = NULL;
} }
} }
@ -280,6 +290,13 @@ namespace Hurricane {
} }
void DrawingGroup::qtFree ()
{
for ( size_t i=0 ; i < _drawingStyles.size() ; i++ )
_drawingStyles[i]->qtFree ();
}
DrawingGroup* DrawingGroup::getClone () DrawingGroup* DrawingGroup::getClone ()
{ {
DrawingGroup* clone = new DrawingGroup ( getName() ); DrawingGroup* clone = new DrawingGroup ( getName() );
@ -494,6 +511,13 @@ namespace Hurricane {
} }
void DisplayStyle::qtFree ()
{
for ( size_t gi=0 ; gi < _groups.size() ; gi++ )
_groups[gi]->qtFree ();
}
const Name& DisplayStyle::getGroup ( const Name& key ) const const Name& DisplayStyle::getGroup ( const Name& key ) const
{ {
for ( size_t gi=0 ; gi < _groups.size() ; gi++ ) { for ( size_t gi=0 ; gi < _groups.size() ; gi++ ) {

View File

@ -144,6 +144,20 @@ namespace Hurricane {
} }
void Graphics::_disable ()
{
_qtEnabled = false;
for ( size_t si=0 ; si < _styles.size() ; si++ )
_styles[si]->qtFree ();
_fireColorScale.qtFree ();
_rainbowColorScale.qtFree();
_temperatureColorScale.qtFree();
Breakpoint::setStopCb ( Breakpoint::simpleStopCb );
}
size_t Graphics::_findStyle ( const Name& name ) const size_t Graphics::_findStyle ( const Name& name ) const
{ {
size_t si = 0; size_t si = 0;
@ -212,6 +226,16 @@ namespace Hurricane {
} }
void Graphics::_clear ()
{
_disable();
_active = NULL;
for ( DisplayStyle* style : _styles ) delete style;
_styles.clear();
}
bool Graphics::isEnabled () bool Graphics::isEnabled ()
{ return getGraphics()->_qtEnabled; } { return getGraphics()->_qtEnabled; }
@ -224,6 +248,10 @@ namespace Hurricane {
{ return getGraphics()->_enable(); } { return getGraphics()->_enable(); }
void Graphics::disable ()
{ return getGraphics()->_disable(); }
void Graphics::addStyle ( DisplayStyle* displayStyle ) void Graphics::addStyle ( DisplayStyle* displayStyle )
{ {
getGraphics()->_addStyle ( displayStyle ); getGraphics()->_addStyle ( displayStyle );
@ -351,6 +379,7 @@ namespace Hurricane {
return value; return value;
} }
bool Graphics::breakpointStopCb ( const string& message ) bool Graphics::breakpointStopCb ( const string& message )
{ {
static BreakpointWidget* bpw = NULL; static BreakpointWidget* bpw = NULL;
@ -364,6 +393,12 @@ namespace Hurricane {
} }
void Graphics::clear ()
{
return getGraphics()->_clear();
}
void Graphics::toJson ( JsonWriter* w ) const void Graphics::toJson ( JsonWriter* w ) const
{ {
w->startObject(); w->startObject();

View File

@ -2,14 +2,14 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved // Copyright (c) UPMC/LIP6 2010-2020, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | C O R I O L I S | // | C O R I O L I S |
// | Alliance / Hurricane Interface | // | Alliance / Hurricane Interface |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./PyGraphics.cpp" | // | C++ Module : "./PyGraphics.cpp" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
@ -284,11 +284,29 @@ extern "C" {
static PyObject* PyGraphics_enable ( PyObject*, PyObject* args ) static PyObject* PyGraphics_enable ( PyObject*, PyObject* args )
{ {
cdebug_log(20,0) << "PyGraphics_enable()" << endl; cdebug_log(20,0) << "PyGraphics_enable()" << endl;
HTRY HTRY
Graphics::getGraphics()->enable(); Graphics::getGraphics()->enable();
HCATCH HCATCH
Py_RETURN_NONE;
}
static PyObject* PyGraphics_disable ( PyObject*, PyObject* args )
{
cdebug_log(20,0) << "PyGraphics_disable()" << endl;
HTRY
Graphics::getGraphics()->disable();
HCATCH
Py_RETURN_NONE;
}
static PyObject* PyGraphics_clear ( PyObject*, PyObject* args )
{
cdebug_log(20,0) << "PyGraphics_clear()" << endl;
HTRY
Graphics::getGraphics()->clear();
HCATCH
Py_RETURN_NONE; Py_RETURN_NONE;
} }
@ -342,6 +360,10 @@ extern "C" {
, "Return the list of all availables styles (only iterable)." } , "Return the list of all availables styles (only iterable)." }
, { "enable" , (PyCFunction)PyGraphics_enable , METH_NOARGS|METH_STATIC , { "enable" , (PyCFunction)PyGraphics_enable , METH_NOARGS|METH_STATIC
, "Bind to Qt, effectively calling Qt and allocating all objects." } , "Bind to Qt, effectively calling Qt and allocating all objects." }
, { "disable" , (PyCFunction)PyGraphics_disable , METH_NOARGS|METH_STATIC
, "Unbind from Qt, removing all allocated objects." }
, { "clear" , (PyCFunction)PyGraphics_clear , METH_NOARGS|METH_STATIC
, "Remove all loaded styles, but keep the singleton." }
//, { "destroy" , (PyCFunction)PyGraphics_destroy , METH_NOARGS //, { "destroy" , (PyCFunction)PyGraphics_destroy , METH_NOARGS
// , "Destroy the associated hurricane object. The python object remains." } // , "Destroy the associated hurricane object. The python object remains." }
, {NULL, NULL, 0, NULL} /* sentinel */ , {NULL, NULL, 0, NULL} /* sentinel */

View File

@ -1,31 +1,21 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2018, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2020, All Rights Reserved
// //
// =================================================================== // +-----------------------------------------------------------------+
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./ColorScale.h" | // | C++ Header : "./hurricane/viewer/ColorScale.h" |
// | *************************************************************** | // +-----------------------------------------------------------------+
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#ifndef __HURRICANE_COLOR_SCALE__ #ifndef HURRICANE_COLOR_SCALE_H
#define __HURRICANE_COLOR_SCALE__ #define HURRICANE_COLOR_SCALE_H
#include <QColor> #include <QColor>
#include <QBrush> #include <QBrush>
@ -53,6 +43,7 @@ namespace Hurricane {
public: public:
// Accessors. // Accessors.
void qtAllocate (); void qtAllocate ();
void qtFree ();
inline const Name& getName () const; inline const Name& getName () const;
QBrush getBrush ( size_t, const DisplayStyle::HSVr& darkening ) const; QBrush getBrush ( size_t, const DisplayStyle::HSVr& darkening ) const;
@ -110,7 +101,6 @@ namespace Hurricane {
inline const Name& ColorScale::getName () const { return _name; } inline const Name& ColorScale::getName () const { return _name; }
} // End of Hurricane namespace. } // Hurricane namespace.
#endif // HURRICANE_COLOR_SCALE_H
#endif // __HURRICANE_COLOR_SCALE__

View File

@ -1,14 +1,14 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC 2008-2018, All Rights Reserved // Copyright (c) UPMC 2008-2020, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./hurricane/viewer/DisplayStyle.h" | // | C++ Header : "./hurricane/viewer/DisplayStyle.h" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
@ -44,6 +44,7 @@ namespace Hurricane {
~DrawingGroup (); ~DrawingGroup ();
DrawingGroup* getClone (); DrawingGroup* getClone ();
void qtAllocate (); void qtAllocate ();
void qtFree ();
// Methods. // Methods.
inline const Name& getName () const; inline const Name& getName () const;
inline const DrawingStyles& getDrawingStyles () const; inline const DrawingStyles& getDrawingStyles () const;
@ -150,6 +151,7 @@ namespace Hurricane {
// Modifiers. // Modifiers.
void qtAllocate (); void qtAllocate ();
void qtFree ();
inline void setDescription ( const std::string& description ); inline void setDescription ( const std::string& description );
inline void setDescription ( const char* description ); inline void setDescription ( const char* description );
void inheritFrom ( const DisplayStyle* base ); void inheritFrom ( const DisplayStyle* base );
@ -230,6 +232,7 @@ namespace Hurricane {
public: public:
// Accessors. // Accessors.
void qtAllocate (); void qtAllocate ();
void qtFree ();
inline bool isGoMatched () const; inline bool isGoMatched () const;
inline const Name& getName () const; inline const Name& getName () const;
inline const std::string& getPattern () const; inline const std::string& getPattern () const;

View File

@ -67,6 +67,7 @@ namespace Hurricane {
static string toHtml ( const string& ); static string toHtml ( const string& );
static int toHighDpi ( int ); static int toHighDpi ( int );
static bool breakpointStopCb ( const string& message ); static bool breakpointStopCb ( const string& message );
static void clear ();
// Modifiers. // Modifiers.
static void addStyle ( DisplayStyle* displayStyle ); static void addStyle ( DisplayStyle* displayStyle );
static void setStyle ( const Name& key ); static void setStyle ( const Name& key );
@ -75,6 +76,7 @@ namespace Hurricane {
static DisplayStyle* getStyle (); static DisplayStyle* getStyle ();
static const vector<DisplayStyle*>& getStyles (); static const vector<DisplayStyle*>& getStyles ();
static void enable (); static void enable ();
static void disable ();
void toJson ( JsonWriter* ) const; void toJson ( JsonWriter* ) const;
// Internals - Attributes. // Internals - Attributes.
protected: protected:
@ -110,8 +112,10 @@ namespace Hurricane {
inline float _getThreshold ( const Name& key ) const; inline float _getThreshold ( const Name& key ) const;
inline const DisplayStyle::HSVr& _getDarkening () const; inline const DisplayStyle::HSVr& _getDarkening () const;
inline const ColorScale& _getColorScale ( ColorScale::ScaleType ) const; inline const ColorScale& _getColorScale ( ColorScale::ScaleType ) const;
inline void _enable (); void _enable ();
void _disable ();
inline const TextTranslator& _getHtmlTranslator () const; inline const TextTranslator& _getHtmlTranslator () const;
void _clear ();
}; };

View File

@ -638,7 +638,7 @@ namespace Katana {
} }
_eventQueue.commit(); _eventQueue.commit();
cmess2 << " <repair.queue:" << right << setw(8) << setfill('0') cmess2 << " <repair.queue:" << right << setw(8) << setfill('0')
<< _eventQueue.size() << ">" << endl; << _eventQueue.size() << ">" << setfill(' ') << endl;
count = 0; count = 0;
//_eventQueue.prepareRepair(); //_eventQueue.prepareRepair();