Sunteți pe pagina 1din 12

Paper 12: The Successful Use of SKILL for Allegro/APD Customization:

Installation, User Interface and Programming Tips

Moody Dreiza, B.Eng.

Amkor Technology Inc.


(480) 821-5000 ext.5324
mdrei@amkor.com

INTERNATIONAL CADENCE USERSGROUP CONFERENCE


September 15-17, 2003
Manchester, NH
Abstract

During the past 12 months Amkor Technology Inc. has implemented the use of Cadence Allegro to address
some substrate design for silicon packaging. The nature of advanced packaging and the sheer number of
designers worldwide requires both customization of the design tool (with frequent changes) while
maintaining a simple user interface. This has been successfully achieved through the use of SKILL. While
SKILL is relatively straightforward there were a number of hurdles that had to be overcome. The paper
presented will deal with two main topics. The first will present an example of a network installation
(covering dozens of Cadence users) that allows for full control of the SKILL environment by the
individual/group responsible for maintenance. The second part of the paper will deal with customization
issues using SKILL and will focus heavily on GUI development and intellectual property (IP) protection.
While Cadence does offer a couple of classes on SKILL development (it is also true that none of these
classes are focused on Allegro/APD) there remains a plethora of items that are only learnt first-hand and
are not necessarily published in any one source. Some of these items will be highlighted including:

• The use of dynamic bitmaps in SKILL forms to guide users.


• The use of properties in SKILL coding to achieve results.
• Limitations of SKILL documentation and alternate resources.
• Miscellaneous SKILL functionality such as: the use of status bars to provide user feedback during the
running of SKILL routines.
• The protection of SKILL files using encryption and "licensing" methods.

Introduction: The challenge

Amkor’s core business and products are in a constant state of flux to meet customer requirements. As such
any CAD tool can never “rest on its laurels” and must constantly keep up while providing the users with
easy-to-use GUIs and systems. For Allegro/APD SKILL was the clear answer to that question.

However the use of SKILL presented a second and more complex problem the answer to which was not so
obvious. The framework would have to allow for quick introduction for new and updated SKILL routines.
It would also have to allow for dozens of internationally dispersed users while maintaining the sanity of the
CAD administrator. The first part of this paper will address this issue.

Once the structure had been mapped out many different SKILL routines could be developed. A number of
programming topics and examples will be presented in the second part of this paper.

Finally, the effort that was put into creating the different routines had to protected as Intellectual Property.
The last section in the paper will deal with measures that can be taken to avoid users simply walking off
with all of your SKILL code and distributing it to potential competitors.
1.0 The installation structure

The basic aim of this installation structure should be to allow the users immediate and automatic access to
the latest SKILL routines and library components. In this case it is assumed that all users work on a
network and network login scripts are employed to control user’s environment variables and env files
(which have to be modified after the basic installation of Allegro/APD). If this is not the case other
methods could be employed including the use of simple batch files.

The basic structure is shown in figure 1.0a:

FIGURE 1.0a (see next page for more details)

LOCAL RESOURCES

Environment Variables Configuration Files

Home Directory

A
Home env

Apd.illinit
B

Telenev Installation Directory

C
env

NETWORK RESOURCES
Design Library

FORM Files

F
Main.il
MENU Files

DEVICE Files
SKILL Files

NC_PARAM
Files
SKILL Files

ART_PARAM
Files

SCRIPT Files
Custom SKILL SKILL License
Functions Files
CLIP Files

ICON Files
On figure 1.0a we see:

• The “HOME” environment variable points (A and B) to the env and apd.illinit files in the “HOME”
directory. The env file in the home directory is the one that should be used by individuals to create
aliases.
• The “TELENV” environment variable points to (C) the env file in the installation directory. This env
file has been modified at install (via network login scripts) to take advantage of the network resources
by setting different paths. This can also be done in Allegro by using a script that runs at startup.
• The apd.illinit file in the home directory contains a simple line that loads “Main.il” on the network (E).
This way Every time the Cadence software is launched Main.il is reloaded (user gets the absolute latest
SKILL routines every time). SKILL updates are instant to all users.
• Users all share the same NCParameter and ArtParameter files. Thus all gerber and drill files exported
by your company are in the same format and can be changed by the tool administrator instantaneously.
• Installation/update of any SKILL based software (such as Ansoft’s ANF interface) can be done in
minutes regardless of the number of users.
• Library components can be made available to all users. Users are certain that they always have the
latest version of components.
• Remote users can be given routines to map the network drives that hold the SKILL routines so that
work can be done from, say, the user’s home. Remote sites could have mirror images of the local site’s
directory structure and this could be updated on a hourly/daily basis.
• There is only one instance of any SKILL routine, library component, script file, menu file (customize
the toolbars to show pull-downs for your company as shown in figure 1.0b), etc.

