Cadence SKILL
Cadence SKILL
Cadence SKILL
Programming
Version 5.0
Lecture Manual July 26, 2002
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
1990-2002 Cadence Design Systems, Inc. All rights reserved.
Printed in the United States of America.
Cadence Design Systems, Inc., 555 River Oaks Parkway, San Jose, CA 95134, USA
Cadence Trademarks
Alanza SM HDL-ICE® Radium™
Allegro® how big can you dream?™ SignalStorm™
Ambit® Integration Ensemble™ Silicon Ensemble®
Assura™ MegaSim™ SoC Encounter™
BuildGates® Mercury™ SourceLink® online customer support
Cadence® (brand and logo) NC-Verilog® SPECCTRA®
CeltIC™ OpenBook® online documentation library SPECCTRAQuest™
ClockStorm™ Orcad® Spectre®
CoBALT™ Orcad Capture® TtME®
Concept® Orcad Layout® Vampire®
Connections® Palladium™ Verifault-XL®
Diva® Pearl® Verilog®
Dracula® PowerSuite™ Verilog®-XL
ElectronStorm™ PSpice® Virtuoso®
Fire & Ice® Q/Bridge® VoltageStorm™
First Encounter® QPlace®
FormalCheck® Quest®
Gate Ensemble® Quickturn®
Other Trademarks
All other trademarks are the exclusive property of their respective owners.
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’s customer in
accordance with, a written agreement between Cadence and its customer. 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Table of Contents SKILL Language Programming
Table of Contents
SKILL Language Programming
www.cadfamily.com
July 26, 2002 EMail:[email protected]
Cadence Design Systems, Inc. iii
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Language Programming Table of Contents
Module 4 Windows
www.cadfamily.com
iv EMail:[email protected]
Cadence Design Systems, Inc. July 26, 2002
The document is for study only,if tort to your rights,please inform us,we will delete
Table of Contents SKILL Language Programming
Module 6 Menus
Module 7 Customization
www.cadfamily.com
July 26, 2002 EMail:[email protected]
Cadence Design Systems, Inc. v
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Language Programming Table of Contents
www.cadfamily.com
vi EMail:[email protected]
Cadence Design Systems, Inc. July 26, 2002
The document is for study only,if tort to your rights,please inform us,we will delete
Table of Contents SKILL Language Programming
www.cadfamily.com
July 26, 2002 EMail:[email protected]
Cadence Design Systems, Inc. vii
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Language Programming Table of Contents
www.cadfamily.com
viii EMail:[email protected]
Cadence Design Systems, Inc. July 26, 2002
The document is for study only,if tort to your rights,please inform us,we will delete
Table of Contents SKILL Language Programming
www.cadfamily.com
July 26, 2002 EMail:[email protected]
Cadence Design Systems, Inc. ix
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Language Programming Table of Contents
www.cadfamily.com
x EMail:[email protected]
Cadence Design Systems, Inc. July 26, 2002
The document is for study only,if tort to your rights,please inform us,we will delete
Table of Contents SKILL Language Programming
www.cadfamily.com
July 26, 2002 EMail:[email protected]
Cadence Design Systems, Inc. xi
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Language Programming Table of Contents
Module 18 OpenAccess
www.cadfamily.com
xii EMail:[email protected]
Cadence Design Systems, Inc. July 26, 2002
The document is for study only,if tort to your rights,please inform us,we will delete
Module 1: About This Course
Objectives
■ Itemize the course modules.
■ Outline the schedule.
■ Explain what is expected and supplied in the lab exercises.
■ Describe SKILL documentation.
■ Learn about the Cadence online documentation utilities.
■ Use the Cadence Finder to identify the available SKILL functions.
■ Itemize the libraries used in the course.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
SKILL SKILL is a LISP like language with C IO structures. SKILL
extends and enhances the functionality of Cadence tools.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-2
About This Course 1-3
Day 1 Day 2
Fundamentals Menus
Lunch Lunch
Lists Customization
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Introduction to SKILL Overview
# Module Purpose or Objective
1 About This Course Orientation to the course and SKILL documentation.
2 Beginning to Use Survey the role of the SKILL Evaluator in the Design
SKILL Framework II environment. Survey SKILL data types and
syntax.
3 Lists Build SKILL lists.
Retrieve data from SKILL lists.
4 Windows Manipulate Design Framework II windows.
Open Design Framework II application windows.
Define application bindkeys.
5 Queries Query Design Framework II cellviews.
6 Menus Build pop-up and pull-down menus.
7 Customization Survey the .cdsinit file.
8 Defining Learn to define a SKILL function.
SKILL Functions Define global and local variables.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-4
About This Course 1-5
Data Models
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Programming Overview
# Module Purpose or Objective
9 Flow of Control Use the branching capabilities of the SKILL language.
10 File I/O Read and write UNIX text files.
11 SKILL Development Survey the utilities in the SKILL Development Environment.
12 List Construction Use advanced techniques to build SKILL lists.
13 Data Models Survey the cellview database model.
14 User Interface Build dialog boxes, list boxes, and forms.
15 Customization Customize application user interfaces.
16 Interprocess Launch a child UNIX process.
Communication (IPC)
17 Data Structures Learn advanced data structures, such as arrays, associative
arrays, and SKILL structures.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-6
About This Course 1-7
Lab Exercises
There are two types of labs in this course—operational and programming.
■ Operational exercises
— Enter an example SKILL expression into the Command Interpreter and
observe the results.
Modify the example.
— Examine and run source code.
Solutions to questions are usually on the next page.
■ Programming exercises
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.
Sample solutions Study a solution that follows the
recommendations.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Exercises
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-8
About This Course 1-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-10
About This Course 1-11
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Searching Cadence Documents
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-12
About This Course 1-13
Search Operators
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Search Operators
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-14
About This Course 1-15
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-16
About This Course 1-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The SKILL Documentation Set
SKILL Language Reference Manual
SKILL User Guide
User Interface SKILL Functions
Design Framework II SKILL Functions
Custom Layout/Physical Verification SKILL Functions
IC Design Entry & Simulation Environment SKILL Functions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-18
About This Course 1-19
The Finder
The Finder provides quick online help for the core SKILL language functions. It
displays the syntax and a brief description for each SKILL function.
Example description of the strcat function:
strcat( t_string1 [t_string2 t_string3 ...] ) => t_result
Takes input strings and concatenates them.
The Finder contains the same information as the SKILL Quick Reference Guide.
You can save the online documentation to a file.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The Finder
The 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.
To use the Finder, follow these steps:
1. Specify a name pattern in the Search String pane.
2. Click the Search button.
3. Select a function in the Matches window pane.
The Finder displays the abbreviated documentation for the selected function.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-20
About This Course 1-21
Lab Overview
There are no labs for this module.
This rest of this course uses libraries from the Cell Design Tutorial.
If you’re interested, you can use the Cadence Online Documentation to access
the Cell Design Tutorial.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
The file ~/SKILL/cds.lib for this course contains the following information:
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-22
About This Course 1-23
Module Summary
In this module, we
■ Itemized the course modules.
■ Outlined the schedule.
■ Examined the format of the lab exercises.
■ Described SKILL documentation.
■ Identified the role of Cadence online documentation in accessing
documentation.
■ Previewed the Cadence Finder.
■ Discussed the libraries used in the course.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 1-24
Module 2: Beginning to Use SKILL
Objectives
■ Start the Design Framework II environment.
■ Examine the Command Interpreter Window (CIW).
■ Narrate the role of the SKILL Evaluator.
■ Examine the CDS.log file.
■ Summarize SKILL syntax.
■ Display data in the CIW output pane.
■ Get the most out of SKILL error messages.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-2
Beginning to Use SKILL 2-3
What Is SKILL?
SKILL is a high-level, interactive programming language.
SKILL is the command language of the Design Framework II environment.
Whenever you use forms, menus, and bindkeys, the Design Framework II
software calls SKILL functions to complete your task.
You can enter SKILL functions directly into the CIW input pane to bypass the
normal user interface.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What Is SKILL?
SKILL was developed from the language LISP (LISt Processing language). To learn more
about the SKILL interpreter core language you can consult literature pertaining to LISP or
SCHEME (a newer implementation of language very similar to LISP).
The IO used in SKILL is that of C. Those of you familiar with Fortran will also see a strong
resemblance.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-4
Beginning to Use SKILL 2-5
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What Can SKILL Functions Do?
The Return Value of a SKILL Function
All SKILL functions compute a data value known as the return value of the function. You can
■ Assign the return value to a SKILL variable.
■ Pass the return value to another SKILL function.
Any SKILL data can become a return value.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-6
Beginning to Use SKILL 2-7
Note: In the table above <cds> represents the name of your executable.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Starting the Design Framework II Environment
Graphic Sessions
In a graphic session, the Command Interpreter Window (CIW) is the first window you see.
Nongraphic Sessions
A nongraphic session is useful when you are using an ASCII terminal or modem or do not
require graphics. For example, without graphics you still can open designs into virtual
memory to query and update them.
After you launch a nongraphic session in an xterm window, the xterm window expects you to
enter SKILL expressions.
During a nongraphic session, the Cadence® Design Framework II environment suppresses any
graphic output. It does not create any windows.
Replaying Sessions
When replaying a session, the Design Framework II environment evaluates all the SKILL
expressions contained in the -replay transcript file.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-8
Beginning to Use SKILL 2-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Initializing the Design Framework II Environment
The site administrator has three ways of controlling the user customization.
Policy Customization Strategy
The site administrator does all The <install_dir>/tools/dfII/local/.cdsinit
customization. contains all customization commands.
There are no ./.cdsinit or ~/.cdsinit files
involved.
The administrator does the site The <install_dir>/tools/dfII/local/.cdsinit
customization. The user can file contains a command to load the
add further customization. ./.cdsinit or ~/.cdsinit files.
The user does all the The <install_dir>/tools/dfII/local/.cdsinit
customization. file does not exist.
All customization is handled by either the
./.cdsinit or ~/.cdsinit files.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-10
Beginning to Use SKILL 2-11
Prompt pane
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Command Interpreter Window
In a graphic session, the Command Interpreter Window (CIW) is the first window you see.
CIW Area Description
Window manager title The title indicates the name of the transcript log file
Window menu banner The window banner contains several pull-down menus and a
HELP button.
Output pane This pane displays information from the session log file. You can
control the kind of information the output pane displays.
Input pane You can enter one or more SKILL expressions on this single line.
When you type a carriage return in this pane, your input line is sent
to the SKILL Evaluator.
Mouse button cues When you enter data, this pane indicates the action available to
you through the three mouse buttons. Other keys can also have a
special meaning at this time.
Prompt pane The pane displays the command prompt. When you enter data the
prompt indicates what you need to do next.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-12
Beginning to Use SKILL 2-13
Bindkey WAIT
Menu Item
Read SKILL Expression
Form
Loading a File
SKILL Evaluator
Error?
CIW Input Pane
UNIX Process
\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()
\o Old value: 2 New Value: 3 user type-in SKILL expression
\t 3 SKILL expression output
SKILL expression’s return value
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The CDS.log File
The definition of the TrBump function is:
procedure( TrBump( )
printf( "Old value: %d New Value: %d\n" x ++x ) x )
The following SKILL expression defines the <Key>F7 bindkey for the CIW.
hiSetBindKey(
"Command Interpreter" "<Key>F7" "TrBump()" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-16
Beginning to Use SKILL 2-17
Tag Description
\p The prompt displayed in the CIW. This identifies the boundary
between two user-level commands.
\i A SKILL expression that the user typed into the CIW.
\o The output, if any, that the SKILL expression generates.
\w The warnings, if any, that the SKILL expression generates.
\e The error, if any, that the SKILL expression caused.
\t The return value for a SKILL expression that the user typed into
the CIW.
\a The SKILL expression activated by a bindkey or menu item.
\r The return value for a SKILL expression activated by a bindkey or
menu item.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The CDS.log File Code
When you replay a log file the replay function interprets each of these log file codes and passes
those that represent input to the SKILL interpreter.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-18
Beginning to Use SKILL 2-19
■ From the CIW, use the Options—Log Filter command to display the Set
Log File Display Filter form.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-20
Beginning to Use SKILL 2-21
Data
Each SKILL data type has an input syntax and a print representation.
■ You use the input syntax to specify data as an argument or to assign a value
to a variable.
■ SKILL 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.
Data Type Input Syntax Print Type Example
Representation Character Variable
integer 5 5 x x_count
floating point 5.3 5.3 f f_width
text string "this is text" "this is text" t t_msg
list ’( 1 "two" 3 4 ) ( 1 "two" 3 4 ) l l_items
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Data
When using the SKILL documentation to look up function details you see the type character
used as the start of the arguments. This tells you the variable type that the argument expects.
The type Function
To determine the type of a variable you use the type function.
The type function categorizes the data type of its single argument. The return value designates
the data type of the argument.
Examples:
type( 4 ) => fixnum /* an integer */
type( 5.3 ) => flonum /* a floating point number */
type( "mary had a little lamb" ) => string /* a string */
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-24
Beginning to Use SKILL 2-25
Variables
You do not need to declare variables in SKILL. The SKILL Evaluator creates a
variable the first time you use it.
Variable names can contain
■ alphanumeric characters
■ underscores ( _ )
■ question marks
The first character of a variable cannot be a digit or a question mark.
Use the assignment operator to store a value in a variable. Enter the variable
name to retrieve its value.
This example uses the type function to verify the data type of the current value of
the variable.
lineCount = 4 => 4
lineCount => 4
type( lineCount ) => fixnum
lineCount = "abc" => "abc"
lineCount => "abc"
type( lineCount ) => string
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Variables
SKILL allows both global and local variables. In Module 8 see, Grouping Expressions with
Local Variables.
SKILL Symbols
SKILL 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-26
Beginning to Use SKILL 2-27
Function Calls
Function names are case sensitive.
SKILL syntax accepts function calls in three ways:
■ State the function name first, followed by the arguments in a pair of
matching parentheses.
No spaces are allowed between the function name and the left
parenthesis.
strcat( "mary" " had" " a" " little" " lamb" )
=> "mary had a little lamb"
■ Alternatively, you can place the left parenthesis to the left of the function
name.
( strcat "mary" " had" " a" " little" " lamb" )
=> "mary had a little lamb"
■ For SKILL function calls that are not subexpressions, you can omit the
outermost levels of parentheses.
strcat "mary" " had" " a" " little" " lamb"
=> "mary had a little lamb"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-28
Beginning to Use SKILL 2-29
Multiple Lines
A literal text string cannot span multiple lines.
Function calls
■ You can span multiple lines in either the CIW or a source code file.
strcat(
"mary" " had" " a"
" little" " lamb" ) => "mary had a little lamb"
SKILL implicitly combines several SKILL expressions on the same line into a
single SKILL expression.
■ The composite SKILL expression returns the return value of the last SKILL
expression.
■ All preceding return values are ignored.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Multiple Lines
You can span multiple lines with a single command. You need to 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"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-30
Beginning to Use SKILL 2-31
A single SKILL function can have all three kinds of arguments. But the majority of
SKILL functions have the following type of arguments:
■ Required arguments with no optional arguments
■ Keyword arguments with no required and no optional arguments
Optional Arguments
You do not have to provide the optional arguments. Each optional argument has a default
value. If you provide an optional argument, you must provide all the preceding optional
arguments in order.
view( t_file [g_boxSpec][g_title][g_autoUpdate ][l_iconPosition] )
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-32
Beginning to Use SKILL 2-33
Operators
SKILL provides operators that simplify writing expressions. Compare the
following two equivalent SKILL expressions.
( 3**2 + 4**2 ) **.5 => 5.0
expt( plus( expt( 3 2 ) expt( 4 2 )) .5 ) => 5.0
For more information, check the online documentation and search for preincrement.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-34
Beginning to Use SKILL 2-35
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Tracing Operator Evaluation
The trace function shows the order and intermediate results of operator evaluation.
SKILL Output Explanation
>tracef(t The user executes the trace function to turn on tracing.
t The SKILL evaluator acknowledges successful
completion of the function.
(3+4)*5 The user enters an expression for evaluation.
|(3 + 4) The SKILL evaluator begins evaluation starting from
left to right.
|plus --> 7 The SKILL evaluator executes the "plus" function
resulting in 7.
|(7 * 5) The 7 is returned to the original expression replacing ( 3
+4)
|times --> 35 The "times" function is executed resulting in 35.
35 The result of the expression evaluation is returned.
> The SKILL evaluator is listening for the next command.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-36
Beginning to Use SKILL 2-37
Lab Overview
Lab 2-1 Using the Command Interpreter Window
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-38
Beginning to Use SKILL 2-39
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying Data in the CIW
The print and println Functions
Both the print and println functions return nil.
This nongraphic session transcript illustrates println.
> x = 8
8
> println( x )
8
nil
>
This nongraphic session transcript shows an attempt to use the println function to print out an
intermediate value 3+4 during the evaluation of (3+4)*5. The println’s return value of nil
causes the error.
> println(3+4)*5
7
*Error* times: can't handle (nil * 5)
>
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-40
Beginning to Use SKILL 2-41
The %L directive specifies the default format. Use the print representation for
each type to display the value.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying Data with Format Control
The printf Function
If the conversion control directive is inappropriate for the data item, printf gives you an error
message.
> printf( "%d %d" 5 6.3 )
*Error* fprintf/sprintf: format spec. incompatible with data - 6.3
>
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.
> aList = '(1 2 3)
(1 2 3)
> printf( "This is a list: %L\n" aList )
This is a list: (1 2 3)
t
>
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-42
Beginning to Use SKILL 2-43
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Solving Common Problems
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-44
Beginning to Use SKILL 2-45
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What If the CIW Doesn’t Respond?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-46
Beginning to Use SKILL 2-47
Examples
A SKILL function to concatenate several strings
strcat ( "mary" " had" " a" " little" " lamb")
*** Error in routine eval:
Message: *Error* eval: illegal function mary
An assignment to a variable
greeting = strcat ( "happy" " birthday" )
*** Error in routine eval:
Message: *Error* eval: unbound variable strcat
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
White Space Sometimes Causes Errors
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-48
Beginning to Use SKILL 2-49
Examples
The strcat function does not accept numeric data.
strcat( "mary had a" 5 )
Message: *Error* strcat: argument #2 should be either
a string or a symbol (type template = "S") - 5
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Passing Incorrect Arguments to a Function
Use the Cadence Finder to verify the following information for a SKILL function:
■ The number of arguments that the function expects.
■ The expected data type of each argument.
The following table summarizes some of the characters in the type template which indicate the
expected data type of the arguments. The Cadence Finder and the Cadence online SKILL
documentation follow the same convention.
Character in Expected
Type Template Data Type
x integer
f floating point
s variable
t text string
S variable or text string
g general
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-50
Beginning to Use SKILL 2-51
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-52
Beginning to Use SKILL 2-53
Module Summary
This module
■ Introduced SKILL, the command language for the Design Framework II
environment.
■ Defined what user interface action sends SKILL expressions to the SKILL
Evaluator.
■ Explored SKILL data, function calls, variables, and operators.
■ Showed you ways to solve common problems.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 2-54
Module 3: SKILL Lists
Objectives
■ Build lists
■ Retrieve list elements
■ Use lists to represent points and bounding boxes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-2
SKILL Lists 3-3
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What Is a SKILL List?
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-4
SKILL Lists 3-5
To display a list as a return value, SKILL splits the list across multiple lines when
the list:
■ contains sublists.
■ has more than _itemsperline number of items.
Use the printf or println functions to display a list. SKILL displays the output on a
single line.
Consider the examples shown below based on these assignments. The output is
taken from a nongraphical session.
aList = '( 1 2 3 )
aLongList = '( 1 2 3 4 5 6 7 8 )
aNestedList = '( 1 ( 2 3 ) 4 5 ( 6 7 ))
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
How SKILL Displays a List
> aList = '( 1 2 3 )
(1 2 3)
> println( aList )
(1 2 3)
nil
> printf( "This is a list: %L\n" aList )
This is a list: (1 2 3)
t
> aLongList = '( 1 2 3 4 5 6 7 8 )
(1 2 3 4 5
6 7 8
)
> println( aLongList )
(1 2 3 4 5 6 7 8)
nil
> printf( "This is a list: %L\n" aLongList )
This is a list: (1 2 3 4 5 6 7 8)
t
>aNestedList = '( 1 ( 2 3 ) 4 5 ( 6 7 ))
(1
(2 3) 4 5
(6 7)
)
> println( aNestedList )
(1 (2 3) 4 5 (6 7))
nil
> printf( "This is a list: %L\n" aNestedList )
This is a list: (1 (2 3) 4 5 (6 7))
t
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-6
SKILL Lists 3-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating New Lists
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-8
SKILL Lists 3-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Adding Elements to an Existing List
The cons Function
The construct (cons) function adds an element to the beginning of an existing list. This
function takes two arguments. The first is the new element to be added. The second is the list
to add the element to. The result of this function’s execution is a list containing one more
element than the input list.
Store the return result from cons in a variable. Otherwise, you cannot refer to the list
subsequently. It is common to store the result back into the variable containing the target list.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-10
SKILL Lists 3-11
Points of Confusion
People often think that nil, cons, and the append functions violate common sense.
Here are some frequently asked questions.
Question Answer
What is the difference nil is a list containing nothing. Its length is 0.
between nil and ’( nil )? ’( nil ) builds a list containing the single
element nil. The length is 1.
How can I add an element to Use the append and list functions.
the end of a list? aList = ’( 1 2 )
aList = append( aList list( 3 )) => ( 1 2 3 )
Can I reverse the order of You either get different results or an error.
the arguments to the cons cons( ’( 1 2 ) ’( 3 4 ) ) => ( ( 1 2 ) 3 4 )
function? Will the results be cons( ’( 3 4 ) ’( 1 2 )) => ( ( 3 4 ) 1 2 )
the same? cons( 3 ’( 1 2 ) ) => ( 3 1 2 )
cons( ’( 1 2 ) 3 ) =>
*** Error in routine cons
*Error* cons: argument #2 should be a list
What is the difference cons( ’( 1 2 ) ’( 3 4 ) ) => ( ( 1 2 ) 3 4 )
between cons and append? append( ’( 1 2 ) ’( 3 4 ) ) => ( 1 2 3 4 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Points of Confusion
Question Answer
What is the difference nil is a list containing nothing. Its length is 0.
between nil and ’( nil )? ’( nil ) builds a list containing a single element. The length
is 1.
How can I add an element to Use the list function to build a list containing the individual
the end of a list? 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 Common sense suggests that simply reversing the elements
arguments to the cons to the cons function will put the element on the end of the
function? Will the results be list. This is not the case.
the same?
What is the difference The cons function requires only that its second argument be
between cons and append? 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-12
SKILL Lists 3-13
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Working with Existing Lists
The nth Function
Lists in SKILL are numbered from 0. The 0 element of a list is the first element, the 1 element
of a list is the second element and so on.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-14
SKILL Lists 3-15
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-16
SKILL Lists 3-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Frequently Asked Questions
Questions Answers
Why are such critical car and cdr were machine language instructions on the first
functions as car and cdr machine to run Lisp. car stands for contents of the address
called such weird names? register and cdr stands for contents of the decrement register.
What is the purpose of the Lists are stored internally as a series of doublets. The first
car and cdr functions? element is the list entry, 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
search all levels in a member function follows right branches until it locates a
hierarchical list? branch point whose left branch dead ends in the element.
How does the setof The setof function makes a new list by copying only those
function work? What is top-level elements in a list that pass a test. The test must be
the variable x for? written in terms of a single variable. The first parameter to the
setof function identifies the variable you are using in the test.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-18
SKILL Lists 3-19
Two-Dimensional Points
SKILL represents a two-dimensional point as a two-element list.
The binary operator (:) builds a point from an x-value and a y-value.
xValue = 300
yValue = 400
P = xValue:yValue => ( 300 400 )
The xCoord and yCoord functions access the x-coordinate and the y-coordinate.
y-axis
P = 300:400
400
x-axis
300
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Two-Dimensional Points
The : Operator
You can use the ’ operator or list function to build a coordinate.
P = ’( 3.0 5.0 )
P = list( xValue yValue )
The : operator expects both of its arguments to be numeric. The range function implements
the : operator.
> "hello":3
*Error* range: argument #1 should be a number
(type template = "n") - "hello"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-20
SKILL Lists 3-21
Computing Points
The : operator combines naturally with arithmetic operators. It has a lower
precedence than the + or the * operator.
3+4*5:4+7*8 => (23 60)
Q = xCoord(P)+dx:yCoord( P)+dy
dy
P
x-axis
dx
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Computing Points
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-22
SKILL Lists 3-23
Bounding Boxes
SKILL represents a bounding box as a two-element list. The first element is the
lower-left corner and the second element is the upper-right corner.
y-axis
ur = 500:450
ll = 300:400
x-axis
This is returned to you by the system as: ( ( 300 400 ) ( 500 450 ) )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Bounding Boxes
Remember that : is a point operator.
’(300:400 500:450) does not create a list of two lists since the : operator is not evaluated.
Use list( 300:400 500:450) which will evaluate the point and thus create a list containing two
lists and so, in this case, also a bounding box.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-24
SKILL Lists 3-25
ll = 300:400 ur = 500:450
bBox = list( ll ur ) =>
(( 300 400 ) ( 500 450 ))
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating a Bounding Box
When you create a bounding box, put the points in the correct order. When SKILL prompts
the user 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 ))
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-26
SKILL Lists 3-27
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Retrieving Elements from Bounding Boxes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-28
SKILL Lists 3-29
Lecture Exercises
The exercises on the next few pages illustrate techniques for manipulating
bounding boxes:
■ Offsetting a box
■ Finding the smallest bounding box
■ Finding the intersection of two bounding boxes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lecture Exercises
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-30
SKILL Lists 3-31
Offsetting a Box
Assume the variable Box contains the lower-left bounding box. The upper-right
box is the same size as the lower-left box.
Using variables, write an expression for the upper-right bounding box.
y-axis
dy
dx x-axis
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
3-32 SKILL Language Programming 7/26/02
x-axis
Use the xCoord, yCoord, lowerLeft, and upperRight functions in the following
template.
boxLL = min( ... ... ):min( ... ... )
boxUR = max( ... ... ):max( ... ... )
list( boxLL boxUR )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
3-34 SKILL Language Programming 7/26/02
y-axis
x-axis
Use the xCoord, yCoord, lowerLeft, and upperRight functions in the following
template.
boxLL = max( ... ... ):max( ... ... )
boxUR = min( ... ... ):min( ... ... )
list( boxLL boxUR )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
3-36 SKILL Language Programming 7/26/02
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Combinations car and cdr Functions
Using the xCoord, yCoord, lowerLeft and upperRight functions is preferable in practice to
access coordinates, bounding boxes, and paths.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-38
SKILL Lists 3-39
Lab Overview
Lab 3-1 Building Lists
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-40
SKILL Lists 3-41
Module Summary
This module covered the following:
■ SKILL lists can contain any type of SKILL data. nil is the empty list.
■ Use the ’ operator and the list function to build lists.
■ Use the cons and append functions to build lists from existing lists.
■ Use the length function to count the number of elements in a list.
■ Use the member function to find an element in an existing list.
■ Use the setof function to filter a list according to a condition.
■ Two-dimensional points are represented by two element lists.
■ Bounding boxes are also represented by two element lists.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 3-42
Module 4: Windows
Objectives
■ Understand the window ID data type.
■ Open design windows.
■ Define application bindkeys.
■ Open read-only text windows.
■ Manage windows.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-2
Windows 4-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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Design Framework II Windows
The hiGetWindowList Function
The hiGetWindowList function returns a list of the window IDs of the existing Design
Framework II windows.
hiGetWindowList() => ( window:1 window:2 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-4
Windows 4-5
The following expression displays the Open File form with the Library Name field
set to master.
geOpen( ?lib "master" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Opening a Design Window
The geOpen Function
The geOpen function requires keyword parameter passing. Precede each argument with the
corresponding keyword. Keywords correspond to the formal arguments.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-6
Windows 4-7
Using Bindkeys
Bindkeys make frequently used commands easier for the user to execute.
There are several different uses for bindkeys:
■ To initiate a command, such as the Zoom In command.
■ To use the mouse during a command to enter points.
■ To perform subsidiary actions, such as panning the window, during a
command.
A bindkey associates a SKILL expression with a key or mouse button.
When the mouse cursor is in an application window, and the user presses a key
or mouse button, SKILL evaluates the bindkey expression.
Each application can associate different SKILL expressions with the same key or
mouse button.
While the user digitizes points during a command, a key or mouse button can
trigger a different SKILL expression than it normally does.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using Bindkeys
This example illustrates the different uses of bindkeys.
1. With the mouse cursor in a Layout Editor window, the user presses the z key.
The Zoom In command starts.
2. The user clicks the left mouse button to indicate the first corner of the region to zoom.
3. The user presses the Tab key.
The Pan command starts.
4. The user clicks the left mouse button to indicate the center point of the pan command.
The Pan command finishes.
5. Finally, to indicate the second corner of the region, the user clicks the left mouse button
again.
The Zoom In command finishes.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-8
Windows 4-9
Defining Bindkeys
When you define a bindkey, you specify the following information:
■ The application type, which identifies the application by means of a text
string. Typical application types include the following:
— "Command Interpreter"
— "Layout"
— "Schematics"
— "Graphics Browser"
■ The keyboard or mouse event that triggers the SKILL expression. Typical
events include the following:
— Press the a key.
— Press the left mouse button.
— Draw through with the left mouse button.
■ 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Defining Bindkeys
The hiGetAppType Function
Use the hiGetAppType function to determine the appropriate application type.
hiGetAppType( window( 1) ) =>
"Command Interpreter"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-10
Windows 4-11
Describing Events
To determine the syntax to describe an event, do one of the following:
■ Study the Cadence online documentation.
■ Display the bindkeys for an application that uses the event.
Examples
Event Description Event Syntax
The user pressed the a key. "<Key>a"
The user clicked the left mouse "<Btn1Down>"
button.
The user draws through an area with "<DrawThru1>"
the left mouse button.
While holding down shift and control "Shift Ctrl<Btn2Down>(2)"
keys, the user double clicked the
middle mouse button.
To limit the event to entering points, append EF to the event syntax as in this
example:
"<Btn1Down>EF"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Describing Events
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 SKILL 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-12
Windows 4-13
Displaying Bindkeys
To display the current bindings for the application, perform these steps:
1. In the CIW, use the Options—Bind Key command to display the Key or
Mouse Bindings form.
2. In the Application Type Prefix cyclic field, choose the name of the
application.
3. Click the Show Bind Keys button.
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?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying Bindkeys
The hiGetBindKey Function
Use the hiGetBindKey function to determine the SKILL command associated with a mouse or
keyboard event.
hiGetBindKey( "Schematics" "None<Btn1Down>" ) =>
"schSingleSelectPt()"
hiGetBindKey( "Schematics" "<Key>z" ) => "hiZoomIn()"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-14
Windows 4-15
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Standard Bindkey Definitions
The alias Function
Use this function to give a more convenient name to a SKILL function. This example gives
the shorter name bk to the hiSetBindKey function.
alias( bk hiSetBindKey )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-16
Windows 4-17
Example
This example displays the Composer bindkey file.
view(
prependInstallPath( "samples/local/schBindKeys.il" )
)
Example
This example displays the same file in a window entitled Schematics
Bindkeys.
view(
prependInstallPath("samples/local/schBindKeys.il" )
;; path to file
’((406 506) (1032 806)) ;;; window bounding box
"Schematics Bindkeys" ;;; window title
) EMail:[email protected]
www.cadfamily.com => window:6
The document is for study only,if tort to your rights,please inform us,we will delete
Opening a Text Window
The view Function
The view function takes several optional arguments.
Argument Status Type Meaning
file required text Pathname
winSpec optional bounding box/ Bounding box of the window
nil 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 will update 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-18
Windows 4-19
Manipulating Windows
1
3
Virtuoso...
5
X
1140
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Manipulating Windows
Naming Windows
■ The hiGetWindowName Function
Use the hiGetWindowName function to retrieve a window title.
hiGetWindowName( window(5)) => "Virtuoso ... "
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-20
Windows 4-21
Resizing Windows
The origin of the screen coordinate system is the lower-left corner.
The unit of measurement for screen coordinates is a pixel.
Y
hiResizeWindow( window( 3) list( 300:50 1000:600 ))
870
X
1140
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Resizing Windows
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-22
Windows 4-23
Iconifying Windows
870
3
hiIconifyWindow( window( 3 ) )
X
1140
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Iconifying Windows
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-24
Windows 4-25
Lab Overview
Lab 4-1 Opening Windows
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-26
Windows 4-27
Module Summary
In this module, we discussed
■ The window ID data type.
■ Opening design windows.
■ Defining application bindkeys.
■ Opening read-only text windows.
■ Managing windows.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 4-28
Module 5: Database Queries
Objectives
■ Use SKILL to query design databases.
— What is the name of the design in the current window?
— How many nets are in this design?
— What are the net names?
— Are there any instances in this design? If so, how many?
— Are there any shapes in this design? If so, how many?
■ Understand database object concepts.
■ Use the ~> operator to retrieve design data.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-2
Database Queries 5-3
Database Objects
You can use SKILL to access schematic, symbol, and mask layout design data.
■ Physical information (rectangles, lines, and paths)
■ Logical information (nets and terminals)
SKILL organizes design data in virtual memory in terms of database objects.
Each database object belongs to an object type that defines a set of common
attributes that describe the object.
The set of object types and their attributes is fixed by Cadence.
This module presents several object types and some of their attributes.
■ the cellView object type
■ the inst object type
■ the net object type
■ the Figure object types with their common attributes
■ the Shape object types with their common attributes
Each database object can have one or more user-defined properties.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Database Objects
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-4
Database Queries 5-5
Querying a Design
When the design is in a graphics window, use the geGetWindowCellView function
to retrieve the database object for the design as in this example.
geOpen(
?lib "master"
?cell "mux2"
?view "schematic"
?mode "r" ) => window:7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Querying a Design
The geGetWindowCellView Function
See the Cadence online documentation to read about this function.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-6
Database Queries 5-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The ~> Operator
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-8
Database Queries 5-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Querying Designs with the ~> Operator
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-10
Database Queries 5-11
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The cellView Object Type
The cellView object type includes the following attributes among others:
Attribute Data Type Description
objType String "cellView"
libName String The library name of the design.
cellName String The cell name of the design.
viewName String The view name of the design.
cellViewType String The type of design data. Examples
include "schematic", "maskLayout",
and "schematicSymbol".
instances List of The list of instances in the design.
database objects Can be nil.
shapes List of The list of shapes in the design.
database objects Can be nil.
nets List of The list of nets in the design.
database objects Can be nil.
terminals List of The list of terminals in the design.
database objects Can be nil.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-12
Database Queries 5-13
Instances
In this design, each of the instances has user-defined properties that describe the
physical sizes of the transistors.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Instances
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-14
Database Queries 5-15
Nets
Example: net SEL in master mux2 schematic
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Nets
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-18
Database Queries 5-19
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The net Object Type
The net object type has the following attributes among others:
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-20
Database Queries 5-21
Instance Terminals
Instance terminals provide an interface between instance and the nets in a
design.
■ Each instance contains one instance terminal at least.
■ Each net connects to one instance terminal at least.
Example: The B instance terminal on the I1 instance.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Instance Terminals
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-22
Database Queries 5-23
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The instTerm Object Type
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-24
Database Queries 5-25
Terminals
A terminal provides a way to connect to a net within the design.
Internal nets do not have terminals.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terminals
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-26
Database Queries 5-27
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" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The term Object Type
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-28
Database Queries 5-29
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-30
Database Queries 5-31
Shape Attributes
All shapes have several common attributes.
Attribute Data Type Description
objType string "line", "rect", or "path", or "polygon"
etc.
bBox list of coordinates The bounding box of the shape.
layerName string The name of the layer on which the
shape is found.
layerNum integer The number of the layer on which the
shape is found.
lpp list of two strings The list of layer name and layer
purpose.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Shape Attributes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-32
Database Queries 5-33
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-34
Database Queries 5-35
Module Summary
In this module, we covered
■ Database object concepts
■ Several specific object types
— the cellView object type
— the inst object type
— the various shape object types
— the net object type
■ The geGetWindowCellView function
■ The geGetSelSet function
■ Using the ~> operator to retrieve attributes and user-defined properties.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 5-36
Module 6: Menus
Objectives
■ Create and display pop-up menus.
■ Create pull-down menus.
■ Install and remove pull-down menus from window banners.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
Callback SKILL code that the system calls when the user does something
in the user interface.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-2
Menus 6-3
Use the hiDisplayMenu function to display the menu. Once it’s displayed,
■ Choosing One causes println( "One" ) to execute.
■ Choosing Two causes println( "Two" ) to execute.
Example Menu
One
Two
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating a Pop-Up Menu
The hiCreateSimpleMenu Function
Example Meaning
Arguments
’TrExampleMenu The menu variable.
hiCreateSimpleMenu stores
the data structure of the menu in this variable.
TrExampleMenu => array[7]:27015368
"Example Menu" The title of the menu.
’( "One" "Two" ) The list of the choices. No repetitions.
’( The list of callbacks.
"println( \"One\" )" Each callback is a string representing a single expression.
"println( \"Two\" )" Use \" to embed a single quote.
) Use curly braces, { }, to group multiple expressions into a
single expression.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-4
Menus 6-5
hiDisplayMenu
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying a Pop-Up Menu
The hiDisplayMenu Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-6
Menus 6-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Inserting a Pull-Down Menu
The hiInsertBannerMenu Function
Example Argument Meaning
window( 1 ) The window ID
TrPulldownMenu The data structure for the pull-down menu.
Use the variable you passed to hiCreatePulldownMenu.
Do not apply the ’ operator to the hiCreatePulldownMenu
variable because you want to refer to its contents.
0 The index of the menu after it has been inserted.
0 is the leftmost.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-10
Menus 6-11
Notice that the hiDeleteBannerMenu function requires the index of the pull-down
menu. You can easily determine the index by counting.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Deleting a Pull-Down Menu
The hiDeleteBannerMenu Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-12
Menus 6-13
Lab Overview
Lab 6-1 Exploring Menus
■ Exploring Pop-Up Menus
■ Exploring Pull-Down Menus
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-14
Menus 6-15
Module Summary
In this module, we covered
■ Creating and displaying a pop-up menu.
■ Creating a pull-down menu.
■ Installing a pull-down menu in a window banner.
■ Deleting a pull-down menu from a window banner.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
Function Description
hiCreateSimpleMenu Builds a pop-up menu with text choices only.
hiCreateMenu Builds a pop-up menu text or icon choices.
hiDisplayMenu Displays a pop-up menu built by hiCreateSimpleMenu or
hiCreateMenu.
hiCreateMenuItem Builds a menu item. Several menus can share this item
simultaneously.
hiCreatePulldownMenu Builds a pull-down menu with text or icon choices.
hiInsertBannerMenu Installs a pull-down menu in a window banner.
hiDeleteBannerMenu Removes a pull-down menu from the banner.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 6-16
Module 7: Customization
Objectives
■ Provide an overview of the Design Framework II Initialization sequence.
■ Basic tasks to accomplish in your .cdsinit file.
■ Survey several useful SKILL functions.
■ Optional tasks to accomplish in your .cdsinit file.
■ Preview the laboratory exercise.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-2
Customization 7-3
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Design Framework II Initialization Sequence
The context files are in the <install_dir>/tools.dfII/etc/context directory.
Each executable loads different contexts.
■ Study the log file to determine the contexts that your executable loads prior to the
.cdsinit file.
■ The icfb 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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-4
Customization 7-5
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The .cdsinit File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-6
Customization 7-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The Basic .cdsinit Tasks
The SKILL Path
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-8
Customization 7-9
Example
Load standard Composer bindkey definitions.
load( prependInstallPath( "samples/local/schBindKeys.il" ) )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Loading SKILL Source Code
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-10
Customization 7-11
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Other Useful .cdsinit Functions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-12
Customization 7-13
Example
This example code adds three directories to the front of the current SKILL path.
The three directories are in the installation hierarchy.
TrSamplesPath = list(
prependInstallPath( "etc/context" )
prependInstallPath( "local" )
prependInstallPath( "samples/local" )
)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Determining the Installation Path
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-14
Customization 7-15
Example
simplifyFilename( "~/SKILL" ) => "/usr1/mnt/skilldev/SKILL"
simplifyFilename( "./.cdsinit" )=>
"/usr1/mnt/skilldev/SKILL/.cdsinit"
simplifyFilename( "Menus" ) =>
"/usr1/mnt/skilldev/SKILL/Menus"
Use the getDirFiles function to retrieve the files and subdirectories in a directory.
Example
getDirFiles( "Menus" ) =>
("." ".." "Solutions" "Pulldown.il" "PopUp.il"
"MenuItemUtilities.il" "SimpleMenuExample.il" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Interfacing with UNIX Files and Directories
The simplifyFilename Function
The simplifyFilename function expands the specified path to a full path. The tilde, /, and ./ are
resolved, and redundant backslashes are removed. This shows exactly where the files are
accessed for reporting information or error reporting by functions that require paths.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Reading Shell Environment Variables
The getShellEnvVar Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-18
Customization 7-19
Example
buildString( ’( "a" "b" "c" "d" )) => "a b c d"
buildString( ’( "a" "b" "c" "d" ) "/" ) => "a/b/c/d"
Use the parseString function to parse a single string into a substring based on
delimiter characters.
Example
parseString( "a b c d" ) => ( "a" "b" "c" "d" )
parseString( "a/b/c/d" "/" ) => ( "a" "b" "c" "d" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Manipulating a List of Strings
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-20
Customization 7-21
■ Adding pull-down menus to the CIW. Consider the following example from
the previous module.
hiInsertBannerMenu( window( 1 ) TrPulldownMenu 0 )
■ Removing pull-down menus from the CIW menu banner. Consider the
following example from the previous module.
hiDeleteBannerMenu( window( 1 ) 0 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Manipulating the CIW in the .cdsinit File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-22
Customization 7-23
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Development .cdsinit Tasks
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-24
Customization 7-25
Lab Preview
In the lab, you make several bindkey definitions immediately available when the
Design Framework II environment starts.
You define a bindkey for both the Schematics and Layout applications to raise the
Command Interpreter Window.
You define a bindkey for the Command Interpreter application to raise the current
window.
With a single key stroke, you can toggle back and forth between the current
window and the CIW. This feature has the following benefits:
■ You can keep the CIW large without loosing track of your current window.
■ You can bury the CIW until you need it.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Preview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-26
Customization 7-27
Lab Overview
Lab 7-1 Setting Bindkeys in the .cdsinit File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-28
Customization 7-29
Module Summary
In this module, we covered
■ The Design Framework II Initialization sequence.
■ Basic tasks to accomplish in your .cdsinit file.
■ Several useful SKILL functions.
■ Optional tasks to accomplish in your .cdsinit file.
■ A preview of the laboratory exercise.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 7-30
Module 8: Developing a SKILL Function
Objectives
■ Grouping several SKILL expressions into a single SKILL expression.
■ Declaring local variables.
■ Declaring a SKILL function.
■ Understanding the SKILL software development cycle.
— Loading your SKILL source code.
— Redefining a SKILL function.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
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 Design Framework II
environment.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-2
Developing a SKILL Function 8-3
The variables ll, ur, lly, and ury are global variables. The curly braces, { }, do not
make them local variables.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Grouping SKILL Expressions Together
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-4
Developing a SKILL Function 8-5
■ The local variables ll, ur, lly, and ury are initialized to nil.
■ The return value is the ury-lly.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Grouping Expressions with Local Variables
The let Function
You can freely nest let statements.
You can access the value of a variable any time from anywhere in your program. SKILL
transparently manages the value of a variable like a stack. Each variable has a stack of values.
■ 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 the flow of control enters a let function, SKILL pushes a temporary value onto the
value stack of each variable in the local variable list. The local variables are normally
initialized to nil.
When the flow of control exits a let function, SKILL pops the top value of each variable in the
local variable list. If a variable with the same name existed outside of the let it will have the
same value that it had before the let was executed.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-6
Developing a SKILL Function 8-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-8
Developing a SKILL Function 8-9
Example
bBox = list( 100:200 350:450 ) Write global variable
Local Variables
You can use the let syntax function to declare the variables ll, ur, ury, and lly to be local
variables. The arguments presented in an argument list of a procedure definition are also local
variables. All other variables are global variables.
Global Variable
The bBox variable is a global variable because it is neither an argument nor a local variable.
Return Value
The function returns the value of the last expression evaluated. In this example, the function
returns the value of the let expression, which is the value of the ury-lly expression.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-10
Developing a SKILL Function 8-11
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-12
Developing a SKILL Function 8-13
To execute your function, you must provide a value for the bBox parameter.
bBoxHeight = TrBBoxHeight( list( 50:150 200:300 ) )
=> 150
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Defining Required Function Parameters
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 SKILL 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-14
Developing a SKILL Function 8-15
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 ).
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Defining Optional Function Parameters
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>).
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-16
Developing a SKILL Function 8-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Defining Keyword Function Parameters
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-18
Developing a SKILL Function 8-19
Example
The TrCreatePath function receives all of the arguments you pass in the formal
argument points.
procedure( TrCreatePath( @rest points )
printf(
"You passed these %d arguments: %L\n"
length( points ) points
)
) ; procedure
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 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Collecting Function Parameters into a List
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-20
Developing a SKILL Function 8-21
Define Functions
Test Functions
Yes
Bug?
No
Yes
Enhance?
No
www.cadfamily.com EMail:[email protected]
Done
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Development Cycle
SKILL allows you to redefine functions without exiting the Design Framework II
environment. A rapid edit and run cycle facilitates bottom-up software development.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Loading Source Code
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-24
Developing a SKILL Function 8-25
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Pasting Source Code into the CIW
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-26
Developing a SKILL Function 8-27
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Redefining a SKILL Function
The writeProtect switch has nothing to do with write protecting the source code file itself.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-28
Developing a SKILL Function 8-29
Lab Overview
Lab 8-1 Developing a SKILL Function
■ Develop a SKILL function, TrBBoxArea, to compute the area of a bounding
box. The bounding box is a parameter.
■ Model your SKILL function after the example SKILL function, TrBBoxHeight.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-30
Developing a SKILL Function 8-31
Module Summary
In this module, we covered
■ Using curly braces, { }, to group SKILL statements together
■ Using the let function to declare local variables
■ Declaring SKILL functions with the procedure function
— Name
— Arguments
— Body
■ The SKILL development cycle
■ Maintaining SKILL code
— The edit function and editor variable
— The load function
— The writeProtect switch
■ The lab exercise
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 8-32
Module 9: Flow of Control
Objectives
■ Review relational operators
■ Describe logical operators
■ Examine branching statements
■ Discuss several methods of iteration
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-2
Flow of Control 9-3
Relational Operators
Use the following operators to compare data values.
These operators all return t or nil.
Operator Arguments Function Example Return Value
< numeric lessp 3<5 t
3<2 nil
<= numeric leqp 3 <= 4 t
> numeric greaterp
>= numeric geqp
== numeric equal 3.0 == 3 t
string "abc" == "ABc" nil
list
!= numeric nequal
string "abc" != "ABc" t
list
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Relational Operators
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
SKILL 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")
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-4
Flow of Control 9-5
Logical Operators
SKILL considers nil as FALSE and any other value as TRUE.
SKILL provides generalized boolean operators.
Operator Arguments Function Example Return
Value
! general null !3 nil
!nil t
!t nil
&& general and x=1y=5 5
x < 3 && y < 4 nil
x < 3 && 1/0 *** Error
y < 4 && 1/0 nil
|| general or x < 3 || y < 4 t
x < 3 || 1/0 t
y < 4 || 1/0 *** Error
The && and || operators only evaluate their second argument if they must to
determine the return result.
The && and || operators return the value last computed.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Logical Operators
The && Operator
Evaluates its first argument. If it is nil, then && returns nil.
The second argument is not evaluated.
If the first argument evaluates to non-nil, then && evaluates the second argument. The &&
operator returns the value of the second argument.
The || Operator
Evaluates its first argument. If it is non-nil, then || returns the value of the first argument. The
second argument is not evaluated.
If the first argument evaluates to nil, then the second argument is evaluated. The || operator
returns the value of the second argument.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-6
Flow of Control 9-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using the && and || Operators to Control Flow
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-8
Flow of Control 9-9
Branching
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Branching
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-10
Flow of Control 9-11
The if Function
Use the if function to selectively evaluate two groups of one or more expressions.
The selection is based on whether the condition evaluates to nil or non-nil.
■ Use if( exp ... ) instead of if( exp != nil ... )
■ Use if( !exp ... ) instead of if( exp == nil ... )
The return value of the if expression is the value last computed.
if( shapeType == "rect" then
println( "Shape is a rectangle" )
++rectCount
else
println( "Shape is not a rectangle" )
++miscCount
) ; if rect
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The if Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-12
Flow of Control 9-13
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Two Common if Errors
SKILL 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 ... )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-14
Flow of Control 9-15
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Nested if-then-else Expressions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-16
Flow of Control 9-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The when and unless Functions
The when and unless functions both return the last value evaluated within their body or nil.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-18
Flow of Control 9-19
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-20
Flow of Control 9-21
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-22
Flow of Control 9-23
Iteration
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Iteration
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-24
Flow of Control 9-25
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-26
Flow of Control 9-27
When evaluating a foreach expression, SKILL determines the list of values and
repeatedly assigns successive elements to the index variable, evaluating each
expression in the foreach body.
The foreach expression returns the list of values over which it iterates.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The foreach Function
In the example,
■ The variable shapeType is the index variable. Before entering the foreach loop, SKILL
saves the current value of shapeType. SKILL restores the saved value after completing
the foreach loop.
■ The variable shapeTypeList contains the list of values. SKILL 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-28
Flow of Control 9-29
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The while Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-30
Flow of Control 9-31
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, the prog function 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.
procedure( TrClassify( signal )
prog( ()
unless( signal return( nil ))
unless( numberp( signal ) return( nil ))
when( signal >= 0 && signal < 3 return( "weak" ))
when( signal >= 3 && signal < 10 return( "moderate" ))
when( signal >= 10 return( "extreme" ))
return( "unexpected" )
) ; prog
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The prog and return Functions
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-32
Flow of Control 9-33
Lab Overview
Lab 9-1 Writing a Database Report Program
You write a SKILL function to count the shapes in a design.
You enhance this program in subsequent labs.
Lab 9-2 Exploring Flow of Control
You write a SKILL function to validate 2-dimensional points.
Lab 9-3 More Flow of Control
You write a SKILL function to compare 2-dimensional points.
Lab 9-4 Controlling Complex Flow
You write a SKILL function to validate a bounding box.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-34
Flow of Control 9-35
Module Summary
In this module, we covered
Category Function
Relational Operators <
<=
>
>=
==
!=
Logical Operators !
&&
||
Branching if when unless
case
cond
Iteration for
foreach
while
Miscellaneous prog return
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 9-36
Module 10: File I/O
Objectives
■ Write UNIX text files.
■ Read UNIX text files.
■ Open a text window.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-2
File I/O 10-3
After you execute the close function, the file /tmp/myFile contains the following
lines:
("Number:" 1)
("Number:" 2)
("Number:" 3)
("Number:" 4)
("Number:"
www.cadfamily.com 5)
EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Writing Data to a File
The print and println Functions
Notice how SKILL displays a port in the CIW.
myPort = outfile( "/tmp/myfile" )
port:"/tmp/myfile"
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")
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-4
File I/O 10-5
Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Writing Data to a File (continued)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-6
File I/O 10-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Reading Data from a File
The infile Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-8
File I/O 10-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The fscanf Function
The format directives commonly found include the ones in this table.
Format Data Type Scans Input Port
Specification
%d integer for next integer
%f floating point for next floating point
%s text string for next text string
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-10
File I/O 10-11
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 7, 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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Opening a Text Window
The view Function
The view function takes several optional arguments.
Argument Status Type Meaning
file required text Pathname
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 the file parameter.
autoUpdate optional t/nil If t, then the window updates for each write to
the file.
The default is nil.
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-12
File I/O 10-13
Lab Overview
Lab 10-1 Writing Data to a File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-14
File I/O 10-15
Module Summary
In this module, we covered
■ Writing text data to a file by using
— the outfile function to obtain an output port on a file.
— an optional output port parameter to the print and println functions.
— a required port parameter to the fprintf function.
— the close function to close the output port.
■ Reading a text file by using
— the infile function to obtain an input port.
— the gets function to read the file a line at a time.
— the fscanf function to convert text fields upon input.
— the close function to close the input port.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 10-16
Module 11: Using the SKILL Development
Environment
Objectives
■ Discuss common bugs.
■ Identify mistakes to avoid.
■ Explore the most useful facilities of the SKILL debugger.
— Single-step tracing
— Function tracing
— Trapping SKILL errors
— Setting and clearing breakpoints
— Single-step execution
■ Learn about SKILL Lint.
■ Learn about the SKILL Profiler.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-2
Using the SKILL Development Environment 11-3
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Development Tips
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-4
Using the SKILL Development Environment 11-5
Common Bugs
When a SKILL program does not behave according to its specifications, you need
to determine the underlying cause and correct the program accordingly.
Consider a Shape Report Program with a bug in it. Here are some possible
outcomes when you run the program.
■ No Shape Report window appears.
SKILL displays the following error message:
*Error* postincrement: can't handle add1(nil)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Common Bugs
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-6
Using the SKILL Development Environment 11-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using Print Statements
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-8
Using the SKILL Development Environment 11-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Checking for Common Errors
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-10
Using the SKILL Development Environment 11-11
Have you ever edited your program and forgotten to reload the new source code?
When debugging your function, use the pp function to verify that you have loaded
your latest version of the function.
The pp function displays the definition of a SKILL function.
The pp function does not use the file system. Instead, it accesses the definition
of the function in virtual memory.
Example
This example displays the definition of the TrExample function that is currently in
memory.
procedure( TrExample( x y ) x+y )
pp( TrExample )
procedure(TrExample(x y)
(x + y)
)
nil
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Check the Running Source Code
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-12
Using the SKILL Development Environment 11-13
Example
Can you spot the problem in the following fragment of code?
procedure( TrCountRectangles( cv )
let( ( count )
count = 0
foreach( shape cv~>shaps
++count
) ; foreach
count
) ; let
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Check All Attribute and Property Names
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-14
Using the SKILL Development Environment 11-15
The ~> operator works on many different kinds of objects. Different types of
objects are likely to contain different attributes or properties.
Example
Can you spot the problem in the following fragment of code?
hiSetBindKey( "Layout" "<Key>F8"
"println( TrCountRectangles( hiGetCurrentWindow()))" )
procedure( TrCountRectangles( cv )
let( ( count )
count = 0
foreach( shape cv~>shapes
++count
) ; foreach
count
) ; let
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Verify ~> Data Types
In the example:
The input required for TrCountRectangles is the databaseid of a cell view.
The input passed to the function is a windowid.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-16
Using the SKILL Development Environment 11-17
Programming Defensively
Consider designing your code to make bugs easier to track down. Bugs that raise
an error far away from the root cause are harder to track down.
For example,
■ Declare the expected argument types of one or more of your functions.
You can either have SKILL 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.
The next several pages discuss these suggestions in greater detail.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Programming Defensively
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-18
Using the SKILL Development Environment 11-19
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Include Data Type Checks
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-20
Using the SKILL Development Environment 11-21
The TrCellNameMatch function returns the cellView database object if the name
contains phrase otherwise it returns nil. The expected types of the two arguments
are:
■ cv, a database object
■ phrase, a text string
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
An Example Type Template
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 value.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-22
Using the SKILL Development Environment 11-23
Example
The following version of the TrCellNameMatch function checks specifically that
the first argument obj is a cellView database object.
procedure( TrCellNameMatch( obj phrase )
cond(
( !dbobjectp( obj ) || obj~>objType != "cellView"
error(
" TrCellNameMatch: obj is not cellView - %L" obj )
)
( ... ) ;;; Other checks
( t ... ) ;;; This alternative contains the rest of the function
) ; cond
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The error Function
Use the %L format string to specify the default print representation of the argument.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-24
Using the SKILL Development Environment 11-25
The following techniques are often very effective for isolating or minimizing
problems:
■ Develop working programs incrementally, adding functionality in stages.
■ Become familiar with common problems and their symptoms.
■ Examine your source code for common problems.
■ 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.
■ Program defensively to identify problems as soon as they occur.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Development Tip Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-26
Using the SKILL Development Environment 11-27
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Development Environment
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-28
Using the SKILL Development Environment 11-29
Commands Help 3
SKILL Debugger...
SKILL Lint...
SKILL Profiler...
SKILL Browser...
Tracing...
Finder...
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Development Window
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-30
Using the SKILL Development Environment 11-31
The SKILL Debugger button on the SKILL Development window opens the SKILL
Debugger Toolbox.
SKILL Debugger...
SKILL Lint...
SKILL Profiler...
SKILL Browser...
Tracing...
Finder...
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Debugger Toolbox
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()" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-32
Using the SKILL Development Environment 11-33
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using Single-Step Tracing to Analyze an Error
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-34
Using the SKILL Development Environment 11-35
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
A Single-Step Trace Example
In this example, the trace output indicates that the code expects a cellview database object but
is dealing with a window ID.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-36
Using the SKILL Development Environment 11-37
Normally, when your program causes a SKILL error, your program is aborted.
SKILL discards the knowledge about the program state at the time of the error.
This knowledge includes the following:
■ The values of local variables
■ The sequence of function calls under evaluation at the time of the SKILL
error
This information can help you determine the cause of the error. To examine this
information before SKILL discards it, you must trap the error. To do this:
1. Install the SKILL Debugger.
This enables the SKILL Debugger to trap any untrapped error.
2. Run your application to reproduce the error.
The SKILL Debugger traps the error.
3. Display the SKILL stack and dump the local variables.
Analyze the flow of control.
The next several pages cover more details of this debugging approach.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using the SKILL Debugger to Trap an Error
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-40
Using the SKILL Development Environment 11-41
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>.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Installing the SKILL Debugger
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-42
Using the SKILL Development Environment 11-43
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying the SKILL Stack
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-44
Using the SKILL Development Environment 11-45
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-46
Using the SKILL Development Environment 11-47
Debugging Example
The next several pages show an excerpt from the ~/CDS.log file.
This page shows the following steps:
1. Installing the SKILL Debugger
2. Running your program
The SKILL Debugger traps the error.
\p >
\i installDebugger()
\t t
\p 1>
\i TrShapeReport( window( 4 ))
\o *** Error in routine postincrement:
\o Message: *Error* postincrement: can't handle add1(nil)
\o SKILL Debugger: run GUI-based tools/bin/cdsFinder
on search string `debug' for a list of commands or debugQuit to leave.
\p Debug 2>
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Debugging Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-48
Using the SKILL Development Environment 11-49
This excerpt from the ~/CDS.log shows these next two steps:
1. Dumping the SKILL stack at the time of the error.
2. 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>
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-50
Using the SKILL Development Environment 11-51
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Suspending and Resuming Your Program
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
Call In the caller, after SKILL evaluates the argument expressions
Entry In the callee, after binding the caller’s actual arguments to the
callee’s formal arguments
Exit In the callee, after computing the return result
Return In the caller, after running to the caller
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-52
Using the SKILL Development Environment 11-53
Setting Breakpoints
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 ) ))
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Setting Breakpoints
The breakpt Function
breakpt( [s_function [break_condition]])=> g_result
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-54
Using the SKILL Development Environment 11-55
Clearing Breakpoints
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Clearing Breakpoints
The unbreakpt Function
unbreakpt( [s_function... | t] ) => g_result
Clears breakpoints for the functions listed. The return value is the names of the functions for
which the breakpoints were removed.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-56
Using the SKILL Development Environment 11-57
Hitting a Breakpoint
The following excerpt from the ~/CDS.log shows these steps:
1. Setting a breakpoint at the entry of the TriShapeReport function.
2. Calling the TrShapeReport function.
3. Displaying the stack at the breakpoint.
4. Examining the wid and thePort function arguments.
\i breakpt TriShapeReport
\t (TriShapeReport)
\p 1>
\i TrShapeReport( window( 4 ))
\o <<< Break >>> on entering TriShapeReport
\o SKILL Debugger: ...
\p Debug 2>
\i stacktrace
\e <<< Stack Trace >>>
\e breakHandler(nil)
\e entry of TriShapeReport
\e TriShapeReport(wid thePort)
\e TrShapeReport(window(4))
\t 3
\p Debug 2>
\i wid
\t window:4
\p Debug 2>
\i thePort
\t port:"/tmp/ShapeReport.txt"
\p Debug 2>
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Hitting a Breakpoint
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-58
Using the SKILL Development Environment 11-59
To resume your suspended program from a breakpoint, you have these options:
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Resuming Your Program
The Continue Command
Continues execution from a breakpoint.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-60
Using the SKILL Development Environment 11-61
Example
\i breakpt( outfile TriShapeReport TrShapeReport )
\t (TrShapeReport TriShapeReport outfile)
\p 1>
\i TrShapeReport( window( 4 ))
\o <<< Break >>> on entering TrShapeReport
\o SKILL Debugger: ...
\p Debug 2>
\i continue
\o <<< Break >>> on calling outfile with args ("/tmp/ShapeReport.txt")
\o SKILL Debugger: ...
\p Debug 2>
\i continue
\o <<< Break >>> on entering TriShapeReport
\o SKILL Debugger: ...
\p Debug 2>
\i stacktrace
\e <<< Stack Trace >>>
\e breakHandler(nil)
\e entry of TriShapeReport
\e TriShapeReport(wid thePort)
\e TrShapeReport(window(4))
\t 3
\p Debug 2>
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The continue Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-62
Using the SKILL Development Environment 11-63
From a breakpoint, you can execute your program one function call at a time.
To run your program in single-step mode, you have the following options:
SKILL suspends your program after executing the current function call.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Single-Stepping Your Program
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-64
Using the SKILL Development Environment 11-65
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Debugger Sessions
After you have fixed a problem, make sure that you abort the program before rerunning it.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-66
Using the SKILL Development Environment 11-67
When you are at a breakpoint, you can abort your program by quitting the
debugger session.
When the SKILL Debugger traps an error, you cannot resume your program. After
examining local variables and displaying the stack, you need to quit the debugger
session.
You can choose either of these ways to quit a debugger session:
■ Use the Quit Debugger command on the SKILL Debugger Toolbox.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-68
Using the SKILL Development Environment 11-69
The SKILL Debugger nests debugger sessions. The prompt in the CIW indicates
a number that is one higher than the number of nested SKILL Debugger sessions.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Nesting SKILL Debugger Sessions
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-70
Using the SKILL Development Environment 11-71
To set an error trap, install the SKILL Debugger. This error trap only traps errors
that are not otherwise trapped.
You do not have to install the SKILL Debugger if you just want to set breakpoints.
It is a good idea to install the SKILL Debugger and define several aliases in your
.cdsinit file. Include the following lines in your .cdsinit file:
installDebugger()
alias( q debugQuit )
alias( c continue )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Debugger Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-72
Using the SKILL Development Environment 11-73
Question
The CIW prompt says Debug 23>. Is there one command that will get me back to
a CIW prompt of 1>?
Answer
No. You have to click Quit Debugger 22 times. The Quit Debugger command
terminates the most deeply nested debugger session. This is the most recently
created debugger session.
Question
Why can’t I just uninstall the SKILL Debugger to get back to a CIW prompt of 1> ?
Answer
Uninstalling the debugger changes the CIW prompt back to the normal >. The
debugger will not trap subsequent errors. However, the nested debugger
sessions remain. Also, breakpoints are still active and most of the debugger
commands still work.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Frequently Asked Questions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-74
Using the SKILL Development Environment 11-75
While the SKILL Debugger is installed, you have the following advantages:
■ You can redefine any SKILL function.
■ When you call the edit function, you can specify just the function name, as
in this example:
edit( TrShowFileBrowser t )
■ You can call the whereIs function to display information about a function’s
source code file as in this example.
whereIs( TrShowFileBrowser )
TrShowFileBrowser is defined in file
"/usr1/mnt/skilldev/SKILL/CaseStudy/ShowFileBrowser.il"
at line 492.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Other SKILL Debugger Benefits
While the SKILL Debugger is installed, the load function associates the file being loaded with
each function that the file declares.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-76
Using the SKILL Development Environment 11-77
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-78
Using the SKILL Development Environment 11-79
SKILL Lint
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Lint
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-80
Using the SKILL Development Environment 11-81
SKILL Profiler
The SKILL Profiler tells you where your SKILL programs are taking the most time
and allocating the most memory. Specifically, it performs the following tasks:
■ Measures the time spent in each function that executes longer than 1/60th
of a second.
■ Shows how much SKILL memory is allocated in each function.
■ 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Profiler
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-82
Using the SKILL Development Environment 11-83
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-84
Using the SKILL Development Environment 11-85
Module Summary
In this module, we
■ Matched SKILL development utilities with development tasks
■ Surveyed the SKILL Debugger
■ Learned about SKILL Lint and the SKILL Profiler
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 11-86
Chapter 12: List Construction
Objectives
■ Review the techniques for building a list.
— The ’ operator
— The list function
— The cons function
— The append function
■ Use the foreach mapcar function to make a list that corresponds one to one
with a given list.
■ Use the setof function to make a filtered copy of a list.
■ Use the foreach mapcar function and setof function together to make a list
that corresponds one to one with a filtered list.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-2
List Construction 12-3
List Review
You can make a new list by:
■ Specifying all the elements literally.
’( ( "one" 1 ) ( "two" 2 ) )
=> ( ( "one" 1 ) ( "two" 2 ) )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-4
List Construction 12-5
Example
L = ’( 1 2 3 )
foreach( x L x**2 ) => ( 1 2 3 )
Squares = foreach( mapcar x L x**2 ) => ( 1 4 9 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The foreach mapcar Function
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
The foreach The foreach mapcar
Function Function
What happens to Each loop result is Each loop result is collected
the return result of ignored. into a new list.
the last expression in the
loop body?
What is the return result? The original base list is The new list is the return
the return result. result.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-6
List Construction 12-7
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Extended foreach mapcar Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-8
List Construction 12-9
Examples
■ A foreach mapcar expression
foreach( mapcar x ’( 1 2 3 4 ) x**2 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-10
List Construction 12-11
Filtering Lists
The setof function makes a filtered copy of a list, including all elements that satisfy
a given filter.
For example, you can build a list of the odd elements of ( 1 2 3 4 5 ).
Filtered list
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-12
List Construction 12-13
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The setof Function
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-14
List Construction 12-15
A setof Example
Suppose you want to retrieve all the rectangles in a design.
The following code uses the setof function to retrieve all rectangles in a
design.
cv = geGetWindowCellView()
setof( shape cv~>shapes shape~>objType == "rect" )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
A setof Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-16
List Construction 12-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Another setof Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-18
List Construction 12-19
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Transforming Elements of a Filtered List
This example computes the list of squares of odd integers.
TrListOfSquares( ’( 1 2 3 4 5 6 )) => ( 1 9 25 )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-20
List Construction 12-21
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-22
List Construction 12-23
Module Summary
In this module, we covered
■ The foreach mapcar function to build lists.
■ The setof function to make a filtered copy of a list.
■ The foreach mapcar function and the setof function used together to build a
list by transforming each element.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 12-24
Module 13: Cellview Data Model
Objectives
■ Review database object concepts.
■ Survey the cellview data model documentation.
■ Open a cellview nongraphically.
■ Create geometry in a design.
■ Save and close a cellview.
■ Survey how the cellview data model represents
— Geometry
— Hierarchy
— Connectivity
— User-defined Properties
■ Retrieve all the attributes of a database object.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-2
Cellview Data Model 13-3
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Database Object Review
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-4
Cellview Data Model 13-5
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Design Framework II Database Technology
CDBA
C-level database access (CDBA) consists of procedural access layers on top of the Cadence
database. CDBA routines provide nearly complete access to all the data stored in the Cadence
design database. You can create, modify, save, retrieve, and maintain data in the Cadence
database. CDBA functions are available at the programming level and allow tight and
complete control over database operations.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-6
Cellview Data Model 13-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Database Access SKILL Documentation
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-8
Cellview Data Model 13-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Description of Database Objects
There are three types of attributes as shown in this table.
Attribute Description
Mandatory Must be specified at the time the database object is created.
These attributes are essential to the viability of the database object.
Optional Might or might not be present on a particular database object, in which
case its value is nil.
Derived Are computed dynamically from other attributes.
Consequently, you cannot change them.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-10
Cellview Data Model 13-11
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Database Object Classes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-12
Cellview Data Model 13-13
Shape cellView
shapes
objType objType
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-14
Cellview Data Model 13-15
Opening Cellviews
The dbOpenCellViewByType function opens a cellview nongraphically.
If successful, it returns the database object of the cellview.
cv = dbOpenCellViewByType(
"master" ;; library name
"mux2" ;; cell name
"schematic" ;; view name
"schematic" ;; view type
"r" ;; access mode
;; "r" = read, "a" = append, "w" = overwrite
)
⇒ db:12345678
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Opening Cellviews
The dbOpenCellViewByType Function
If the dbOpenCellViewByType function is unsuccessful, it returns nil.
cv = dbOpenCellViewByType( "master" "boxes"
"layout" "maskLayout" )
*WARNING* failed to open cellview (boxes layout)
from lib (master) in 'r' mode
because cellview does not exist.
nil
See the Cadence online documentation to read more about this function.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-16
Cellview Data Model 13-17
Shapes
layerPurposePairs
cellView
shapes
cellView
layerName shapes
layerNum Shape LP
lpp
layerName
layerNum
purpose
nPoints nPoints
points points
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-18
Cellview Data Model 13-19
Creating Shapes
There are several SKILL functions that create database objects. These functions:
■ Begin with dbCreate.
■ Require a cellview database object and enough other arguments to
describe the object.
■ Return the new database object.
Use the dbCreateRect function to create a rectangle on a layer with a given
bounding box.
let( ( cv newRect )
cv = dbOpenCellViewByType( "master" "new"
"layout" "maskLayout" "w")
newRect = dbCreateRect(
cv ;;; cellView database object
"metal1" ;;; layer name
list( 0:0 .5:.5 ) ;;; bounding box
)
...
) ; let
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating Shapes
Arguments Interpretation
d_cellView Specifies the cellview.
tx_layer Specifies either the layer name or number.
t_purpose Specifies purpose, defaults to all.
l_bBox Defines the lower left and upper right corners of the
bounding box.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-20
Cellview Data Model 13-21
Updating Shapes
You can often use the ~> operator to update a shape.
Expression Action Example
~>bBox = Move a rectangle aRect~>bBox = newBBox
~>layerName = Change a shape’s layer aRect~>layerName = "thinox"
~>points = Change a path’s points aPath~>points = newPoints
~>width = Change a path’s width aPath~>width = 3.0
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Updating Shapes
Refer to the reference documentation for further information on these functions.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-22
Cellview Data Model 13-23
You cannot save or overwrite a cellview that is open in read or scratch mode.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Saving and Closing a Cellview
The dbSave Function
See the Cadence online documentation to read more about this function. For instance, you can
specify a different cellview to save the data to.
If you are editing a schematic cellview you will also need to do a schCheck prior to the dbSave
function. This corresponds to the Check and Save step that you perform interactivly when
editing or expanding a schematic cellview.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-24
Cellview Data Model 13-25
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The dbClose Function
See the Cadence online documentation to read more about the dbClose function.
To manage memory efficiently, CDBA maintains its own virtual memory pool. CDBA uses a
simple reference count algorithm to determine when it can purge a cellview from virtual
memory.
For a particular cellview, when the number of times you have called dbClose equals the
number of times you have called dbOpenCellViewByType, CDBA returns the memory to the
memory pool. CDBA uses the memory for subsequent dbOpenCellViewByType calls. Design
Framework II returns the CBDA memory pool to UNIX when you exit the Design
Framework II environment.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-26
Cellview Data Model 13-27
Lab Overview
Lab 13-1 Enhancing the Layer Shape Report SKILL Program
You develop a SKILL function that produces a report to count the number of
each kind of shape on each layer in a design.
Lab 13-2 Creating a Cellview
You create a cellview containing various shapes.
Lab 13-3 Aligning Rectangles
You develop a SKILL function to align the top sides of a collection of
rectangles.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-28
Cellview Data Model 13-29
Hierarchy
Example: Instance I1 of master mux2 schematic
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Hierarchy
The following examples review ~> expressions you have seen previously.
■ The list of the instances in the design
mux2~>instances =>
( db:39520396 db:39523572 db:39522480 .... )
I1 = dbFindAnyInstByName( mux2 "I1" ) => db:38127508
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-30
Cellview Data Model 13-31
instanceMasters
instRefs
instances master
cellView inst cellView
cellView name
libName libName libName
cellName cellName cellName
viewName viewName viewName
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The cellView and inst Object Types
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-32
Cellview Data Model 13-33
Can you account for the return value t by studying the source code?
This more realistic format string prints the information in columns.
format =
"Instance: %-10s Master: %-10s within CellView: %-10s %-10s %-10s \n"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-34
Cellview Data Model 13-35
A Hierarchical Design
Assume you have a hierarchical design and you need a list of masters that are
instantiated in the hierarchy. In this example, the list is ( A B C D ).
Top A C
A B
C C D
D
A
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
A Hierarchical Design
The following tree describes the hierarchy. A and C are leaf cells that contain no instances.
Top
A B C
A C D
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-36
Cellview Data Model 13-37
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-38
Cellview Data Model 13-39
dbOpenCellViewByType(
"Example"
"nand2"
’( "silos" "schematic" )
)
⇒ db:12345678
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using dbOpenCellViewByType to Switch Views
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-40
Cellview Data Model 13-41
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-42
Cellview Data Model 13-43
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-44
Cellview Data Model 13-45
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Labs
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-46
Cellview Data Model 13-47
Connectivity
Example: net SEL in master mux2 schematic
Terminals
Instance Terminals
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-48
Cellview Data Model 13-49
name
direction
terminals
term
net
cellView
term
nets
net
instances name
instTerms
net
instTerms
Instance instTerm
inst
name name
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The term, net, and instTerm Object Types
Each cellView database object has
■ A terminals attribute, whose value is a list of all term database objects in this design.
■ A nets attribute, whose value is a list of all net database objects in this design.
A net runs between one or more internal instance terminals. Each instance terminal is on a
unique instance. In addition, a net can connect to the outside world by means of a terminal.
Each net database object has
■ A term attribute, whose value is the unique term database object for this net.
■ An instTerms attribute, whose value is a list of instTerm database objects.
Each instTerm object has an inst attribute, whose value indicates the instance.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-50
Cellview Data Model 13-51
nets pins
cellView net
name
instances instTerms
net
instTerms
Instance instTerm
name inst name
master term
terminals
cellView term
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Connectivity Between Instances and Masters
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-52
Cellview Data Model 13-53
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.
This example determines what type of figure is associated with the terminal
pin(s).
cv~>terminals~>pins~>fig~>objType
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Figures and Terminals
Every Instance database object has a purpose attribute. This attribute helps you determine the
role of the instance in the design.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-54
Cellview Data Model 13-55
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-56
Cellview Data Model 13-57
cellView
Generic
Database Object cellView
objType
prop
object
name
prop value
valueType
Attribute Meaning
objType The specific object type: "net", "line", etc.
cellView The cellView database object containing the database object.
prop 0, 1 or more prop database objects.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Generic Database Object
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-58
Cellview Data Model 13-59
User-Defined Properties
Applications are responsible for creating, updating, and interpreting user-defined
properties.
CDBA represents a user-defined property by a database object with object type
"prop".
Every database object, except prop objects themselves, can have one 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" ... )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
User-Defined Properties
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-60
Cellview Data Model 13-61
Example
cv~>prop~>name => ("net#" ... )
cv~>prop~>value => (22 ... )
cv~>prop~>valueType => ( "int" ... )
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"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Examining User-Defined Properties
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")
)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-62
Cellview Data Model 13-63
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating User-Defined Properties
See the Cadence online documentation for the list of allowed property valueTypes. Refer to
the Description of Database Objects section of chapter 2 of the Design Framework II SKILL
Functions Reference Manual.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-64
Cellview Data Model 13-65
Example
hp = dbCreateHierProp( cv "TrHierProp" ) => db:39320456
hp~>a = 1
hp~>b = 2
hp~>value => (db:39320544 db:39320504)
hp~>value~>object => (db:39320456 db:39320456)
hp~>prop => nil
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Hierarchical User-Defined Properties
The dbCreateHierProp Function
See the Cadence online documentation to read more about this function.
The dbReplaceHierProp Function
See the Cadence online documentation to read more about this function.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-66
Cellview Data Model 13-67
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Other Kinds of User-Defined Properties
See the Cadence online documentation to read more about these functions.
■ dbCreateEnumProp
■ dbReplaceEnumProp
■ dbCreateRangeProp
■ dbReplaceRangeProp
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-68
Cellview Data Model 13-69
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Retrieving All Attributes of a Database Object
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-70
Cellview Data Model 13-71
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The Show File Browser
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
Lab Overview
Lab 13-8 Exploring User-Defined Properties
Lab 13-9 Dumping Database Objects
Lab 13-10 Building the Cellview Data Model Road Map
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-74
Cellview Data Model 13-75
Module Summary
In this module, we
■ Reviewed database object concepts.
■ Opened a cellview into virtual memory.
■ Created shapes in a design.
■ Surveyed the cellview database model.
— Geometry
— Hierarchy
— Connectivity
— User-defined properties
■ Traversed a hierarchical database.
■ Retrieved all the attributes on a database object.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 13-76
Module 14: User Interface
Objectives
■ Context sensitive pop-up menus
■ Fixed menus
■ Dialog boxes
■ List boxes
■ Forms
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-2
User Interface 14-3
procedure( TrGetSortedWindowList()
sort( hiGetWindowList() ’TrCompareWindowTitles )
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-4
User Interface 14-5
Fixed Menus
Fixed menus have the following characteristics:
■ They typically occupy the entire top or side of the screen.
■ They include a two dimensional array of menu items.
■ They include Done as the last menu item.
Clicking a menu item in a fixed menu does not set the current window.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Fixed Menus
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-6
User Interface 14-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating Fixed Menus
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-8
User Interface 14-9
You can use the hiFixedMenuDown function to remove a fixed menu from the
screen.
hiFixedMenuDown( TrExampleVerticalFixedMenu )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying Fixed Menus
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-10
User Interface 14-11
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Attaching Fixed Menus to Application Windows
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.
Several functions manipulate attached, fixed menus.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-12
User Interface 14-13
Lab Overview
Lab 14-1 Exploring Fixed Menus
■ Create a vertical fixed menu.
■ Attach the menu to an application window.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-14
User Interface 14-15
Dialog Boxes
Reminder
Workout
Yes No Help
Each dialog box has two or three buttons to allow the user to confirm an action or status and
to dismiss or close the dialog box.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-16
User Interface 14-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The hiDisplayAppDBox Function
The hiDisplayAppDBox function creates and displays a dialog box.
The dialog box is destroyed when it is removed from the screen.
Keyword Argument Meaning
?name The dboxHandle symbol is bound to the data structure of the dialog
box and then reset to nil when box is dismissed.
?dboxBanner Text that appears within the window manager banner text of the
dialog box.
?dboxText Message that appears in the dialog box.
?callback Callback that executes whenever the user selects OK or Yes.
?dialogType hicWarningDialog, hicErrorDialog etc.
See User Interface SKILL Functions Reference Manual.
?dialogStyle Blocking behavior of this dialog box. Acceptable choices are
’systemModal, ’modal, or ’modeless.
?buttonLayout ’OKCancel, ’YesNo, ’YesNoCancel, etc.
See User Interface SKILL Functions Reference Manual.
?location See User Interface SKILL Functions Reference Manual.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-18
User Interface 14-19
Caution
Do not rely on the delayed return of the hiDisplayAppDBox function in the case of modal
and systemModal boxes. In some future release, this function will immediately return
regardless of the dialog style.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The Dialog Box Blocking Behavior
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-20
User Interface 14-21
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The Dialog Box Callback and Button Layout
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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-22
User Interface 14-23
Lab Overview
Lab 14-2 Exploring Dialog Boxes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-24
User Interface 14-25
List Boxes
Produce
OK Cancel Apply
Apple
Orange
Kiwi
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-26
User Interface 14-27
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The hiShowListBox Function
The hiShowListBox function creates and displays a list box containing a group of text strings.
Keyword Meaning
Argument
?name A global variable in which SKILL stores data
structure.
?title The title.
?choices List of text string choices.
?callback Function called when the user clicks OK, Cancel,
or Apply.
?multipleSelect Controls single item selection or multiple item
selection.
?applyButton t => provides Apply button.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-28
User Interface 14-29
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
Action return value Screen
Behavior
OK t t Disappears.
the list box data structure
Apply t Remains on
the list box data structure screen.
Cancel nil nil Disappears.
nil
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The List Box Callback
The callback can use the SKILL expressions in this table.
Expression Meaning
theListBox->value Retrieves the list of selected items.
theListBox->choices Retrieves the list of items that the user can
select.
theListBox->choices = ’( ... ) Changes the list of items that the user can
select.
While the box is displayed, other SKILL functions can similarly manipulate the list box data
structure through a global variable.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-30
User Interface 14-31
Lab Overview
Lab 14-3 Exploring List Boxes
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-32
User Interface 14-33
Standard Forms
Standard forms solicit data from the user to complete a command.
Forms contain a window banner with generic command buttons—OK, Cancel,
Defaults, Apply, and Help.
You can define other fields and command buttons specific to your application.
The user interacts with a form by mouse and keyboard.
Open File
Forms provide these
OK Cancel Defaults Help generic command
buttons automatically.
Library Name master Cell Names
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Standard Forms
Standard forms solicit data from the user.
You create each standard form with a banner containing the name of the form and any of the
following buttons:
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-34
User Interface 14-35
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Analyzing a Design Framework II Command
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-36
User Interface 14-37
hiDisplayForm( ... )
➌
hiCreateAppForm( ... ) or
➋
hiCreateStringField( ... ) hiOpenWindow( ... )
➌
Create Forms from the Bottom Up
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating and Displaying a Form
The hiCreateAppForm Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-38
User Interface 14-39
File Form
OK Cancel Defaults Apply Help
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Example File Form
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-40
User Interface 14-41
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating the File Name Field
The hiCreateStringField Function
Creates a string field entry for a form.
Keyword Meaning
Argument
?name Symbolic name of this field
?prompt Field prompt
?value Initial value
?help See User Interface SKILL Functions Reference Manual.
?defValue Default value
?font See User Interface SKILL Functions Reference Manual.
?callback The function call(s) to execute when the user clicks into
another field.
?format See User Interface SKILL Functions Reference Manual.
?editable nil => read-only
t => user can edit this field.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-42
User Interface 14-43
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Validating the File Name Field
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-44
User Interface 14-45
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Creating the File Form
The hiCreateAppForm Function
Returns the SKILL data structure of a form with the specified field entries.
Keyword Argument Meaning
?name A global variable.
SKILL stores the form’s data structure in this variable.
?fields A list of the field data structures.
?formTitle The form name, which appears in the form’s window banner.
?callback The function to be called when the user selects
OK or Apply in the form.
?unmapAfterCB If t, SKILL removes the form after the callback returns.
Otherwise, the form is removed immediately when the user
clicks OK. See User Interface SKILL Functions Reference
Manual.
?formType See User Interface SKILL Functions Reference Manual.
?dialogStyle See User Interface SKILL Functions Reference Manual.
?buttonLayout See User Interface SKILL Functions Reference Manual.
?initialSize
www.cadfamily.com
See User Interface SKILL Functions Reference Manual.
EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-46
User Interface 14-47
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The File Form OK/Apply Callback
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.
The hiHighlightField Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-48
User Interface 14-49
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Displaying the File Form
The hiDisplayForm Function
By default, the hiDisplayForm function does not return until the user clicks OK or clicks
Cancel.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-50
User Interface 14-51
TIME
User Clicks OK
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The ?unmapAfterCB Argument
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-52
User Interface 14-53
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Controlling the Cursor Icon
hicArrow XC_left_ptr
hicCross XC_cross
hicHand XC_hand2
hicHelp XC_question_arrow
hicIbeam XC_xterm
hicNo XC_pirate
hicSizeAll XC_fleur
hicSizeNESW —
hicSizeNS XC_sb_v_double_arrow
hicSizeNWSE —
hicSizeWE XC_sb_h_double_arrow
hicUpArrow XC_sb_up_arrow
hicWait XC_watch
hicArrowHourglass —
hicHourglass —
hicNoCursor —
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-54
User Interface 14-55
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Frequently Asked Questions
This table explains the role and the scope of each variable in the overhead example.
Variables Role Scope (local or global)
f1, f2, f3 Each value is a field data Make these variables local.
structure.
field1, field2, field3 Each is the symbolic name of The scope is irrelevant,
a field. because the variable name,
Each value is irrelevant. instead of the value, is used.
fields The value is a list of the field Make this variable local.
data structures.
form The value is a form data Make this variable local.
structure.
ExampleForm The symbolic name of the Make this variable global.
form.
The value is a form data
structure.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-56
User Interface 14-57
Form Fields
All field creation routines share similar arguments and return the field structure.
Field Category Field Type Creation Function
Type-in single-line string hiCreateStringField
multi-line string hiCreateMLTextField
integer numeric hiCreateIntField
floating point numeric hiCreateFloatField
list hiCreateListField
2–D point hiCreatePointField
bounding box hiCreateBBoxField
2–D point list hiCreatePointListField
Enumerated toggle hiCreateToggleField
Choice boolean hiCreateBooleanButton
radio hiCreateRadioField
list box hiCreateListBoxField
cyclic hiCreateCyclicField
layer cyclic hiCreateLayerCyclicField
scale hiCreateScaleField
Command button hiCreateButton
button box hiCreateButtonBoxField
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Form Fields
Use the Cadence Finder to list all the functions whose name starts with hiCreate and end with
Field.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-58
User Interface 14-59
Lab Overview
Lab 14-4 Exploring Forms
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-60
User Interface 14-61
Module Summary
In this module, we covered
■ Context sensitive pop-up menus
■ Fixed menus
■ Dialog boxes
■ List boxes
■ Forms
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
Category Functions
Fixed menus hiCreateVerticalFixedMenu
hiCreateHorizontalFixedMenu
hiDisplayFixedMenu
hiGetWindowFixedMenu
hiRemoveFixedMenu
hiAddFixedMenu
Dialog boxes hiDisplayAppDBox
List boxes hiShowListBox
Forms hiCreateStringField
hiCreateAppForm
hiDisplayForm
hiSetCallbackStatus
hiHighlightField
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 14-62
Module 15: Advanced Customization
Objectives
■ Customize the Composer software and the Virtuoso Layout Editor.
— Add a menu item to a pull-down menu.
— Insert a menu item in a pull-down menu.
— Delete a menu item from a pull-down menu.
— Add a pull-down menu to the menu banner.
— Reorganize the menus in the menu banner.
■ Customize form field default values.
■ Mange the Layer Selection Window
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-2
Advanced Customization 15-3
Module Scope
This module covers the following topics:
■ Customizing Composer, Virtuoso Layout Editor, and other Design Editor
applications.
■ Customizing the default value and initial value of a statically defined field in
a SKILL form.
You need different techniques to customize the CIW and the LSW.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Scope
This module focuses on one of several approaches to customizing certain Design
Framework II applications, such as the Composer and the Virtuoso Layout Editor
applications.
Different techniques are required for customizing the CIW and the LSW.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-4
Advanced Customization 15-5
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-6
Advanced Customization 15-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Design Editor User Trigger Functions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-8
Advanced Customization 15-9
You must use the -> operator to access the fields. Do not use the ~> operator.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Declaring a User Postinstall Trigger Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-10
Advanced Customization 15-11
■ The first argument is the view type associated with the application.
Composer = "schematic"
Layout Editor = "maskLayout"
■ Pass nil for the second and third arguments.
■ The fourth argument is the function that you want for the user postinstall
trigger. Use the single quote syntax.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Registering a User Postinstall Trigger Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-12
Advanced Customization 15-13
Develop a user postinstall trigger function the same way you develop any SKILL
function.
Be aware that the Design Editor traps any SKILL errors that a user postinstall
trigger function causes.
If you are using the SKILL Debugger, configure it to display a stack trace
automatically.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Developing a User Postinstall Trigger Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-14
Advanced Customization 15-15
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Debugging a User Postinstall Trigger Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-16
Advanced Customization 15-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Redefining a User Postinstall Trigger Function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-18
Advanced Customization 15-19
Example
procedure( TrUserPostInstallTrigger( args )
...
) ; procedure
deRegUserTriggers( "schematic"
nil
nil
’TrUserPostInstallTrigger
)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What You Put in the .cdsinit File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-20
Advanced Customization 15-21
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Three User Postinstall Trigger Examples
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-22
Advanced Customization 15-23
deRegUserTriggers( "schematic"
nil
nil
’TrUserPostInstallTrigger
)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Adding a Menu Item to the Composer Edit Menu
The hiAddMenuItem Function
Use the hiAddMenuItem function to add a menu item to a menu. Pass data structures for both
the menu and the menu item.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-24
Advanced Customization 15-25
4. 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
Composer Edit menu.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Finding the Edit Menu Data Structure
■ 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
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Avoiding Errors and Warnings
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-28
Advanced Customization 15-29
deRegUserTriggers( "schematic"
nil
nil
’TrUserPostInstallTrigger
)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What You Put into the .cdsinit File
Check #1
Check #1 determines whether the menu item exists.
Check #2
Check #2 determines whether the menu exists without the menu item present.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-30
Advanced Customization 15-31
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Adding a Pull-Down Menu to Composer Windows
Building Your Pull-Down Menu
The Design Editor calls your trigger function each time the user opens a Composer window.
To avoid building your menu repeatedly, the following code checks whether the menu already
exists.
procedure( TrCreateSchematicPulldownMenu()
if( boundp( ’TrSchematicPulldownMenu )
then TrSchematicPulldownMenu
else
hiCreatePulldownMenu( ’TrSchematicPulldownMenu ... )
) ; if
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-32
Advanced Customization 15-33
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What You Put into the .cdsinit File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-34
Advanced Customization 15-35
deRegUserTriggers( "maskLayout"
nil
nil
’TrUserPostInstallTrigger
)
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Reordering Layout Editor Pull-Down Menus
Use the same approach as the first and second examples.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-36
Advanced Customization 15-37
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What You Put into the .cdsinit File
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-38
Advanced Customization 15-39
Customizing Forms
Assume your goal is to customize the default value or initial value of a form field.
To use SKILL to customize a form, follow these steps:
1. Declare a function that customizes a form field’s default value.
2. Use the defUserInitProc function to register your function as a user init proc
with SKILL.
When SKILL brings this form into memory, SKILL calls your function.
The next several pages explain these steps in greater detail.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Customizing Forms
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-40
Advanced Customization 15-41
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.
2. Observe the resulting SKILL expression in the CIW.
TrFileForm->TrFileNameField->value = "/tmp/report.txt"
A similar expression sets the default value. Use defValue instead of value.
TrFileForm->TrFileNameField->defValue = "/tmp/report.txt"
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Customizing the Default Value of a Form Field
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-42
Advanced Customization 15-43
➋ ➌
PRshare amSynUI schView selectSv .cdsinit schematic
Building your own context is beyond the scope of this course. See the SKILL User
Guide for details.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Design Framework II Initialization Sequence
Each executable can load different contexts. For example, the icfb executable loads the
following contexts: PRshare, amSynUI, schView and selectSv. 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-44
Advanced Customization 15-45
Example
procedure( TrCustomizeContext()
...
) ; procedure
Context User
initialization
function
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The defUserInitProc Function
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-46
Advanced Customization 15-47
The LSW is only present with the layout tools. By default once 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Manage the Layer Selection Window (LSW)
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 will 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 will need to use leRemapLSW.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-48
Advanced Customization 15-49
Lab Overview
Lab 15-1 Adding a Menu Item to the Composer Edit Menu
You study and run the lecture example.
Lab 15-2 Adding a Pull-Down Menu to Composer Window
You study and run the lecture example.
Lab 15-3 Reversing the Layout Editor Pull-Down Menus
You study and run the lecture example.
Lab 15-4 Customizing Initial Window Placement
You customize the Layout Editor to initially place all of its design windows in
a given location.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-50
Advanced Customization 15-51
Module Summary
In this module, we discussed
■ Customizing the Composer software and the Layout Editor.
■ Customizing form field default values.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 15-52
Module 16: Interprocess Communication
Objectives
■ Discuss the scope of SKILL IPC.
■ Discuss an example C program.
■ Spawn the C program as a separate UNIX child process.
■ Communicate synchronously with the child process.
■ Communicate asynchronously with the child process.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-2
Interprocess Communication 16-3
stderr
Child Process
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The Scope of SKILL IPC
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-4
Interprocess Communication 16-5
while ( *p )
{
if (*p != ’ ’ && islower(*p))
*p = toupper(*p); Force case
p++;
}
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-6
Interprocess Communication 16-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Comparing the Two Communication Styles
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-8
Interprocess Communication 16-9
ipcWriteProcess
stdin
SKILL
ipcReadProcess stdout
Program
stderr
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Spawning a Child Process
The ipcBeginProcess Function
Use the ipcBeginProcess function to spawn a UNIX process to execute a command or
sequence of commands. The ipcBeginProcess function returns an integer process ID.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-10
Interprocess Communication 16-11
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Synchronizing with the Child Process
The ipcWaitForProcess Function
Call the ipcWaitForProcess function before you send any data to the child process.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-12
Interprocess Communication 16-13
ipcWriteProcess
stdin
SKILL
ipcReadProcess stdout
Program
stderr
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Communicating with the Child Process
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-14
Interprocess Communication 16-15
Synchronous Communication
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Synchronous Communication
The ipcIsAliveProcess Function
If the child process is alive, the ipcIsAliveProcess function returns t. If the child process has
terminated, the ipcIsAliveProcess returns nil.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-16
Interprocess Communication 16-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Synchronous Communication Example
The TrUpperCaseList Function
The TrUpperCaseList function does the following:
■ Accepts a list of text strings as its single argument.
■ Returns the list of text strings that the child sends back.
■ Uses the functions in this table.
Function Purpose
ipcBeginProcess Launch a child process to execute the compiled
UpperCase.c program.
simplifyFilename Determine the full path name to the executable.
ipcWaitForProcess Synchronously wait for the child to launch.
ipcWriteProcess Write each text string in a list to the child process.
ipcReadProcess Synchronously wait for the child to send back data.
ipcKillProcess Terminate the child process.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-18
Interprocess Communication 16-19
Asynchronous Communication
Task Asynchronous Communication
Processing Child Data Data handler Specify to ipcBeginProcess
Processing Child Errors Error handler Specify to ipcBeginProcess
Determining Exit Status Postfunction Specify to ipcBeginProcess
Detecting Child Termination Postfunction Specify to ipcBeginProcess
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Asynchronous Communication
The SKILL Evaluator executes calls to data handlers, calls to postfunctions, and user input in
the order they are queued.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-20
Interprocess Communication 16-21
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Asynchronous Communication Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-22
Interprocess Communication 16-23
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Launching the Child Process
Function Purpose
ipcBeginProcess Launch a child process to execute to
the compiled UpperCase.c program.
simplifyFilename Determine the full path name to the
executable.
ipcWaitForProcess Synchronously wait for the child to
launch.
TrUpperCase_Write Write a text string to the child
process.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-24
Interprocess Communication 16-25
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Writing Data to the Child
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-26
Interprocess Communication 16-27
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.
■ Terminate the child.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Receiving Data from the Child Process
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-28
Interprocess Communication 16-29
Example of TrUpperCase_PostFunction
procedure( TrUpperCase_PostFunction( pid status )
printf( "Child %d result: %L\n" pid TrResult )
) ; procedure
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
The TrUpperCase_PostFunction Function
When a child process terminates, the Design Framework II environment queues a call to the
child’s postfunction, if one exists.
The call to the postfunction executes when the SKILL Evaluator is idle.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-30
Interprocess Communication 16-31
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Controlling the Child Process
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-32
Interprocess Communication 16-33
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-34
Interprocess Communication 16-35
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
Category Functions
Launching a child process ipcBatchProcess
ipcBeginProcess
Synchronizing with a ipcWaitForProcess
child process ipcWait
Controlling a child process ipcStopProcess
ipcContProcess
ipcSoftInterrupt
ipcKillProcess
ipcKillAllProcesses
Data communication ipcReadProcess
ipcWriteProcess
data handlers
postfunctions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 16-36
Module 17: Data Structures
Objectives
■ Implementing records in SKILL
— Disembodied property lists
— SKILL structures
■ Arrays
■ Associative data structures
— Association tables
— Association lists
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-2
Data Structures 17-3
Use the -> operator together with the = operator to update or add a field.
aCard->faceUp = t
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Implementing Records in SKILL
Disembodied Property Lists
The first element of the disembodied list does not have to be nil. It can be any SKILL data
object. The access operation ignores the first element.
You can use a disembodied property list to consolidate several arguments into a single
argument. Similarly, you can use a disembodied property list to consolidate several global
variables into a single global data structure.
When you apply the ~>?? operator to a database object, this operator builds a disembodied
property list. This list consists of the attributes and values of the database object.
The get function is a generalized version of the getq function. Both of its arguments are
evaluated.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-4
Data Structures 17-5
SKILL Structures
A SKILL structure is also logically equivalent to a record.
The defstruct function declares a template. It automatically defines a SKILL
creation function with the slot names as keyword parameters.
Example
1. Define a card structure and allocate an instance of card.
defstruct( card rank suit faceUp ) => t
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Structures
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-6
Data Structures 17-7
You can create slots dynamically for a specific instance by simply referencing
them with the -> operator.
aCard->marked = t => t
aCard->?? => (faceUp nil suit "spades" rank "ace"
marked t )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Accessing and Updating Structures
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-8
Data Structures 17-9
Arrays
SKILL provides arrays.
■ Elements of an array can be any datatype.
■ SKILL provides run-time array bounds checking.
Use the declare function to allocate an array of a given size.
Example
declare( week[7] ) => array[7]:9780700
week => array[7]:9780700
type( week ) => array
arrayp( week ) => t
days = ’(monday tuesday wednesday
thursday friday saturday sunday)
for( day 0 length(week)-1
week[day] = nth(day days))
■ 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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Arrays
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.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-10
Data Structures 17-11
2-Dimensional Arrays
You can implement a 2-dimensional array as an array of row arrays.
procedure( Tr2DArray( nRows mCols)
let( ( rowArray row )
declare( rowArray[ nRows ] )
for( i 0 nRows-1
declare( row[ mCols ] )
rowArray[ i ] = row
) ; for
rowArray
) ; let
) ; procedure
TrTimesTable = Tr2DArray( 10 10 )
for( i 0 9
for( j 0 9
TrTimesTable[i][j] = i*j
) ; for
) ; for
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
2-Dimensional Arrays
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-12
Data Structures 17-13
Association Tables
An association table is a collection of key/value pairs.
You can use these SKILL data types as keys in a table:
■ integer
■ 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).
■ The default entry (optional).
The default of the default is the unbound symbol.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Association Tables
An association table is implemented as a hash table.
Association table access uses the equal function to compare keys.
Several list-oriented functions also work on tables, including iteration. Use these functions to
manipulate tables:
■ The foreach function executes a collection of SKILL expressions for each key in a table.
■ The setof function returns a list of keys in a given table that satisfies a given criterion.
■ The length function returns the number of keys in a table.
■ The remove function removes a key from a table.
Use the tablep function to test whether a data value is a table.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-14
Data Structures 17-15
TrTimesTable = Tr2D_DynamicArray( )
for( i 0 9
for( j 0 9
TrTimesTable[ list( i j ) ] = i*j
) ; for
) ; for
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Using Association Tables as Dynamic Arrays
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-16
Data Structures 17-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-18
Data Structures 17-19
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Traversing Association Tables
The readTable and writeTable Functions
Use these functions to read a table from a file and to write a table to a file.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-20
Data Structures 17-21
Association Lists
A list of key/value pairs is a natural means to record associations.
An association list is a list of lists. The first element of each list is the key.
assocList = ’( ( "A" 1 ) ( "B" 2 ) ( "C" 3 ) )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Association Lists
The tableToList Function
You can also convert an association table to an association list. Use the tableToList function
to build an association list from an association table.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-22
Data Structures 17-23
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Lab Overview
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-24
Data Structures 17-25
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Module Summary
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 17-26
Module 18: OpenAccess
Objectives
■ Understand OpenAccess
■ Understand how OpenAccess is related to DFII
■ Learn how to obtain OpenAccess
■ Locate additional information on OpenAccess
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Terms and Definitions
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-2
OpenAccess 18-3
What Is OpenAccess?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What Is OpenAccess?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-4
OpenAccess 18-5
OpenAccess Database
Schematics
Data Model
Reference Database Layout
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
OpenAccess Database
Advantages of OpenAccess:
■ 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
■ Non-proprietary — uses OpenSource model for distribution and enhancements
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-6
OpenAccess 18-7
Database-Centric Flows
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Database-Centric Flows
■ All tools communicate through the common API layer
■ Custom model extensions are allowed and can be created by customer or third party
■ Multiple tool flows share data without the need for translation
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-8
OpenAccess 18-9
Code Examples
Tech Database LPP API
Open the tech DB for a given cellview
gnCellView::getTech()
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Code Examples
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-10
OpenAccess 18-11
What is Si2?
Overview
Si2 is an organization of industry-leading silicon systems and tool companies
focused on improving productivity and reducing cost in creating and producing
integrated silicon systems.
Mission
To provide value-added services and to transfer technologies that reduce the cost
and complexity of silicon design and integration.
Key Strategies
■ Facilitate collaborative customer-driven solutions definition, development,
and implementation
■ Engage and support EDA Industry Council thrusts
■ Provide dedicated support services, which accelerate adoption of solutions
■ Technology transfer
■ Project management
■ Testing services
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What is Si2?
History
Si2 was founded in 1988 as CAD Framework Initiative, Inc. Today Si2 represents
semiconductor manufacturers, electronic systems companies, and EDA tool suppliers in North
America, Europe, and Asia.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-12
OpenAccess 18-13
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
What Does OpenAccess Mean for IC 5.0?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-14
OpenAccess 18-15
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
How Does OpenAccess Affect DFII?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-16
OpenAccess 18-17
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
How Will DFII on OA Be Supported?
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-18
OpenAccess 18-19
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
How to Obtain OpenAccess
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-20
OpenAccess 18-21
Si2 Information
http://www.openEDA.org
OpenAccess Training
■ Students should:
— have experience with C++ software development
— have experience with some EDA database
— undertand the basics of physical IC design data
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Where to Go for Information
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming 18-22
Appendix A
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Appendix A: Cellview Data Model Map
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming A-2
Cellview Data Model Map A-3
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming A-4
Appendix B
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
~/SKILL/CaseStudy/ShowFileBrowser.il
trDatabaseObjectTable = nil
defstruct( trDbObjectStruct
dbObject;;; the database object
dbNeighborhood;;; the neighborhood of the object
browserId;;; the window id of the browser
)
;;; trGetDbObjectReference
;;; insures that the dbObject is entered in the table.
;;; returns the database object reference
dbObjectReference = strcat(
dbObject~>objType ;;; use the objType in symbol name
substring( dbstr 4 );;; use same digits as in db:123456789
)
dbObjectStruct = trDatabaseObjectTable[ dbObjectReference ]
unless( dbObjectStruct
trDatabaseObjectTable[ dbObjectReference ] =
dbObjectStruct = make_trDbObjectStruct( ?dbObject dbObject )
) ; unless
dbObjectReference
) ; let
) ;procedure
;;; trDbObjectFromString
;;; returns the database object that corresponds to the textString
www.cadfamily.com
7/26/02 EMail:[email protected]
SKILL Language Programming B-1
The document is for study only,if tort to your rights,please inform us,we will delete
trDatabaseObjectTable[ textString ]->dbObject
) ; procedure
;;; trDbObjectReferences
;;; returns an expression with all database objects replaced
;;; by database object references.
;;; trNeighborhood
;;; returns the neighborhood of the database object.
;;; enters the database object in the table.
www.cadfamily.com
B-2 EMail:[email protected]
SKILL Language Programming 7/26/02
The document is for study only,if tort to your rights,please inform us,we will delete
;;; dbAppReferenceForDbObject
;;; returns an application specific text string
;;; describing the database object
;;; This is used for the browser title
)
( "net"
sprintf( nil
"net: %s"
dbObject~>name
)
)
( "inst"
sprintf( nil
"inst: %s master: %s"
dbObject~>name
dbAppReferenceForDbObject( dbObject~>master )
)
)
( "instTerm"
sprintf( nil
"instTerm: %s %s %s"
dbObject~>name
dbAppReferenceForDbObject( dbObject~>net )
dbAppReferenceForDbObject( dbObject~>inst )
)
)
( "term"
sprintf( nil
"term: %s direction: %s %s"
dbObject~>name
dbObject~>direction
dbAppReferenceForDbObject( dbObject~>net )
)
)
www.cadfamily.com
7/26/02 EMail:[email protected]
SKILL Language Programming B-3
The document is for study only,if tort to your rights,please inform us,we will delete
( t;;; the most generic way to represent a database object symbol
trGetDbObjectReference( dbObject )
)
) ; case
) ; procedure
;;; trGetTextSelection
;;; returns the reverse of the usual text selection in the view file window
;;; trGetCurrentDbObject
;;; returns the the current database object
;;; which is either the one whose reference is selected
;;; or the browser window.
;;; Note that trGetCurrentDbObject() assumes that
;;; the current window is a browser window.
procedure( trGetCurrentDbObject()
"return the current database object"
let( ( browserId dbObject selection dbObjectReference )
browserId= hiGetCurrentWindow()
selection= car( trGetTextSelection( browserId ))
if( selection
then
trDbObjectFromString( selection )
else
trDatabaseObjectTable[ browserId->dbObjectReference ]->dbObject
) ;if
) ; let
) ; procedure
;;; trBrowserPopMenuCB
;;; the callback routine for the Browser pop-up menu
www.cadfamily.com
B-4 EMail:[email protected]
SKILL Language Programming 7/26/02
The document is for study only,if tort to your rights,please inform us,we will delete
)
( raiseParentBrowser
when( windowp(browserId->parentBrowser)
hiRaiseWindow( browserId->parentBrowser )
) ; when
)
( raiseChildBrowser
when( windowp(browserId->childBrowser)
hiRaiseWindow( browserId->childBrowser )
) ; when
)
( raiseCellViewWindow
hiRaiseWindow(
trParentCellViewWindow( trGetCurrentDbObject()~>cellView ) )
)
( raiseCIW
hiRaiseWindow( hiGetCIWindow())
)
( clearSelection
hiUnselectTextAll( browserId )
)
(t println( ‘(Bad call to trBrowserPopMenuCB: ,actionSymbol)))
) ;cond
) ; let
) ; procedure
;;; trObjectMenus
;;; is an association table that stores a pop-up for each object type
trObjectMenus = nil
hiCreateSimpleMenu(
’trFigurePopUp
"Figure Menu"
’(
"Select in Graphics Editor"
"Probe Net in Graphics Editor"
)
’(
"trObjTypeMenuCB( ’selectFig )"
"trObjTypeMenuCB( ’probeFigureNet )"
)
"" ; empty help string
) ; hiCreateSimpleMenu
hiCreateSimpleMenu(
’trNetPopUp
"Net Menu"
’(
www.cadfamily.com
7/26/02 EMail:[email protected]
SKILL Language Programming B-5
The document is for study only,if tort to your rights,please inform us,we will delete
"Probe in Graphics Editor"
)
’(
"trObjTypeMenuCB( ’probeNet )"
)
"" ; empty help string
) ; hiCreateSimpleMenu
trFigureObjTypes = ’(
"arc"
"dot"
"donut"
"ellipse"
"label"
"line"
"path"
"polygon"
"rect"
"textDisplay"
"inst" ;;; conflicts with the inst menu
;;; "mosaic"
;;; "mosaicInst"
)
;;; trInitObjectMenus
;;; stores the various object menus in the trObjectMenu table
procedure( trInitObjectMenus( )
trObjectMenus = makeTable( "Object Menus" nil )
;;; trObjectTypePopUp
;;; pops up the object menu for the selected object
procedure( trObjectTypePopUp()
"pop up the menu based on the text selection"
let( ( menuToDisplay dbObject )
dbObject = trGetCurrentDbObject()
menuToDisplay = trObjectMenus[ dbObject~>objType ]
if( menuToDisplay
www.cadfamily.com
B-6 EMail:[email protected]
SKILL Language Programming 7/26/02
The document is for study only,if tort to your rights,please inform us,we will delete
then
hiDisplayMenu( menuToDisplay )
else
printf( "\nNo menu for %L" dbObject )
) ; if
) ; let
) ; procedure
;;; trObjTypeMenuCB
;;; is the common callback for all the object type menus
;;; trOpenCellView
;;; opens a window on cellView
procedure( trOpenCellView( cv )
geOpen(
?window nil
?lib cv~>libName
?cell cv~>cellName
?view cv~>viewName
;;; ?versioncv~>versionName
?mode "r"
)
) ; procedure
;;; trParentCellViewWindow
;;; returns a window viewing the dbObject’s cellView ...
;;; Either take the first window viewing the cellview
;;; or open a new window
www.cadfamily.com
7/26/02 EMail:[email protected]
SKILL Language Programming B-7
The document is for study only,if tort to your rights,please inform us,we will delete
procedure( trParentCellViewWindow( dbObject )
let( ( theWindow theCellView )
theCellView= dbObject~>cellView
theWindow=
car(
exists( wid hiGetWindowList()
hiGetWidgetType( wid ) == "graphics" &&
theCellView == geGetWindowCellView( wid )
) ; exists
) ; car
theWindow || trOpenCellView( theCellView )
) ; let
) ; procedure
;;; trSelectFig
;;; selects the figure in the parent cell view window
;;; trProbeNet
;;; puts a net probe on the net
;;; using trProbeColor
www.cadfamily.com
B-8 EMail:[email protected]
SKILL Language Programming 7/26/02
The document is for study only,if tort to your rights,please inform us,we will delete
?probeType "net"
?object dbObject
?color trProbeColor
?window cellViewWindowId
)
hiRaiseWindow( cellViewWindowId )
) ; when
) ; let
) ; procedure
;;; trProbeFigureNet
;;; probes the figure’s net
www.cadfamily.com
7/26/02 EMail:[email protected]
SKILL Language Programming B-9
The document is for study only,if tort to your rights,please inform us,we will delete
"Clear Selection"
)
’(
"trBrowserPopMenuCB( ’browse )"
"trBrowserPopMenuCB( ’raiseParentBrowser )"
"trBrowserPopMenuCB( ’raiseChildBrowser )"
"trBrowserPopMenuCB( ’raiseCellViewWindow )"
"trBrowserPopMenuCB( ’raiseCIW )"
"trBrowserPopMenuCB( ’clearSelection )"
)
"" ;empty help string
)
hiSetMenu( menuSymbol browserId )
menuSymbol;;; return value
) ; let
) ; procedure
) ; procedure
;;; trOpenBrowser
;;; Opens a browser on the dbObject.
;;; Return the length of the trDatabaseObjectTable.
www.cadfamily.com
B-10 EMail:[email protected]
SKILL Language Programming 7/26/02
The document is for study only,if tort to your rights,please inform us,we will delete
;;; use window properties to cross-correlate the windows
browserId->parentBrowser = parentId
when( parentId
parentId->childBrowser = browserId
) ; when
dbObjectStruct->browserId = browserId
browserId->dbObjectReference= dbObjectReference
trBrowserPopUpMenu( browserId )
length( trDatabaseObjectTable )
) ; let
) ; procedure
;;; trShowFileBrowser
;;; Opens a browser on the dbObject.
;;; If one already exists, raise it.
;;; trBrowseSelectedSet
;;; opens a browser on the first object in the selected set
www.cadfamily.com
7/26/02 EMail:[email protected]
SKILL Language Programming B-11
The document is for study only,if tort to your rights,please inform us,we will delete
when( object
trShowFileBrowser( object )
) ; when
) ; let
) ; procedure
;;; trBrowseCellView
;;; opens a browser on the cellview in the window
;;; trInitShowFileBrowser
;;; set bind keys used by the Show File Browser
procedure( trInitShowFileBrowser()
trCloseBrowsers()
trDatabaseObjectTable = makeTable( "Database Object Table" nil )
trInitObjectMenus( )
hiSetBindKey( "Show File" "None<Btn2Down>" "mousePopUp()" )
hiSetBindKey( "Show File" "None<Btn3Down>" "trObjectTypePopUp()" )
;;; trCloseBrowsers
;;; closes all the browser windows
procedure( trCloseBrowsers()
let( ( wid )
foreach( key trDatabaseObjectTable
when( wid = trDatabaseObjectTable[ key ]->browserId
errset( hiCloseWindow( wid ))
) ; when
) ; foreach
) ; foreach
) ; procedure
trInitShowFileBrowser()
www.cadfamily.com
B-12 EMail:[email protected]
SKILL Language Programming 7/26/02
The document is for study only,if tort to your rights,please inform us,we will delete
Appendix C
OCEAN Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Appendix C: OCEAN Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
OCEAN Example
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming C-2
OCEAN Example C-3
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
OCEAN SKILL Script to Control Simulation
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming C-4
OCEAN Example C-5
simulator( 'spectre )
design(
"/home1/userA/oceanExample/simulation/testocean/spectre/schematic/
netlist/netlist")
resultsDir(
"/home1/userA/oceanExample/simulation/testocean/spectre/schematic" )
analysis('tran ?stop "10u" )
temp( 27 )
run()
selectResult( 'tran )
plot(getData("/Vin") getData("/Out") )
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
SKILL Script Output from Session->Save Script...
The content of this file reflects the simulation setup and execution just completed.
You can further edit this file and use SKILL constructs such as loops and variables to
customize the script.
For example, you could place the expressions in a for loop and use a variable for the
temperature to plot the results over a temperature range.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming C-6
OCEAN Example C-7
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
Running the SKILL Script in Batch Mode
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming C-8
OCEAN Example C-9
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming C-10
OCEAN Example C-11
OCEAN Demonstration
To see a demonstration of OCEAN, open the file ./animations/oceanscript.gif in a
Web browser.
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
OCEAN Demonstration
www.cadfamily.com EMail:[email protected]
The document is for study only,if tort to your rights,please inform us,we will delete
7/26/02 SKILL Language Programming C-12