diff --git a/crlcore/etc/CMakeLists.txt b/crlcore/etc/CMakeLists.txt index fee715fc..247cc243 100644 --- a/crlcore/etc/CMakeLists.txt +++ b/crlcore/etc/CMakeLists.txt @@ -5,4 +5,5 @@ install( DIRECTORY 180 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY 45 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY node180 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) + install( DIRECTORY node600 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) diff --git a/crlcore/etc/node600/__init__.py b/crlcore/etc/node600/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crlcore/etc/node600/phenitec/__init__.py b/crlcore/etc/node600/phenitec/__init__.py new file mode 100644 index 00000000..5ba0b2db --- /dev/null +++ b/crlcore/etc/node600/phenitec/__init__.py @@ -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() diff --git a/crlcore/etc/node600/phenitec/alliance.py b/crlcore/etc/node600/phenitec/alliance.py new file mode 100644 index 00000000..1989a623 --- /dev/null +++ b/crlcore/etc/node600/phenitec/alliance.py @@ -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 ) diff --git a/crlcore/etc/node600/phenitec/analog.py b/crlcore/etc/node600/phenitec/analog.py new file mode 100644 index 00000000..b6b4aa78 --- /dev/null +++ b/crlcore/etc/node600/phenitec/analog.py @@ -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 diff --git a/crlcore/etc/node600/phenitec/devices.py b/crlcore/etc/node600/phenitec/devices.py new file mode 100644 index 00000000..bf902acd --- /dev/null +++ b/crlcore/etc/node600/phenitec/devices.py @@ -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' ), + ) + ) + diff --git a/crlcore/etc/node600/phenitec/display.py b/crlcore/etc/node600/phenitec/display.py new file mode 100644 index 00000000..d1ebabe0 --- /dev/null +++ b/crlcore/etc/node600/phenitec/display.py @@ -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 ) diff --git a/crlcore/etc/node600/phenitec/etesian.py b/crlcore/etc/node600/phenitec/etesian.py new file mode 100644 index 00000000..291ada86 --- /dev/null +++ b/crlcore/etc/node600/phenitec/etesian.py @@ -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 diff --git a/crlcore/etc/node600/phenitec/kite.py b/crlcore/etc/node600/phenitec/kite.py new file mode 100644 index 00000000..66f1da0b --- /dev/null +++ b/crlcore/etc/node600/phenitec/kite.py @@ -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 ) diff --git a/crlcore/etc/node600/phenitec/misc.py b/crlcore/etc/node600/phenitec/misc.py new file mode 100644 index 00000000..160f5537 --- /dev/null +++ b/crlcore/etc/node600/phenitec/misc.py @@ -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 diff --git a/crlcore/etc/node600/phenitec/patterns.py b/crlcore/etc/node600/phenitec/patterns.py new file mode 100644 index 00000000..2a0006a5 --- /dev/null +++ b/crlcore/etc/node600/phenitec/patterns.py @@ -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 diff --git a/crlcore/etc/node600/phenitec/plugins.py b/crlcore/etc/node600/phenitec/plugins.py new file mode 100644 index 00000000..a494a988 --- /dev/null +++ b/crlcore/etc/node600/phenitec/plugins.py @@ -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') diff --git a/crlcore/etc/node600/phenitec/stratus1.py b/crlcore/etc/node600/phenitec/stratus1.py new file mode 100644 index 00000000..51f37e37 --- /dev/null +++ b/crlcore/etc/node600/phenitec/stratus1.py @@ -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" ) diff --git a/crlcore/etc/node600/phenitec/technology.py b/crlcore/etc/node600/phenitec/technology.py new file mode 100644 index 00000000..fc40f049 --- /dev/null +++ b/crlcore/etc/node600/phenitec/technology.py @@ -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 ) diff --git a/crlcore/etc/symbolic/phenitec06/alliance.conf b/crlcore/etc/symbolic/phenitec06/alliance.conf index b3fabad4..ef461b89 100644 --- a/crlcore/etc/symbolic/phenitec06/alliance.conf +++ b/crlcore/etc/symbolic/phenitec06/alliance.conf @@ -20,7 +20,7 @@ allianceConfig = \ ( ( 'CATALOG' , 'CATAL') , ( 'WORKING_LIBRARY' , '.') , ( 'SYSTEM_LIBRARY' , ( (cellsTop+'/nsxlib' , Environment.Append) - , (cellsTop+'/mpxlib' , Environment.Append)) ) + , (cellsTop+'/phlib80' , Environment.Append)) ) , ( 'SCALE_X' , 100) , ( 'IN_LO' , 'vst') , ( 'IN_PH' , 'ap') @@ -33,7 +33,7 @@ allianceConfig = \ , ( 'PAD' , '.*_sp$') # The following are only read by the Alliance tool wrappers. , ( 'ALLIANCE_TOP' , allianceTop) - , ( 'MBK_TARGET_LIB' , cellsTop+'/msxlib') + , ( 'MBK_TARGET_LIB' , cellsTop+'/nsxlib') , ( 'RDS_TECHNO_NAME' , allianceTop+'/etc/scn6m_deep_09.rds') , ( 'GRAAL_TECHNO_NAME' , allianceTop+'/etc/graal.rds') ) diff --git a/crlcore/python/helpers/__init__.py b/crlcore/python/helpers/__init__.py index 6f404162..d9e170bc 100644 --- a/crlcore/python/helpers/__init__.py +++ b/crlcore/python/helpers/__init__.py @@ -24,6 +24,8 @@ import os.path import re import traceback import Hurricane +import Viewer +import CRL import helpers.io quiet = False @@ -33,6 +35,7 @@ ndaDir = None techno = 'symbolic/cmos' technoDir = None moduleGlobals = globals() +confModules = [ ] def stype ( o ): return str(type(o)).split("'")[1] @@ -393,16 +396,60 @@ def netDirectionToStr ( netDir ): 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 (): + 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/__init__.py'): sys.path.insert( 0, os.getcwd() ) import coriolis2.settings - return True + rvalue = True else: print helpers.io.WarningMessage( [ 'User\'s settings directory "%s" exists, but do not contains "__init__.py".' % './coriolis2/' , '(path:"%s")' % os.path.abspath(os.getcwd()) ] ) + else: + import symbolic.cmos - import symbolic.cmos - return False + confModules = set() + 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 diff --git a/crlcore/src/ccore/AllianceFramework.cpp b/crlcore/src/ccore/AllianceFramework.cpp index 0dda5683..cef54ead 100644 --- a/crlcore/src/ccore/AllianceFramework.cpp +++ b/crlcore/src/ccore/AllianceFramework.cpp @@ -189,6 +189,7 @@ namespace CRL { , _parsers () , _drivers () , _catalog () + , _libraries () , _parentLibrary (NULL) , _routingGauges () , _defaultRoutingGauge(NULL) @@ -203,9 +204,6 @@ namespace CRL { _parentLibrary = rootLibrary->getLibrary( _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) { // Triggers System singleton creation. System::get(); - _singleton = new AllianceFramework (); + AllianceFramework* af = new AllianceFramework (); + af->_postCreate(); //if (not (flags & NoPythonInit)) // System::runPythonInit(); //_singleton->bindLibraries(); @@ -263,9 +262,21 @@ namespace CRL { { 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 ) { bool createCell = false; - Catalog::State* state = _catalog.getState ( name ); + Catalog::State* state = _catalog.getState( name ); ParserFormatSlot* parser; - // The cell is not even in the Catalog : add an entry. - if ( state == NULL ) state = _catalog.getState ( name, true ); + if (not _libraries.empty()) { + // The cell is not even in the Catalog : add an entry. + if (state == NULL) state = _catalog.getState( name, true ); - if ( state->isFlattenLeaf() ) depth = 0; - state->setDepth ( depth ); + if (state->isFlattenLeaf()) depth = 0; + state->setDepth( depth ); - // Do not try to load. - if ( mode & Catalog::State::InMemory ) return state->getCell(); + // Do not try to load. + if (mode & Catalog::State::InMemory) return state->getCell(); - unsigned int loadMode; - for ( int i=0 ; i<2 ; i++ ) { - // Check is the view is requested for loading or already loaded. - switch ( i ) { - case 0: loadMode = mode & Catalog::State::Logical; break; - case 1: loadMode = mode & Catalog::State::Physical; break; - } - if ( loadMode == 0 ) continue; - if ( state->getFlags(loadMode) != 0 ) continue; + unsigned int loadMode; + for ( int i=0 ; i<2 ; i++ ) { + // Check is the view is requested for loading or already loaded. + switch ( i ) { + case 0: loadMode = mode & Catalog::State::Logical; break; + case 1: loadMode = mode & Catalog::State::Physical; break; + } + if (loadMode == 0) continue; + if (state->getFlags(loadMode) != 0) continue; - // Transmit all flags except thoses related to views. - loadMode |= (mode & (!Catalog::State::Views)); - parser = & ( _parsers.getParserSlot ( name, loadMode, _environment ) ); + // Transmit all flags except thoses related to views. + loadMode |= (mode & (!Catalog::State::Views)); + parser = & (_parsers.getParserSlot( name, loadMode, _environment )); - // Try to open cell file (file extention is supplied by the parser). - if ( !_readLocate(name,loadMode) ) continue; + // Try to open cell file (file extention is supplied by the parser). + if (not _readLocate(name,loadMode)) continue; - if ( state->getCell() == NULL ) { - state->setCell ( Cell::create ( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) ); - state->getCell ()->put ( CatalogProperty::create(state) ); - state->getCell ()->setFlattenLeaf ( false ); - createCell = true; + if (state->getCell() == NULL) { + state->setCell ( Cell::create( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) ); + state->getCell ()->put( CatalogProperty::create(state) ); + state->getCell ()->setFlattenLeaf( false ); + createCell = true; + } + + try { + // Call the parser function. + (parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() ); + } catch ( ... ) { + if (createCell) + //state->getCell()->destroy(); + throw; + } } - try { - // Call the parser function. - (parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() ); - } catch ( ... ) { - if ( createCell ) - //state->getCell()->destroy(); - throw; + // 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 ); + } 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. if (mode & Catalog::State::Foreign) return DataBase::getDB()->getCell( name ); @@ -801,20 +818,20 @@ namespace CRL { } - string AllianceFramework::_getString () const - { return ""; } + string AllianceFramework::_getTypeName () const + { return "AllianceFramework"; } Record *AllianceFramework::_getRecord () const { - Record* record = new Record ( "" ); - record->add ( getSlot ( "_environment" , &_environment ) ); - record->add ( getSlot ( "_libraries" , &_libraries ) ); - record->add ( getSlot ( "_catalog" , &_catalog ) ); - record->add ( getSlot ( "_defaultRoutingGauge", _defaultRoutingGauge ) ); - record->add ( getSlot ( "_routingGauges" , &_routingGauges ) ); - record->add ( getSlot ( "_defaultCellGauge" , _defaultCellGauge ) ); - record->add ( getSlot ( "_cellGauges" , &_cellGauges ) ); + Record* record = Super::_getRecord(); + record->add( getSlot( "_environment" , &_environment ) ); + record->add( getSlot( "_libraries" , &_libraries ) ); + record->add( getSlot( "_catalog" , &_catalog ) ); + record->add( getSlot( "_defaultRoutingGauge", _defaultRoutingGauge ) ); + record->add( getSlot( "_routingGauges" , &_routingGauges ) ); + record->add( getSlot( "_defaultCellGauge" , _defaultCellGauge ) ); + record->add( getSlot( "_cellGauges" , &_cellGauges ) ); return record; } diff --git a/crlcore/src/ccore/AllianceLibrary.cpp b/crlcore/src/ccore/AllianceLibrary.cpp index 5bae869a..b9a453f0 100644 --- a/crlcore/src/ccore/AllianceLibrary.cpp +++ b/crlcore/src/ccore/AllianceLibrary.cpp @@ -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 { return ( "<" + _TName("AllianceLibrary") + " " + getString(_library->getName()) + ">" ); diff --git a/crlcore/src/ccore/Catalog.cpp b/crlcore/src/ccore/Catalog.cpp index 52014115..4421e4f2 100644 --- a/crlcore/src/ccore/Catalog.cpp +++ b/crlcore/src/ccore/Catalog.cpp @@ -14,7 +14,8 @@ // +-----------------------------------------------------------------+ -# include +#include +#include using namespace std; #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 { map::const_iterator it; ostringstream s; + s << "Catalog contents:" << endl; for ( it=_states.begin() ; it!=_states.end() ; it++ ) { s << left << setw(30) << getString(it->first) << getString(it->second) << endl; } diff --git a/crlcore/src/ccore/ParsersDrivers.cpp b/crlcore/src/ccore/ParsersDrivers.cpp index 334851df..d69ecd56 100644 --- a/crlcore/src/ccore/ParsersDrivers.cpp +++ b/crlcore/src/ccore/ParsersDrivers.cpp @@ -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 ); 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 ); 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(); @@ -140,7 +140,7 @@ namespace CRL { } - bool ParserFormatSlot::unRegisterLib ( const Name& ext ) + bool ParserFormatSlot::unRegisterLib ( string ext ) { ParserSlotIter it = _libs.begin(); @@ -163,7 +163,7 @@ namespace CRL { // Class : "ParsersMap" - ParsersMap::ParsersMap (): map() + ParsersMap::ParsersMap (): map() { // Register the Alliance default parsers. 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; iterator it; - if ( ( it = find(Name(tag)) ) != end() ) { + if ( ( it = find(tag) ) != end() ) { slot = & ( it->second ); } else { (*this)[tag] = ParserFormatSlot (); @@ -196,17 +196,17 @@ namespace CRL { } - ParserFormatSlot &ParsersMap::getParserSlot ( const string& name + ParserFormatSlot &ParsersMap::getParserSlot ( string name , unsigned int mode , const Environment& environment ) { // Look for the parser tag (i.e. file extention). - Name format; + string format; switch ( mode & (Catalog::State::Views) ) { case Catalog::State::Physical: format = environment.getIN_PH(); break; case Catalog::State::Logical: format = environment.getIN_LO(); break; default: - throw Error ( BadInputMode, "ParserMap::getParserSlot()", getString(name).c_str() ); + throw Error ( BadInputMode, "ParserMap::getParserSlot()", name.c_str() ); } iterator it = find ( format ); @@ -220,12 +220,12 @@ namespace CRL { } - DriverSlot &DriversMap::getDriverSlot ( const string& name + DriverSlot &DriversMap::getDriverSlot ( string name , unsigned int mode , const Environment& environment ) { // Look for the parser tag (i.e. file extention). - Name format; + string format; switch ( mode & (Catalog::State::Views) ) { case Catalog::State::Physical: format = environment.getOUT_PH(); 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 ); @@ -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 ); @@ -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); @@ -277,7 +277,7 @@ namespace CRL { // Class : "DriversMap" - DriversMap::DriversMap () : map() + DriversMap::DriversMap () : map() { // Register the Alliance default drivers. 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 ]; } - 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 ); 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 ); DriverSlot* p; @@ -326,7 +326,7 @@ namespace CRL { } - void DriversMap::unRegisterSlot ( const Name& tag ) + void DriversMap::unRegisterSlot ( string tag ) { iterator it = find ( tag ); diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index 535f8909..7475dbce 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -153,7 +153,7 @@ namespace { , DirectionLeft =DirectionHorizontal|DirectionDecrease , DirectionRight =DirectionHorizontal|DirectionIncrease }; - static LayerInformations _layerInformations; + LayerInformations _layerInformations; AllianceFramework* _framework; string _cellPath; Cell* _cell; @@ -165,7 +165,7 @@ namespace { protected: // Internal: Methods. - static LayerInformation* _getLayerInformation ( const Name& layerName ); + LayerInformation* _getLayerInformation ( const Name& layerName ); inline DbU::Unit _getUnit ( long value ); inline DbU::Unit _getUnit ( const char* value ); vector _splitString ( char* s, char separator ); @@ -187,9 +187,6 @@ namespace { }; - LayerInformations ApParser::_layerInformations; - - ApParser::ApParser ( AllianceFramework* framework ) : _framework (framework) , _cellPath () @@ -199,70 +196,68 @@ namespace { , _parserState(StateVersion) , _lineNumber (0) { - if ( _layerInformations.empty() ) { - _layerInformations.setTechnology ( DataBase::getDB()->getTechnology() ); + _layerInformations.setTechnology ( DataBase::getDB()->getTechnology() ); - _layerInformations.add ( "NWELL" , "NWELL" , false, false ); - _layerInformations.add ( "PWELL" , "PWELL" , false, false ); - _layerInformations.add ( "NTIE" , "NTIE" , false, false ); - _layerInformations.add ( "PTIE" , "PTIE" , false, false ); - _layerInformations.add ( "NDIF" , "NDIF" , false, false ); - _layerInformations.add ( "PDIF" , "PDIF" , false, false ); - _layerInformations.add ( "NTRANS" , "NTRANS" , false, false ); - _layerInformations.add ( "PTRANS" , "PTRANS" , false, false ); - _layerInformations.add ( "POLY" , "POLY" , false, false ); - _layerInformations.add ( "POLY2" , "POLY2" , false, false ); - - _layerInformations.add ( "ALU1" , "METAL1" , false, false ); - _layerInformations.add ( "ALU2" , "METAL2" , false, false ); - _layerInformations.add ( "ALU3" , "METAL3" , false, false ); - _layerInformations.add ( "ALU4" , "METAL4" , false, false ); - _layerInformations.add ( "ALU5" , "METAL5" , false, false ); - _layerInformations.add ( "ALU6" , "METAL6" , false, false ); - _layerInformations.add ( "ALU7" , "METAL7" , false, false ); - _layerInformations.add ( "ALU8" , "METAL8" , false, false ); + _layerInformations.add ( "NWELL" , "NWELL" , false, false ); + _layerInformations.add ( "PWELL" , "PWELL" , false, false ); + _layerInformations.add ( "NTIE" , "NTIE" , false, false ); + _layerInformations.add ( "PTIE" , "PTIE" , false, false ); + _layerInformations.add ( "NDIF" , "NDIF" , false, false ); + _layerInformations.add ( "PDIF" , "PDIF" , false, false ); + _layerInformations.add ( "NTRANS" , "NTRANS" , false, false ); + _layerInformations.add ( "PTRANS" , "PTRANS" , false, false ); + _layerInformations.add ( "POLY" , "POLY" , false, false ); + _layerInformations.add ( "POLY2" , "POLY2" , false, false ); + + _layerInformations.add ( "ALU1" , "METAL1" , false, false ); + _layerInformations.add ( "ALU2" , "METAL2" , false, false ); + _layerInformations.add ( "ALU3" , "METAL3" , false, false ); + _layerInformations.add ( "ALU4" , "METAL4" , false, false ); + _layerInformations.add ( "ALU5" , "METAL5" , false, false ); + _layerInformations.add ( "ALU6" , "METAL6" , false, false ); + _layerInformations.add ( "ALU7" , "METAL7" , false, false ); + _layerInformations.add ( "ALU8" , "METAL8" , false, false ); - _layerInformations.add ( "CALU1" , "METAL1" , true, false ); - _layerInformations.add ( "CALU2" , "METAL2" , true, false ); - _layerInformations.add ( "CALU3" , "METAL3" , true, false ); - _layerInformations.add ( "CALU4" , "METAL4" , true, false ); - _layerInformations.add ( "CALU5" , "METAL5" , true, false ); - _layerInformations.add ( "CALU6" , "METAL6" , true, false ); - _layerInformations.add ( "CALU7" , "METAL7" , true, false ); - _layerInformations.add ( "CALU8" , "METAL8" , true, false ); + _layerInformations.add ( "CALU1" , "METAL1" , true, false ); + _layerInformations.add ( "CALU2" , "METAL2" , true, false ); + _layerInformations.add ( "CALU3" , "METAL3" , true, false ); + _layerInformations.add ( "CALU4" , "METAL4" , true, false ); + _layerInformations.add ( "CALU5" , "METAL5" , true, false ); + _layerInformations.add ( "CALU6" , "METAL6" , true, false ); + _layerInformations.add ( "CALU7" , "METAL7" , true, false ); + _layerInformations.add ( "CALU8" , "METAL8" , true, false ); - _layerInformations.add ( "TALU1" , "BLOCKAGE1" , false, true ); - _layerInformations.add ( "TALU2" , "BLOCKAGE2" , false, true ); - _layerInformations.add ( "TALU3" , "BLOCKAGE3" , false, true ); - _layerInformations.add ( "TALU4" , "BLOCKAGE4" , false, true ); - _layerInformations.add ( "TALU5" , "BLOCKAGE5" , false, true ); - _layerInformations.add ( "TALU6" , "BLOCKAGE6" , false, true ); - _layerInformations.add ( "TALU7" , "BLOCKAGE7" , false, true ); - _layerInformations.add ( "TALU8" , "BLOCKAGE8" , false, true ); + _layerInformations.add ( "TALU1" , "BLOCKAGE1" , false, true ); + _layerInformations.add ( "TALU2" , "BLOCKAGE2" , false, true ); + _layerInformations.add ( "TALU3" , "BLOCKAGE3" , false, true ); + _layerInformations.add ( "TALU4" , "BLOCKAGE4" , false, true ); + _layerInformations.add ( "TALU5" , "BLOCKAGE5" , false, true ); + _layerInformations.add ( "TALU6" , "BLOCKAGE6" , false, true ); + _layerInformations.add ( "TALU7" , "BLOCKAGE7" , false, true ); + _layerInformations.add ( "TALU8" , "BLOCKAGE8" , false, true ); - _layerInformations.add ( "CONT_BODY_N", "CONT_BODY_N", 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_P" , "CONT_DIF_P" , false, false ); - _layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false ); - _layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false ); - _layerInformations.add ( "CONT_VIA" , "VIA12" , false, false ); - _layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false ); - _layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false ); - _layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false ); - _layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false ); - _layerInformations.add ( "CONT_VIA5" , "VIA56" , false, false ); - _layerInformations.add ( "CONT_VIA6" , "VIA67" , false, false ); - _layerInformations.add ( "CONT_VIA7" , "VIA78" , false, false ); - _layerInformations.add ( "CONT_TURN1" , "METAL1" , false, false ); - _layerInformations.add ( "CONT_TURN2" , "METAL2" , false, false ); - _layerInformations.add ( "CONT_TURN3" , "METAL3" , false, false ); - _layerInformations.add ( "CONT_TURN4" , "METAL4" , false, false ); - _layerInformations.add ( "CONT_TURN5" , "METAL5" , false, false ); - _layerInformations.add ( "CONT_TURN6" , "METAL6" , false, false ); - _layerInformations.add ( "CONT_TURN7" , "METAL7" , false, false ); - _layerInformations.add ( "CONT_TURN8" , "METAL8" , 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_DIF_N" , "CONT_DIF_N" , false, false ); + _layerInformations.add ( "CONT_DIF_P" , "CONT_DIF_P" , false, false ); + _layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false ); + _layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false ); + _layerInformations.add ( "CONT_VIA" , "VIA12" , false, false ); + _layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false ); + _layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false ); + _layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false ); + _layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false ); + _layerInformations.add ( "CONT_VIA5" , "VIA56" , false, false ); + _layerInformations.add ( "CONT_VIA6" , "VIA67" , false, false ); + _layerInformations.add ( "CONT_VIA7" , "VIA78" , false, false ); + _layerInformations.add ( "CONT_TURN1" , "METAL1" , false, false ); + _layerInformations.add ( "CONT_TURN2" , "METAL2" , false, false ); + _layerInformations.add ( "CONT_TURN3" , "METAL3" , false, false ); + _layerInformations.add ( "CONT_TURN4" , "METAL4" , false, false ); + _layerInformations.add ( "CONT_TURN5" , "METAL5" , false, false ); + _layerInformations.add ( "CONT_TURN6" , "METAL6" , false, false ); + _layerInformations.add ( "CONT_TURN7" , "METAL7" , false, false ); + _layerInformations.add ( "CONT_TURN8" , "METAL8" , false, false ); } diff --git a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy index 2bf1f56d..d80ebb96 100644 --- a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy +++ b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy @@ -1369,8 +1369,8 @@ void vstParser ( const string cellPath, Cell *cell ) static bool firstCall = true; if ( firstCall ) { firstCall = false; - Vst::framework = AllianceFramework::get (); } + Vst::framework = AllianceFramework::get (); Vst::states.push_back ( new Vst::YaccState(cellPath) ); diff --git a/crlcore/src/ccore/crlcore/AllianceFramework.h b/crlcore/src/ccore/crlcore/AllianceFramework.h index e98fbd14..b93c3dba 100644 --- a/crlcore/src/ccore/crlcore/AllianceFramework.h +++ b/crlcore/src/ccore/crlcore/AllianceFramework.h @@ -39,7 +39,8 @@ namespace CRL { class CellGauge; - class AllianceFramework { + class AllianceFramework : public DBo { + typedef DBo Super; public: enum FunctionsFlags { NoFlags = 0 , NoPythonInit = (1<<0) @@ -56,92 +57,90 @@ namespace CRL { , ConfigChanged = (1<<2) }; public: - // Constructors. - static AllianceFramework* create ( unsigned long flags=NoFlags ); - // Destructors. - void destroy (); + static AllianceFramework* create ( unsigned long flags=NoFlags ); + virtual void _postCreate (); + virtual void _preDestroy (); // Accessors. - static AllianceFramework* get (); - string getPrint () const; + static AllianceFramework* get (); + string getPrint () const; // Predicates. - Catalog::State* isInCatalog ( const Name& ); - Catalog::State* isInCatalog ( string ); - inline bool isPOWER ( const char* name ); - inline bool isPOWER ( const string& name ); - inline bool isPOWER ( const Name& name ); - inline bool isGROUND ( const char* name ); - inline bool isGROUND ( const string& name ); - inline bool isGROUND ( const Name& name ); - inline bool isCLOCK ( const char* name ); - inline bool isCLOCK ( const string& name ); - inline bool isCLOCK ( const Name& name ); - inline bool isBLOCKAGE ( const char* name ); - inline bool isBLOCKAGE ( const string& name ); - inline bool isBLOCKAGE ( const Name& name ); - inline bool isBLOCKAGE ( const Net* net ); - inline bool isPad ( const char* name ); - inline bool isPad ( const string& name ); - inline bool isPad ( const Name& name ); - inline bool isPad ( const Cell* ); + Catalog::State* isInCatalog ( const Name& ); + Catalog::State* isInCatalog ( string ); + inline bool isPOWER ( const char* name ); + inline bool isPOWER ( const string& name ); + inline bool isPOWER ( const Name& name ); + inline bool isGROUND ( const char* name ); + inline bool isGROUND ( const string& name ); + inline bool isGROUND ( const Name& name ); + inline bool isCLOCK ( const char* name ); + inline bool isCLOCK ( const string& name ); + inline bool isCLOCK ( const Name& name ); + inline bool isBLOCKAGE ( const char* name ); + inline bool isBLOCKAGE ( const string& name ); + inline bool isBLOCKAGE ( const Name& name ); + inline bool isBLOCKAGE ( const Net* net ); + inline bool isPad ( const char* name ); + inline bool isPad ( const string& name ); + inline bool isPad ( const Name& name ); + inline bool isPad ( const Cell* ); // Accessors. - inline Environment* getEnvironment (); - inline Catalog* getCatalog (); - inline const Name& getParentLibraryName () const; - inline Library* getParentLibrary (); - Library* getLibrary ( unsigned int index ); - Library* getLibrary ( const Name& libName ); - AllianceLibrary* getAllianceLibrary ( unsigned int index ); - AllianceLibrary* getAllianceLibrary ( const Name& libName, unsigned int flags ); - AllianceLibrary* getAllianceLibrary ( Library* ); - AllianceLibrary* createLibrary ( const string& path, unsigned int flags, string libName="" ); - inline const AllianceLibraries& getAllianceLibraries () const; - void saveLibrary ( Library* ); - void saveLibrary ( AllianceLibrary* ); - RoutingGauge* getRoutingGauge ( const Name& name="" ); - CellGauge* getCellGauge ( const Name& name="" ); - CellGauge* matchCellGauge ( DbU::Unit width, DbU::Unit height ) const; - CellGauge* matchCellGaugeByHeight ( DbU::Unit height ) const; - inline const Name getDefaultCGPinLayerName () const; + inline Environment* getEnvironment (); + inline Catalog* getCatalog (); + inline const Name& getParentLibraryName () const; + inline Library* getParentLibrary (); + Library* getLibrary ( unsigned int index ); + Library* getLibrary ( const Name& libName ); + AllianceLibrary* getAllianceLibrary ( unsigned int index ); + AllianceLibrary* getAllianceLibrary ( const Name& libName, unsigned int flags ); + AllianceLibrary* getAllianceLibrary ( Library* ); + AllianceLibrary* createLibrary ( const string& path, unsigned int flags, string libName="" ); + inline const AllianceLibraries& getAllianceLibraries () const; + void saveLibrary ( Library* ); + void saveLibrary ( AllianceLibrary* ); + RoutingGauge* getRoutingGauge ( const Name& name="" ); + CellGauge* getCellGauge ( const Name& name="" ); + CellGauge* matchCellGauge ( DbU::Unit width, DbU::Unit height ) const; + CellGauge* matchCellGaugeByHeight ( DbU::Unit height ) const; + inline const Name getDefaultCGPinLayerName () const; // Modifiers. - RoutingGauge* setRoutingGauge ( const Name& name="" ); - CellGauge* setCellGauge ( const Name& name="" ); - void addRoutingGauge ( RoutingGauge* ); - void addCellGauge ( CellGauge* ); - void addObserver ( BaseObserver* ); - void removeObserver ( BaseObserver* ); - void notify ( unsigned int flags ); + RoutingGauge* setRoutingGauge ( const Name& name="" ); + CellGauge* setCellGauge ( const Name& name="" ); + void addRoutingGauge ( RoutingGauge* ); + void addCellGauge ( CellGauge* ); + void addObserver ( BaseObserver* ); + void removeObserver ( BaseObserver* ); + void notify ( unsigned int flags ); // Cell Management. - Cell* cellLoader ( const string& rpath ); - Cell* getCell ( const string& name - , unsigned int mode - , unsigned int depth=(unsigned int)-1 ); - Cell* createCell ( const string& name, AllianceLibrary* library=NULL ); - void saveCell ( Cell* , unsigned int mode ); - void bindLibraries (); - unsigned int loadLibraryCells ( Library* ); - unsigned int loadLibraryCells ( const Name& ); - static size_t getInstancesCount ( Cell*, unsigned int flags ); + Cell* cellLoader ( const string& rpath ); + Cell* getCell ( const string& name + , unsigned int mode + , unsigned int depth=(unsigned int)-1 ); + Cell* createCell ( const string& name, AllianceLibrary* library=NULL ); + void saveCell ( Cell* , unsigned int mode ); + void bindLibraries (); + unsigned int loadLibraryCells ( Library* ); + unsigned int loadLibraryCells ( const Name& ); + static size_t getInstancesCount ( Cell*, unsigned int flags ); // Hurricane Managment. - void toJson ( JsonWriter* ) const; - inline string _getTypeName () const; - string _getString () const; - Record* _getRecord () const; + void toJson ( JsonWriter* ) const; + virtual string _getTypeName () const; + virtual Record* _getRecord () const; // Internals - Attributes. protected: - static const Name _parentLibraryName; - static AllianceFramework* _singleton; - Observable _observers; - Environment _environment; - ParsersMap _parsers; - DriversMap _drivers; - Catalog _catalog; - AllianceLibraries _libraries; - Library* _parentLibrary; - map _routingGauges; - RoutingGauge* _defaultRoutingGauge; - map _cellGauges; - CellGauge* _defaultCellGauge; + static const Name _parentLibraryName; + static AllianceFramework* _singleton; + Observable _observers; + Environment _environment; + ParsersMap _parsers; + DriversMap _drivers; + Catalog _catalog; + AllianceLibraries _libraries; + Library* _parentLibrary; + map _routingGauges; + RoutingGauge* _defaultRoutingGauge; + map _cellGauges; + CellGauge* _defaultCellGauge; // Internals - Constructors. AllianceFramework (); @@ -182,7 +181,6 @@ namespace CRL { // TEMPORARY. inline const Name AllianceFramework::getDefaultCGPinLayerName () const { return "CALU1"; } - inline string AllianceFramework::_getTypeName () const { return "AllianceFramework"; } class JsonAllianceFramework : public JsonObject { diff --git a/crlcore/src/ccore/crlcore/AllianceLibrary.h b/crlcore/src/ccore/crlcore/AllianceLibrary.h index 594dac95..aa1fee6a 100644 --- a/crlcore/src/ccore/crlcore/AllianceLibrary.h +++ b/crlcore/src/ccore/crlcore/AllianceLibrary.h @@ -44,23 +44,20 @@ namespace CRL { class AllianceLibrary { public: - // Constructors. AllianceLibrary (); AllianceLibrary ( const Name& path, Library* library=NULL ); - // Operators AllianceLibrary& operator= ( const AllianceLibrary& directory ); AllianceLibrary& operator= ( const std::string& path ); - // Accessors inline const Name& getPath () const; inline Library* getLibrary () const; - // Hurricane management. + void saveCells () const; + void saveCATAL () const; void toJson ( JsonWriter* ) const; inline std::string _getTypeName () const; std::string _getString () const; Record* _getRecord () const; protected: - // Internal - Attributes. Name _path; Library* _library; diff --git a/crlcore/src/ccore/crlcore/Catalog.h b/crlcore/src/ccore/crlcore/Catalog.h index 09329cf0..7cf3297d 100644 --- a/crlcore/src/ccore/crlcore/Catalog.h +++ b/crlcore/src/ccore/crlcore/Catalog.h @@ -65,6 +65,7 @@ namespace CRL { bool deleteState ( const Name& name ); void clear (); bool loadFromFile ( const string& path, Library* library ); + void saveToFile ( const string& path, Library* library ); inline map* getStates (); string _getPrint () const; inline string _getTypeName () const; @@ -232,7 +233,7 @@ namespace CRL { inline unsigned int Catalog::State::getDepth () const { return _depth; } inline string Catalog::State::_getTypeName () const { return _TName("Catalog::State"); } - inline Catalog::Catalog () : _states() {} + inline Catalog::Catalog () : _states() { } inline map* Catalog::getStates () { return &_states; } inline string Catalog::_getTypeName () const { return _TName("Catalog"); } diff --git a/crlcore/src/ccore/crlcore/ParsersDrivers.h b/crlcore/src/ccore/crlcore/ParsersDrivers.h index d99bf42b..8c2707dd 100644 --- a/crlcore/src/ccore/crlcore/ParsersDrivers.h +++ b/crlcore/src/ccore/crlcore/ParsersDrivers.h @@ -20,7 +20,6 @@ #include #include -#include "hurricane/Name.h" namespace Hurricane { class Library; class Cell; @@ -29,7 +28,6 @@ namespace Hurricane { namespace CRL { - using Hurricane::Name; using Hurricane::Cell; using Hurricane::Library; @@ -51,9 +49,9 @@ namespace CRL { // Struct : "CRL::ParserSlot". struct ParserSlot { - Name _tag; - Name _ext; - void* _parser; + std::string _tag; + std::string _ext; + void* _parser; ParserSlot ( const string& t, const string& e, void* p ): _tag(t),_ext(e),_parser(p) {}; }; @@ -73,15 +71,15 @@ namespace CRL { inline ParserFormatSlot (); // Accessors. inline bool loadByLib (); - inline const Name& getTag (); - inline const Name& getExt (); + inline std::string getTag (); + inline std::string getExt (); inline LibraryParser_t* getParsLib (); inline CellParser_t* getParsCell (); // Modifiers. - void registerCell ( const std::string& tag, CellParser_t* p, const std::string& ext ); - void registerLib ( const std::string& tag, LibraryParser_t* p, const std::string& ext ); - bool unRegisterCell ( const Name& ext ); - bool unRegisterLib ( const Name& ext ); + void registerCell ( std::string tag, CellParser_t* p, std::string ext ); + void registerLib ( std::string tag, LibraryParser_t* p, std::string ext ); + bool unRegisterCell ( std::string ext ); + bool unRegisterLib ( std::string ext ); // Iterators handling. inline void cbegin (); inline void lbegin (); @@ -101,8 +99,8 @@ namespace CRL { inline ParserFormatSlot::ParserFormatSlot () : _loadByLib(false), _itset(false) { }; inline bool ParserFormatSlot::loadByLib () { return ( _loadByLib ); } - inline const Name& ParserFormatSlot::getTag () { return ( _it->_tag ); } - inline const Name& ParserFormatSlot::getExt () { return ( _it->_ext ); } + inline std::string ParserFormatSlot::getTag () { return ( _it->_tag ); } + inline std::string ParserFormatSlot::getExt () { return ( _it->_ext ); } inline LibraryParser_t* ParserFormatSlot::getParsLib () { return ( (LibraryParser_t*)_it->_parser ); } inline CellParser_t* ParserFormatSlot::getParsCell () { return ( (CellParser_t* )_it->_parser ); } inline void ParserFormatSlot::cbegin () { _it = _cells.begin(); _itset = true; } @@ -112,17 +110,17 @@ namespace CRL { // ------------------------------------------------------------------- // Class : "CRL::ParsersMap". - class ParsersMap : public map { + class ParsersMap : public map { public: // Constructor. ParsersMap (); // Methods. - ParserFormatSlot& getParserSlot ( const std::string& tag ); - ParserFormatSlot& getParserSlot ( const std::string& tag, unsigned int mode, const Environment& env ); - void registerSlot ( const std::string& tag, LibraryParser_t* p, const std::string& ext ); - void registerSlot ( const std::string& tag, CellParser_t* p, const std::string& ext ); - void unRegisterSlot ( const Name& tag, const Name& ext, bool lib ); + ParserFormatSlot& getParserSlot ( std::string tag ); + ParserFormatSlot& getParserSlot ( std::string tag, unsigned int mode, const Environment& env ); + void registerSlot ( std::string tag, LibraryParser_t* p, std::string ext ); + void registerSlot ( std::string tag, CellParser_t* p, std::string ext ); + void unRegisterSlot ( std::string tag, std::string ext, bool lib ); }; @@ -135,23 +133,23 @@ namespace CRL { // Constructor. inline DriverSlot ( string tag="unknown" ); // Accessors. - inline const Name& getTag (); - inline const Name& getExtLib (); - inline const Name& getExtCell (); + inline std::string getTag (); + inline std::string getExtLib (); + inline std::string getExtCell (); inline LibraryDriver_t* getDrivLib (); inline CellDriver_t* getDrivCell (); // Modifiers. - inline void setExtLib ( const std::string &ext ); - inline void setExtCell ( const std::string &ext ); + inline void setExtLib ( std::string ext ); + inline void setExtCell ( std::string ext ); inline void setDrivLib ( LibraryDriver_t *driv ); inline void setDrivCell ( CellDriver_t *driv ); private: // Internal - Attributes. - Name _tag; - Name _extLib; - Name _extCell; + std::string _tag; + std::string _extLib; + std::string _extCell; LibraryDriver_t* _drivLib; CellDriver_t* _drivCell; }; @@ -164,13 +162,13 @@ namespace CRL { , _drivLib(NULL) , _drivCell(NULL) { } - inline const Name& DriverSlot::getTag () { return ( _tag ); } - inline const Name& DriverSlot::getExtLib () { return ( _extLib ); } - inline const Name& DriverSlot::getExtCell () { return ( _extCell ); } + inline std::string DriverSlot::getTag () { return ( _tag ); } + inline std::string DriverSlot::getExtLib () { return ( _extLib ); } + inline std::string DriverSlot::getExtCell () { return ( _extCell ); } inline LibraryDriver_t* DriverSlot::getDrivLib () { return ( _drivLib ); } inline CellDriver_t* DriverSlot::getDrivCell () { return ( _drivCell ); } - inline void DriverSlot::setExtLib ( const std::string& ext ) { _extLib = ext; } - inline void DriverSlot::setExtCell ( const std::string& ext ) { _extCell = ext; } + inline void DriverSlot::setExtLib ( std::string ext ) { _extLib = ext; } + inline void DriverSlot::setExtCell ( std::string ext ) { _extCell = ext; } inline void DriverSlot::setDrivLib ( LibraryDriver_t* driv ) { _drivLib = driv; } inline void DriverSlot::setDrivCell ( CellDriver_t* driv ) { _drivCell = driv; } @@ -180,17 +178,17 @@ namespace CRL { // ------------------------------------------------------------------- // Class : "CRL::DriversMap". - class DriversMap : public map { + class DriversMap : public map { public: // Constructor. DriversMap (); // Methods. - DriverSlot& getDriverSlot ( const std::string& tag ); - DriverSlot& getDriverSlot ( const std::string& tag, unsigned int mode, const Environment& env ); - void registerSlot ( const std::string& tag, CellDriver_t *d, const std::string& ext ); - void registerSlot ( const std::string& tag, LibraryDriver_t *d, const std::string& ext ); - void unRegisterSlot ( const Name& tag ); + DriverSlot& getDriverSlot ( std::string tag ); + DriverSlot& getDriverSlot ( std::string tag, unsigned int mode, const Environment& env ); + void registerSlot ( std::string tag, CellDriver_t *d, std::string ext ); + void registerSlot ( std::string tag, LibraryDriver_t *d, std::string ext ); + void unRegisterSlot ( std::string tag ); }; diff --git a/crlcore/src/pyCRL/PyAllianceFramework.cpp b/crlcore/src/pyCRL/PyAllianceFramework.cpp index fc77e22c..b017eac4 100644 --- a/crlcore/src/pyCRL/PyAllianceFramework.cpp +++ b/crlcore/src/pyCRL/PyAllianceFramework.cpp @@ -70,25 +70,18 @@ extern "C" { { cdebug_log(30,0) << "PyAllianceFramework_create()" << endl; - AllianceFramework* af = NULL; - PyAllianceFramework* pyAf = NULL; - unsigned long flags = AllianceFramework::NoFlags; + AllianceFramework* af = NULL; + unsigned long flags = AllianceFramework::NoFlags; HTRY - PyObject* arg0; - if (ParseOneArg("AllianceFramework.create()", args, INT_ARG, &arg0)) { - flags = PyInt_AsUnsignedLongMask(arg0); - } - - af = AllianceFramework::create( flags ); - - pyAf = PyObject_NEW( PyAllianceFramework, &PyTypeAllianceFramework ); - if (pyAf == NULL) return NULL; - - pyAf->_object = af; + PyObject* arg0; + if (ParseOneArg("AllianceFramework.create()", args, INT_ARG, &arg0)) { + flags = PyInt_AsUnsignedLongMask(arg0); + } + af = AllianceFramework::create( flags ); HCATCH - return (PyObject*)pyAf; + return PyAllianceFramework_Link( af ); } @@ -96,19 +89,11 @@ extern "C" { { cdebug_log(30,0) << "PyAllianceFramework_get()" << endl; - AllianceFramework* af = NULL; - PyAllianceFramework* pyAf = NULL; - + AllianceFramework* af = NULL; HTRY - af = AllianceFramework::get(); - - pyAf = PyObject_NEW( PyAllianceFramework, &PyTypeAllianceFramework ); - if (pyAf == NULL) return NULL; - - pyAf->_object = af; + af = AllianceFramework::get(); HCATCH - - return (PyObject*)pyAf; + return PyAllianceFramework_Link( af ); } @@ -520,7 +505,7 @@ extern "C" { // Standart Destroy (Attribute). - // DBoDestroyAttribute(PyAllianceFramework_destroy,PyAllianceFramework) + DBoDestroyAttribute(PyAllianceFramework_destroy,PyAllianceFramework) PyMethodDef PyAllianceFramework_Methods[] = @@ -562,13 +547,13 @@ extern "C" { , "Get a routing gauge (without a name, return the default)." } , { "setRoutingGauge" , (PyCFunction)PyAllianceFramework_setRoutingGauge , METH_VARARGS , "Select the default routing gauge." } - //, { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS - // , "Destroy the associated hurricane object. The python object remains." } + , { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS + , "Destroy the Framework, Hurricane-level objects remains." } , {NULL, NULL, 0, NULL} /* sentinel */ }; - PythonOnlyDeleteMethod(AllianceFramework) + DBoDeleteMethod(AllianceFramework) PyTypeObjectLinkPyType(AllianceFramework) @@ -579,8 +564,8 @@ extern "C" { // | "PyAllianceFramework" Shared Library Code Part | // x=================================================================x - // Link/Creation Method. + DBoLinkCreateMethod(AllianceFramework) PyTypeObjectDefinitions(AllianceFramework) diff --git a/crlcore/src/pyCRL/PyAllianceLibrary.cpp b/crlcore/src/pyCRL/PyAllianceLibrary.cpp index 62228546..cc35a6b9 100644 --- a/crlcore/src/pyCRL/PyAllianceLibrary.cpp +++ b/crlcore/src/pyCRL/PyAllianceLibrary.cpp @@ -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; Library* lib = NULL; - HTRY - METHOD_HEAD("AllianceLibrary.getLibrary()") - lib = alib->getLibrary(); + METHOD_HEAD("AllianceLibrary.getLibrary()") + lib = alib->getLibrary(); HCATCH - 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; - HTRY - METHOD_HEAD("AllianceLibrary.getPath()") - return PyString_FromString( getString(alib->getPath()).c_str() ); + METHOD_HEAD("AllianceLibrary.getPath()") + return PyString_FromString( getString(alib->getPath()).c_str() ); HCATCH - 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 ) { if ( self->ACCESS_OBJECT == NULL ) @@ -105,6 +123,10 @@ extern "C" { , "Return the complete path of the library." } , { "getLibrary" , (PyCFunction)PyAllianceLibrary_getLibrary , METH_NOARGS , "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 the associated hurricane object. The python object remains." } , {NULL, NULL, 0, NULL} /* sentinel */ diff --git a/crlcore/src/pyCRL/PyEnvironment.cpp b/crlcore/src/pyCRL/PyEnvironment.cpp index 45c80d19..4b79cf45 100644 --- a/crlcore/src/pyCRL/PyEnvironment.cpp +++ b/crlcore/src/pyCRL/PyEnvironment.cpp @@ -138,8 +138,9 @@ extern "C" { if ( self->ACCESS_OBJECT == NULL ) return PyString_FromString(""); - string s = ""; - return PyString_FromString(s.c_str()); + ostringstream s; + s << "ACCESS_OBJECT << ">"; + return PyString_FromString(s.str().c_str()); } diff --git a/cumulus/src/plugins/chip/Chip.py b/cumulus/src/plugins/chip/Chip.py index 1c793096..7bff91c2 100644 --- a/cumulus/src/plugins/chip/Chip.py +++ b/cumulus/src/plugins/chip/Chip.py @@ -237,7 +237,7 @@ class PlaceRoute ( object ): katana.loadGlobalRouting ( Anabatic.EngineLoadGrByNet ) katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) katana.runNegociate ( Katana.Flags.NoFlags ) - success = katana.getToolSuccess() + success = katana.getSuccessState() katana.finalizeLayout() katana.destroy() diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 2aec7353..95f27d4c 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -643,6 +643,8 @@ namespace Etesian { //cerr << "Outside Pin: " << pin << endl; } + string topCellInstancePin = getString(getCell()->getName()) + ":C"; + for ( RoutingPad* rp : net->getRoutingPads() ) { if (getBlockInstance() and (rp->getOccurrence().getPath().getHeadInstance() != getBlockInstance())) { // 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; auto iid = _cellsToIds.find( insName ); - if (iid == _cellsToIds.end() ) { - cerr << Error( "Unable to lookup instance <%s>.", insName.c_str() ) << endl; + if (iid == _cellsToIds.end()) { + if (insName != topCellInstancePin) + cerr << Error( "Unable to lookup instance \"%s\".", insName.c_str() ) << endl; } else { pins.push_back( temporary_pin( point(xpin,ypin), (*iid).second, netId ) ); } @@ -798,7 +801,7 @@ namespace Etesian { ostringstream label; label.str(""); - label << " [" << setw(3) << setfill('0') << i << "] Bipart."; + label << " [" << setw(3) << setfill('0') << i << setfill(' ') << "] Bipart."; _progressReport1(label.str() ); upperWL = static_cast(get_HPWL_wirelength(_circuit, _placementUB)); @@ -862,7 +865,7 @@ namespace Etesian { for ( int i=0; i to continue, 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. +#include "hurricane/Breakpoint.h" namespace Hurricane { @@ -136,6 +104,27 @@ namespace Hurricane { } + bool Breakpoint::simpleStopCb ( const string& message ) + { + cerr << "[STOP] " << message << endl; + + char answer = '?'; + while ( answer == '?' ) { + cerr << " Type to continue, 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. diff --git a/hurricane/src/hurricane/CMakeLists.txt b/hurricane/src/hurricane/CMakeLists.txt index dbbddbcf..1721b555 100644 --- a/hurricane/src/hurricane/CMakeLists.txt +++ b/hurricane/src/hurricane/CMakeLists.txt @@ -25,6 +25,7 @@ hurricane/Box.h hurricane/Boxes.h hurricane/Torus.h hurricane/Cell.h hurricane/Cells.h + hurricane/CellsSort.h hurricane/Collection.h hurricane/Commons.h hurricane/Component.h hurricane/Components.h @@ -154,6 +155,7 @@ Entity.cpp Cell.cpp CellCollections.cpp + CellsSort.cpp NetAlias.cpp Net.cpp DeepNet.cpp diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index 6d9683d5..4d160e93 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -1198,7 +1198,6 @@ void Cell::_preDestroy() Markers markers = getMarkers (); while ( markers .getFirst() ) markers .getFirst()->destroy(); Instances instances = getSlaveInstances(); while ( instances.getFirst() ) instances.getFirst()->destroy(); - instances = getInstances (); while ( instances.getFirst() ) instances.getFirst()->destroy(); Nets nets = getNets(); while ( nets.getFirst() ) { @@ -1208,6 +1207,12 @@ void Cell::_preDestroy() } for ( auto islave : _netAliasSet ) delete islave; + instances = getInstances(); + vector 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(); while ( not _extensionSlices.empty() ) _removeSlice( _extensionSlices.begin()->second ); diff --git a/hurricane/src/hurricane/CellsSort.cpp b/hurricane/src/hurricane/CellsSort.cpp new file mode 100644 index 00000000..48c0896d --- /dev/null +++ b/hurricane/src/hurricane/CellsSort.cpp @@ -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 +// . +// +// +-----------------------------------------------------------------+ +// | 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 +#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( 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(property->getOwner()); + _sortedCells.push_back( cell ); + cell->remove( property ); + } + + std::vector().swap( _depthProperties ); + } + + + void CellsSort::_computeDepth ( Cell* cell ) + { + size_t depth = 0; + DepthProperty* parentDepthProp = dynamic_cast( cell->getProperty( DepthProperty::staticGetName() )); + + for ( Instance* instance : cell->getInstances() ) { + Cell* masterCell = instance->getMasterCell(); + DepthProperty* childDepthProp = dynamic_cast( 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. diff --git a/hurricane/src/hurricane/DBo.cpp b/hurricane/src/hurricane/DBo.cpp index f24c9cba..257c40e5 100644 --- a/hurricane/src/hurricane/DBo.cpp +++ b/hurricane/src/hurricane/DBo.cpp @@ -36,6 +36,7 @@ #include "hurricane/Property.h" #include "hurricane/Quark.h" #include "hurricane/Error.h" +#include "hurricane/Warning.h" namespace Hurricane { @@ -49,6 +50,7 @@ namespace Hurricane { unsigned long DBo::_flags = 0; unsigned int DBo::_nextId = 0; unsigned int DBo::_idCounterLimit = 0; + unsigned int DBo::_idCount = 0; unsigned int DBo::_idCounter = 1; @@ -64,6 +66,17 @@ namespace Hurricane { { 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 () { return _flags & ForcedIdMode; } @@ -139,11 +152,18 @@ namespace Hurricane { // } // if (_id == 75060) // cerr << "DBo::DBo() " << this << endl; + + ++_idCount; } DBo::~DBo () throw(Error) - { } + { + if (_idCount) --_idCount; + else { + cerr << Warning( "BDo::~DBo(): _idCount is becoming negative. Severe database corruption ahead." ) << endl; + } + } void DBo::_postCreate () @@ -160,7 +180,7 @@ namespace Hurricane { void DBo::destroy () { - cdebug_log(0,1) << "DBo::destroy() " << this << endl; + cdebug_log(0,1) << "DBo::destroy() " << getId() << " " << this << endl; _preDestroy(); cdebug_tabw(0,-1); delete this; diff --git a/hurricane/src/hurricane/DataBase.cpp b/hurricane/src/hurricane/DataBase.cpp index 686c3eff..0a39e633 100644 --- a/hurricane/src/hurricane/DataBase.cpp +++ b/hurricane/src/hurricane/DataBase.cpp @@ -21,11 +21,13 @@ #include "hurricane/Initializer.h" #include "hurricane/Warning.h" #include "hurricane/Error.h" +#include "hurricane/SharedName.h" #include "hurricane/SharedPath.h" #include "hurricane/UpdateSession.h" #include "hurricane/DataBase.h" #include "hurricane/Technology.h" #include "hurricane/Library.h" +#include "hurricane/CellsSort.h" namespace { @@ -149,6 +151,8 @@ void DataBase::_postCreate() void DataBase::_preDestroy() // ************************ { + clear(); + UpdateSession::open(); Inherit::_preDestroy(); @@ -156,6 +160,7 @@ void DataBase::_preDestroy() if (_technology) _technology->destroy(); UpdateSession::close(); + DBo::resetId(); _db = NULL; } @@ -277,6 +282,22 @@ Cell* DataBase::getCell(string name) 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 // **************************************** { diff --git a/hurricane/src/hurricane/Entity.cpp b/hurricane/src/hurricane/Entity.cpp index c00674e6..38bf0a24 100644 --- a/hurricane/src/hurricane/Entity.cpp +++ b/hurricane/src/hurricane/Entity.cpp @@ -59,9 +59,9 @@ namespace Hurricane { SlaveEntityMap::iterator it; SlaveEntityMap::iterator end; getCell()->_getSlaveEntities(this,it,end); - for(; it != end ; it++) + for( ; it != end ; it++) slaveEntities.push_back(it->second); - for(; slaveEntities.size() ; slaveEntities.pop_back()) { + for( ; slaveEntities.size() ; slaveEntities.pop_back()) { slaveEntities.back()->destroy(); } @@ -69,21 +69,19 @@ namespace Hurricane { if (quark) quark->destroy(); stack sharedPathStack; - for_each_instance(instance, getCell()->getSlaveInstances()) { + for ( Instance* instance : getCell()->getSlaveInstances() ) { SharedPath* sharedPath = instance->_getSharedPath(NULL); if (sharedPath) sharedPathStack.push(sharedPath); - end_for; } - while (!sharedPathStack.empty()) { + while (not sharedPathStack.empty()) { SharedPath* sharedPath = sharedPathStack.top(); sharedPathStack.pop(); Quark* quark = _getQuark(sharedPath); if (quark) quark->destroy(); Cell* cell = sharedPath->getOwnerCell(); - for_each_instance(instance, cell->getSlaveInstances()) { + for ( Instance* instance : cell->getSlaveInstances() ) { SharedPath* sharedPath2 = instance->_getSharedPath(sharedPath); if (sharedPath2) sharedPathStack.push(sharedPath2); - end_for; } } diff --git a/hurricane/src/hurricane/Instance.cpp b/hurricane/src/hurricane/Instance.cpp index ffaf295d..f7413ce6 100644 --- a/hurricane/src/hurricane/Instance.cpp +++ b/hurricane/src/hurricane/Instance.cpp @@ -596,7 +596,8 @@ void Instance::_postCreate() void Instance::_preDestroy() // ************************ { - for ( SharedPath* sharedPath : _getSharedPathes() ) delete sharedPath; + SharedPathes pathes = _getSharedPathes(); + while ( pathes.getFirst() ) delete pathes.getFirst(); Inherit::_preDestroy(); diff --git a/hurricane/src/hurricane/Net.cpp b/hurricane/src/hurricane/Net.cpp index c503a8c5..79a47b24 100644 --- a/hurricane/src/hurricane/Net.cpp +++ b/hurricane/src/hurricane/Net.cpp @@ -717,11 +717,13 @@ void Net::_preDestroy() Inherit::_preDestroy(); + cdebug_log(18,0) << "Net::_preDestroy: " << this << " slave Plugs..." << endl; Plugs plugs = getSlavePlugs(); while ( plugs.getFirst() ) plugs.getFirst()->_destroy(); unmaterialize(); + cdebug_log(18,0) << "Net::_preDestroy: " << this << " slave Rubbers..." << endl; Rubbers rubbers = getRubbers(); while ( rubbers.getFirst() ) rubbers.getFirst()->_destroy(); @@ -735,7 +737,13 @@ void Net::_preDestroy() // over a collection as it is modificated/destroyed! } } + + cdebug_log(18,0) << "Net::_preDestroy: " << this << " RoutingPads..." << endl; + vector 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(); while ( components.getFirst() ) { Component* component = components.getFirst(); @@ -743,6 +751,7 @@ void Net::_preDestroy() else (static_cast(component))->setNet(NULL); } + cdebug_log(18,0) << "Net::_preDestroy: " << this << " Names/Aliases..." << endl; _mainName.clear(); _cell->_getNetMap()._remove(this); diff --git a/hurricane/src/hurricane/SharedName.cpp b/hurricane/src/hurricane/SharedName.cpp index 068ee093..4ab4e1fd 100644 --- a/hurricane/src/hurricane/SharedName.cpp +++ b/hurricane/src/hurricane/SharedName.cpp @@ -83,6 +83,14 @@ Record* SharedName::_getRecord() const return record; } +void SharedName::dump () +// ********************** +{ + cerr << "_SHARED_NAME_MAP contents:" << endl; + for ( auto item : *_SHARED_NAME_MAP ) { + cerr << "- [" << item.first << "] = " << item.second << endl; + } +} // **************************************************************************************************** diff --git a/hurricane/src/hurricane/hurricane/Breakpoint.h b/hurricane/src/hurricane/hurricane/Breakpoint.h index 526d4cd3..8621c2b0 100644 --- a/hurricane/src/hurricane/hurricane/Breakpoint.h +++ b/hurricane/src/hurricane/hurricane/Breakpoint.h @@ -43,6 +43,8 @@ namespace Hurricane { public: typedef bool ( StopCb_t )( const string& ); + public: + static bool simpleStopCb ( const string& message ); public: static Breakpoint* get (); static void setStopCb ( StopCb_t* ); diff --git a/hurricane/src/hurricane/hurricane/CellsSort.h b/hurricane/src/hurricane/hurricane/CellsSort.h new file mode 100644 index 00000000..9322de2c --- /dev/null +++ b/hurricane/src/hurricane/hurricane/CellsSort.h @@ -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 +// . +// +// +-----------------------------------------------------------------+ +// | 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 +#include +#include "hurricane/Property.h" + + +namespace Hurricane { + + class Library; + class Cell; + + +// ------------------------------------------------------------------- +// Class : "DepthProperty". + + + typedef StandardPrivateProperty 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& getSortedCells () const; + private: + void _computeDepth ( Cell* ); + private: + std::vector _sortedCells; + std::vector _depthProperties; + }; + + + inline const std::vector& 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 diff --git a/hurricane/src/hurricane/hurricane/DBo.h b/hurricane/src/hurricane/hurricane/DBo.h index 1bdd6c00..39051717 100644 --- a/hurricane/src/hurricane/hurricane/DBo.h +++ b/hurricane/src/hurricane/hurricane/DBo.h @@ -55,6 +55,7 @@ namespace Hurricane { static unsigned int getIdCounter (); unsigned int getNextId (); static void setNextId ( unsigned int ); + static void resetId (); static bool inForcedIdMode (); static void enableForcedIdMode (); static void disableForcedIdMode (); @@ -92,6 +93,7 @@ namespace Hurricane { static unsigned int _memoryLimit; static unsigned long _flags; static unsigned int _nextId; + static unsigned int _idCount; static unsigned int _idCounter; static unsigned int _idCounterLimit; unsigned int _id; diff --git a/hurricane/src/hurricane/hurricane/DataBase.h b/hurricane/src/hurricane/hurricane/DataBase.h index 4c28337b..f876edfc 100644 --- a/hurricane/src/hurricane/hurricane/DataBase.h +++ b/hurricane/src/hurricane/hurricane/DataBase.h @@ -87,6 +87,7 @@ class DataBase : public DBo { public: Library* getLibrary(string,unsigned int flags); public: Cell* getCell(string, unsigned int flags); public: Cell* getCell(string); + public: void clear(); public: static DataBase* getDB(); }; diff --git a/hurricane/src/hurricane/hurricane/SharedName.h b/hurricane/src/hurricane/hurricane/SharedName.h index 4983994e..ccd9f277 100644 --- a/hurricane/src/hurricane/hurricane/SharedName.h +++ b/hurricane/src/hurricane/hurricane/SharedName.h @@ -31,7 +31,8 @@ namespace Hurricane { class SharedName { friend class Name; - + public: + static void dump (); public: inline unsigned long getHash () const; const string& _getSString () const { return _string; }; diff --git a/hurricane/src/isobar/PyDataBase.cpp b/hurricane/src/isobar/PyDataBase.cpp index 19105e48..e8c802c7 100644 --- a/hurricane/src/isobar/PyDataBase.cpp +++ b/hurricane/src/isobar/PyDataBase.cpp @@ -121,6 +121,7 @@ extern "C" { // Standart Accessors (Attributes). // Standart Destroy (Attribute). + DirectVoidMethod(DataBase,db,clear) DBoDestroyAttribute(PyDataBase_destroy,PyDataBase) @@ -135,6 +136,7 @@ extern "C" { , { "getTechnology" , (PyCFunction)PyDataBase_getTechnology , METH_NOARGS , "Return the Technology" } , { "getRootLibrary", (PyCFunction)PyDataBase_getRootLibrary, METH_NOARGS , "Return the root library" } , { "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 associated hurricane object The python object remains." } , {NULL, NULL, 0, NULL} /* sentinel */ diff --git a/hurricane/src/viewer/CellViewer.cpp b/hurricane/src/viewer/CellViewer.cpp index 9b5c1dca..be8aca24 100644 --- a/hurricane/src/viewer/CellViewer.cpp +++ b/hurricane/src/viewer/CellViewer.cpp @@ -924,7 +924,7 @@ namespace Hurricane { void CellViewer::runStressScript () { 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" ) ); } } diff --git a/hurricane/src/viewer/ColorScale.cpp b/hurricane/src/viewer/ColorScale.cpp index 90eb968b..3f6abfa6 100644 --- a/hurricane/src/viewer/ColorScale.cpp +++ b/hurricane/src/viewer/ColorScale.cpp @@ -1,15 +1,9 @@ - // -*- C++ -*- // // 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 | // | 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 | // | =============================================================== | // | C++ Module : "./ColorScale.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #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 { assert ( _brush[i] != NULL ); diff --git a/hurricane/src/viewer/DisplayStyle.cpp b/hurricane/src/viewer/DisplayStyle.cpp index 6f33903f..b834e537 100644 --- a/hurricane/src/viewer/DisplayStyle.cpp +++ b/hurricane/src/viewer/DisplayStyle.cpp @@ -76,11 +76,7 @@ namespace Hurricane { RawDrawingStyle::~RawDrawingStyle () { - if ( _color ) { - delete _color; - delete _pen; - delete _brush; - } + qtFree(); } @@ -111,18 +107,32 @@ namespace Hurricane { void RawDrawingStyle::qtAllocate () { - if ( !_color ) { + if (not _color) { _color = new QColor ( _red, _green, _blue ); _pen = new QPen (); - if ( _borderWidth ) { - _pen->setStyle ( Qt::SolidLine ); - _pen->setWidth ( _borderWidth ); + if (_borderWidth) { + _pen->setStyle( Qt::SolidLine ); + _pen->setWidth( _borderWidth ); } else - _pen->setStyle ( Qt::NoPen ); - _pen->setColor ( *_color ); + _pen->setStyle( Qt::NoPen ); + _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* 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 { for ( size_t gi=0 ; gi < _groups.size() ; gi++ ) { diff --git a/hurricane/src/viewer/Graphics.cpp b/hurricane/src/viewer/Graphics.cpp index 6e425aa4..1c2f9853 100644 --- a/hurricane/src/viewer/Graphics.cpp +++ b/hurricane/src/viewer/Graphics.cpp @@ -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 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 () { return getGraphics()->_qtEnabled; } @@ -224,6 +248,10 @@ namespace Hurricane { { return getGraphics()->_enable(); } + void Graphics::disable () + { return getGraphics()->_disable(); } + + void Graphics::addStyle ( DisplayStyle* displayStyle ) { getGraphics()->_addStyle ( displayStyle ); @@ -351,6 +379,7 @@ namespace Hurricane { return value; } + bool Graphics::breakpointStopCb ( const string& message ) { static BreakpointWidget* bpw = NULL; @@ -364,6 +393,12 @@ namespace Hurricane { } + void Graphics::clear () + { + return getGraphics()->_clear(); + } + + void Graphics::toJson ( JsonWriter* w ) const { w->startObject(); diff --git a/hurricane/src/viewer/PyGraphics.cpp b/hurricane/src/viewer/PyGraphics.cpp index 5d07875b..5d30f511 100644 --- a/hurricane/src/viewer/PyGraphics.cpp +++ b/hurricane/src/viewer/PyGraphics.cpp @@ -2,14 +2,14 @@ // -*- C++ -*- // // 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 | // | Alliance / Hurricane Interface | // | | // | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./PyGraphics.cpp" | // +-----------------------------------------------------------------+ @@ -284,11 +284,29 @@ extern "C" { static PyObject* PyGraphics_enable ( PyObject*, PyObject* args ) { cdebug_log(20,0) << "PyGraphics_enable()" << endl; - HTRY - Graphics::getGraphics()->enable(); + Graphics::getGraphics()->enable(); 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; } @@ -342,6 +360,10 @@ extern "C" { , "Return the list of all availables styles (only iterable)." } , { "enable" , (PyCFunction)PyGraphics_enable , METH_NOARGS|METH_STATIC , "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 the associated hurricane object. The python object remains." } , {NULL, NULL, 0, NULL} /* sentinel */ diff --git a/hurricane/src/viewer/hurricane/viewer/ColorScale.h b/hurricane/src/viewer/hurricane/viewer/ColorScale.h index 5857ddc7..43647cf9 100644 --- a/hurricane/src/viewer/hurricane/viewer/ColorScale.h +++ b/hurricane/src/viewer/hurricane/viewer/ColorScale.h @@ -1,31 +1,21 @@ - // -*- C++ -*- // // 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 | // | 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@asim.lip6.fr | // | =============================================================== | -// | C++ Header : "./ColorScale.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// | C++ Header : "./hurricane/viewer/ColorScale.h" | +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_COLOR_SCALE__ -#define __HURRICANE_COLOR_SCALE__ - +#ifndef HURRICANE_COLOR_SCALE_H +#define HURRICANE_COLOR_SCALE_H #include #include @@ -53,6 +43,7 @@ namespace Hurricane { public: // Accessors. void qtAllocate (); + void qtFree (); inline const Name& getName () const; QBrush getBrush ( size_t, const DisplayStyle::HSVr& darkening ) const; @@ -110,7 +101,6 @@ namespace Hurricane { inline const Name& ColorScale::getName () const { return _name; } -} // End of Hurricane namespace. +} // Hurricane namespace. - -#endif // __HURRICANE_COLOR_SCALE__ +#endif // HURRICANE_COLOR_SCALE_H diff --git a/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h b/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h index 40cbca6e..5e28cf8a 100644 --- a/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h +++ b/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h @@ -1,14 +1,14 @@ // -*- C++ -*- // // 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 | // | 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@asim.lip6.fr | +// | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./hurricane/viewer/DisplayStyle.h" | // +-----------------------------------------------------------------+ @@ -44,6 +44,7 @@ namespace Hurricane { ~DrawingGroup (); DrawingGroup* getClone (); void qtAllocate (); + void qtFree (); // Methods. inline const Name& getName () const; inline const DrawingStyles& getDrawingStyles () const; @@ -150,6 +151,7 @@ namespace Hurricane { // Modifiers. void qtAllocate (); + void qtFree (); inline void setDescription ( const std::string& description ); inline void setDescription ( const char* description ); void inheritFrom ( const DisplayStyle* base ); @@ -230,6 +232,7 @@ namespace Hurricane { public: // Accessors. void qtAllocate (); + void qtFree (); inline bool isGoMatched () const; inline const Name& getName () const; inline const std::string& getPattern () const; diff --git a/hurricane/src/viewer/hurricane/viewer/Graphics.h b/hurricane/src/viewer/hurricane/viewer/Graphics.h index 7609445b..3a477e66 100644 --- a/hurricane/src/viewer/hurricane/viewer/Graphics.h +++ b/hurricane/src/viewer/hurricane/viewer/Graphics.h @@ -67,6 +67,7 @@ namespace Hurricane { static string toHtml ( const string& ); static int toHighDpi ( int ); static bool breakpointStopCb ( const string& message ); + static void clear (); // Modifiers. static void addStyle ( DisplayStyle* displayStyle ); static void setStyle ( const Name& key ); @@ -75,6 +76,7 @@ namespace Hurricane { static DisplayStyle* getStyle (); static const vector& getStyles (); static void enable (); + static void disable (); void toJson ( JsonWriter* ) const; // Internals - Attributes. protected: @@ -110,8 +112,10 @@ namespace Hurricane { inline float _getThreshold ( const Name& key ) const; inline const DisplayStyle::HSVr& _getDarkening () const; inline const ColorScale& _getColorScale ( ColorScale::ScaleType ) const; - inline void _enable (); + void _enable (); + void _disable (); inline const TextTranslator& _getHtmlTranslator () const; + void _clear (); }; diff --git a/katana/src/NegociateWindow.cpp b/katana/src/NegociateWindow.cpp index e29b454a..1e673070 100644 --- a/katana/src/NegociateWindow.cpp +++ b/katana/src/NegociateWindow.cpp @@ -638,7 +638,7 @@ namespace Katana { } _eventQueue.commit(); cmess2 << " " << endl; + << _eventQueue.size() << ">" << setfill(' ') << endl; count = 0; //_eventQueue.prepareRepair();