FIGURE 1.0b

Tip!

There is more interaction here than meets the eye. For example, each main SKILL routine has a
registered command that is then placed in the menu file for easy user access via pull-downs.
2.0 Programming Tips

I have never seen a SKILL training class that is geared for Allegro/APD users offered. Of course it can be
argued that the SKILL class offered by Cadence is generic to all products. This is certainly true but there is
something to be said for developing SKILL specifically for the product you will be writing the code in.

In this section I will be dealing with Allegro SKILL functions. These are characterized by the “axl” prefix
(which stands for Allegro Extension Language).

If you are just starting to use SKILL for Allegro the best way to start messing with this is to download the
following from http://sourcelink.cadence.com:

• Allegro/APD Design Guide: SKILL Reference Manual


• SKILL Language User Guide
• SKILL Language Reference
• Any of the freeware SKILL source code that is available. This will provide solid (working) examples.

In the course of twelve months one learns that not all functions are documented in the resources shown
above. A final source for information is located right in your Cadence install directory. Allegro 14.2 installs
the location is: <Install Directory>\PSD_14.2\share\pcb\examples\skill\DOC\FUNCS. This folder had a
much more up-to-date list than the documentation. Even then there are functions that do not seem to be
documented.
2.1 Using dynamic bitmaps in GUIs

In order to make your programs easily usable by the average user you should consider using changing
bitmaps to guide users. A simple example is given below. Simply substitute your own bitmaps for
bitmapA.bmp, bitmapB.bmp and bitmapC.bmp.

Tip!

Only 16-color bitmaps (4-bit or below) will work with Allegro SKILL. For example, 256 color
bitmaps won’t show up. Simply open your bitmap in MSPaint and save down.

/*
This routine gives an example of dynamic bitmaps. To run type the following
at the Allegro command line:
load "myCompanyDynabitmap.il" <enter>
myCompanyDynaBitmap <enter>
*/
axlCmdRegister( "myCompanyDynaBitmap" ‘myCompanyDynaBitmap)
(defun myCompanyDynaBitmap ()
; Define the form
myCompanyDynamicForm = axlFormCreate( (gensym) "myCompanyDynaBitmap.form" nil
‘myCompanyDynaBitmapFormAction t)
; Set default values for the form
axlFormSetField(myCompanyDynamicForm "womanSelect" 1)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpWoman" 1)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpMan" 0)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpAlien" 0)
; Display the form
axlFormDisplay(myCompanyDynamicForm)
axlUIWPrint(myCompanyDynamicForm "Look at this dynamic form!")
); end defun myCompanyDynaBitmap

; Simple bitmap callback function


(defun myCompanyDynamicFormBitmapCallback (myCompanyDynamicForm File)
(axlGRPDrwBitmap myCompanyDynamicForm "bitmapA.bmp")
(axlGRPDrwBitmap myCompanyDynamicForm "bitmapB.bmp")
(axlGRPDrwBitmap myCompanyDynamicForm "bitmapC.bmp")
);end defun myCompanyDynamicFormBitmapCallback

; Define the form actions


(defun myCompanyDynaBitmapFormAction (myCompanyDynamicForm)
(case myCompanyDynamicForm->curField
("womanSelect"
womanSelect = (myCompanyDynamicForm->curValue)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpWoman" 1)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpMan" 0)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpAlien" 0)
);end "womanSelect"
("manSelect"
manSelect = (myCompanyDynamicForm->curValue)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpWoman" 0)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpMan" 1)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpAlien" 0)
);end "manSelect"
("alienSelect"
alienSelect = (myCompanyDynamicForm->curValue)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpWoman" 0)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpMan" 0)
axlFormSetFieldVisible(myCompanyDynamicForm "bmpAlien" 1)
);end "alienSelect"
("Finish"
axlFormClose(myCompanyDynamicForm)
axlShell("redisplay")
); end "Finish"
);end case myCompanyDynamicForm->curField
);end defun myCompanyDynaBitmapFormAction

And the form file that goes along with this is shown here:
FILE_TYPE=FORM_DEFN VERSION=2
FORM
FIXED
PORT 41 20
HEADER "Dynamic Form Sample"

TILE
GROUP "User Identification"
GLOC 1 0
GSIZE 20 10
ENDGROUP

