Monday, April 12, 2010

Tips and tricks for working in and customizing the Cadence environment

1. Modifying your .cdsinit file
The .cdsinit file is an initialization file that runs when Cadence is starting. This section describes some useful additions to your .cdsinit file that you can add. The .cdsinit file is a hidden file and is often located in the directory where you start Cadence. This is not always the case and you may have to search for it. All these scripts can also be entered in the command line once cadence starts.

2. Changing the default text editor
When working with AHDL or VerilogA it is nice to have a choice of different text editors to use. To change the default text editor in Cadence, add the following to your .cdsinit file:

editor = "TEXT_EDITOR_NAME"
Where TEXT_EDITOR_NAME is an editor such as nedit, gedit, vim, ect. For a complete list of Linux text editors see: http://en.wikipedia.org/wiki/Category:Linux_text_editors

3. Close the "What's new" window
ddsNewsClose()

4. Resize the Command Interface Window (CIW)
hiResizeWindow(window(1) list(1:25 800:200))
The CIW is the command line window. The window size and position is set by defining the pixel positions of the bottom-left (BL) and top-right (TR) location of the window. The bottom-left corner of the screen is the origin. The syntax is
list([BL_horizontal_position]:[BL_vertical_position] [TR_horizontal_position]:[TR_vertical_position])
list(1:25 800:200) sets it up in the bottom left part of the screen.

5. Open the library manager window
ddsOpenLibManager()

6. Load bindkeys
Bindkeys are keyboard button definitions for commonly used functions. The following two commands set the bindkeys to those that are used by the AMS groups.

loadi "~cdsmgr/common/schBindKeys.il"
loadi "~cdsmgr/common/leBindKeys.il"
The first file is for schematic bindkeys and the second is for layout bind keys. If you would like to change the bindkeys, you can copy these files to your home directory, edit them, and load them by changing the path in the commands above.
If you would like to create your own bindkey, you must first know the SKILL function of the command you are trying to bind. If you don't know the SKILL function you can find it by having cadence print all input activity in the command window. In the ICFB command window select Options->Log Filter...->Show Input->menu commands. Now when you activate a command through a menu or the mouse, its SKILL function will be displayed in the command window. Just copy this function into your bindkeys file with the same syntax as the other bind keys.
Note : The above command does not work on Cadence 6 if your .cdsinit file contains the following:
let( (bindKeyFileList file path saveSkillPath)
bindKeyFileList = '(
"common_bindkeys.il" ; JTS, from Cadence
)
An easy fix if you have this script is to simply repalce the above with this:

let( (bindKeyFileList file path saveSkillPath)
bindKeyFileList = '(
"leBindKeys.il"
"schBindKeys.il"
)
Note 2: If you are using IBM processes, the "IBM_PDK" customization setup automatically adds the "IBM" Bindkeys. To replace them, just replace this path
loadi(strcat( ibmPdkPath "cms9flp/V1.5.0.0IBM/cdslib/Skill/ibmPdkBindkeys.il")))
with your path like this:

JonPath="/nfs/spectre/u9/guerberj/Cadence/90nm/IBM_90"
loadi(strcat( JonPath "leBindkeys.il")))
loadi(strcat( JonPath "schBindkeys.il")))

7. Changing the default simulation directory
envSetVal("asimenv.startup" "projectDir" 'string strcat("/scratch/" getShellEnvVar("USER")))
This sets the default simulation directory to /scratch/user_name where user_name is your login name. Adding the user name directory is a precaution so that other people will not over write your data. Storing data on scratch keeps your account space from filling up. Note that this is not backed up.

Another method would be to delete the default simulation directory for your process and replace it with a link to a scratch directory folder.

8. Set the undo limit to 10
hiSetUndoLimit(10)

9. Add a model files path
asiSetEnvOptionVal( asiGetTool('spectre) 'modelFiles '(("/model_file_path" "")) )

10. Unlock your files
Sometimes if your computer crashes or looses power while Cadence is open, many of your folders will have a file in them that ends in .cdslck. This file is created when you open a schematic for edit and prevents anyone from altering the file while you have it open. There are several ways to fix this problem:

Use the clsAdminTool
The path for this tool is: /nfs/guille/a2/rh80apps/cadence/current/tools/bin/clsAdminTool
Run clsAdminTool in a directory above your locked files.
Type ale . to list locked files below the current directory.
Type are . to unlock files below the current directory.
If you only had one or two windows open at the time of the crash, then just browse to the folder and delete the .cdslck file.
If you had many files open...
Open a terminal and type cd ~ to return to your home directory
Type find . -name "*.cdslck" This will find all the cdslck files.
If you want to delete all of these files type find . -name "*.cdslck" -exec rm -f {} \; This will delete all files containing .cdslock in the filename.
You can make people very mad at you if you run this command in a group directory

11. Cadence Segmentation Faults
One of the Most annoying things is when cadence crashes. Here are some things that will cause Cadence to crash:

In Virtuoso 6 do not hit the "Results > Print" Command while the simulation is running or else a crash is eminent