# -*- Mode:Python; explicit-buffer-name: "alliance.conf<cmos>" -*-

import os
from helpers.Alliance import AddMode
from helpers.Alliance import Gauge


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 = allianceTop+'/cells/'


allianceConfig = \
    ( ( 'CATALOG'            , 'CATAL')
    , ( 'WORKING_LIBRARY'    , '.')
#   , ( 'SYSTEM_LIBRARY'     , ( (cellsTop+'ramlib'  , AddMode.Append), ) )
    , ( 'SYSTEM_LIBRARY'     , ( (cellsTop+'sxlib'   , AddMode.Append)
                               , (cellsTop+'dp_sxlib', AddMode.Append)
                               , (cellsTop+'ramlib'  , AddMode.Append)
                               , (cellsTop+'romlib'  , AddMode.Append)
                               , (cellsTop+'rflib'   , AddMode.Append)
                               , (cellsTop+'rf2lib'  , AddMode.Append)
                               , (cellsTop+'pxlib'   , AddMode.Append)
                               , (cellsTop+'padlib'  , AddMode.Append) ) )
    , ( 'IN_LO'              , 'vst')
    , ( 'IN_PH'              , 'ap')
    , ( 'OUT_LO'             , 'vst')
    , ( 'OUT_PH'             , 'ap')
    , ( 'POWER'              , 'vdd')
    , ( 'GROUND'             , 'vss')
    , ( 'CLOCK'              , '.*ck.*|.*nck.*')
    , ( 'BLOCKAGE'           , '^blockage[Nn]et*')
    , ( 'PAD'                , '.*_px$')
   # The following are only read by the Alliance tool wrappers.
    , ( 'SCALE_X'            , 100)
    , ( 'ALLIANCE_TOP'       , allianceTop)
    , ( 'MBK_TARGET_LIB'     , cellsTop+'sxlib')
    , ( 'RDS_TECHNO_NAME'    , allianceTop+'/etc/cmos.rds')
    , ( 'GRAAL_TECHNO_NAME'  , allianceTop+'/etc/graal.rds')
    )