TEXT "What are you?"


TLOC 2 2
ENDTEXT

FIELD womanSelect
FLOC 2 4
CHECKLIST "A Woman" "whatAreYouControl"
ENDFIELD
FIELD manSelect
FLOC 2 6
CHECKLIST "A Man" "whatAreYouControl"
ENDFIELD
FIELD alienSelect
FLOC 2 8
CHECKLIST "An Alien" "whatAreYouControl"
ENDFIELD

FIELD Finish
FLOC 26 8
MENUBUTTON "Exit" 12 3
ENDFIELD

FIELD bmpWoman
THUMBNAIL bitmapA
FLOC 4 12
FSIZE 34 18
ENDFIELD

FIELD bmpMan
THUMBNAIL bitmapB
FLOC 4 12
FSIZE 34 18
ENDFIELD

FIELD bmpAlien
THUMBNAIL bitmapC
FLOC 4 12
FSIZE 34 18
ENDFIELD
ENDTILE
ENDFORM
The results of this simple example are shown here. Notice the radio buttons.

FIGURE 2.1a

The pictures shown above are beautiful but do not have any practical purpose. Instead one could display:
• A flow chart that changes as the user progresses through the form.
• A schematic that dynamically shows what is being asked of the user (instead of asking the user for
“the distance between the IC and the first bondable location” show what you are asking for
graphically)

2.2 Using properties in SKILL

One of the most useful features of SKILL is the ability to attach custom defined properties to items that you
create. Examples of where this comes in handy include:

• Easily identifying items that were created in SKILL for deletion. For example if you have a routine
that creates voids in a metal plane you may want to delete these voids afterwards. This may get tricky
if the user has added some voids manually that you don’t want to delete. What you need here is to
attach a property (myCompanyCreatedVoid = “true”) that allows you to easily distinguish the SKILL
created voids. One may argue that a list of the SKILL defined void dbids may be stored but this list
would be deleted if the database is closed or if the axlShell function is used.
• Storing user defined data for future use. Imagine a SKILL routine that requires 10 different values
input from a user. If the routine is to be run again (say in a few days time) but you want to avoid the
user having to reenter the values (examples myCompanyDieSize= “300” myCompanyDieThickness =
“100”) you can attach these as properties.

Tip!

It is suggested that all properties defined (and functions for that matter) are preceded by a unique
prefix such as your company’s name. This will avoid conflicts with Cadence defined properties.

The use of properties requires a property definition (once) using axlDBCreatePropDictEntry followed by
the use of axlDBAddProp for each item that is to have the property attached. It should also be noted that,
for example, axlDBCreatePropDictEntry does not list “voids” as an object that properties can be attached
to. However, you can still attach properties to a void by using the “shape” object in your
axlDBCreatePropDictEntry definition.
2.3 Displaying reports to users using comma separated (.csv) files.

The following has only been tested in the Windows environment. Results in UNIX can not be guaranteed.

As designs become more and more complex it is crucial to be able to collect information from a design
database and easily pass it on to customers and design analysts. One of the most acceptable media for such
information is in the form of MSExcel spreadsheets. The following example produces a simple report for a
given design and launches MSExcel at the end of the process. Notice the use of the axlHttp() function for a
purpose other than it is documented for.

