# -*- Mode:Python; explicit-buffer-name: "kite.conf<freepdk_45>" -*-

import helpers
from   helpers import l, u, n

# Contains the layout (shared by all technologies).
execfile( helpers.sysConfDir+'/common/kite.conf' )


parametersTable = \
    ( ('lefImport.minTerminalWidth'     ,TypeDouble    ,0.065    )
    , ("katabatic.globalLengthThreshold",TypeInt       ,1450     ) # Katabatic parameters.
    , ("katabatic.saturateRatio"        ,TypePercentage,90       )
    , ("katabatic.saturateRp"           ,TypeInt       ,10       )
    , ('katabatic.topRoutingLayer'      ,TypeString    , 'metal5')
    , ('anabatic.routingGauge'          ,TypeString    , 'gscl45')
    , ('crlcore.groundName'             ,TypeString    , 'gnd!'  )
    , ('crlcore.powerName'              ,TypeString    , 'vdd!'  )
    # Kite parameters.
    , ("kite.hTracksReservedLocal"      ,TypeInt       ,4        , { 'min':0, 'max':18 } )
    , ("kite.vTracksReservedLocal"      ,TypeInt       ,3        , { 'min':0, 'max':18 } )
    , ("kite.eventsLimit"               ,TypeInt       ,4000002  )
    , ("kite.ripupCost"                 ,TypeInt       ,3        , { 'min':0 } )
    , ("kite.strapRipupLimit"           ,TypeInt       ,16       , { 'min':1 } )
    , ("kite.localRipupLimit"           ,TypeInt       ,9        , { 'min':1 } )
    , ("kite.globalRipupLimit"          ,TypeInt       ,5        , { 'min':1 } )
    , ("kite.longGlobalRipupLimit"      ,TypeInt       ,5        , { 'min':1 } )
    # Anabatic parameters are temporarily hosted here.
    , ("anabatic.edgeLength"            ,TypeInt       ,24       )
    , ("anabatic.edgeWidth"             ,TypeInt       ,4        )
    , ("anabatic.edgeCostH"             ,TypeDouble    ,9.0      )
    , ("anabatic.edgeCostK"             ,TypeDouble    ,-10.0    )
    , ("anabatic.edgeHScaling"          ,TypeDouble    ,1.0      )
    , ("anabatic.globalIterations"      ,TypeInt       ,10       , { 'min':1, 'max':100 } )
    , ("anabatic.gcell.displayMode"     ,TypeEnumerate ,1
      , { 'values':( ("Boundary"      , 1)
                   , ("Density"       , 2) ) }
      )
    )


# Format of routingGaugesTable (dictionary):
#    A list of entry of the form:
#    ( METAL_NAME, (Direction, Type, depth, density, offset, pitch, wire_width, via_width, obs_dw) )
 
routingGaugesTable = {}
 
routingGaugesTable['gscl45'] = \
    ( ( 'symbolic', False )
    , ( 'metal1'  , ( Gauge.Horizontal, Gauge.PinOnly, 0, 0.0, u(0), u(0.190), u(0.065), u(0.065), u(7) ) )
    , ( 'metal2'  , ( Gauge.Vertical  , Gauge.Default, 1, 0.0, u(0), u(0.190), u(0.070), u(0.070), u(8) ) )
    , ( 'metal3'  , ( Gauge.Horizontal, Gauge.Default, 2, 0.0, u(0), u(0.190), u(0.070), u(0.070), u(8) ) )
    , ( 'metal4'  , ( Gauge.Vertical  , Gauge.Default, 3, 0.0, u(0), u(0.285), u(0.140), u(0.140), u(8) ) )
    , ( 'metal5'  , ( Gauge.Horizontal, Gauge.Default, 4, 0.0, u(0), u(0.285), u(0.140), u(0.140), u(8) ) )
    , ( 'metal6'  , ( Gauge.Vertical  , Gauge.Default, 5, 0.0, u(0), u(0.285), u(0.140), u(0.140), u(8) ) )
    , ( 'metal7'  , ( Gauge.Horizontal, Gauge.Default, 6, 0.0, u(0), u(0.855), u(0.400), u(0.400), u(8) ) )
    , ( 'metal8'  , ( Gauge.Vertical  , Gauge.Default, 7, 0.0, u(0), u(0.855), u(0.400), u(0.400), u(8) ) )
    , ( 'metal9'  , ( Gauge.Horizontal, Gauge.Default, 8, 0.0, u(0), u(1.710), u(0.800), u(0.800), u(8) ) )
    , ( 'metal10' , ( Gauge.Vertical  , Gauge.Default, 9, 0.0, u(0), u(1.710), u(0.800), u(0.800), u(8) ) )
    )
 
 
# Format of cellGaugesTable (dictionary):
#    A list of entry of the form:
#    ( METAL_PIN, xy_common_pitch, slice_height, slice_step )
 
cellGaugesTable = {}
cellGaugesTable['gscl45'] = ('metal2', u(0.38), u(2.47), u(0.38))

