Professional Documents
Culture Documents
Skill Language Programming: Lecture Manual July 16, 2012
Skill Language Programming: Lecture Manual July 16, 2012
Skill Language Programming: Lecture Manual July 16, 2012
Cadence Trademarks
Trademarks and service marks of Cadence Design Systems, Inc. (Cadence) contained in this document are attributed to Cadence with the appropriate
symbol. For queries regarding Cadence trademarks, contact the corporate legal department at the address above or call 800.862.4522.
Other Trademarks
Open SystemC, Open SystemC Initiative, OSCI, SystemC, and SystemC Initiative are trademarks or registered trademarks of Open SystemC Initiative,
Inc. in the United States and other countries and are used with permission.
All other trademarks are the property of their respective holders.
Confidentiality Notice
No part of this publication may be reproduced in whole or in part by any means (including photocopying or storage in an information storage/retrieval
system) or transmitted in any form or by any means without prior written permission from Cadence Design Systems, Inc. (Cadence).
Information in this document is subject to change without notice and does not represent a commitment on the part of Cadence. The information
contained herein is the proprietary and confidential information of Cadence or its licensors, and is supplied subject to, and may be used only by
Cadence customers in accordance with a written agreement between Cadence and its customers. Except as may be explicitly set forth in such
agreement, Cadence does not make, and expressly disclaims, any representations or warranties as to the completeness, accuracy or usefulness of the
information contained in this document. Cadence does not warrant that use of such information will not infringe any third party rights, nor does
Cadence assume any liability for damages or costs of any kind that may result from use of such information.
RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of
the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013.
UNPUBLISHED This document contains unpublished confidential information and is not to be disclosed or used except as authorized by written
contract with Cadence. Rights reserved under the copyright laws of the United States.
Version 6.1.5
Module 1
SKILL Examples
Go to the Cadence Community web site to stay current with tips and
tricks.
http://www.cadence.com/community/forums
http://www.cadence.com/community/blogs
http://www.cadence.com/cdnlive
To access Cadence Help from a Cadence software application, choose Help – Cadence
Documentation from the pull-down menus. The browser displays the document page. After
the document page opens, click the Library button to open the Library window.
To access Cadence Help from a command line, enter cdnshelp & in a terminal window. When
the Library window appears, navigate to the manual you want by selecting the specific
product, and then double-click to open the manual in your browser.
Submit Service
Request
From the online support site, fill out the
Service Request Creation form to...
Receive Customer
Support
You can use the Cadence Online Support site for service requests. Fill out the Service Request
Creation form and submit it. The request goes to Customer Support, and if necessary is escalated
to Cadence R&D for a solution.
Module 2
These links link to the SKILL related documentation on Cadence Online Support.
Search
Browse
SKILL Solutions
If you scroll to the bottom of the Custom IC Design SKILL Code Library page, you can click a
link to download a compressed file of the entire SKILL code library.
Enter topic
Click on item to
view discussion
The Cadence SKILL API Finder database varies according to the products on your system. Each
separate product loads its own language information in the Cadence hierarchy that the Finder
reads.
You can add your own functions locally for quick reference because the Finder can display any
information that is properly formatted and located.
Choose SKILL
The Search assistant lets you search through a variety of design information including SKILL
commands.
Programming labs
Section Description
Requirements Describe the functionality of the SKILL function you
write.
Recommendations Outline an approach to solving the problem.
Testing your solution Run some tests that your SKILL function must pass.
Module 3
Examine the role of the SKILL® Evaluator and interpret return values
Interpret tags and results within the CDS.log file
Zoom in by 2.
Other SKILL functions compute or retrieve data from the Virtuoso Design
Environment or from designs. For example, SKILL functions can
Retrieve the bounding box of the current window.
Note: In the table above virtuoso is the name of the executable. The & places the
application in background mode which you do not want for the nongraphic session
where you will be entering commands directly into a terminal window.
-64 Select the 64bit version; if not available, print a warning and try to launch the 32bit version.
-32only Select the 32bit version; if not available, print an error and exit with error.
-64only Select the 64bit version; if not available, print an error and exit with error.
-3264 Select the 32bit version; if not available, print an info and try to launch the 64bit version.
-6432 Select the 64bit version; if not available, print an info and try to launch the 32bit version.
-debug3264 Print the environment updated by the wrapper and the command launched.
-plat <platform> Allow to override the default platform selection when the tool is launched from the
directory:<install_root>/bin.
-v3264 Print the wrapper's version string.
Note: These command line options override the CDS_AUTO_64BIT variable for the virtuoso executable.
7/16/12 SKILL Language Programming 41
Some Cadence® applications have both 32- and 64-bit versions. The 64-bit versions of
applications are installed in the same tools hierarchy as the 32-bit versions. A wrapper for each
application determines which version of the application is run. The 64-bit version of an
application is located in the 64bit directory in the standard installation location of the
application. For example,
your_install_dir/tools/bin/64bit
your_install_dir/tools/dfII/bin/64bit
Notes on the CDS_AUTO_64BIT environment variable:
The default setting is to run applications in 32-bit unless the CDS_AUTO_64BIT environment
variable is set to ALL.
To run the 64-bit version of a Cadence application, do the following:
Verify that your operating system supports 64-bit applications. You should have a
minimum of 4GB of RAM to run Cadence 64-bit applications.
Verify that a 64-bit version of the application is installed.
Set the following environment variable:
CDS_AUTO_64BIT { ALL | NONE | list | INCLUDE:list | EXCLUDE:list }
The site administrator has three ways of controlling the user customization.
Resizeable
Input and
Output panes
Color-coded
Syntax
In a graphic session, the Command Interpreter Window (CIW) is the first window
you see.
Also use
the mouse
to stretch
the input
area
Code groups between parens are shaded in gray as you type or by clicking on
a paren. In this example the let( … ) block of code is highlighted.
To turn OFF auto-highlighting, add the following line to your .cdsenv file:
ui ciwSyntaxHighlighting boolean nil
To control the highlight colors, there are .cdsenv settings under the ui category as follows:
ui ciwWarnColor string "#b87b00"
ui ciwErrorColor string "dark red"
ui ciwMatchParenColor string "#dcdcdc"
ui ciwMismatchParenColor string "red"
ui ciwMatchCmdColor string "#cce8c3“
Bindkey Wait
Menu Item
Read SKILL Expression
Form callback
Linux Process
CDS.log CIW Output
Pane
SKILL Evaluator
For each expression, the SKILL Evaluator parses it, compiles it, and then executes the
compiled code. SKILL Evaluator makes safety checks during each phase.
\p 1> prompt
\i x = 0 user type-in SKILL expression
\t 0 SKILL expression’s return value
\p 1> prompt
\i TrBump() user type-in SKILL expression
\o Old value: 0 New Value: 1 SKILL expression output
\t 1 SKILL expression’s return value
\p 1> Prompt
\a TrBump() Bindkey SKILL expression
\o Old value: 1 New Value: 2 SKILL expression output
\r 2 SKILL expression’s return value
\i TrBump() user type-in SKILL expression
\o Old value: 2 New Value: 3 SKILL expression output
\t 3 SKILL expression’s return value
The following SKILL expression defines the <Key>F7 bindkey for the CIW:
hiSetBindKey( "Command Interpreter" "<Key>F7" "TrBump()" )
By default mouse drag events are not logged. You can turn on logging by entering in the CIW:
hiLogDragEvents( t )
Data integer 5
floating point 5.3
text string "this is text"
list ( 1 "two" 3 4 )
Boolean t ;;; true
nil ;;; false
Variables naming Line_Count1
assignment x = 5
retrieval x
Function call C syntax strcat( "Good" " day" )
Lisp syntax ( strcat "Good" " day" )
Operators operator 4 + 5 * 6
functions plus( 4 times( 5 6 ))
7/16/12 SKILL Language Programming 53
The SKILL Evaluator uses the print representation as the default format when displaying
data, unless you specify another format.
An argument to a SKILL function usually must be a specific type. SKILL documentation
designates the expected type with a single or double character prefix preceding the variable
name. The letter g designates an unrestricted type.
The following table summarizes several common data types.
Variables
The SKILL language allows both global and local variables. In the module on Developing a
SKILL Function, see Grouping Expressions with Local Variables.
SKILL Symbols
The SKILL language uses a data type called symbol to represent both variables and functions.
A SKILL symbol is a composite data structure that can simultaneously and independently hold
the following:
Data value. For example x = 4 stores the value 4 in the symbol x.
Function definition. For example, procedure( x(a b) a+b) associates a function definition
with the symbol x. The function takes two arguments and returns their sum.
Property list. For example, x.raiseTime = .5 stores the name-value pair raiseTime .5 on the
property list for the symbol x.
You can use symbols as tags to represent one of several values. For example,
strength = ’weak assigns the symbol as a value to the variable strength.
Alternatively, you can place the left parenthesis to the left of the function name.
( strcat "A" " SKILL" " program" " automates " " tasks" )
=> "A SKILL program automates tasks"
For SKILL function calls that are not subexpressions, you can omit the
outermost levels of parentheses.
strcat "A" " SKILL" " program" " automates " " tasks"
=> "A SKILL program automates tasks"
Use white space to separate function arguments. You can use all three syntax
forms together.
You can span multiple lines with a single command. Be careful with this ability. When you send a
segment of your command to the SKILL compiler and it can be interpreted as a statement, the
compiler treats it as one.
Example
a=2
a + 2 * (3 + a) => 12
however,
a+2
* (3 + 2) =>
4
* error * - wrong number of arguments: mult expects 2 arguments
A text string can span multiple lines by including a \ before the return.
Example
myString = "this string spans \
two lines using a backslash at the end of the first line"
"this string spans two lines using a backslash at the end of the first line"
Keyword Arguments
When you provide a keyword argument you must preface it with the name of the
formal argument. You can provide keyword arguments in any order.
geOpen(
?window w_windowId
?lib t_lib
?cell t_cell
?view t_view
?viewType t_viewType
?mode t_mode )
=> t / nil
7/16/12 SKILL Language Programming 60
The %L directive specifies the default format. Use the print representation for each
type to display the value.
7/16/12 SKILL Language Programming 68
The %L Directive
The %L directive specifies the print representation. This directive is a very
convenient way to intersperse application specific formats with default
formats. Remember that printf returns t.
Examples
sprintf( myMessage “Located data in file %s” fileName)
myMessage = sprintf( nil “Located data in file %s” fileName )
7/16/12 SKILL Language Programming 70
The newline ( \n ) and tab ( \t ) printf formatting controls are note evaluated by sprintf. They are
sent as is into the output string from sprintf. For example: sprintf( z “a\n b\t”) => ”a\n b\t”
An assignment to a variable
greeting = strcat ( "work" " smarter" )
*** Error in routine eval:
Message: *Error* eval: unbound variable strcat
7/16/12 SKILL Language Programming 73
The type template mentioned in the error message encodes the expected argument
types.
The strlen function expects at least one argument.
strlen()
*Error* strlen: too few arguments (1 expected, 0 given) - nil
Module 4
Instances in a design
You can use a list to represent many different types of objects. The arbitrary meaning of a list is
inherent in the programs that manipulate it.
’( "one" 1 ) ( "one" 1 )
b=2 (2)
list( a b 3 ) (123)
Use Variables
Store the new list in a variable. Otherwise, you cannot refer to the list again.
The ’ Operator
Follow these guidelines when using the ’ operator to build a list:
Include sublists as elements with a single set of parentheses.
Do not use the ’ operator in front of the sublists.
Separate successive sublists with white space.
result = ’( 2 3 ) ( 2 3 )
oneList = ’( 4 5 6 ) ( 4 5 6 )
aList = ’( 1 2 3 ) ( 1 2 3 )
bList = append( oneList aList ) ( 4 5 6 1 2 3 )
Question Answer
What is the difference between nil and ’( nil )? nil is a list containing nothing. Its length is 0.
’( nil ) builds a list containing a single element. The
length is 1.
How can I add an element to the end of a list? Use the list function to build a list containing the
individual elements. Use the append function to merge
it to the first list.
There are more efficient ways to add an element to the
end of a list. They are beyond the scope of this course.
Can I reverse the order of the arguments to the cons Common sense suggests that simply reversing the
function? Will the results be the same? elements to the cons function will put the element on
the end of the list. This is not the case.
What is the difference between cons and append? The cons function requires only that its second
argument be a list. The length of the resulting list is
one more than the length of the original list.
The append function requires that both its arguments
be lists. The length of resulting list is the sum of the
lengths of the two argument lists.
You can use car and cdr to traverse a list. You can draw a tree as shown to layout your list structure. Make each
sub-list a sub-tree. Label each left branch with a car and each right branch with a cdr. From the item you wish to
locate in the list follow the tree back to the root and construct your nested car and cdr function calls.
You can abbreviate your nested car and cdr function calls by using just the "a" for car and "d" for cdr to create a
function call. For example, you can abbreviate car( cdr ( alist )) as cadr(alist).
The SKILL language provides a family of functions that combine car and cdr operations. You can use these
functions on any list. Bounding boxes provide a good example of working with the car and cdr functions.
How does the setof function work? What is the variable x for?
Questions Answers
Why are such critical car and cdr were machine language instructions on the first machine to run Lisp. car
functions as car and cdr stands for contents of the address register and cdr stands for contents of the
called such weird names? decrement register.
What is the purpose of the Lists are stored internally as a series of doublets. The first element is the list entry,
car and cdr functions? the second element of the doublet is a pointer to the rest of the list. The car function
returns the first element of the doublet, the cdr function returns the second. For any
list L it is true that cons( car( L ) cdr( L )) builds a list equal to L. This relates the
three functions cons, car, and cdr.
Can the member function No. It only looks at the top-level elements. Internally the member function follows
search all levels in a right branches until it locates a branch point whose left branch dead ends in the
hierarchical list? element.
How does the setof function The setof function makes a new list by copying only those top-level elements in a list
work? What is the variable that pass a test. The test must be written in terms of a single variable. The first
x for? parameter to the setof function identifies the variable you are using in the test.
The xCoord and yCoord functions access the x-coordinate and the y-
coordinate.
xCoord( P ) => 300
yCoord( P ) => 400
y-axis
P = 300:400
400
x-axis
300
7/16/12 SKILL Language Programming 89
x-axis
dx
ll = 300:400
x-axis
ll = 300:400 ur = 500:450
bBox = list( ll ur ) =>
(( 300 400 ) ( 500 450 ))
When you create a bounding box, put the points in the correct order. When the SKILL code
prompts you to digitize a bounding box, it returns the bounding box with the lower-left and
upper-right corner points correctly ordered, even though the user may have digitized the upper-
left and lower-right corners!
You may use the ’ operator to build the bounding box ONLY if you specify the coordinates as
literal lists.
bBox = ’(( 300 400 ) ( 500 450 ))
=> (( 300 400 ) ( 500 450 ))
B
A
dy
dx x-axis
Example Solution
x-axis
Use the xCoord, yCoord, lowerLeft, and upperRight functions in the
following template.
boxLL = min( ... ... ):min( ... ... )
boxUR = max( ... ... ):max( ... ... )
list( boxLL boxUR )
7/16/12 SKILL Language Programming 96
Example Solution
llAx = xCoord( lowerLeft( A ))
llBx = xCoord( lowerLeft( B ))
llAy = yCoord( lowerLeft( A ))
llBy = yCoord( lowerLeft( B ))
urAx = xCoord( upperRight( A ))
urBx = xCoord( upperRight( B ))
urAy = yCoord( upperRight( A ))
urBy = yCoord( upperRight( B ))
boxLL = min( llAx llBx ):min( llAy llBy )
boxUR = max( urAx urBx ):max( urAy urBy )
list( boxLL boxUR )
x-axis
Use the xCoord, yCoord, lowerLeft, and upperRight functions in the
following template.
boxLL = max( ... ... ):max( ... ... )
boxUR = min( ... ... ):min( ... ... )
list( boxLL boxUR )
Example Solution
llAx = xCoord( lowerLeft( A ))
llBx = xCoord( lowerLeft( B ))
llAy = yCoord( lowerLeft( A ))
llBy = yCoord( lowerLeft( B ))
urAx = xCoord( upperRight( A ))
urBx = xCoord( upperRight( B ))
urAy = yCoord( upperRight( A ))
urBy = yCoord( upperRight( B ))
boxLL = max( llAx llBx ):max( llAy llBy )
boxUR = min( urAx urBx ):min( urAy urBy )
list( boxLL boxUR )
Using the xCoord, yCoord, lowerLeft and upperRight functions is preferable in practice to access
coordinates, bounding boxes, and paths.
The functions cadr, caar, and so forth are built in for your convenience.
You can use any combination of four a’s and d’s when you construct the abbreviated commands,
such as aadd.
Module 5
Manage windows
Application windows
The Layer Selection Window (LSW) is not one of these windows.
The window function converts a window number to a window ID.
window( 3 ) => window:3
The data type wtype represents the underlying data structure for a window.
type( window( 3 ) ) => wtype
To make a window current, the user puts the mouse cursor in the window
and presses either a mouse button or a key.
The CIW is never the current window.
SKILL® functions act on the current window by default.
7/16/12 SKILL Language Programming 105
The geOpen function requires keyword parameter passing. Precede each argument with the
corresponding keyword. Keywords correspond to the formal arguments.
Prompt Line
By default every graphic window has a prompt line. This line tells the user what the command
requires next. You can remove the prompt line for the current window with the command:
hiRemovePromptLine()
Optionally, you can specify a window ID as an input parameter to the command.
The mode that governs the bindkey. The bindkey is either modeless or
is in effect only when the user enters points.
The SKILL expression that the bindkey triggers.
Use curly braces { } to group several SKILL expressions together when defining the callback (the
third argument in hiSetBindKey).
Examples
Event description Event syntax
The user pressed the a key. "<Key>a"
The user clicked the left mouse button. "<Btn1Down>"
Modes
If t_key ends with EF, you use the SKILL command in enterfunction mode. Otherwise, it is a
non-enterfunction mode command. If there is no enterfunction mode command defined when a
key or mouse event happens in enterfunction mode, the system uses the non-enterfunction
mode command for this key.
Note that even an empty string is a valid bindkey command. Therefore, if you want a non-
enterfunction mode command to be executed during an enterfunction, do not define an
enterfunction mode command for this key.
Enterfunctions
An enterfunction in the SKILL language is a built-in function which allows you to enter points
graphically. The enterfunctions then collect these points and pass them to your procedure which
uses the points to perform some action. These are very useful in the graphical environment.
The list of enterfunctions that collect points are
enterArc, enterBox, enterCircle, enterDonut, enterEllipse, enterLine, enterPath, enterPoint,
enterPoints, enterPolygon, enterScreenBox, enterSegment, enterMultiRep
Additional enterfunctions are enterNumber and enterString.
Select
application
Double-click
Bindkey or
Command
to edit
You can save the displayed file and load it from your .cdsinit file.
The file uses the hiSetBindKeys function, instead of the hiSetBindKey function, to define the
bindkeys.
Can you describe the difference between the arguments for these two functions?
/tools/dfII/samples/local/leBindKeys.il
Notice that these files use the aliasfunction to give a shorter name to the
hiSetBindKey function.
Use the prependInstallPath function to make a pathname relative to the Virtuoso Design Environment installation
directory. This function prepends <install_dir>/tools/dfII to the path name. The view Function: The view function takes
several optional arguments.
winSpec Optional Bounding box/nil Bounding box of the window. If you pass nil, the default position is used.
Title Optional Text The title of the window. The default is the value of file parameter.
autoUpdate Optional t/nil If t, then the window updates for each write to the file. The default is no
autoUpdate.
appName Optional Text The application type for this window. The default is “Show File”.
Help Optional Text Text string for online help. The default means no help is available.
Example
This example displays the same file in a window titled Schematics Bindkeys.
view(
prependInstallPath( "samples/local/schBindKeys.il" )
’((406 506) (1032 806)) ;;; window bounding box
"Schematics Bindkeys" ;;; window title
) => window:6
SKILL Language Programming 115
Cadence
ManipulatingAE use only: Do not distribute
Windows
1
3
Virtuoso...
5
X
1140
Naming Windows
The hiGetWindowName Function
Use the hiGetWindowName function to retrieve a window title.
hiGetWindowName( window( 5 )) => "Virtuoso ...
The hiSetWindowName Function
Use the hiSetWindowName function to set a window title.
hiSetWindowName( window( 5 ) "My Title" ) => t
Y
hiResizeWindow( window( 3 ) list( 300:50 1000:600 ))
870
X
1140
870
3
hiIconifyWindow( window( 3 ) )
X
1140
Managing windows
Category Functions
Basic window
hiGetWindowList
hiGetCurrentWindow
hiGetAbsWindowScreenBBox
Window manipulation hiGetWindowName,
hiSetWindowName
hiRaiseWindow
hiResizeWindow
hiGetWindowIconifyState,
hiIconifyWindow,
hiDeiconifyWindow
Opening design windows geOpen
Opening text windows view
Bindkeys hiGetAppType
hiGetBindKey
hiSetBindKey
Module 6
User actions can create, modify, and save database objects to disk.
SKILL® variables can contain data of any type. However, for each attribute, the Database
Access software constrains the value of the attribute to one of these SKILL data types:
A string
An integer
A floating-point number
A database object
A list, possibly of database objects
Properties
You can also use the geGetEditCellView function to retrieve the database object for
the design that is open in the window specified (default = current window).
These two functions are equivalent except when you are doing an edit-in-place. In that case
geGetEditCellview returns the cellview being edited rather than the cellview in the window
returned by geGetWindowCellView.
The underlying function for the ~> operator is the getSGq function. You sometimes see
getSGq, get, or getq in error messages if you apply it to the wrong data.
The error message summarizes the data types to which the ~> operator is applicable. A
database object is a kind of user type.
mux2 = 5
mux2~>objType
*Error* get/getq: first arg must be
either symbol, list, defstruct or user type - 5
The cellView object type includes the following attributes among others:
The inst Object Type has the following attributes among others:
master A database object The mater cell view of this instance. Can be nil if
master hasn’t been read into virtual memory.
instTerms List of database objects The list of instance terminals. Can be nil.
Every net connects to one terminal at most. nil means that the
corresponding net doesn’t connect to a terminal object.
mux2~>nets~>term =>
( db:27850008 nil nil db:27850348 db:27849804
nil nil db:27847992 nil )
Internal nets do not connect to any terminal. For example, the net4 net
does not connect to a terminal.
mux2~>nets~>name =>
("B" "net7" "net6" "Y" "A"
"vdd!" "gnd!" "SEL" "net4" )
Example
mySet = geGetSelSet( ) => (db:0x1… db:0x2… db:0x3… )
mySet~>objType => (“path” “inst” “stdVia” )
7/16/12 SKILL Language Programming 137
Figures
Anything the user can select with the mouse is a Figure.
Every Figure is either an instance or database object such as a shape or via. Every Figure has a
bBox attribute that describes its bounding box.
Each net can have one or more associated Figures. In a schematic, these are wire segments with
objType "line".
master A database object The mater cell view of this instance. Can be nil
if master hasn’t been read into virtual memory.
instTerms List of database objects The list of instance terminals. Can be nil.
Module 7
Callback SKILL® code that the system calls when the user does something in
the user interface
deFileOpen is a built-in SKILL function that lets the user open design files.
geSave is a built-in SKILL function that lets the user save changes to a design.
1. Define bindkey for menu. 2. Click bindkey. 3. Choose Item. 4. Enter Information.
7/16/12 SKILL Language Programming 146
?callback "println( \"One\" )" The action triggered by this menu item.
Notice that the hiDeleteBannerMenu function requires the index of the pull-
down menu. You can use the result of hiGetBannerMenus() to figure out
the index by counting down the list to the position of the menu. The first
menu in the list is index 0.
7/16/12 SKILL Language Programming 149
Layout
You can customize the toolbars by modifying a definition file. The default
toolbar definition file is located at:
<install_dir>/share/cdssetup/dfII/toolbars/byApplication/appName.toolbars
Here is an example from the Layout.toolbars file:
(( nil
name leFileToolbar
Text “File”
Items ( ( *** item1 definition ***)
( *** item2 definition ***)
)
) ...
7/16/12 SKILL Language Programming 150
You can create your own icons using an image editor like GIMP. You need to be able to save the icon file in the PNG format. Be sure
to set the pixel size to 24x24 so they will display correctly in the toolbar. You can also locate free icons on the internet.
The iconFile is looked up in the standard setup.loc locations prefixed by the path icons/24x24. The standard locations include
<install_dir>/share/cdssetup
./.cadence
~/.cadence
A complete explanation of each field can be found in the Virtuoso Design Environment User Guide. See “Customizing Toolbars” in the
“Customizing Your Design Environment” section.
Toolbar Customization File Definition
Main Toolbar
Mandatory fields: name, text, items
Optional Fields: Invisible, toolButtonStyle (textOnly, iconOnly, textBesideIcon, textUnderIcon)
Item Type: action
Mandatory Fields: type (action), name, text, callback, iconFile (.png format)
Optional Fields: subAction, disabled, checkable, checked
Item Type: comboBox
Mandatory Fields: type (comboBox), name, toolTip, items, callback, width
Optional Field: disabled
Item Type: typein
Mandatory Fields: type (typein), name, toolTip, callback, value, width
Optional Field: disabled
Item Type: separator
Mandatory Fields: type (separator), name
Item Type: inheritToolbarsFrom
Mandatory Fields: inheritToolbarsFrom (application)
Modifying a toolbar
Function Description
Module 8
1 1 1 1 2 3 4
The search order for the .cdsinit file is /tools/dfII/local, the current directory, and the home
directory. Once the environment finds a .cdsinit file, the search stops.
Application Pathname
Use the Cadence online documentation to study the functions on the next
few slides.
The isFile function returns t if the files exists and returns nil otherwise. Use the
isFile function to test for the existence of the file in the SKILL search path before
attempting to load the file.
Example
when( isFile( "SomeUtilities.il" )
loadi( "SomeUtilities.il" )
) ;when
foreach is an iteration (loop) function which goes through all elements in a list and extracts one at
a time to process in the loop. This will be covered in more detail in the Flow of Control module.
The rexMatchList Function creates a new list of those strings or symbols in the given list that
match a regular expression pattern.
Syntax:
rexMatchList(
t_pattern
l_targets
) => l_results | nil
For example, the following line returns the value of the USER variable.
user = getShellEnvVar("USER")=> “JohnG“
Use the parseString function to parse a single string into a substring based
on delimiter characters.
Example
parseString( “GPU1 JohnG status design.report" ) =>
( “GPU1" “JohnG" “status" "design.report" )
Removing pull-down menus from the CIW menu banner. Consider the
following example from the previous module.
hiDeleteBannerMenu( window( 1 ) 0 )
Module 9
load A SKILL procedure that opens a file and reads it one SKILL expression at a
time. The load function evaluates immediately.
Usually, you set up your .cdsinit file to load your SKILL source code during
the initialization of the Virtuoso® Design Environment.
The variables ll, ur, lly, and ury are global variables. The curly braces, { },
do not make them local variables.
Curly Braces
The following statements refer to the example above:
The ll and ur variables hold the lower-left and upper-right points of the bounding box
respectively.
The xCoord and yCoord functions return the x and y coordinate of a point.
The ury-lly expression computes the height. It is the last statement in the group and
consequently determines the return value of the group.
The return value is assigned to the bBoxHeight variable.
All of the variables, ll, ur, ury, lly, bBoxHeight and bBox are global variables.
The local variables ll, ur, lly, and ury are initialized to nil.
The return value is the ury-lly.
Notice that the error message refers to the procedure function. The
arguments to procedure are the function name, the argument list of the
function, and the expression composing the body of the function.
7/16/12 SKILL Language Programming 179
To execute your function, you must provide a value for the bBox parameter.
bBoxHeight = TrBBoxHeight( list( 50:150 200:300 ) )
=> 150
You can use the let function to declare the variables ll, ur, ury, and lly to be local variables.
In the example, the variable bBox occurs both as a global variable and as a formal parameter.
Here’s how the SKILL Evaluator keeps track. When you call the TrBBoxHeight function, the
SKILL Evaluator:
Saves the current value of bBox.
Evaluates list( 50:150 200:300 ) and temporarily assigns it to bBox.
Restores the saved value of bBox when the TrBBoxHeight function returns.
To call the TrOffsetBBox function, specify the required and the optional arguments
as follows:
TrOffsetBBox( someBBox )
dx and dy default to 0.
TrOffsetBBox( someBBox 0.5 )
dy defaults to 0.
TrOffsetBBox( someBBox 0.5 0.3 )
7/16/12 SKILL Language Programming 181
The procedure above takes as input the original bounding box and the desired change in the x and
y directions. The procedure returns a new bounding box that has been offset.
Unless you provide a default value for an optional parameter in the procedure declaration, the
default value will be nil. This can lead to an error if nil is not appropriate for the operations
executed using the parameter. This is the case for the procedure shown here.
You provide a default value for a parameter using a list (<parameter> <default value>).
Keyword parameters free you from the need for a specific order for your parameters. This can be
very valuable when you have a significant number of optional parameters. When you must
preserve the order for optional parameters you need to supply values for all parameters preceding
the one you actually want to set.
Keyword parameters are always syntactically optional. Care should be taken however that the
procedure will give correct results without a parameter specified. If you cannot do this check each
parameter for an acceptable value and emit an error message when execution of the function will
not yield a sensible answer.
As with all parameters, unless you provide a default value for a keyword parameter the default
value will be nil
The TrCreatePath function simply prints a message about the list contained
in points. To call the TrCreatePath function, specify any number of points.
TrCreatePath( 3:0 0:4 )
TrCreatePath( 3:0 0:4 0:0 )
7/16/12 SKILL Language Programming 183
The @rest parameter structure allows you to specify input parameters even when you do not know
how many input elements the user will want to operate on. This type of argument specification is
perfect for functions like dbCreatePath or dbCreatePolygon. It is also very convenient for
inputting the elements of an arbitrary length list.
As written, the TrCreatePath function doesn’t really create a path. You can make it create a path
in a cellview by passing the list points to the dbCreatePath function.
Test Functions
In CIW: Load or paste code in the CIW and In SKILL IDE: load and run the code. Debug
examine error messages source code, trace variables, set breakpoints, etc.
Bug? Yes
In CIW: Correct in CIW or in text editor and re-load In SKILL IDE: Correct in SKILL IDE or in Text
SKILL code Editor and reload SKILL code
No
Enhance? Yes
In CIW: Update in CIW or in text editor and re-load In SKILL IDE: Update in SKILL IDE or in Text
SKILL code Editor and reload SKILL code
No
Done
Optional: Create Context files of groups of
Document and archive procedures
procedures to allow for faster loading
Any error aborts the load function. The load function does not evaluate any
expression that follows the offending SKILL expression.
When you pass a relative pathname to the load function, the load function
resolves it in terms of a list of directories called the SKILL path.
You usually establish the SKILL path in your .cdsinit file by using the
setSkillPath or getSkillPath functions.
If you are using the vi editor, make sure line numbering is turned off. Otherwise, when you paste
your code into the CIW, the line numbers become SKILL expressions in the virtual memory
definition of your functions. To turn off line numbers, enter the following into your vi window:
:set nonumber
Make sure you select all the characters of the SKILL function definition. Be particularly careful to
include the final closing parentheses.
If you paste the definition of a single SKILL function into the CIW, then the function name is the
last word displayed in the CIW output pane.
Why is that?
Because the SKILL procedure function returns the function symbol.
The SKILL® Interactive Debugging Environment (IDE) is an extension of the basic SKILL
Debugger and provides an interactive interface to it.
Tool
Bars
Variable
Trace
Source Assistant
Code Window
Pane
Stack Trace
Assistant
Status
Window
Bar
The SKILL IDE interface is user-friendly and easy-to-learn, and it eliminates the need to learn
complex debugging commands. It consists of menus, toolbars, dialog boxes, and windows that
help you control your debugging operations.
•Run function
Set breakpoints, run the program and single
Execute
code
•Step/Continue step or continue to control code evaluation.
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
•Select variables
•Add to Trace
Trace window
Variables
•Set interactively
Set •Set conditionals
Breakpoints
•Run function
Execute •Step/Continue
code
•Edit source
Modify •Save changes
Code
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
Use Window – Assistants to open
•Select variables the Trace window to trace variables
•Add to Trace
Trace window
Variables
Use Window – Assistants to open
the Stack Trace window
•Set interactively
Set •Set conditionals
Breakpoints Open help file
windows as
needed.
•Run function
Execute •Step/Continue
code
•Edit source
Modify •Save changes
Code
Position the CIW so it is visible
as warning and errors will be
reported here.
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
•Select variables
•Add to Trace
Trace window
Variables
•Set interactively
Set •Set conditionals
Breakpoints
•Run function
Execute •Step/Continue
code
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
•Select variables
•Add to Trace
Trace window
Variables
•Set interactively
Set •Set conditionals
Breakpoints Select the variables to
trace. As you step
•Run function
through the code and
Execute •Step/Continue the values change you
code can observe them in the
trace window.
•Edit source
Modify •Save changes
Code
Initially the variable values are unbound, because we have not started to run the code.
•Check syntax
Load •Analyze errors
Program
•Select variables
•Add to Trace
Trace window
Variables
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
•Select variables
•Add to Trace
Trace window
Variables
The SKILL evaluator
stops at first
•Set interactively
•Set conditionals
breakpoint. Initial
Set
Breakpoints values of local
variables are set to nil.
• Run function
Execute • Step/Continue
code
•Edit source
Modify •Save changes
Code
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
•Select variables
Trace •View values
Variables
•Set interactively
Set •Set conditionals
Breakpoints
•Run function
Execute •Step/Continue
code
•Edit source
Modify •Save changes
Code
Initially the variable values are unbound, because we have not started to run the code.
•SKILL functions
Open •Pcell definitions
File
•Check syntax
Load •Analyze errors
Program
•Set interactively
Set •Set conditionals
Breakpoints
•Run function
Execute •Step/Continue
code
•Edit source
Modify •Save changes
Code
Module 11
Use parentheses to control the order of evaluation. This example assigns 3 to x, returning 3, and
next compares 3 with 5, returning t.
(x=3)<5 => t
The SKILL Evaluator generates an error if the data types are inappropriate. Error messages
mention the function in addition to the operator.
1 > "abc"
*** Error in routine greaterp:
Message: *Error* greaterp: can’t handle (1 > "abc")
The && and || operators only evaluate their second argument if they must to
determine the return result.
The && and || operators return the value last computed.
7/16/12 SKILL Language Programming 210
Binary branching if
when
unless
Multiway branching case
cond
Arbitrary exit prog return
In this expression:
If the shapeType is rect the return value is the value of rectCount.
If the shapeType is not rect the return value is the value of miscCount.
Alternatives expressions:
Use if( exp ... ) instead of if( exp != nil ... )
Use if( !exp ... ) instead of if( exp == nil ... )
if ( shapeType == "rect"
...
)
*** Error in routine if
Message: *Error* if: too few arguments ...
The SKILL Evaluator does most of its error checking during execution. Error messages involving
if expressions can be obscure.
Remember
To avoid whitespace immediately after the if syntax function.
To place parentheses as follows:
if( ... then ... else ... )
The when and unless functions both return the last value evaluated within their body or nil.
If you have expressions to evaluate when no target value matches the candidate value, then
include those expressions in an arm at the end. Use t for the target value for this last arm. If the
flow of control reaches an arm whose target value is the t value, then the SKILL Evaluator
unconditionally evaluates the expressions in the arm.
When target value of an arm is a list, the SKILL Evaluator searches the list for the candidate
value. If the candidate value is found, all the expressions in the arm are evaluated.
case( shapeType
( "rect"
++rectCount
println( "Shape is a rectangle" )
)
( ( "label" "line" )
++labelOrLineCount
println( "Shape is a line or a label" )
)
( t
++miscCount
println( "Shape is miscellaneous" )
)
) ; case
This example TrClassify function includes the cond function and the numberp function.
procedure( TrClassify( signal )
cond(
( !signal nil )
( !numberp( signal ) nil )
( signal >= 0 && signal < 3 "weak" )
( signal >= 3 && signal < 10 "moderate" )
( signal >= 10 "extreme" )
( t "unexpected" )
) ; cond
) ; procedure
These functions repeat a statement block for a specific number of times, or through each element
of a list, or until a certain condition is satisfied.
The only way to exit a for loop early is to call the return function. To use the return function, you
must enclose the for loop within a prog expression. This example finds the first odd integer less
than or equal to 10.
prog( ( )
for( i 0 10
when( oddp( i )
return( i )
) ; when
) ; for
) ; prog
In the example,
The variable shapeType is the index variable. Before entering the foreach loop, the SKILL
Evaluator saves the current value of shapeType. The SKILL Evaluator restores the saved
value after completing the foreach loop.
The variable shapeTypeList contains the list of values. The SKILL Evaluator successively
assigns the values in shapeTypeList to shapeType, evaluating the body of the foreach loop
once for each separate value.
The body of the foreach loop is a case statement.
The return value of the foreach loop is the list contained in the shapeTypeList variable.
Use the return function to force the prog function to immediately return a value. The
prog function does not execute any more SKILL statements.
If you do not call the return function within the prog body, prog returns nil.
For example, the TrClassify function returns either nil, "weak", "moderate",
"extreme", or "unexpected", depending on the signal argument. This prog example
does not use any local variables.
Use the prog function and the return function to exit early from a for loop. This example finds the
first odd integer less than or equal to 10.
prog( ( )
for( i 0 10
when( oddp( i )
return( i )
) ; when
) ; for
) ; prog
A prog function can also establish temporary values for local variables. All local variables receive
temporary values initialized to nil.
The current value of a variable is accessible at any time from anywhere.
The SKILL Evaluator transparently manages a value slot of a variable as if it were a stack.
The current value of a variable is simply the top of the stack.
Assigning a value to a variable changes only the top of the stack.
Whenever your program invokes the prog function, the SKILL Evaluator pushes a temporary
value onto the value stack of each variable in the local variable list.
When the flow of control exits, the system pops the temporary value off the value stack, restoring
the previous value.
Module 12
After you execute the close function, /tmp/myFile contains the following lines:
("Number:" 1)
("Number:" 2)
("Number:" 3)
("Number:" 4)
("Number:" 5)
Use a full pathname with the outfile function. Keep in mind that outfile returns nil if you do not
have write access to the file, or if you cannot create the file in the directory you specified in the
pathname.
The print and println functions raise an error if the port argument is nil. Observe that the type
template uses a p character to indicate a port is expected.
println( "Hello" nil )
*** Error in routine println:
Message: *Error* println: argument #2 should be an I/O port
(type template = "gp")
Unlike the print and println functions, the printf function does not accept an
optional port argument.
Use the fprintf function to write formatted data to a file. The first argument
must be an output port associated with the file.
Example
myPort = outfile( "/tmp/myFile" )
for( i 1 5
fprintf( myPort "\nNumber: %d" i )
) ; for
close( myPort )
The format directives commonly found include the ones in this table.
The view function is very useful for displaying a report file to the user.
The view function resolves a relative pathname in terms of the SKILL® path.
This is a list of directories you can establish in your .cdsinit.
See Module 8, “Customization”, for specifics on the SKILL path.
To select text from your CDS.log file, try the following:
view(
"~/CDS.log" ;;; pathname to CDS.log
nil ;;; default location
"Log File" ;;; window title
t ;;; auto update
) => window:6
Key Value
“met1width” 1.1
“met2width” 2.5
“met3width” 3.6
Use the readTable function to read a text file into a SKILL table.
readTable(“width_table.txt” WidthTable)
The table must exist in SKILL before callingreadTable (see makeTable)
The format of the text file is one key / value per line.
You can create the text file table entries using a text editor and then
read them into SKILL.
If you are not sure of the text file format, create and example of the table in
SKILL and use write table write the table to a file.
Check output text file for the correct syntax to use.
Module 13
Use the foreach mapcar function to make a list that corresponds one to
one with a given list
Use the foreach mapcar function and setof function together to make a
list that corresponds one to one with a filtered list
The foreach mapcar function and the foreach function behave similarly with one exception.
Although they compute the same values during each loop iteration, they return different lists.
The foreach mapcar function returns the list of values that each loop iteration computes.
The foreach function returns the base list.
Questions Answers
What happens to the Each loop result is Each loop result is collected into
return result of the last ignored. a new list.
expression in the loop
body?
What is the return result? The original base list is The new list is the return result.
the return list.
As an alternative to using the foreach mapcar function, you can use the
normal foreach function.
However, you are responsible for collecting the return results. Use the
cons function.
In addition, the list will be in reverse order. Use the reverse function to
make a copy of the list in the correct order.
winNames = nil
foreach( wid hiGetWindowList()
winNames = cons( hiGetWindowName( wid ) winNames )
) ; foreach
During compilation, each foreach mapcar expression is translated into a mapcar function call. You can use the trace
facility to reveal the details in these examples:
Filtered list
The oddp function returns t/nil if its argument is odd/even.
setof( x ’( 1 2 3 4 5 ) oddp( x ) ) => ( 1 3 5 )
7/16/12 SKILL Language Programming 245
The following nongraphic session uses the trace facility to illustrate how the setof function works.
> tracef( t )
t
> setof( x ’( 1 2 3 4 5 ) oddp( x ) )
|oddp(1)
|oddp --> t
|oddp(2)
|oddp --> nil
|oddp(3)
|oddp --> t
|oddp(4)
|oddp --> nil
|oddp(5)
|oddp --> t
(1 3 5)
> untrace()
t
TrListOfSquares( ’( 1 2 3 4 5 6 )) => ( 1 9 25 )
Module 14
pp( TrExample )
procedure(TrExample(x y)
(x + y)
)
nil
The pp Function
The pp function only works on the SKILL functions that you define.
You cannot use pp to inspect the following kinds of SKILL functions:
Built-in SKILL functions defined in C
Encrypted SKILL functions
SKILL functions defined in a context
The pp function accepts an optional port argument. The following code declares the TrExample
function and writes its definition to the /tmp/myfun.txt file.
procedure( TrExample( x y )
x+y
) ; procedure
let( ( FILE )
FILE = outfile( "/tmp/myfun.txt" )
pp( TrExample FILE )
close( FILE )
) ; let
In the example,
The input required for TrCountRectangles is the databaseid of a cell view.
The input passed to the function is a windowid.
You can either have SKILL Evaluator perform the argument type
checking or write your own code to check.
Include assertions in your code that check for a condition that holds if
things are in working order.
Write a function to check that a condition holds and raise an error if the
condition does not hold.
Use the same character to encode a data type that the Cadence®
Finder uses. Here are some examples:
Character Data type Comment
w window ID
d database object
g general indicates more than one data type works
l list
x integer
7/16/12 SKILL Language Programming 263
The "dt" is called a type template. It encodes the expected argument types.
procedure( TrCellNameMatch( cv phrase "dt" )
let( ((name cv~>cellName))
when( rexMatchp( phrase name ) cv )
) ; let
) ; procedure
If you do not declare the TrCellNameMatch function with a type template, then the error message
is more obscure since it comes from the rexMatchp function.
\i TrCellNameMatch( window(6) "nand2" )
\o *** Error in routine rexMatchp:
\o Message: *Error* rexMatchp:
argument #2 should be either
a string or a symbol (type template = "tS")
When you use type templates, you cannot control the wording of the error message.
Also, type templates only specify the SKILL type of arguments. You cannot use a type template to
check that an argument is a database object with a specific objType attribute
Use the %L format string to specify the default print representation of the argument.
Usage
Debug off: TrShapeReport( window(3) )
Debug on: TrShapeReport( window(3) t )
Rather than removing print statements you use for debugging, you can leave them
in and turn them on as needed with the optional parameter.
7/16/12 SKILL Language Programming 266
Document your source code. Often, as you annotate your code, you
uncover problems.
Use println or printf statements to clarify the flow of control or display
the values of local variables.
Define an optional debug parameter.
Utility Task
SKILL Debugger Trap errors.
Suspend execution.
Monitor execution.
SKILL Lint Identify potential errors, oversights, and inefficient constructs.
SKILL Profiler Measure performance and memory usage.
SKILL Surveyor Survey SKILL code to determine what changes are needed to
migrate to a new version of Cadence software.
Single-step tracing can be very effective, but it has the following drawbacks:
Single-step tracing produces a lot of output. If the SKILL error does not occur early in the
run, you can easily get confused or lost looking at the output.
The output shows each function call with evaluated arguments. It can be hard to correlate the
output with your source code.
In this example, the trace output indicates that the code expects a cellview database object but is
dealing with a window ID.
You can use the SKILL IDE to help debug this code.
This information can help you determine the cause of the error. To examine this
information before SKILL discards it, you must trap the error:
1. Start the SKILL IDE
2. Open and Load your program
3. Run your application to reproduce the error.
The SKILL IDE debugger traps the error and highlights the source-code line.
When you open a file in the SKILL IDE, it automatically opens the file in the SKILL editor. You
can open multiple files and they are viewed in tabs.
SKILL IDE is an interactive source-level symbolic debugger that helps you develop, test, and
refine SKILL procedures. It is a multifile editor that provides common editing and debugging
capabilities, including:
• Auto indenting of source code
• Color syntax highlighting of source code
• Single stepping execution through SKILL programs
• Setting breakpoints to suspend execution graphically
• Tracing and editing the values of variables during execution
• Displaying variable scope
• Displaying a stack trace of the hierarchy of functions
Tool
Bars
Variable
Trace
Source Assistant
Code Window
Pane
Stack Trace
Assistant
Status
Window
Bar
The SKILL IDE interface is user-friendly and easy-to-learn, and it eliminates the need to learn
complex debugging commands. It consists of menus, toolbars, dialog boxes, and windows that
help you control your debugging operations.
After examining local variables and verifying expressions, you resume the execution
of your program.
7/16/12 SKILL Language Programming 280
A function boundary consists of four points. Each point is an event that occurs during a function
call. The order of events is call, entry, exit, and return. In the following table, the caller refers to
the code that contains the function call and the callee refers to the function itself:
You can set a breakpoint at all four points for any function you define while the SKILL Debugger
is installed.
For other SKILL functions, you can set a breakpoint at only the call point or the return point.
Point Description
Example
Click in the left column to set the breakpoint on the TriShapeReport
function. A red-hand icon appears. To clear it click on it again.
You can read further about SKILL Lint in the SKILL User Guide.
Displays a tree graph of all functions that your program executed, and
the time that those functions spent, or the memory that those functions
allocated.
You can measure performance without having to modify function
definitions.
You can read further about the SKILL Profiler in the SKILL User Guide.
No
No
No
Make any required Works
changes to SKILL file Fix SKILL File
properly in
6.1.X?
No
Yes No
SKILL Lint
IC5.X:
successful? Passes
Run SKILL Lint
Yes SKILL Lint?
SKILL Survey
Yes
SKILL code migration is not a single step. It is a cycle that involves the running SKILL Lint,
conducting a survey, and verifying, validating, checking and rechecking the code. The phases of
the cycle are as follows:
1. Organize and categorize your SKILL files in the existing environment.
2. Validate the SKILL code in the existing environment by devising tests for the code. Fix
any problems prior to testing the code in the new environment.
3. Run SKILL Lint on the files prior to translation. Fix any globals, unused variables or
functions, or other mistakes. Run Lint iteratively until the file has no problems.
4. Perform a SKILL survey on the files using SKILL Surveyor. Study all results for possible
conversion issues.
5. Fix any issues found in the survey by modifying the SKILL file.
6. Test the function in the new environment. Test all branches and functions in the file.
7. If any fixes are required, make the changes.
8. After the file is working, run SKILL Lint for the new version on the file to make sure that
there are no globals or unused variables. Use Lint iteratively until the file is clean.
9. Document all changes and modifications. Make a backup of the new working file.
First, select the SKILL Development toolbox from the CIW Tools menu. Then select SKILL
Surveyor from the SKILL Development form.
Previously you would go to the SourceLink website to download the SKILL Surveyor utility
(SKILL Tabulator). Now you can access it directly from the SKILL Development toolbox.
*File or Directory Name(s): The SKILL files to be tabulated or directory names where the SKILL files to be tabulated are
located. By default this field shows the current directory where the application is launched. Note that this field is required in
order to successfully run the SKILL Tabulator.
*File Extensions: The extensions of the files to tabulate (default: il ile cdsinit). If you use extensions other than the usual il,
ile, or cdsinit, you need to modify this field. The SKILL Tabulator follows symbolic links and the extensions are checked
against the file linked to, rather than the link itself. This field is required to successfully run the SKILL Tabulator.
Recurse Directories: Whether the SKILL Tabulator should recursively search all the files hierarchically under the directory
paths given in the File or Directory Name(s) fields. This option is on by default.
Exclude Files or Directories: Specifies files or directories to be excluded from tabulation in the current directory level of
the directories specified in the File or Directory Name(s) field.
Recursively Excluded Files: Specifies files to be recursively excluded from tabulation in the current directory level as well
as all the sub-directories of the directories specified in the Directory Name(s) field.
*Report File: The output file (default: ./skillTab.out) that contains a list of Cadence and user-defined functions called and
defined and how many times they were called. This field is required in order to successfully run the SKILL Tabulator.
Create Info File: Specifies whether to create the info file that contains a list of files where Cadence and user-defined
functions were called. This option is on by default.
Info File: The information file (default: ./skillTab.info) that contains a list of files where Cadence and user-defined functions
were called. This field is grayed-out by default.
Create Defn File: Whether to create the definition file that contains a list of files where Cadence and user-defined functions
were defined. This option is on by default.
Defn File: The definition file (default: ./skillTab.defn) that contains a list of files where Cadence and user-defined functions
were defined. This field is grayed-out by default.
Show Report: Specifies whether to display the report file in a viewfile window when tabulation is done. By default, this
option is switched on (the report file will be displayed).
Show User Defined: Whether to list the functions that are filtered by the local definition criterion in the output file. This
option is selected by default.
You can e-mail the skillTab.out file to Cadence Support for analysis. Cadence
Support will e-mail the analysis results back to you.
The analysis results include changes you need to make to your code to assure compatibility with
the current version of the SKILL language.
The analysis results provide
All undefined functions (misspelled or dependencies): for example, you called it, but neither
you nor we defined it.
All re-defined Cadence functions: for example, you defined it and we also defined it in our
code.
All changed functions (most are positive improvements): for example, you called it, yet we
changed it between releases.
All deleted functions (with replacements if available): for example, you called it, yet we
deleted it between releases.
All functions which are safely supported, for example: you called it, and we documented and
support it.
All functions which might be dangerous to use: for example: you called it, yet we don't
document or support it.
Advice on how to recover from any changes identified, for example: Cadence R&D-supplied
advice for your functions.
Exclusion of user-defined functions by turning off the checkbox for Show User Defined in
the tabulator form.
All of the resources mentioned, except the SKILL Finder, can be found in the Cadence online
documentation. This can be started by setting your shell environment path to point to the Cadence
tools (as you would when starting the Cadence IC tools) and typing cdnshelp. You can also select
Help from any window in IC5.0.2 to open the documentation.
The SKILL Finder can be started three ways:
Typing startFinder( ) in the CIW input pane
Typing cdsFinder& in a shell window
Using the menu item in the CIW: Tools–SKILL Development–Finder.
You also have CIW command-line access to the SKILL Finder help files, as shown in the
following example:
> help help
help( [ S_name ] ) => t / nil
Retrieves and prints the cdsFinder documentation strings for the given
function name (a symbol). If the given name is a string, it is interpreted
as a regular expression, and the entire cdsFinder database is searched for
functions whose name or documentation string contains or matches the given
string. Help is an nlambda function.
t
>help "leLayer"
leLayerAnd, leLayerAndNot, leLayerOr, leLayerSize, leLayerXor
SKILL Surveyor
Module 15
Well-documented C++ based public API for easy integration of third-party tools.
Single database eliminates translation steps
Single data model eliminates loss of data
Correct representation is between each application and the database, not a function of
downstream tools
Name mapping in the API means each tool uses its own naming rules
All existing design data is available to any tool that decides to use it
Nonproprietary and uses OpenSource model for distribution and enhancement
Increased capacity for physical layout data
For documentation, OpenAccess uses a GNU Public License application product called Doxygen.
This provides the capability of producing documentation for all functions by extracting the
information from the comments in the source code.
OA and SKILL
Database access consists of procedural access layers on top of the OpenAccess database. SKILL
routines provide nearly complete access to all the data stored in the OA design database. You can
create, modify, save, retrieve, and maintain data in the OA database. SKILL functions are
available at the programming level and allow tight and complete control over database operations.
When the data model is revised, then the new releases of the Cadence tools are updated to support
the new data model.
Attribute Description
The inst and mosaicInst object types both have a master attribute.
All shape object types and the inst object type have a bBox attribute.
Class Scope
Shape cellView
shapes
objType objType
This table summarizes the example road map. The road map focuses on attributes that represent
relationships between object types.
Shape objType
Shape cellView one cellView object
cellView objType
cellView libName
cellView cellName
cellView viewName
cellView shapes zero or more Shape database objects
The ~/SKILL/CaseStudy/RoadMap.il defines a function that builds the complete road map as a
layout cellview. See Lab -10, Building the Cellview Data Model Road Map, for further details.
dbOpenCellviewByType Examples
If cell "cellA" with view "layout" exists in library "test," open the cellview for read.
cellview = dbOpenCellViewByType("test" "cellA" "layout")
Open cell "cellA" with view "layout" in library "test" for "append" mode. Create the cellview if it
does not exist.
cellview = dbOpenCellViewByType("test" "cellA" "layout" "maskLayout" "a")
Open cell "cellA" with view "layout" in library "test" for "append" mode only if the cellview
already exists.
cellview = dbOpenCellViewByType("test" "cellA" "layout" "" "a")
shapes
cellView
layerName shapes
layerNum Shape LP
lpp
layerName
layerNum
purpose
nPoints nPoints
points points
Every cellView database object has a shapes attribute. The value of shapes is a list of all shapes in
the design. If you need to process all the shapes in a design by layer purpose pair, retrieve the
layerPurposePairs attribute, whose value is a list of LP database objects.
Arguments Interpretation
Avoid accessing purged objects. The ~> operator cannot retrieve attributes
from a purged database object that has been removed from virtual memory.
In that case, the ~> operator issues a warning and returns nil.
cv~>cellName
dbGetq: Object is a purged/freed object. - db:37711916
nil
After closing a cellview, set all variables containing the database object to
nil.
To read more about the dbClose function, see the Cadence online documentation.
subpaths
Master path
The code for the example shown here might look something like this:
routeWidth = routeSpacing = 1.0
rodCreatePath(
?layer “metal1”
?pts list(20:-20 40:-20 40:-30 80:-30) Master path
?width routeWidth
?justification "center "
?cvId geGetEditCellView()
?offsetSubPath
list(
list(
?layer “metal1”
?justification "left"
?sep routeSpacing First adjacent path
) ;end subpath1
list(
?layer “metal1” Next adjacent path
?justification "left”
?sep (routeSpacing * 2.0) + routeWidth
) ;end subpath2
...
) ; offsetSubPath
) ; rodCreatePath
SKILL Language Programming 317
Cadence AE use
Creating Objects only:Objects
from Other Do not distribute
Using the rodCreateRect, rodCreatePolygon, or rodCreatePath function, you can
create a new rectangle, polygon, or path from one or more existing ROD objects.
The existing objects are referred to as source objects, and the new object is
referred to as the generated object
You use the ?fromObj keyword argument to specify the source objects
You can specify a difference in the size between the generated object and the
source objects
You use the ?size keyword argument to specify the scaling factor for the new
object.
source object: diffusion region generated object: well
The code for the example shown here might look something like this:
cv = geGetEditCellView() ;; Get the current cellview ID
?cvId cv
?layer "pdiff"
?cvId cv
?layer "nwell"
System Handle
Examples
lowerLeft lowerRight
7/16/12 SKILL Language Programming 319
Examples
Assume a layout editor window is open and these commands have been executed:
smallRect = rodCreateRect(?cvId geGetEditCellView()
?layer “metal1” ?width 3 ?length 2)
bigRect = rodCreateRect(?cvId geGetEditCellView()
?layer “metal1” ?width 8 ?length 10)
1. Align the lower-left corner of bigRect to a fixed point:
rodAlign(
?alignObj bigRect
?alignHandle "lowerLeft"
?refPoint 2.5:4
)
2. Align the upper-left corner of smallRect to the upper-right corner of bigRect:
rodAlign(
?alignObj smallRect
?alignHandle "upperLeft"
?refObj bigRect
?refHandle "upperRight“ )
Note: The system maintains the handles such as lowerLeft, upperLeft and upperRight on all
ROD objects, so no calculations are required by your SKILL code to locate these.
instanceMasters
instRefs
instances master
cellView inst cellView
cellView name
libName libName libName
cellName cellName cellName
viewName viewName viewName
Example
dbCreateInst(inCellView masterCV "inst1" list(0 0) "R0" 1)
Example
dbCreateParamInstByMasterName(inCellView
"basic" "nand" "symbol" "inst1" list(0 0) "R0" 1
list(list("w" "float" 2.0) list("l" "float" 5.0)))
Each parameter specified need the parameter name, parameter type and parameter value.
A B C
C C D A C D
A A
D
A
( t nil )
) ; case
) ; if
) ; procedure
7/16/12 SKILL Language Programming 335
net
cellView
term
nets
net
instances name
instTerms
net
instTerms
Instance instTerm
inst
name name
cellView net
name
instances instTerms
net
instTerms
Instance instTerm
name inst name
master term
terminals
cellView term
term
pins
net
name
For a schematic cellView, Figures associated with term objects are Instances
whose purpose attribute is "pin".
For a maskLayout cellView, Figures associated with term objects are Shapes or
Instances.
This example determines what type of figure is associated with the terminal pins.
cv~>terminals~>pins~>fig~>objType
Every Instance database object has a purpose attribute. This attribute helps you determine the role
of the instance in the design.
Custom vias are often fixed devices. The layers and rules for the via cannot
be known by the application placing the vias so making optimum via
placements is usually not possible. For each unique via variant, a unique
customViaDef must exist so the overhead of maintaining a set of custom
vias is higher than with standard vias.
Vias are defined in their respective technology files. After the technology
file is loaded or attached, it becomes part of the database.
Example
Print out all vias and their locations and parameters:
cv = geGetEditCellView()
foreach( via cv~>vias
printf( “Via: %s, Origin: %L\n” via~>name via~>origin )
foreach( paramlist via~>viaHeader~>overrideParams
printf( “Params: %L\n” paramlist)
)))
7/16/12 SKILL Language Programming 345
You cannot use dbCreateInst to create a via in IC6.1.X. The command dbCreateInst will place an
instance.
For custom vias, l_paramList is a list of
l_param and l_param is list(t_propName t_propType g_value)
For standard vias, l_paramList is a list of lists, each of which is a name value pair.
The parameters are
t_cutLayerName n_cutWidth n_cutHeight x_cutRows x_cutColumns l_cutSpacing etc.
For more details, see the Cadence Help document Virtuoso Design Environment SKILL Functions
Reference.
object
name
prop value
valueType
Attribute Meaning
objType The specific object type: “net”, “line”, and so forth
cellView The cellView database object containing the database object
prop Zero, one, or more prop database objects
7/16/12 SKILL Language Programming 348
The value of the objType attribute is a text string that indicates the type of the database object.
The value of the prop attribute is a list, possibly nil, of prop database objects. Each such object
represents a user-defined property on the database object.
Every database object, except prop objects themselves, can have zero or
more user-defined properties.
CDBA stores all the properties on an object as the value of the prop
attribute.
Example
Assume that window 5 is displaying master mux2 schematic.
cv = geGetWindowCellView( window(5)) => db:18253868
cv~>prop => (db:22856044 ... )
cv~>prop~>objType => ( "prop" ... )
7/16/12 SKILL Language Programming 349
The CDBA manages the prop attribute but does not manage any specific user-defined properties.
Applications are responsible for managing their own user-defined properties.
Use the user-defined property name on the right side of the ~> operator to
retrieve a specific property value. The user-defined property name must
satisfy the syntax for a SKILL symbol. Include the name in quotes if the
name includes illegal characters.
cv~>"net#" => 22
Given the property name, use the dbFindProp name to retrieve the prop
database object.
dbFindProp( cv "net#" )~>valueType => "int”
7/16/12 SKILL Language Programming 350
Use a foreach mapcar expression to retrieve a list of property name and property value pairs.
foreach( mapcar prop cv~>prop
list( prop~>name prop~>value )
); foreach
=>
(("net#" 22)
("schGeometryLastRecorded" "Oct 2 08:43:49 1995")
("lastSchematicExtraction" "Oct 2 08:43:49 1995")
("schXtrVersion" "sch.10.0")
("instance#" 10)
("instancesLastChanged" "Oct 2 08:43:48 1995")
("schGeometryVersion" "sch.ds.gm.1.4")
)
For the list of allowed property valueTypes, see the Cadence online documentation. In the Design
Framework II SKILL Functions Reference Manual, Chapter 2, refer to the section “Description of
Database Objects.”
To read more about the following functions, see the Cadence online documentation.
dbCreateEnumProp
dbReplaceEnumProp
dbCreateRangeProp
dbReplaceRangeProp
The ~>?? expression builds a list that starts with the database object in question, followed by
alternating name value pairs.
This list is an example of a disembodied property list. Such lists usually start with nil, but the list
you build with the ~>?? expression starts with the database object in question.
Here is the code to start the Show File Browser with a bindkey.
hiSetBindKey(
"Schematics" "Ctrl<Btn2Down>"
"{ mouseSingleSelectPt() TrBrowseObject() }" )
hiSetBindKey(
"Layout" "Ctrl<Btn2Down>"
"{ mouseSingleSelectPt() TrBrowseObject() }" )
procedure( TrBrowseObject( )
TrShowFileBrowser(
car( geGetSelSet( )) || geGetWindowCellView()
)
) ; procedure
Both geGetSelSet and geGetWindowCellView functions default to the current window. We assume
that the TrBrowseObject function is called with the bindkey mechanism, so that the design
window is the current window.
To browse any database object showing in a Browser window, such as "net12345678", do the
following:
Double-click over "net12345678" with the mouse.
Select the Browse Selection menu item.
Module 16
Fixed menus
Dialog boxes
List boxes
Forms
Toolbars
You can create menus dynamically at the time you invoke the hiDisplayMenu function. Such
menus can be context-sensitive. The callback for each menu item can refer to
Literal data
Global variables
hiDisplayMenu( hiCreateSimpleMenu( ... ))
procedure( TrGetSortedWindowList()
sort( hiGetWindowList() ’TrCompareWindowTitles )
) ; procedure
Clicking a menu item in a fixed menu does not set the current window.
You can use the hiFixedMenuDown function to remove a fixed menu from
the screen.
hiFixedMenuDown( TrExampleVerticalFixedMenu )
By default, the menu appears on the left side of the application window.
The Done menu item does not appear. Clicking a menu item sets the current
window.
Note: You cannot attach fixed menus to graphics windows. Use toolbars instead.
Cadence® applications attach fixed menus that usually consist of icon items.
On the User Preferences form, the Show Fixed Menu Names field controls whether the itemText
for an item is dynamically displayed. You can also use the SKILL® command.
hiGetCIWindow()->showFixedMenuLabels => t
Status Report
Yes No Help
Clicking Yes.
Displays Status Report completed in the CIW
Dialog boxes are pop-up windows that display a message for the user.
Use dialog boxes to
Ask for confirmation from the user.
Display status messages bundled with an associated follow-up callback that the user can
select.
There are three kinds of dialog boxes.
Each dialog box has two or three buttons to let the user confirm an action or status and dismiss or
close the dialog box.
The following program displays modeless dialog boxes to verify the circumstances under which
the system triggers the callback. The source code is in the ~/SKILL/DialogBoxes/ButtonLayout.il
file.
TrButtonLayouts =
’( OKCancel YesNo YesNoCancel CloseHelp Close )
procedure( TrDialogBoxes( )
foreach( buttonLayout TrButtonLayouts
hiDisplayAppDBox(
?name gensym( ’TrDialogBox )
?dboxBanner "Test"
?dboxText get_pname( buttonLayout )
?buttonLayout buttonLayout
?dialogType hicInformationDialog
?dialogStyle ’modeless
?callback
sprintf( nil "TrDialogBoxCB( ’%L )" buttonLayout )
)
) ; foreach
) ; procedure
SEL
A
Y
You can provide the list of choices explicitly or using a data query such as cv~>nets~>name.
The hiShowListBox function creates and displays a list box containing a group of text strings.
Design Framework II triggers the callback function when the user clicks
OK, Cancel, or Apply.
Design Framework II supplies two arguments.
User Callback arguments hiShowListBox List box screen
action return value behavior
OK t t Disappears
the list box data structure
Apply t Remains on screen
the list box data structure
Cancel nil nil Disappears
nil
Expression Meaning
While the box is displayed, other SKILL functions can similarly manipulate the list box data
structure through a global variable.
Button Function
OK Completes the command and removes the form from the screen.
Cancel Cancels any changes or selections made to the form and removes
the form from the screen.
Defaults Sets all values in the form to their default values.
Apply Completes the command and leaves the form on the screen.
Help Displays a document containing additional information.
hiDisplayForm( ... )
hiCreateAppForm( ... ) or
hiCreateStringField( ... ) hiOpenWindow( ... )
Create forms from the bottom up
The form callback checks whether the file exists. If the file exists, the
form callback displays it in a Show File window.
?callback The function calls to execute when the user clicks into another
field.
?format See User Interface SKILL Functions Reference Manual.
User actions trigger the execution of the field validation routines. They execute after the field and
form creation routines have returned.
Do not rely on passing local variables to either of the following:
Your form field checking routines
Your form callback routine
However, you can use global variables to communicate with the field checking routines as
well as with the form callback routine.
Make the ?name argument be a global variable. This variable plays these
two roles:
The form data structure contains a reference to the ?name parameter.
?name A global variable; SKILL stores the form’s data structure in this variable.
?fromTitle The form name, which appears in the form’s window banner.
?ummapAfterCB If t, SKILL removes the form after the callback returns. Otherwise, the form is
removed when the user clicks OK. See User Interface SKILL Functions Reference
Manual.
To facilitate a user-friendly interface, make your callback validate the fields before continuing the
command.
If there are any fields with errors, then
Highlight the fields with errors.
Prevent the removal of the form from the screen.
Do not continue the command.
If all fields contain valid data, then
Remove any field highlighting.
Continue the command.
The ?unmapAfterCB Argument
If you create the form with ?unmapAfterCB set to t, the form stays on the screen until the form
callback returns.
The hiSetCallbackStatus Function
When you set the callback status to nil, the form stays on the screen. To permit the form to be
removed later, set the callback status to t.
Use the hiDisplayForm function to display a form you create with the
hiCreateAppForm function.
By default, the hiDisplayForm function does not return until the user clicks
OK or clicks Cancel.
TIME
User Clicks OK
Example
hiSetCursor( hiGetCurrentWindow() hicHourglass)
This table explains the role and the scope of each variable in the overhead example.
f1, f2, f3 Each value is a field data structure. Make these variables local.
field1, field2, field3 Each is the symbolic name of a The scope is irrelevant,
field. Each value is irrelevant. because the variable name,
instead of the value, is used
fields The value is a list of the field data Make this variable local.
structures.
form The value is a form data structure. Make this variable local.
ExampleForm The symbolic name of the form. Make this variable local.
The value is a form data structure.
Use the Cadence Finder to list all the functions whose name starts with hiCreate and end with
Field.
Aesthetically you can use the following to organize the form:
hiCreateFrameField
hiCreateSeparatorField
hiCreateScrollRegion
hiCreateLabel.
Schematic
Layout
You can customize the toolbars by modifying a definition file. The default
toolbar definition file is located at
<installdir>/share/cdssetup/dfII/toolbars/byApplication/appName.toolbars
You can create your own icons using an image editor like GIMP. You need to be able to save the
icon file in the PNG format. Be sure to set the pixel size to 24x24 so they will display correctly in
the toolbar. You can also locate free icons on the internet.
Note
The iconFile is looked up in the standard setup.loc locations prefixed by the path icons/24x24. The
standard locations include
<installdir>/share/cdssetup
./.cadence
~/.cadence
A complete explanation of each field can be found in the Virtuoso Design Environment User
Guide. See “Customizing Toolbars” in the “Customizing Your Design Environment” section.
hiCreateToolbar(
?name s_name
[?title t_title]
[?toolButtonStyle s_buttonStyle]
[?toolTip t_toolTip]
[?items l_toolbarItems]
[?invisible g_invisible]
)
s_buttonStyle
One of the following symbols specifying the style of the toolbar buttons: 'textOnly, 'iconOnly,
'textBesideIcon, or 'textUnderIcon.
Default value: 'iconOnly
t_toolTip
The tooltip that will be displayed whenever the cursor hovers over the toolbar.
g_invisible
t or nil. Specify t if you want the toolbar to be invisible initially; specify nil if you want it to
be displayed. The default value is nil.
You can modify the value of this argument after the toolbar is created with the invisible
property, as in this example:
windowId->hiToolbars->toolbarName->invisible = nil
?icon
The icon that is displayed for the action. After the toolbar is created, you can change the icon
with the hiIcon property.
For example: windowID->hiToolbars->toolbarName->actionName->hiIcon = “EditIcon.gif”
Specifying Icons for hi Functions
All hi functions that take icons as arguments (such as hiCreateButton, hiCreateLabel,
hiCreateTreeItem, and hiCreateMenuItem) accept icons in any of the following formats:
t_fileName
list(t_fileName x_width x_height)
list(x_iconHandle x_width x_height)
where x_iconHandle is the handle of the icon, x_width is the desired width of the icon, and
x_height is the desired height of the icon. This list, which was the only format accepted in releases
prior to IC 6.1.2, can be obtained through the hiStringToIcon, hiLoadIconData, hiLoadIconFile,
geCellViewToDlist, and dlDlistToIcon functions.
t_fileName: If t_fileName in any of the above options is an absolute path (starting with /), the file
is loaded directly. If t_fileName is a relative path, the Cadence Search File mechanism (CSF) is
used to search for the icon file. For each location in your setup.loc file, the following
subdirectories are searched. The names of these subdirectories represent the resolution of the
image files in them: icons/16x16, icons/24x24, icons/32x32, icons/48x48. The first file found for
each resolution is loaded into the icon. When the icon is used, the appropriate resolution is used.
Fixed menus
Dialog boxes
List boxes
Forms
Toolbars
Category Functions
Module 17
This module focuses on one of several approaches to customizing certain Virtuoso® Design
Environment applications, such as the Virtuoso Schematic Editor and the Virtuoso Layout Editor
applications.
The Design Editor calls these registered SKILL functions to configure the
design window when the user does any of the following tasks:
Opens a cellview
Descends the design hierarchy into a cellview
Ascends the design hierarchy into a cellview
The view type of the cellview determines which trigger functions the Design Editor invokes.
Cadence® supplies the basic set of Design Editor trigger functions for each supported view type.
You can define several user trigger functions for each supported view type.
You can register multiple-user trigger functions for a view type. If there is a
user trigger function already present, the new one will be added to the list.
You must use the -> operator to access the fields. Do not use the ~>
operator.
7/16/12 SKILL Language Programming 404
The first argument is the view type associated with the application.
Virtuoso Schematic Editor = "schematic“
Virtuoso Layout Editor = "maskLayout"
Pass nil for any unused trigger, in this case the second argument.
The third argument is the function that you want for the user menu
trigger. Use the single quote syntax.
The fourth argument is the function that you want for the user
postinstall trigger. Use the single quote syntax.
Virtuoso XL viewtypes
schematic: schSynthesisXL
layout: maskLayoutXL
deRegUserTriggers( "schematic"
nil
nil
’TrUserPostInstallTrigger
)
Customization Trigger
Adding a menu item to the Edit menu User postinstall trigger
in the schematic editor window
Adding a pull-down menu to a User menu trigger
schematic editor window
Reordering the Virtuoso Layout Editor User postinstall trigger
pull-down menus
deRegUserTriggers( "schematic"
nil
nil
’TrUserPostInstallTrigger
)
Make the TrUserPostInstallTrigger function do these tasks:
1. Build your menu item if it is not already built.
2. Add your menu item to the Edit menu if it is not already in the Edit menu.
hiAddMenuItem( schEditMenu TrMenuItem )
The schEditMenu global variable contains the data structure of the Edit pull-
down menu in Virtuoso Schematic Editor.
Each variable in the return result holds the data structure of the
corresponding pull-down menu.
Specifically, the schEditMenu variable contains the data structure
for the Edit menu in Virtuoso Schematic Editor.
7/16/12 SKILL Language Programming 412
Before attempting to modify the menu, verify that the menu data
structure is in memory and that the menu item is not present in the
menu, as in this example.
boundp( ’schEditMenu ) && !schEditMenu->TrMenuItem
deRegUserTriggers( "schematic"
nil
nil
’TrUserPostInstallTrigger
)
Check #1
Check #1 determines whether the menu item exists.
Check #2
Check #2 determines whether the menu exists without the menu item present.
Test your menu function to add the pull-down menu to the window banner:
hiInsertBannerMenu( windowID TrUserMenuTrigger() 0)
) ; list
) ; if
) ; procedure
deRegUserTriggers( "maskLayout"
nil
nil
’TrUserPostInstallTrigger
)
See the Cadence online documentation to read more about these functions:
The hiGetBannerMenus function
The hiDeleteBannerMenus function
The TrReverseBannerMenus function
Certain applications use an ASCII text file to control the default values for their forms.
The defUserInitProc function causes your function to be loaded immediately after the context you
have chosen.
You can also set form defaults from the .cdsenv file. When forms appear, the default values are
already set. Some buttons are already turned on, some fields already contain text, and some other
choices are already set.
Cadence supplies an initial set of defaults in a sample file located at
<your_install_dir>/tools/dfII/samples/.cdsenv
Your system administrator customizes this file for your site and puts it in the local environment
file at
<your_install_dir>/tools/dfII/local/.cdsenv
You can override these site-specific settings by creating another .cdsenv file in your home or
workarea directory. When the Cadence software loads, it reads your .cdsenv file after the site-
specific file, so the settings in your file override the settings in files loaded earlier. These overrides
apply to your system only.
Example
Consider the File Form discussed in the User Interface module. Follow
these steps:
1. Set the File Name field to the /tmp/report.txt value.
A similar expression sets the default value. Use defValue instead of value.
TrFileForm->TrFileNameField->defValue = "/tmp/report.txt
7/16/12 SKILL Language Programming 420
1 1 1 1 2 3 4
The search order for the .cdsinit file is /tools/dfII/local, the current directory, and the home directory. When the
environment finds a .cdsinit file, the search stops.
The context files are in the <install_dir>/tools.dfII/etc/context directory.
Each executable (ex. Schematic, Layout, etc. ) loads different contexts.
Study the log file to determine the contexts that your executable loads prior to the .cdsinit file.
The virtuoso executable loads these contexts, as the following excerpt for the CDS.logs indicates.
Loading PRshare.cxt
Loading amSynUI.cxt
Loading schView.cxt
Loading selectSv.cxt
Study the log file to determine the contexts that your executable loads prior to the .cdsinit file.
The context files are in the <install_dir>/etc/context directory.
A priority for the Design Framework II environment is to minimize startup time for application. For large
applications, loading a SKILL context is faster than loading the original SKILL source code.
When Cadence builds a context, Cadence specifies a context initialization function to create data structures that
are not appropriate to save in the context, such as ports, database objects, and window IDs.
After the Design Framework II environment loads a context upon demand, it calls the Cadence context
initialization function. However, if you load a context with the loadContext function, you must use the
callInitProc function to invoke the initialization function.
Some applications build forms dynamically. Customizing these forms is beyond the scope of this course
The user initialization SKILL function that you supply for that context.
Your user initialization S KILL function can customize the menus and forms
that are defined in a context.
Example
procedure( TrCustomizeContext()
...
) ; procedure
See the Cadence online documentation to read more about this function.
The first argument to the defUserInitProc function is the name of a context. The second argument
denotes the SKILL function that you want the Design Framework II environment to call when it
loads the context.
The LSW is only present with the layout tools. By default, after the LSW is
displayed for a layout window, it is not removed from the screen, and there
is no close option on the window itself. The SKILL commands listed here
are the only way remove and restore the window.
Historically this window could not be removed because it was always a reference to the layers in
the current window. If you remove the LSW with leUnmapLSW, you need to restore it if you
require it for another layout window. The system will not restore the LSW when a new layout
window is opened. You need to use leRemapLSW.
Another example is to set the LSW to show only the layers in the current
window in the LSW. This involves looking through the layer purpose pairs
(LPPs) list in the current cellview and using that to set the validity, visibility
and selectability of the layers.
leSetAllLayerValid( nil ) ;;; turn validity of all layers off
leSetAllLayerVisible( nil ) ;;turn visibility of all layers off
leSetLayerSelectable( nil ) ; turn selectability of all layers off
foreach( lpp geGetEditCellView()~>lpps ; go through each lpp and set it
leSetLayerValid( list( lpp~>layerName lpp~>layerPurpose ) t )
leSetLayerVisible( list( lpp~>layerName lpp~>layerPurpose ) t )
leSetLayerSelectable( list( lpp~>layerName lpp~>layerPurpose ) t )
You can control the length of the purpose abbreviation in the LSW to two or three characters by
setting the variable lwLPIconPurposeLength in the .cdsenv file. This variable is only looked at
startup of the layout tool and cannot be reset during the session envSetVal, envLoadFile or
leSetEnv functions.
Module 18
Use Arrays
Name Value
rank “ace”
suit “spades”
Use the -> operator together with the = operator to update or add a field.
aCard->faceUp = t
faceup t
7/16/12 SKILL Language Programming 429
The get function is a generalized version of the getq function. Both of its arguments are evaluated.
The declare function returns the reference to the array storage and stores it as the value of week.
The type function returns the symbol array.
The arrayp function returns t.
Arrays are one dimensional. You can implement higher dimensional arrays using single
dimensional arrays.
SKILL checks the array bounds each time you access the array during runtime. Accessing an array
outside the array bounds causes an error.
for( i 0 6
for( j 0 6
TrTimesTable[i][j] = i*j
) ; for
) ; for
[i][j] 0 1 2 3 4 5 6
0 0 0 0 0 0 0 0
1 0 1 2 3 4 5 6
2 0 2 4 6 8 10 12
3 0 3 6 9 12 15 18
4 0 4 8 12 16 20 24
5 0 5 10 15 20 25 30
6 0 6 12 18 24 30 36
string
list
symbol
database object
Use the syntax for array access to store and retrieve entries in a table.
The makeTable function defines and initializes the association table.
The arguments include:
The table name (required).
TrTimesTable = Tr2D_DynamicArray( )
for( i 0 6
for( j 0 6
TrTimesTable[ list( i j ) ] = i*j
) ; for
) ; for
The sprintf function creates a string using the formatting standards of the printf command and
assigns it to a variable.
The rplaca function updates the first element of a list. Use the rplaca
function to replace the car of the cdr of the association list entry as shown
here.
rplaca( cdr( assoc( "B" assocList ) ) "two" )
=> ( "two" )
assocList => (( "A" 1 ) ( "B" "two" ) ( "C" 3 ))
Key Value
A 1
B 2
C 3
7/16/12 SKILL Language Programming 439
SKILL arrays
Association lists
Association tables
Introduction to SKILL++
Module 19
Macros
Code that writes code
Object System
Very powerful classes and methods
SKILL++ was developed as an extension of the SKILL® language that supplies critical support
for the advanced features required to solve complex problems and create code that is easier to
reuse and maintain. The improvements include lexically scoped variables and the creation of
private functions as well as a greatly enhanced object system.
SKILL and SKILL++ are the same language that execute in different environments. SKILL and
SKILL++ function calls can be mixed in the same procedure. The function definition determines
which environment the function will execute. By default, if the function is defined in a file with a
.ils suffix, it will be defined in the SKILL++ environment. If the file suffix is anything else,
including .il, the function will be defined in the SKILL environment.
The execution environment determines whether the function is run as in SKILL or SKILL++. This
determines such things as scoping of variables, definitions of local functions and symbol usage.
Global functions are shared between the environments and SKILL global variables can be
imported into the SKILL environment.
defun and procedure are the same command with different syntax
Both define functions.
Functions are defined in files using commands like procedure or defun. These are both the same
command using different syntax and can be used interchangeably in either SKILL or SKILL++.
There are other function creation methods such as lambda that creates an unnamed function,
defglobalfun for creating global functions in closures, flet for creating functions local to another
function. We will explore some of these in this class.
SKILL
Loading the source file
load( “mySKILLFile.il” )
Executing a function
mySKILLfunction( “This is an argument string” 8)
SKILL++
Loading the source file
load( “myAdvSKILLFile.ils” )
Executing a function
myAdvSKILLfunction( “Another string” ?keyedArgument 12 )
The suffix of the source file containing the function definition determines the function execution
environment. When the source file is loaded, the execution is the same between SKILL and
SKILL++, the procedure name followed by the values for the arguments, the required arguments
and the optional or keyed arguments.
Functions defined in a file with a .ils extension will be defined in the SKILL++ environment,
functions in any file with a different extension are loaded in SKILL by default.
Since SKILL and SKILL++ functions share the same space, two functions cannot have the same
name even if they are defined in different environments. If there are multiple definitions of the
same function, the last one defined is the one accessible by the user.
A common technique for debugging functions and methods is to copy and paste from an editor
into the CIW. This may be a problem because the function may be re-defined in the wrong
environment. The command toplevel changes the environment between SKILL and SKILL++.
Note that if you paste code in the CIW while another function is executing, the environment will
be determined by the executing function.
inSKILL( …body… )
Executes the body in the SKILL environment
Usually executed in the SKILL++ environment
In .ils SKILL++ source files to switch environment for some function
definitions.
You can execute or define functions in a different environment than the one defined by the source
file suffix using the functions inSKILL and inScheme.
In a SKILL++ source file (.ils), the block defined in the inSKILL statement will be executed in the
SKILL environment. Global variables and function definitions will be defined in the SKILL
environment with its dynamic scoping. In a SKILL source file (.il), the block defined within the
inScheme statement will be executed in the SKILL++ environment. These commands allow you
to mix SKILL and SKILL++ function definitions in the same source file.
SKILL++ supports multiple environments, each let statement creates a new environment that sets
the lexical scope of variables and functions defined within that environment. The variables and
functions defined within an environment implement a closure, the variables, some procedures and
lambda functions are private, functions defined by defglobalfun are public but can access the
values in the closure variables.
SKILL global variables are global to SKILL++ variables are private to the
the SKILL environment SKILL++ environment in which they
are defined
Let
Global variables lexical
scoped
env
Functions F
SKILL SKILL++
Environment Environment
A D
dynamically
C lexical
scoped lexical scoped
variables B env Key
dynamically
scoped
scoped env
variables Environment
C Function
In both the SKILL and SKILL++ environments, named functions are available for general use,
even functions declared within a SKILL++ lexical scope.
• The SKILL functions A and B are defined in the global function space.
• The SKILL++ functions C and D are defined in the global function space because they are
not defined within a lexical scope.
• The function F is declared within the lexical scope of the let. It is only available in the global
function space if it is defined with defglobalfun or globalProc.
importSkillVar
let
SKILL lexical
global variables scoped
env
F
SKILL SKILL++
Environment Environment
A D
dynamically
C lexical
scoped
scoped lexical
variables B env Key
dynamically
scoped
scoped env
variables Environment
C Function
Global variables are available within SKILL and can be imported into the SKILL++ environment.
• Global variables in SKILL++ are available to any SKILL++ function.
• SKILL global variables can be imported into SKILL++ environments using the
importSkillVar function.
• The variable imported into the lexical scope is only available within that scope.
Variables declared within a SKILL function are available to all functions evaluated by the original
function, they are dynamically scoped.
• If the function A calls the function B, the variables declared within SKILL function A are
accessible within SKILL function B.
• If the function C calls the function D, the variables in C are not accessible by the function D.
• If a SKILL function calls a SKILL++ function, the SKILL function’s variables are not
accessible in the SKILL++ function and visa-versa.
The function F can access any variables scoped within its environment.
Module 20
Appendix A
Blocking read The parent process, the Virtuoso® Design Environment, is suspended
until the data is available from a child process. During a blocking
read, the parent’s user interface and graphics freeze.
Deadly embrace Two processes enter a dead lock if both wait for resources held by the
other before releasing resources. A blocking read with a timeout limit
avoids the possibility of a deadly embrace.
Kill command The UNIX kill command sends a signal to a UNIX process. The kill
command requires a UNIX process ID. The SKILL process ID is
different from the UNIX process ID.
The example child program reads a text string from its stdin and writes the
text string containing upper case characters to its stdout.
stderr
Child process
7/16/2012 SKILL Language Programming 469
p = s;
fgets(p, MAXLEN, stdin); Read stdin
while ( *p )
{
if (islower(*p))
*p = toupper(*p); Force case
p++;
}
printf("%s", s); Write stdout
fflush(stdout);
}
ipcWriteProcess
stdin
SKILL
program ipcReadProcess
stdout
stderr
ipcWriteProcess
stdin
SKILL
program ipcReadProcess
stdout
stderr
Function Purpose
The error handler when it receives an error from the child’s stderr
channel.
The postfunction when UNIX reports that the child has terminated.
The SKILL Evaluator executes calls to data handlers, calls to postfunctions, and user input in the
order they are queued.
Function Purpose
data – argument is the text string that the child sent to the Virtuoso
Design Environment.
Example TrUpperCase_DataHandler function
procedure( TrUpperCase_DataHandler( pid data )
Update global
TrResult = append( TrResult list( data ))
Access global
if( TrList then
TrUpperCase_Write( pid )
else ipcKillProcess( pid )
) ; if
) ; procedure
This function appends the child data to the list in the global variable
TrResult and checks the global variable TrList to decide whether to
Send the next string to the child.
When a child process terminates, the Virtuoso Design Environment queues a call to the child’s
postfunction, if one exists.
The call to the postfunction executes when the SKILL Evaluator is idle.
Reading text strings from the child’s stout using the ipcReadProcess
function
Category Functions
Appendix B
Function tracing
Single-step execution
Utility Task
SKILL Debugger Trap errors.
Suspend execution.
Monitor execution.
SKILL Lint Identify potential errors, oversights, and inefficient constructs.
SKILL Profiler Measure performance and memory usage.
SKILL Surveyor Survey SKILL code to determine what changes are needed to
migrate to a new version of Cadence software.
In your .cdsinit file, you can define a bindkey for the F4 key to open the SKILL Debugger
Toolbox.
hiSetBindKey( "Command Interpreter"
"<Key>F4" "ilDebugToolBox()" )
Single-step tracing can be very effective, but it has the following drawbacks:
Single-step tracing produces a lot of output. If the SKILL error does not occur early in the
run, you can easily get confused or lost looking at the output.
The output shows each function call with evaluated arguments. It can be hard to correlate the
output with your source code.
In this example, the trace output indicates that the code expects a cellview database object but is
dealing with a window ID.
) ; when
view( "/tmp/ShapeReport.txt" TrReportBBox "Shape Report" )
) ; let
) ; procedure
) ; case
) ; foreach
fprintf( outport "\n%-10s %-10d" "Rectangles" rectCount )
fprintf( outport "\n%-10s %-10d" "Polygons" polygonCount )
fprintf( outport "\n%-10s %-10d" "Paths" pathCount )
fprintf( outport "\n%-10s %-10d" "Misc" miscCount )
list( cv~>libName cv~>cellName cv~>viewName )
) ; let
) ; procedure
When you install the SKILL Debugger, the prompt in the lower left corner of the CIW
changes from > to 1>. The prompt in the CDS.log file also changes from > to 1>.
7/16/2012 SKILL Language Programming 496
You control the clipping with the tracelevel and tracelength variables.
7/16/2012 SKILL Language Programming 498
tracelevel
This environment variable controls the depth of elements in a list that are printed during tracing.
tracelength
This environment variable controls the number of elements in a list that are printed during tracing.
This excerpt from the ~/CDS.log shows these next two steps:
Dumping the SKILL stack at the time of the error.
Examining the value of the miscCount variable.
\p Debug 2>
\i stacktrace()
\e <<< Stack Trace >>>
\e errorHandler("postincrement" 0 t ... )
\e (miscCount = miscCount)
\e miscCount++
\e case((shape~>objType) ("rect" rectCount++) ("polygon“ polygonCount++) ... )
\e foreach(shape (cv~>shapes) case((shape~>objType) ("rect" &) ("polygon" &) ... ))
\e let((rectCount polygonCount pathCount ... ) (rectCount = (polygonCount = &))
(cv = geGetWindowCellView(wid)) ... )
\e TriShapeReport(wid thePort)
\e TrShapeReport(window(4))
\t 8
\p Debug 2>
\i miscCount
\t nil
\p Debug 2>
A function boundary consists of four points. Each point is an event that occurs during a function
call. The order of events is call, entry, exit, and return. In the following table, the caller refers to
the code that contains the function call and the callee refers to the function itself:
Point Description
You can set a breakpoint at all four points for any function you define while the SKILL Debugger
is installed.
For other SKILL functions, you can set a breakpoint at only the call point or the return point.
This command does not let you set more than one breakpoint on a
function at a time.
Use the breakpt function.
Example
If you want to set a breakpoint both at the entry point and at the exit point of
a function, you must use the breakpt function.
The following example sets an unconditional breakpoint at the entry and at
the exit of the TriShapeReport function.
breakpt( TrShapeReport ( ( entry t ) ( exit t ) ))
7/16/2012 SKILL Language Programming 502
This function sets breakpoints on one or more functions. The SKILL debugger is the default break
handler and is entered automatically when a breakpoint is encountered. The functions breakpt and
unbreakpt set and clear breakpoints on the functions given.
If no break_conditions are given, the breakpoint is called "unconditional." The behavior of an
unconditional breakpoint is as follows:
if the function is read-protected or not yet defined under debugMode, the breakpoint is
assumed to be set at the "call" point.
Otherwise, it is assumed to be set at the "entry" point of the function.
Value returned:
List of functions whose breakpoints have been set.
Clears breakpoints for the functions listed. The return value is the names of the functions for
which the breakpoints were removed.
Breakpoint
If the program is suspended due to a breakpoint, you have these choices:
Resume the program.
Abort the program by quitting the debugger session.
Error Trap
If the program is suspended due to an error trap, you can only abort the
program.
7/16/2012 SKILL Language Programming 508
After you have fixed a problem, make sure that you abort the program before rerunning it.
The SKILL Debugger does not restrict your access to the Design Framework II environment.
During a debugger session, you can still do the following through the user interface:
Trigger the evaluation of other SKILL expressions.
Use the CIW to evaluate a SKILL expression.
One of these SKILL expressions can generate an error or call a function.
To exit all nested debugger sessions without quitting the debugger, type reset in the CIW.
When you call the edit function, you can specify just the function name,
as in this example:
edit( TrShowFileBrowser t )
While the SKILL Debugger is installed, the load function associates the file being loaded with
each function that the file declares.
Appendix C
3. For the callbacks for each choice, convert the list of window IDs to the
SKILL commands needed to deiconify and raise the window.
foreach(mapcar win hiGetWindowList()
sprintf(nil strcat("hiDeiconifyWindow(window(%d)) &&
"hiRaiseWindow(window(%d))") win->windowNum win->windowNum))
procedure(CCSraiseWindow()
let( (winName)
;; create and display a simple pop-up menu containing a list
;; of windows that currently exist for the session
hiDisplayMenu(
hiCreateSimpleMenu('CCSschWinList
"Window List"
;; build a list of window name references
foreach(mapcar win hiGetWindowList()
winName = hiGetWindowName(win)
;; if the window name contains a ':' then use the part of
;; the name after the ':', otherwise just use the whole
;; window name - this is to remove a prefix like
;; "Virtuoso Schematic Editor L Reading"
if(index(winName ":")
substring(index(winName ":") 2)
winName
)
); foreach
;; build a list of callbacks, each one will deiconify and/or
;; raise a specific window using the window number
foreach(mapcar win hiGetWindowList()
sprintf(nil strcat("hiDeiconifyWindow(window(%d)) &&
"hiRaiseWindow(window(%d))") win->windowNum win->windowNum)
); foreach
); hiCreateSimpleMenu
); hiDisplayMenu
); let
); procedure CCSraiseWindow
procedure(CCSaddProp( lib_name )
let( ( libId cellId viewId)
unless( libId = ddGetObj( lib_name )
error( "Could not get library %s." lib_name )
)
foreach( cell libId~>cells~>name
cellId = ddGetObj( lib_name cell )
if( member( "layout" cellId~>views~>name )
then
if(ddIsObjWritable(ddGetObj(lib_name cell "layout"))
then
viewId = dbOpenCellViewByType( lib_name cell "layout"
"" "a")
dbReplaceProp( viewId "prCellType" "string" "standard")
dbSave( viewId )
dbClose( viewId )
else
printf( "CCSaddProp: can't edit %s.\n" cell)
) ; end of if
) ; end of if
) ; end of foreach
) ; end of let
) ; end of procedure
In CIW:
load("CCSaddProp.il")
CCSaddProp("dp_lib")
This file, def.strokes contains the stroke definitions. The strokes can be viewed or
saved to another file using the stroke_editor executable in the tools/bin directory of
your tool installation. In addition to the "Layout" shown above, you can load strokes
for "Schematics" or "Symbol" among some of the tool choices.
You can draw with the right mouse button depressed to make stroke shapes or mouse gestures
in the graphical window. For example, a straight line left, down, up or right pans the view. A "w"
shape performs a "window fit" operation, a "c" shape performs copy, and so on.
A brief summary is shown here:
Shape | Action Comment
-----------------+--------------------------------------------------------------------------------------------
alpha | Delete (lower-case Greek alpha/aleph, fish-like shape, α)
C | Copy (selected set, or object under stroke with infix=t)
M | Move (selected set, or object under stroke with infix=t)
P | Query Properties (selected set, or object under stroke with infix=t)
S | Stretch (selected set, or object under stroke with infix=t)
u | Undo ("U" with a tail)
W | Fit Window (lower-case Greek omega or jagged W will work)
Z | Zoom in
\ | Zoom out
| | Pan Up/Down (depending in which direction is drawn)
- | Pan Left/Right (depending in which direction is drawn)
Often the stroke action is in proportion to the size of the stroke. A "z“ zooms into the area that the
z was drawn over. If "infix" is turned on, then actions such as copy, delete or move apply to the
object the stroke was drawn over, if nothing is previously selected.
Appendix D
Relevant Documentation
Virtuoso Design Environment Adoption Guide
Cadence® User Interface on QT Compatibility Guide
Virtuoso® Design Environment SKILL: What's New?
Virtuoso User Interface SKILL: What's New?
In general:
In SKILL code, find CDB data conventions and replace with new objects.
A V T V
7/16/2012 SKILL Language Programming 523
Throughout this discussion, we’ll keep returning to this theme: Why do we want to access these new
objects through SKILL at all? Many Cadence customers have a significant investment in SKILL, and
there’s a good chance that this SKILL accesses, creates, or modifies objects that behave similarly to these
new DFII objects. That’s why it’s important to understand these new objects in a fundamental, deep-down
sense.
In your old SKILL code, you might find that you were creating these exact objects, only in the form of
shapes on a specific layer-purpose pair (LPP). For example, a rectangle (which is a unique database object)
on the layer metal1 with a purpose blockage might serve by the tool as a blockage for metal1, preventing
any metal1 routing from taking place where that shape lies. The problem with this approach is that now,
every tool in the design flow must understand that a shape on that layer/purpose serves as a blockage. It’s
what we call a data convention.
In OpenAccess 2.2, many objects that were represented with data conventions (shapes on special LPP’s)
have a new, unique representation directly in the database. We’ll address this more in coming slides, but the
short version is: All tools will see these new objects in exactly the same way, with no interpretation
necessary.
The challenge comes in repairing SKILL code that looks for these data conventions, or creates objects that
use them. In general, use the knowledge that you obtain in this chapter about how these objects work and
are used in order to best predict where (in your SKILL code) you will need to make modifications. Look for
those special layer names or purposes, especially if they are unique to your design process.
It’s important to know how these objects are accessed and created through the SKILL language if your
applications will be used with OpenAccess 2.2 data. This appendix makes the process of updating your
code much easier.
Vias are a design object from the technology file. The standardViaDef is most often used in
custom design, the customViaDef is used by place and route tools. The vias are placed as shapes,
not instances and are added directly to the net.. This creates a significant savings in virtual
memory for the millions of vias in a design.
This is an example of how you explore the different objects, listing the CDB equivalent, the
SKILL creation command for the new object, how to find the new object in the cellview, and the
attributes for the new object.
Much like pcells, via placements refer to a viaHeader. The viaHeader contains the parameter
values instead of those values being assigned to each instance. This is a significant memory
savings. If the via parameter value is the same as the default on the custom via master or
stdViaDef, the value is not assigned to the viaHeader.
Octagonal End
Points for 45-degree Path segs
segments
In the past, interconnect was created using chains of paths and special instances that provided
connection between metal layers. Paths, of course, are an important aspect of custom layout, being
very flexible in the angles, end styles, and other features that are possible with paths.
Unfortunately, this same flexibility makes it difficult for Place and Route software to make sense
of paths that have edges that are off-grid, have odd angles, or have different end styles.
To solve the problem of interconnect, OpenAccess 2.2 introduces a new object, the path segment.
In OpenAccess 2.2, this is referred to as an oaPathSeg, or a pathSeg for short. pathSegs are much
simpler than paths, in that they:
Can only have two points: a beginning point and an end point. If a connection requires more
points, a chain of pathSegs will be needed.
Must be either orthogonal or diagonal. The diagonal path segments have octagonal end-
styles, each vertex of which can easily be placed on-grid.
Can easily be forced on-grid.
Paths continue to exist in the database in the exact same manner as they have in the past. We
simply have added a new, simpler, interoperable object that can readily be interpreted by P&R
applications as interconnect.
PathSegs created by the Virtuoso applications comply with the DEF specification of pathSegs,
which specifies the algorithm used to create the octagonal edge-points. This is compatible with
the DEF 5.7 syntax.
Paths are used for guard rings and other non-connectivity design
objects.
7/16/2012 SKILL Language Programming 528
This is the example of the creation, search and attributes of the pathSeg object.
Search
objType
Why would anybody want SKILL access to pathSegs? One of the of most common questions we
get in other migration training classes is “how do I convert my existing interconnect (which uses
paths) into pathSegs? The cdb2oa translator, which translates design data into OpenAccess 2.2,
does not perform this conversion, and with good reason; There are many ways in which a given
path could be converted into pathSegs with different results. For example, given a path with a 90-
degree turn, when this turn is broken into two pathSegs, there are many ways that the intersection
can be constructed; Both pathSegs overlap each other completely, one abuts the other but does not
overlap, one overlaps slightly, etc. The addition of 45-degree segments complicates this even
more. The only reliable way for a Cadence® customer to obtain satisfactory results is to perform
this conversion themselves.
In addition, it might make sense that a user might want custom, non-default end-points. These can
also be customized using SKILL code.
You probably will not have any issues with pathSegs in your old code, because pathSegs did not
exist before the OpenAccess 2.2-based releases. Furthermore, there’s no real requirement by any
single application that you use pathSegs. However, interoperability concerns might be a strong
motivator for changing to pathSegs.
Note also that nothing has changed with respect to regular paths in DFII. You can still use them in
exactly the same way as in previous versions, and your SKILL code will work perfectly without
modification with respect to paths.
However, in order to ensure interoperability, you might want to convert paths in your existing
designs into pathSegs. Be aware that because pathSegs can only represent a single, two-point
segment, if you replace a single path that contained several points, you will now have many
pathSegs in place of the single path. Note that pathSegs are fairly efficient, streamlined objects in
the OpenAccess 2.2 database, and there’s really not much of a performance penalty for using
pathSegs vs. paths.
To update your code, you’ll use the dbCreatePathSeg command instead of dbCreatePath. The
next slide shows an example of how this could be done.
In our example, we have some SKILL code that is creating a path from a point list. This list might
contain only two points, or most likely many more points. In the illustration at the bottom, the
path contains four points.
To replace this code, you need to iterate through the list of points, collecting the points into pairs.
When you have a pair of points, you can easily call dbCreatePathSeg, and pass the two points.
This will iterate over the list of points, creating a new pathSeg for each subsequent point after the
first pair.
The result is a chain of pathSegs that basically represent the original path. Note that you’ll need to
check the endstyles, and based on your particular choice of how the pathSegs will overlap (if at
all), you’ll need to customize your code to make this occur.
Support interoperability
We’ll take a step back from new database objects for a moment to discuss migrating SKILL code
in the general sense. We’ve learned about pathSegs in the database, and we can see that there are
most likely not any places where you can run SKILL and it will cause an error message because
you are not creating a pathSeg. pathSegs are additions to the database, and as such, are optional in
your code, not required. However, this will not be the case for other new objects, such as
boundaries, blockages, rows, and sites.
There is, however, a concern about functions that look for objects in cellview databases. Functions
that tabulate shapes in a design, functions that trace connectivity through shapes, and functions
that look for specific objects (namely, the ones mentioned in the training class) will need to be
updated to look for these new objects, and to look for them in the correct manner. We’ll see many
examples of this during the remainder of this appendix.
case(shape~>objType case(shape~>objType
(“rect” … (“rect” …
(“polygon” … (“polygon” …
(“path”… (“path”…
(“arc” … (“pathSeg” …
(“arc” …
This code sample shows a shape tabulator. Note that we are iterating through the shapes in the
design, querying the object type of each object. Of course, if this code were used on an
OpenAccess 2.2 database, it would still function, albeit incorrectly. It would miss out on all of the
pathSegs that are in the database. In order to update our code, we’ll have to add some lines to
accommodate new objects.
On the right side of the slide, we’ve added a new option to the “Case” statement. We will now
have a branch for each pathseg.
In each of the examples that we will show in the slide, we’ll take a second to examine what strings
we could “grep” for in our SKILL files in order to locate potentially problematic SKILL. So, in
this slide, what could we “grep” for in order to locate this potential problem, specifically with
respect to pathSegs?
In this case, we’d be concerned any time we’re checking a shape’s objType. In many cases, this
will not locate problematic SKILL, as there are many reasons that one might access the objType,
for example, when looking for other objects. However, it might turn up potential problems as in
the example above. We can also grep for “path” in our code. This is a better search string, as it
will find references to paths in our SKILL code as well as in the comment blocks in our SKILL
files. Anywhere we are looking for, manipulating, or creating paths, we might want to be aware
that pathSegs might be in the design serving a similar functions as paths. This code will most
likely need to be updated.
Site
Site
Site
Site
cell, macro, or device is to be
placed.
A site must be the same height as
the instance master.
Site can be flipped or mirrored to Row
provide desired cell orientation
compared to rails.
Sites are defined in the techfile.
Inst Site
Generally, one site exists for each
unique standard cell master height. Sites are defined in the techfile.
Our next new objects in DFII are rows and sites. Rows and sites are common constructs in the
place-and-route environment, but are unfamiliar objects to many custom designers.
A Site is a location where a standard cell will be placed in a design. Generally, sites are arrayed
into a long row called (surprise!) a Row. Standard cells are generally an even multiple of the
width of a site, but are always the exact height of a site, to ensure that the power and ground
connections line up properly with the power and ground rails that run along the top and bottom of
the row.
Sites are defined in the techfile, and a site definition exists for each cell height.
In the design, a row is first created, and the site locations are determined by the row as evenly
spaced snap-points in the row.
There are two ways to create a site definition on the techfile; One is interactively in SKILL, using
the techCreateScalarSiteDef( ) function, which can be done in the CIW. You’ll need to provide a
name for the site definition, generally “core” or “pad” to describe the function of the site. Of
course, width and height are required as well.
You can also create site definitions in the techfile by loading an ASCII techfile and compiling it.
This is generally how sites are created.
A third way to obtain site definitions in the techfile is to import a technology LEF that creates
them. This process is discussed more in the translator user guide for LEF/DEF.
Row
dbCreateRow(
cv
sd
“Row1" 4. Create
0:0 the row
20
)
Sites
As we mentioned, sites are defined (and exist) only in the techfile, but rows exist in the cellview.
To create a row, the User Interface can (of course) be used, but in order to create a row in SKILL,
we’ll use the dbCreateRow function. First, you must obtain the cellview ID, and once we have
that we can obtain the techfile that is currently being referenced by it. We then locate the site def
in that techfile, and once we have the cellview ID and the site def ID we can use dbCreateRow to
create our row.
The image in the lower right of the screen shows a row that was created in a cellview. By
changing the display options to display site locations and row names, we can see what a row looks
like in the cellview.
Sites and Sitedefs have not changed at all since CDB, which includes the definition in the
technology file and the SKILL API. In this respect, your old code will work fine! What’s new,
however, is the ability to place sites in your design in the form of rows, so the new functionality
(which we’ve already covered) will need to be added if you will be using rows and sites.
Boundaries are a familiar concept in Virtuoso, but are new objects in OA2.2. In CDB, they are
rectangles or polygons that are on a special layer/purpose pair, which identify them as those
special objects. The most familiar boundary is the PR Boundary, which is used in Virtuoso XL,
and in OpenAccess, the PR Boundary is still present. In fact, there are also three other types of
boundaries; Snap Boundaries, which are used for snapping an instance to a site in a row; Cluster
Boundaries, which are used to locate cells in a cluster, and Area Boundaries, which are used to
designate a special area of a design for applying special design rules to an area of the design or to
specify a special area for some other purpose. We’ll learn more about boundaries on the coming
slides.
Creating Boundaries
The dbCreate*Boundary functions are very simple
Three or four arguments, including:
The destination cellview ID
The list of points for the boundary object ( not a bounding box )
An optional list of edge names
A name (for cluster boundaries)
One question that arises is: Why access boundaries through SKILL? There are many areas where
you might already be accessing boundaries through SKILL, and it’s important to make sure that
these applications are updated to use the new code constructs. You might have shape report
programs that count figures in the design, and they might include the PR Boundary or other
boundaries in the summaries. You might have SKILL that actually creates boundaries, either PR
Boundaries or area boundaries. In light of the new of data types of boundaries, you might choose
to write custom SKILL code to convert your old methodology (which was most likely LPP-based)
into the new format for representing boundaries. Regardless, there are many reasons why you
might choose to utilize this new SKILL API to create boundary objects.
The functions that create boundaries are fairly simple; They accept three or four arguments, which
include:
The destination cellview ID
The list of points for the boundary object, either a bounding box or a list of points for a
polygonal boundary
An optional list of edge names
And for cluster boundaries, a name of the cluster which is contained by the boundary.
Let’s look at some examples of how these functions work.
As with other objects, there are db functions to create boundaries. Each type of boundary has its
own function create that type of boundary. Two examples are shows on this slide:
dbCreatePRBoundary and dbCreateSnapBoundary. dbCreatePRBoundary accepts very simple
arguments: The cellview in which the PR Boundary will be created, and the list of points that
make it up. Note that it can be polygonal in shape, but it will not be a polygon – it will be a PR
Boundary object. dbCreateSnapBoundary works similarly, except that it also can accept a list of
edge names. We’ll see more about the list of points that these functions accept on the next slide.
There can only be one PR Boundary in a cellview in OpenAccess.. To locate the PR Boundary in a
cellview, you can query it directly from the cellview database object. In fact, you can see all of the
boundaries in a cellview directly from the cellview object, by using the ~>? Operator as you can
see on this slide. Note that these objects are distinct objects in the database, and are not shapes.
To edit the attributes of a boundary, you can store the boundary in a variable, and query the
attribute as you would any ordinary database object. You can locate information that is generic to
any database object, or information specific to a boundary, such as numEdges, points, edgeNames,
etc.
dbCreatePRBoundary( dbCreatePRBoundary(
d_cellViewId cv
l_points list(0:0 0:4 4:4 4:0)
[ lt_edgeNames ] ) => db:0x04cf34a4
) => d_boundaryId | nil
All of the dbCreate functions that create boundaries accept a list of points. PR Boundaries, cluster
boundaries, and Area Boundaries can accept a polygonal list of points. These lists must have at
least three valid points that result in a non-zero area. A bounding box is not sufficient!
The Snap Boundary is the only boundary that must be rectangular in shape. Despite this, it accepts
a list of four points, not a bounding box. So make sure that you check your list of points, and
make sure that the list contains four points, and is polygonal.
If you use nonstandard layer names, you must convert your boundaries.
“grep” for your boundary LPP in your SKILL code
“grep” for “boundary” in your comment blocks
Search for shapes in your designs on your special boundary LPP
A V T V
7/16/2012 SKILL Language Programming 543
To locate SKILL that contains boundaries, we must search for shapes that are being created or
referenced on a certain layer-purpose pair. Shapes on special LPPs were a data convention used in
CDB. You might not get an error if you perform a function in SKILL that creates a shape on the
special Layer-Purpose pair that is reserved for displaying boundaries, but the resulting shape will
not function as a boundary object. They will be treated as shapes, and nothing more. So part of
our SKILL migration related to boundaries will be modifying our old code to create native
boundary objects instead of shapes on the boundary LPP.
To find this code, check for the name of your boundary LPPs in the SKILL code. You can easily
“grep” for these LPPs. You can also grep for the word “boundary” in your code, although this
might be misleading as boundary can be used in many different contexts. Note that the cdb2oa
translator does convert the shapes in your existing designs, so these shapes will be converted into
the correct type of boundary object. But your SKILL must be fixed or it will still create these old
constructs instead of the native OA objects.
In this slide, we can see an example of migrating SKILL that creates a PR Boundary.
There are two problematic areas of this code: One where we are creating a PR Boundary, and then
one where we are creating a snap boundary if it’s needed. Note that we are using
dbCreatePolygon and dbCreateRect to perform both of these actions.
Instead of rodCreatePolygon, we will substitute dbCreatePRBoundary. In place of rodCreateRect
for the SnapBoundary, we’ll use dbCreateSnapBoundary.
What can we grep for in this example?
Of course, our Boundary layers that we used in CDB would be the first things we could search for.
In our case, we have two layers that we can grep for, prBoundary and, the layer we use for the
snap boundary SPB. In addition, searching for the word boundary would have led us to the
comment block in this section. Note that simply searching for the word “Boundary” in this code
would have been hit-and-miss. We’re lucky that this code is well-commented, but if it were not,
our search would have to be more sophisticated, searching for LPP names instead.
Also note that we will need some new code in addition to our previous code. rodCreateRect
accepted a bounding box, and we now need a list that contains four points that form a rectangle.
We’ll need to add that code for our function to operate properly.
Another new object in OpenAccess 2.2 and in IC 6.1 is a blockage. A blockage is a polygonal
object that looks very much like a shape, but has rather the opposite effect: It prevents an object
from being placed in a design in a manner that overlaps the blockage. There are many different
types of blockages that can be placed in a design. Placement blockages prevent instances from
being placed, routing blockages prevent any type of routing on a certain layer, pin blockages
prevent the creation of pins in an area, slot blockages prevent metal slotting from being performed
on an area of metal, and fill blockages prevent fill patterns from being placed. Feedthrough
blockages prevent signal from being passed through a particular pin on a device, and screen
blockages prevent metal screening over the area covered by the blockage.
There is a note on this slide next to Routing Blockages that says “interoperable”. OpenAccess
itself supports two other types of blockages: via blockages, which prevent a via from being placed
in an area, and metal blockages, which prevent certain metals from being placed in an area. Note
that a routing blockage can very easily fill both of these needs. All the designer needs to do is
create a routing blockage on the metal layer or via layer in order to accomplish this.
A blockage is not a shape! It’s a distinct database object, separate from rectangles, paths, or
polygons.
One confusing aspect of blockages is that while they are associated with a layer or layer/purpose,
they do not themselves have a layer. For example, a Metal1 blockage is designed to block metal1
from being placed in a design. However, if I turn off blockages, but turn on Metal1 for display, I
won’t see my blockage.
dbCreateAreaBlockage( Creates
d_cellviewId
l_points
placement
[ d_owner ] blockages
)
=> d_areaBlockageId | nil A V T V
SKILL access to blockages is through the familiar db access functions for creating them. Locating
and editing blockages is done through the familiar cellview data access interface. Let’s see how
we do this:
To create blockages, we have two functions:
dbCreateLayerBlockage - This function creates routing, pin, slot, fill, feedthrough, and screen
blockages, and you must tell it which of these types you want as the type argument.
Placement blockages, on the other hand, are intended to prevent instances from being placed in
the cellview, and therefore do not have an associated layer. The function dbCreateAreaBlockage is
designed to create placement blockages.
Note that this function does not accept a layer, but does accept a list of points which can be
polygonal.
To locate the blockages in the design, you can query them directly from the cellview object. Once
you have a blockage stored in a variable, you can query it directly using the ~> operator like any
other database objects.
Look for code that creates shapes on your special blockage LPPs.
grep for the purpose name of "blockage: or the purpose you used
grep for the string “keepout”
A V T V
To locate errors related to blockages, we should look at applications in our current design flow
that create shapes that operate as blockages. They are primarily used by auto-placers and routers
in order to prevent the placement of instances and routing objects in the design. They are also
placed in the design prior to metal fill, area fill, and screen placements, typically at the end of the
design cycle. Any application or utility that creates, modifies, or looks for these blockages will
need to be updated to use the new objects instead of shapes on a specific layer or purpose.
Recall that in CDB, these objects were on special LPPS. Typically, the layer would be the layer to
be blocked, and the purpose was “blockage”, or something more specific such as
“routeBlockage”. We’ll want to look for these layer/purposes in our custom SKILL code to locate
these constructs, and replace them with the native object API.
Note that this is very much the same process that we used for boundaries, and the same rules
apply in searching for these objects. We’ll see an example on the next slide.
A V T V
What can you grep for in this Note: Need new function to compute
example? polygon points from a bbox.
7/16/2012 SKILL Language Programming 548
In this example code, we are placing an instance, and then it appears that we are creating a
blockage that overlaps the instance. The blockage overlaps the instance, but is created using
dbCreateRect.
To fix this, we will want to replace the call to dbCreateRect, with code that creates a blockage.
Instead, we will include a call to dbCreateAreaBlockage, because we want to prevent the
placement of instances overlapping our instance, The function to use for placement blockages is
dbCreateAreaBlockage.
To locate problematic code in our SKILL directories, we can grep for the word blockage, but a
better search string would be our purpose, in this case, DKblk. This is our own, privately defined
blockage layer that we have created and used in our PDK.
Finally, it’s note worth that like boundaries, both of the blockage creation functions accept a list of
points in polygon fashion, and not a bounding box. We’ll need to use the same function that we
used in the past to convert a bbox into a list of four points that constructs the same rectangle.
A V T V
We can now look at a more comprehensive example of SKILL function migration. In our previous
environment, we used a SKILL function that summarized the various shapes in our design, and
specifically counted boundaries and blockages. On the code on the left, we can see that we were
specifically looking for a purpose name of BDY or BLK, and since these shapes could be
polygons or rectangles, we must search for both. To migrate this code correctly, we must instead
look for the new objects.
In this case, we can dispense with the case statement entirely, because boundaries and blockages
will no longer be stored in the database as rectangles or polygons. Our code can simply iterate
through these shapes and perform whatever action we would if it were not a boundary or
blockage.
We can then simply query the boundaries directly from the cellview itself (using the ~> operator).
Note that boundaries are stored separately on the cellview: The PR Boundary is distinct, as is the
snap boundary (if applicable) and any area boundaries or cluster boundaries.
We can do the same with blockages, except that all blockages are stored under the attribute
“blockages” in the cellview. All blockages, be they placement, routing, fill, or other blockages are
stored under cv~>blockages.
The first case we’ll examine is multiple terminals per net. Often, this problem manifests itself in
that code that previously was comprehensive in its treatment of terminals might not be fully
operating as it should. For example, we can envision some SKILL that accesses a terminal on a
net, adds a property, and renames the terminal. On OpenAccess there are potentially many
terminals per net, and as we’ll see, the single terminal that gets returned from the database query
might or might not be the terminal that is expected. Furthermore, the property is only being
applied to one terminal, so our code must be aware of that when retrieving the information from
the property. In general, your code should be aware of the fact that where in the past there was one
object, now there are many.
Pins
Support both the “fig” and “figs” attributes
Much effort has been put into ensuring backward compatibility for your SKILL whenever
possible. In this course, we’ve seen many instances where changes are required, and many where
backward compatibility is 100%. Pins and Nets both support the previous method of querying
figures and terminals, respectively. Because there are now many terminals on a net, instead of the
“term” attribute on a net, we would expect to see “terms”. What we see, in fact, is both attributes;
“terms” returns a list of the terminals on the net, and “term” returns a single terminal that is the
first element of the list. Thus, your old SKILL code will work with the new release, but be aware
that one of the terminals is being retrieved from the list, and you might or might not receive the
terminal that you are looking for. As was mentioned previously, make sure that your code accesses
the attribute that returns the list of objects (“terms” instead of “terms”, and “figs” instead of
“fig”). Furthermore, you should write your SKILL so that it locates the terminal (or figure) that it
needs, or store that information on the net (or pin).
Accessing terminals through SKILL is done in much the same manner that it was in previous
versions. Terminals can be created using dbCreateTerm as in the past. Now, however, more than
one terminal can be created on a given net.
Locating terminals is done using functions like dbFindTermByName or dbGetNetTerms. Little has
changed with respect to locating terminals.
Most SKILL code, however, accesses terminals not through SKILL functions but directly through
the database object queries.
We can easily retrieve the list of terminals directly from a net by querying a new attribute, terms.
We can also query term, and retrieve one of the terminals. As you can see, both attributes have
been implemented as we discussed on the previous slide.
Migrating your nets and terminals means making your code aware of the fact that there is a one-
to-many relationship between nets and terminals. In this example, we have a section of SKILL
that queries the terminal of a net, sets the direction to be “input”, and then replaces a property
(that we assume exists on the terminal already). As we now know, our old SKILL code might fail
if there is now more than one terminal on the net, and the terminal to be returned was not the
correct terminal. Either our code would fail reassigning the property, or later on when we went to
query the property from the terminal, we might find either no value or the incorrect value on the
terminal that was returned.
To properly repair the code, we must first understand that when either assigning our property
querying our property on the terminal, we must be deliberate in locating the correct terminal on
the net. In this example, we are first searching for a terminal on the net that that already contains
our property, and then reassigning that particular terminal’s value.
Note that we have modified our code from looking for a single object to expecting a list of
terminal objects. We now use the terms attribute instead of term.
It bears mentioning that in the general case, to locate code that uses the older SKILL constructs
we can simply grep for “term”, or even better, grep for term with the ~> operator in front of it.
This will locate areas in our code where we access the terminals on a net. We can also grep for
comments that might indicate terminal/net relationships.
In much the same manner as terminals and nets, we can now have multiple figures per pin. And
our SKILL must similarly anticipate that where a single object was returned in the past, we should
now be looking for a list of objects. In reality, while our old SKILL will still be supported, we
should consider updating the SKILL so that it correctly expects a list of figures on a pin, and
searches through those figures for the one in question.
Where should we look for SKILL to update?
This is a big topic, and one that will be covered in detail later on, as most of the changes we’ll see
will be in custom Pcell abutment code. This will be covered in detail in later phases of this course.
Other areas of SKILL that might be of concern would be connectivity transversal applications. For
example, a user might create a function that highlights specific shapes on a given net, and create a
halo shape, boundary, blockage, or similar operation. In the process, it’s necessary to find out all
of the shapes on the net, and this might be done through pins as well as through nets. In this case,
we should be aware of many shapes on a given pin, although it’s a much safer bet to obtain the
shapes directly from the net. Regardless, you’ll no doubt be familiar with code you’ve written,
and you can easily search for this type of operation in your SKILL.
There’s no difference creating figures through SKILL, with the exception that we have a new
function for creating path segments (which we’ve already covered).
As we’ve discussed, locating figures is where we see significant changes. Our old SKILL is still
supported, in that there is backward support for querying the “fig” attribute of a pin using the ~>
operator. However, as you can see in this example, the figure returned by querying the “fig”
attribute might be just one of many figures on the pin, and there is no way to ensure which figure
gets returned.
The only safe way to perform this query is to query the “figs” attribute instead. This returns the
full list of figures attached to the pin, and it’s up to me in my SKILL code to locate the correct
figure and then use that figure.
Manipulating figures is now a more complex process, as we can (and in some cases, need to) add
or subtract figures from pins. To do this, we have two new functions: dbAddFigToPin and
dbSubFigFromPin. Both of these functions are available and can be used in your SKILL code to
create a figure and then add it to the correct pin.
Make your code search for the correct figure instead of relying on
having the first figure returned.
“pin” or "pins"
"pin~>”
"~>pin"
We will be exploring the pin connectivity model in another chapter. When searching for pins, you
must be update your code to look at the pin figures instead of relying on a single pin and figure as
in CDB. The pin~>command will return the first database id in the figure list, this may not be the
figure your are looking for.
Finally, what should we grep for? Not surprisingly, we should grep for the word pin, ~>pin or
pin~>
Markers are also first-class objects in IC 6.1, as opposed to rectangles or polygons on a marker
layer in previous versions. They are also pervasive objects in the database, not an artifact of the
tool. That means that they are saved to the database when the design is saved. This is important as
in OpenAccess 2.2 all tools use the same representation for markers, and a tool can now
understand and manipulate markers created by another tool.
A marker has a severity attribute, which can vary in severity from annotation or information to
fatalError or unsupported. The user or tool is responsible for setting the severity of the marker.
Markers, in practice, behave exactly like they used to in previous versions. In fact, no migration is
necessary for SKILL API functions that created markers. They accept the same arguments as
before, return the same values, etc., but now they create OpenAccess 2.2. marker objects, and not
rectangles on the marker layer.
The function dbCreateMarker has been enhanced but is 100% backward compatible with IC
5.1.41 CDB SKILL. There’s really no need to change your SKILL functions at all.
In contrast to creating markers, locating markers has changed significantly since IC 5.1.41.
Whereas in the past, markers were regular shapes on a specific Layer-Purpose pair, markers are
distinct objects in the database, stored directly on a cellview. To access markers, we use the ~>
query operator
FigGroups
Clusters
Steiners
All are new in IC 6.1, and have never been supported by previous releases of DFII.
There are two new SKILL APIs for new objects in IC 6.1 that are noteworthy: FigGroups and
Clusters. Both have SKILL APIs for creating and manipulating these objects that are documented,
and both are accessible objects through the database in OpenAccess 2.2. This means that we can
access both objects through ~> access in a cellview, and there are attributes and properties that are
accessible as well.
It bears mentioning that because both of these new objects are brand new, it’s unlikely that there
will be any SKILL migration issues. But because SKILL these new features are present, we’ll
present the SKILL APIs for your use.
FigGroups are a new construct in DFII. A figGroup, or figure group, is a method of grouping
figures to create a virtual level of hierarchy in a cellview. Several figures (this includes shapes,
instances, boundaries, blockages, vias, and other objects) can be added to a figGroup, and once
this is done, they are now associated together. Actions can no longer be performed on the figure;
rather, any action that is performed on a shape that is part of a figGroup is now performed on the
entire figGroup. For example, moving, rotating, flipping, or other edits performed on the shape
will affect the entire figGroup.
Note that while it may appear, for all intents and purposes, that this figGroup is an instance, there
is no additional level of hierarchy created. All figures, as well as the figGroup, exist at the current
level of hierarchy. Figures can be grouped, ungrouped, and regrouped.
There is extensive support of figGroups through the SKILL API, as well as through all menu
commands. A figGroup is a native object in the OA2.2 database, and thus is fully accessible
through regular database access. FigGroups are stored on the cellview.
Editing FigGroups
dbAddFigToFigGroup(
dbGetFigGroupByName(cv
d_figGroupId
"myGroup")
d_figId
db:0x10355a12
)
=> t | nil
A V T V
The first step in using a figGroup in SKILL programming is to create one using the
dbCreateFigGroup function. The cellview, a unique name, a boolean to determine if the objects
contained in the list are specifically ordered, the origin and orientation are all required for creating
a figGroup. Once the figGroup is created, it must be populated with figures in the database. This
is done using the dbAddfigToFigGroup function.
Note that a figGroup is a logical object, in that it exists in parallel to the figures in the database.
Creating a figGroup, or more to the point, adding a figure to a figGroup does not delete the figure,
nor does removing a figure from a figGroup add a figure to the database. When a figure is added
to a figGroup, it is now a member of that figGroup, but both the figure and the figGroup exist in
parallel.
To find the figGroups in a cellview, you can query the cellview directly. The figGroups attribute
of a cellview returns the list of figGroup database objects for that cellview.
Example
We want to group all instances associated with an area of logic together in
a specific area.
Each instance is assigned to be a member of the cluster by the user or
a placement planning application.
Placement tool automatically locates instances on the cluster and
places them a cluster boundary
Clusters are another way of grouping instances together for placement purposes.
The clusters themselves do not create any particular orientation. Rather, a cluster is a container
object that contains several instances in a design. The classic example is that a cluster is
associated with a particular piece of logic in a standard cell digital design. Each instance is
assigned to the cluster, and during placement, the placer recognizes the cluster and plans the
instance placement appropriately.
Clusters are supported primarily by floorplanning tools. Since they are used to guide placement,
they may not be required for your custom design flow. Instances can be freely added to and
removed from clusters using the User Interface, but no SKILL access is provided for these actions.
More functions related to clusters will be supported in future releases.
A V T V
Cluster support in SKILL programming is limited to the ability to create a cluster using
dbCreateCluster and the ability to locate a cluster using dbFindClusterByName. Clusters can be
queried, and information about them can be obtained, but at this time, there are few ways that
clusters can be used and supported in IC 6.1.
Steiners are a logical concept in the database to indicate a branching point in interconnect. They
are usually generated in P&R tools either automatically or by designers, and are used to minimize
the length of a net when there are many branches of wires in the net. They are useful for assigning
an intermediate connection point on the route, from which it may branch outward. In OpenAccess,
elements of wires (which includes paths, pathSegs and vias) must connect to pins, vias, or
steiners. Steiners must have a location, but since they are logical constructs, they need not have a
layer. There is no “steiner” object in CDB, and thus, there are no migration challenges associated
with converting your code to use steiners. It is strictly an optional feature in your SKILL code, but
it is being presented as Steiners are new objects and have a SKILL interface.
We’ll see how we access Steiners through SKILL on the next slide.
A V T V
Steiners can be accessed in the cellview much like the other new objects. You can create a Steiner
using dbCreateSteiner, and the two required arguments are a cellview in which the Steiner is
created, and a list of two points which is a bounding box location of the Steiner. You can
optionally specify a layer to associate with the Steiner.
To locate the steiners in your design, you can query them directly from the cellview using the ~>
operator. They are stored directly on the cellview.
Appendix E
CDB OA
Editing lastInstancesChanged OA counter
Tool lastSchematicExtraction lastSchematicExtraction
System File Time Stamp File Time Stamp
Time stamps have changed significantly from CDB to OpenAccess (OA). Rather than using a
time stamp (which has a resolution of one second of time), OpenAccess uses integer counters to
track the version of a database object. These integer counters are implemented as properties on a
cellview that get incremented each time a save occurs or an edit takes place.
The advantage in doing this is that two events could conceivably occur in the space of a second,
especially when dealing with the faster tools in OpenAccess.
Time stamps are one of the few topics where SKILL® migration may require more effort on the
part of the migrating user. The main change is in the instancesLastChanged time stamp, this has
been eliminated. If you use this to check the connectivity, you can now use isConnCurrent.
IC 6.1
fileTimeStamp: time format (ex:
"Jul 11 02:48:20 2005" ) cv = dbOpenCellViewByType( libName cellName
modifiedCounter: counter format viewName )
printf("Netlisting for cellview: %s %s %s \n"
Tools must be changed to libName cellName viewName)
accept this method of printf(“ %n \n" cv~>modifiedCounter)
tracking changes.
when( cv
lastSchematicExtraction: Tool TriNetlist( cv )
created property that contains a dbClose( cv )
timestamp
) ; when
Fix by replacing attribute and
A V T V format string.
7/16/2012 SKILL Language Programming 570
File time stamps and tool created properties such as lastSchematicExtraction are still available to
the users.
File time stamps are created by the system and are still available.
When converting an object in CDB from one data type to another, DFII always returns the same
database object identifier. This may not be the same in OpenAccess. To avoid problems when
using a SKILL function to change an object’s data type, the return value of the function should be
stored in a variable for later use, rather than relying on the variable that contained the original
object.
Similarly, care must be taken when changing the name of an object in OpenAccess. Because an
object’s name can hold logical value (such as the name of an instance in an arrayed instance),
changing that value may cause warnings.
For example, a common shortcut in CDB for obtaining an instance from the database is to do the
following:
inst~>name = “I<0:4>” (Arrayed instance – different OA object type!)
In OpenAccess, you might inadvertently reassign the object type of the object. Instead of this
code, consider using the following instead:
newId = dbFindInstByName(“I<0:4>”)
1 2
4
Coincident/Collinear 6
points removed
5
vdd!
The OpenAccess database is a very efficient, compact database which is always optimized for
capacity. To accomplish this, all data that is created in the database is optimized to use as little
space as possible, and to be represented as efficiently as possible.
To accomplish this, the functions that create objects such as rectangles, polygons, lines, paths, and
other shapes will automatically check shapes when they are created to make certain that collinear
points, coincident points, zero-area polygons, and zero-area rectangles do not exist.
Cellviews which contain these shapes will either be corrected during translation (in the case of
collinear or coincident points) or can result in errors during translation (in the case of polygons
with retraced segments or zero-area shapes). It is always a good idea to check for these shapes in
cellviews prior to translation.
Pcells that create these illegal shapes will not function in DFII on OpenAccess. An error will
result and a “Pcell Eval Failed” message will result. To prevent this, fix the SKILL function that
creates the illegal shape.
These are the database files that store the design data.
If you use a function without first opening the bag, the function issues a
warning message
A V T V
The order in which data is stored in the CDB database will probably differ
from the order in which they are stored in OpenAccess.
Note: Relying on the order in which objects return is generally a bad idea.
When a group of objects (say, an array of Vias) is generated in OpenAccess, the order in which
they are generated initially differs from the order in which they will be stored. When the objects
are subsequently queried, the order in which they are returned will be more consistent than it was
in CDB.
As a general rule, it is not a good idea to rely on the order in which objects are returned in SKILL.
Data should be sorted if the order is important.
lpp~>layer =>db:0x3456e789
Querying an Instance
2. When querying the layer of a layer-purpose pair object, it is stored as “layer” instead of
“techLayer”. This is a change of an attribute name. Most users will not be impacted, as
most users obtain the layer object (not the LPP object), and obtain the layer name from it.
More to come …
A few function changes have taken place from CDB. Make sure to check the IC 6.1 Adoption
Guide for a complete list of all changes.
DBUperUU is now stored only in the techDB. In the past, DBUperUU was stored in the techDB,
on a library, or even on cellviews. Now, there is only one storage location for DBUperUU.
Specified BBox
Minimum BBox
Arc BBox
In CDB, the original bounding box provided by the user to define the arc was stored in the
database, regardless of how closely it fit the resulting arc.
OpenAccess automatically calculates the minimum bounding box for an arc when it is created and
stores that information in the database. This model approximates more closely the use model that
one would expect from the arc bounding box.
This will not impact most users. Users who use conics (microwave designers, optoelectronics
designers, etc.) might be impacted by this change.
IC 6.1
Start and stop angles:
Range from 0 to 2 π
Stored in double precision
dbObjects store angles as OA, not CDB
Selecting an Arc
When selecting an arc, the arc itself (not the bounding box) must overlap
the selection bbox.
This will not impact most users. Users who use conics (microwave designers, optoelectronics
designers, etc.) might be impacted by this change.
Be sure to check the IC 6.1 Adoption Guide for the latest list of dropped, technology, and other
functions that have been dropped from the release.
dbTech Functions
Most dropped functions were held over for backward compatibility with
version IC 4.3.x. These functions are no longer supported in IC 6.1.
All have replacement functions that work in IC 6.1 or they are obsolete.
Examples include: dbCloseTech, dbCreateLayer,
dbDeleteLayer, dbDeletePurposeByName
techObj Functions
They are private to the techfile and redundant
They all begin with techObj.
Examples: techObjOpenTechFile, techObjCreateLP
SKILL users that intend to add fields to existing forms should expect
changes.
When adding fields, the form size will need to change.
formId~>initialSize = bigger value
When a field is added to the form the 6.1 hi layer expands the existing table
field so it overlaps the new fields.
If I first get the location of the table field before I add fields I can reset the
fields back to their original location after inserting the new fields
(hiGetFieldInfo(form 'field))
Reset with hiResizeField(form 'field list(width height [promptbox])
When it is resized, the field no longer overlaps even after resizing the form.
Result:
Malformed
Fields
Checks form and field creation commands for height of field values
Outputs
Info – If the field height is set by a variable, an info statement is issued.
INFO (hiCreateField): formProblem.il, line 112 (ADCcheckLayoutCellForm)
: hiCreateToggleField has a variable for the field height. If the value
is 0, the form in IC 6.1 will be distorted
Is there a SKILL function that returns the full version of the Cadence tools?
getVersion()
=> “@(#)$CDS: icfb.exe version 6.1 09/13/2006 ...”
getVersion(“<any string>”)
ex: getVersion(“a”) => “sub-version IC 6.1.0EA.162.20”
Is there a function to check the database type to make sure it’s using the correct
plugin?
Appendix F
That said…
It’s useful.
Most users find that it meets their needs and runs safely.
Therefore,
Read each file carefully and understand each line of the SKILL code or
shell script.
Test the function on a “safe” library first.
ALWAYS Make a backup.