/*
This routine creates a report of all the vias in the design.
Open a design with vias and at the Allegro command line type:
load "myCompanyViaReport.il" <enter>
myCompanyViaReport <enter>
*/
axlCmdRegister( "myCompanyViaReport" `myCompanyViaReport)
(defun myCompanyViaReport ()
; Find all of the vias in the design
allViasInDesign=list()
originalVisible=axlVisibleGet()
designName = axlCurrentDesign()
axlVisibleDesign(t)
axlShell("redisplay")
axlSetFindFilter(?enabled '(noall vias) ?onButtons '(noall vias))
allViasInDesign=axlGetSelSet(axlAddSelectAll())
axlClearSelSet()
; Open a file to work on
if(length(allViasInDesign)==0
then
axlUIConfirm("No vias in this design. Please try another design.")
else
writeOutFile = outfile("./myCompanyDesignViaReport.csv" "w")
fprintf(writeOutFile strcat("Design Via Report for " designName "\n\n"))
fprintf(writeOutFile "Via Location,Via Net Name,Padstack Name,Via Start
Layer,Via End Layer\n")
; Output data for each via to the file
foreach(via allViasInDesign
viaLocation = sprintf(nil "%L:%L" car(via->xy) cadr(via->xy))
fprintf(writeOutFile strcat(viaLocation ","))
fprintf(writeOutFile strcat(via->net->name ","))
fprintf(writeOutFile strcat(via->name ","))
fprintf(writeOutFile strcat(car(via->startEnd) ","))
fprintf(writeOutFile strcat(cadr(via->startEnd) "\n"))
);end foreach via allViasInDesign
; Close the file and wrap up
fprintf(writeOutFile "END OF FILE")
close(writeOutFile)
axlVisibleSet(originalVisible)
axlShell("redisplay")
axlUIConfirm( "Report has been generated in your working directory." )
; This next line launches Excel and displays the report
axlHttp("myCompanyDesignViaReport.csv")
);end if length(allViasInDesign)==0
);end defun myCompanyViaReport
2.4 Using a status bar to inform a user.

This function is not documented by Cadence and was used in Allegro/APD 14.2. It may not be available in
Allegro/APD 15.0. Please use at your own discretion.

This function is very handy to avoid the user wondering “what is going on?” after invoking a SKILL
function. The functions are:
axlMeterCreate(title, string, nil) ; This creates a status bar
axlMeterUpdate(percent, string) ; This updates the status bar. Use in “foreach” or “while” loop.
axlMeterDestroy() ; This takes the status bar off-screen
as a sample this code simply counts from 0 to 100000 showing the percentage while doing so.

/*
This routine displays a status bar.
At the allegro command line:
load "statusBar.il" <enter>
statusBar <enter>
*/
axlCmdRegister( "statusBar" `statusBar)
(defun statusBar ()
; Create the status bar
sprintf(string, "00 percent complete")
axlMeterCreate("This is an example...please wait", string, nil)
; Update the status bar
x=0
y=100000
while(x<=y
percent = round((float(x)/float(y)) * 100)
sprintf(string, "%L percent complete", percent)
axlMeterUpdate(percent, string)
x++
);end while
; Remove the status bar
axlMeterDestroy()
);end defun statusBar

The result of this routine is shown in figure

FIGURE 2.4a
3.0 Protecting SKILL routines to maintain Intellectual Property (IP)

After the effort has been put into developing SKILL routines it is essential to protect your new IP. While
none of these measures can be guaranteed to stop a competitor from stealing your code it will certainly
make it harder for them to do so.

3.1 Encrypt your SKILL code

This is useful for sharing SKILL code while keeping your coding techniques private. Make sure a backup
copy of your original (unencrypted) code is kept in a safe place.
Place the SKILL file to be encrypted in your local working directory and at the command line type:

skill <enter>
encrypt(“mySkillFile.il” “mySkillFile.eil”) <enter>
exit <enter>

This will create a new file with a .eil (encrypted SKILL file) which can not be read but will still function
just like any other SKILL file. Try doing this with any of the example files given earlier.

3.2 Creating a context (.cxt) file

The creation of a context file requires a development license. Using a context is desirable from a number of
aspects:

• Ease of distribution: Multiple SKILL files encompassing a complex routine may be used to create a
single context file.
• Ease of use: Context files do not need to be loaded using the load() function prior to use.
• Speed: Since context files are binary representations of SKILL this means that they do not need to be
interpreted at run-time.
• Security: Binary files can not be read/modified by competitors.

3.3 Link your SKILL code to a particular server

Encrypting your SKILL file only stops someone copying your coding techniques. The .eil file can still be
readily shared even without your consent. In order to keep a particular routine locked to a single computer,
server or list of servers it is as easy as including the computer/server UNC codes in your SKILL In the
example below the UNC codes are “serverA” and serverB”). Once you have done this, encrypt your code
(or use a context) so that the use can not change the computer /server codes. An example is shown here for
a company that has two servers setup on a redundancy system (hence the “or”).
if( nil == or( isDir("//serverA/Cadence/skillfiles")
isDir("//serverB/Cadence/skillfiles"))
then
axlUIConfirm( "You are not authorized. Please contact mdrei@amkor.com" )
else……………
Author Bio

Moody Dreiza is a Senior Engineer working in the Tools and Process team at Amkor Technology Inc. in
Chandler, Arizona. During his three years with that company his responsibilities have included the
maintenance of a number of CAD/CAM tools including Cadence Allegro/APD. Amkor Technology Inc. is
the world's largest provider of contract semiconductor assembly and test services and has design centers
worldwide employing a large number of substrate designers. Moody holds a Bachelors degree in
Mechanical Engineering from the University of Manchester in England and has also worked for Honeywell
Inc. and Trane Inc.

S-ar putea să vă placă și