;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; alliance .cdsinit 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Welcome the user

; Cadence-Alliance
printf("			 _  _   _   _       _  _ ")
printf("    _        .  _        _  _\n")
printf("			|  |_| | \\ |_ |\\ | |  |_ ")
printf(" _ |_| |  |  | |_| |\\ | |  |_\n")
printf("			|_ | | |_/ |_ | \\| |_ |_ ")
printf("   | | |_ |_ | | | | \\| |_ |_\n")
printf(" \n")
printf("					      Version 1.0\n")
printf(" \n")

;fprintf( poport ".\n")
;fprintf( poport "Welcome to Cadence -> %s\n"                getShellEnvVar("USER") )
;fprintf( poport "This is version -> %s\n"                   getVersion()           )
;fprintf( poport "Your current WORKING DIRECTORY is -> %s\n" getWorkingDir()        )

; Add opus path to PATH
path=getShellEnvVar("PATH")
if(index(path ":/users/soft2/opus/tools.sun4/bin:/users/soft2/opus/bin:/users/soft2/opus/frame/bin")==nil then
path=strcat(path ":/users/soft2/opus/tools.sun4/bin:/users/soft2/opus/bin:/users/soft2/opus/frame/bin")
setShellEnvVar(strcat("PATH=" path))
)

;load some EnvVariables
mbkdir=getShellEnvVar("MBK_CADAL_DIR")
if( mbkdir==nil then
	printf("MBK_CADAL_DIR doesn't exist . loaded\n")
	setShellEnvVar("MBK_CADAL_DIR=.")
	mbkdir="."
  )

sample=getShellEnvVar("MBK_SAMPLE_DIR")
if( sample==nil then
	printf("MBK_SAMPLE_DIR doesn't exist . loaded\n")
	setShellEnvVar("MBK_SAMPLE_DIR=.")
	sample="."
  )
basic=getShellEnvVar("MBK_BASIC_DIR")
if( basic==nil then
	printf("MBK_BASIC_DIR doesn't exist . loaded\n")
	setShellEnvVar("MBK_BASIC_DIR=.")
	basic="."
  )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The following line sets the technology file name to "default.tf" for
; the "Technology File" field in the "Create Library".

;dmbLibCreateForm->dmbTechFile->value =strcat(mbkdir "/TECHNO/alliance.techno")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Set the LIBRARY SEARCH PATH.
; Edit the following lines as appropriate for your installation.

;dbSetPath(
;  strcat(
;         ". "                           		; Curent dir
;	 mbkdir						; library Alliance
;	 " "
;	 basic
;	 " "
;	 sample
;	 " "
;	; synthdir
;	 )				   	; library HDL SYNTH
;        prependInstallPath("./pcells")	; librairy PCells Alliance
;) 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Invoke the Library Browser when opening a design or placing an instance
; and leave the browser up when closing Open Design form

dmbSetBrowserInteractions( ?openDesignOption t ?openPlaceInstanceOption t
?openOthersOption nil )

; Add scroll bars to graphics windows
; hiSysProps->hiSetWinOptions->scrollBars->value = t

; Set command nesting level
hiSysProps->hiSetNest->value = 20

hiFormApply( hiSysProps )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Define bind keys for Schematic and Symbol editors

printf( "Defining sample bind keys for schematic and symbol editors.\n" )
load( prependInstallPath( "samples/local/schBindKeys.il" ) )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Composer Design Flow Browser

; These commands are only run if the Composer Design Flow Browser is available.
; (Note that you can only check "amadeusTopFlow.autoload" BEFORE the design
; flow browser is loaded. If you check it afterwards, it will be nil).
if( amadeusTopFlow.autoload
then

  ; Example of how to arrange some windows on the screen with specific location
  ; and size.  See the Amadeus User's guide for more options and explanation.
  amdfDFWindowBBox   = list(   0:300  400:600 ) ; Design Flow Browser, top lev
  amdfDFBrowserBBox  = list(   0:800  400:125 ) ; Design Flow Browser, 2nd lev
  amdfDEWindowBBox   = list( 410:300 1020:863 ) ; Design Entry
  amdfWaveWindowBBox = list( 310:150 1020:563 ) ; Waveforms

)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If you want a SKILL file to be automatically loaded from your 
; directory then name it ".cdslocal".  This would be handy for your
; user preferences.

if( isFile( "./.cdslocal" ) then
  printf("Loading user .cdslocal (%s).\n" ".cdslocal")
  loadi( "./.cdslocal" )
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;printf("The current LIBRARY SEARCH PATH is: \n  %s\n" dbGetPath())
;hiFlush()
;hiResizeWindow(window(1) list(5:18 520:325))
printf( "Done with startup initialization.\n" )
