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

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    , 'metal9')
    , ('anabatic.routingGauge'          ,TypeString    , 'ispd18')
    , ('crlcore.groundName'             ,TypeString    , 'VSS'   )
    , ('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['ispd18'] = \
    ( ( 'symbolic', False )
    , ( 'metal1'  , ( Gauge.Horizontal, Gauge.PinOnly, 0, 0.0, u(0.095), u(0.190), u(0.060), u(0.070), u(7) ) )
    , ( 'metal2'  , ( Gauge.Vertical  , Gauge.Default, 1, 0.0, u(0.100), u(0.200), u(0.070), u(0.070), u(8) ) )
    , ( 'metal3'  , ( Gauge.Horizontal, Gauge.Default, 2, 0.0, u(0.100), u(0.200), u(0.070), u(0.070), u(8) ) )
    , ( 'metal4'  , ( Gauge.Vertical  , Gauge.Default, 3, 0.0, u(0.100), u(0.200), u(0.070), u(0.070), u(8) ) )
    , ( 'metal5'  , ( Gauge.Horizontal, Gauge.Default, 4, 0.0, u(0.100), u(0.200), u(0.070), u(0.070), u(8) ) )
    , ( 'metal6'  , ( Gauge.Vertical  , Gauge.Default, 5, 0.0, u(0.100), u(0.200), u(0.070), u(0.360), u(8) ) )
    , ( 'metal7'  , ( Gauge.Horizontal, Gauge.Default, 6, 0.0, u(0.100), u(0.200), u(0.070), u(0.360), u(8) ) )
    , ( 'metal8'  , ( Gauge.Vertical  , Gauge.Default, 7, 0.0, u(0.100), u(0.200), u(0.070), u(0.360), u(8) ) )
    , ( 'metal9'  , ( Gauge.Horizontal, Gauge.Default, 8, 0.0, u(0.475), u(0.330), u(0.070), u(0.360), u(8) ) )
    )
 
 
# Format of cellGaugesTable (dictionary):
#    A list of entry of the form:
#    ( METAL_PIN, xy_common_pitch, slice_height, slice_step )
 
cellGaugesTable = {}
cellGaugesTable['ispd18'] = ('metal2', u(0.2), u(1.71), u(0.2))