VersIC user skill API

Overview

The Perforce SKILL API enables integration of our Cadence client VersIC into your custom design flows. You can call the VersIC SKILL API functions directly from your SKILL procedures, allowing you to seamlessly perform DM operations without requiring the use of the VersIC GUI. 

Functionality supported in the VersIC SKILL API includes: 

  1. Add/Delete 

  2. Checkin/Checkout/Revert 

  3. Copy 

  4. Status query functions 

  5. Hierarchical operations 

Note to users If you require some capability that is not yet available in the API, Perforce are able to leverage the modular architecture of VersIC to quickly add features to the already comprehensive API. 

VersIC also has hooks for user-defined triggers, so you can run your own SKILL procedures when certain events occur in VersIC. See User defined triggers for more information.

Function Argument Syntax

Coding Examples

Note: VersIC has an evolving user Skill API for programmatical DM operations. Keep us apprised of your programming needs, if we can accommodate your requirements we will.

Functions

  Function Name Description Arguments Returns

Examples

1 vscUserIsManaged Is the object managed? d_obj - ddObj|db_cvId|directory|file

Returns:
t - object is managed by VersIC
nil - object is not managed by VersIC

1) Is the cellview (opamp,opamp,schematic) managed by VersIC?
vscUserIsVscObj(ddGetObj("opamp" "opamp" "schematic"))

2) Is a file managed? vscUserIsManaged("~/myProject/myWorkarea/opamp/aFile.txt")

2 vscUserIsVscObj
vscUserIsVscFile
Deprecated (see vscUserIsManaged)  

 

 

3 vscUserGetLibs Get the list of VersIC managed libraries ?b_refresh - refresh the list of managed libraries

Returns:
list of managed libraries
nil - no managed libraries

1) Update and return the list of managed libraries
vscUserGetLibs(?refresh t)

4 vscUserAdd Add database object(s) to VersIC

d_obj/l_objs - ddObj/list of ddObjs
?b_commit - commit(checkin) the added data ?t_message - checkin message (ignored if commit is not set)

t - object(s) were added to VersIC
nil - object(s) were not added

1) Add the cellview (opamp,opamp,schematic)
vscUserAdd(ddGetObj("opamp" "opamp" "schematic"))

2) Add cells opamp and twoStage
vscUserAdd(list(ddGetObj("opamp" "opamp") ddGetObj("opamp" "twoStage")))

5 vscUserAddLib Add database object(s) to VersIC

t_lib - Library name
?t_path - Path to library directory
?t_message - Log message for add operation

t - Library was added to VersIC
nil - Library was not added to VersIC

1) Add the library "myLib" at the top level of the workarea
vscUserAddLib( "myLib" ?path "~/myProject/myWorkarea/cds_libs")

6 vscUserUpdate Update/Sync a managed object d_obj  - ddObj

t - object was updated
nil - object was not updated

1) Update the library opamp
vscUserUpdate(ddGetObj("opamp"))

2) Update a cellview
vscUserUpdate(ddGetObj("opamp" "opamp" "schematic"))

7 vscUserCheckout Checkout objects in VersIC d_obj/l_objs  - ddObj/list of ddObjs

t - all object(s) were checked out (or were already checked out)
nil - one or more objects was not checked out

1) Checkout a cellview
vscUserCheckout(ddGetObj("opamp" "opamp" "schematic"))
or
vscUserCheckout("opamp/opamp/schematic")

2) Checkout a cell
vscUserCheckout(ddGetObj("opamp" "schematic"))

3) Checkout the cell level properties file
vscUserCheckout("opamp/opamp/data.dm")

4) Checkout a list of cells
vscUserCheckout(list("opamp/opamp" "opamp/anotherCell"))

8 vscUserCheckin Checkin (commit) objects in VersIC

l_objs - ddObjs|files|directories (single obj also supported)
?b_addNew - Non-nil value to add unmanaged data during checkin
?t_message - Log message

t - all objects were checked in
nil - one or more objects were not checked in

1) Checkin cellview (opamp, opamp, schematic)
vscUserCheckin(ddGetObj("opamp" "opamp" "schematic"))
or
vscUserCheckin("opamp/opamp/schematic")

2) Checkin everything in library 'opamp', use the given log message
vscUserCheckin(ddGetObj("opamp") ?message "Done with changes in 'opamp'")

3) Checkin the cell level properties file
vscUserCheckin("opamp/opamp/data.dm")

4) Checkin a list of cells
vscUserCheckin(list("opamp/opamp" "opamp/anotherCell"))

9 vscUserCancel Revert (cancel) checked out objects in VersIC l_objs  - ddObjs|files|directories (single obj also supported)

t - all objects were cancelled/reverted
nil - one or more objects were not cancelled/reverted

1) Cancel checkout of cellview (opamp,opamp,schematic)
vscUserCancel(ddGetObj("opamp" "opamp" "schematic"))
or
vscUserCancel("opamp/opamp/schematic")

10 vscUserDelete Delete objects in VersIC

l_objs - list of ddObjs|files|directories (or single obj)
t_message - Log message for delete operation
?b_keepLocal - Delete repository data and keep the local data

t - all objects were deleted

nil - one or more objects were not deleted

1) Delete cellview (opamp,opamp,schematic)

vscUserDelete(ddGetObj("opamp" "opamp" "schematic"))
or
vscUserDelete("opamp/opamp/schematic")
11 vscUserIsCheckedOutByMe Is file (or any file in a directory) locked by current user? d_obj  - ddObj|directory|file|db_cvId

t - object is checked out by current user, in current workspace
nil - object is not checked out by current user, in current workspace

1) Is (opamp,opamp,schematic) checked out by me?
vscUserIsCheckedOutByMe(ddGetObj("opamp" "opamp" "schematic"))

12 vscUserIsCheckedOutByOther Is file (or a file in directory) locked by another user? d_obj  - ddObj|directory|file|db_cvId

l_owners - list of checkout owners if object is checked out by others
nil - object is not checked out by anyone else

1) Is (opamp,opamp,schematic) checked out by other user(s)?
vscUserIsCheckedOutByOther(ddGetObj( "opamp" "opamp" "schematic" ))

13 vscUserPurgeCVs Purge (close) open cellviews belonging to ddObjs ( or all ) [d_ddObjs] - optional list of dd objects

list - length of list is number of open cellviews that were purged
nil - no cellviews were purged

Caution: Will discard unsaved changes

1) Purge all open cellviews in library 'opamp'
vscUserPurgeCVs(ddGetObj("opamp"))

14 vscUserIsObjStatus Is obj checked out by anyone? d_obj - ddObj

t - object is checked out
nil - object is not checked out

1) Check if anyone has data checked out in library opamp
vscUserIsObjStatus(ddGetObj("opamp"))

15 vscUserFileInfo Get informaton about a managed object/file/directory

obj - ddObj/file
[s_type] - optional ['last_change 'have 'repo, 'url, 'author, 'date]

(When using P4 only 'last_change' and 'have' are available)

[b_refresh] - refresh cached info

Without type: disembodied property list (DPL):
list( nil 'repo <repository> 'url <url> 'last_change <last commit revision> 'author <last commit author> 'date <last commit date> )

With type: value of requested info type or nil

1) Get the author of the last checkin of a cellview master file
vscUserFileInfo(ddGetObj("opamp" "opamp" "schematic" "*") 'author)

2) Get all available information about a cellview master file
vscUserFileInfo(ddGetObj("opamp" "opamp" "schematic" "*"))

16 vscUserFilesInfo Get informaton about managed objects/files/directories

objs - list of ddObjs/files
[s_type] - optional ['last_change 'have 'repo, 'url, 'author, 'date]

(When using P4 only 'last_change' and 'have' are available)

[b_refresh] - refresh cached info

Without type: list of disembodied property lists (DPL): - see vscUserFileInfo

With type: list of values of requested info type or nil

 
17 vscUserGetVersion Get the VersIC version identifier None t_version - e.g. "1.6.55"  
18 vscUserCheckAccess

(valid only if VSC_ACCESS_FILE is used)

Check if the user has permission for an action on given dir(s)
Arguments:

t_action - One of the actions from template access control file
l_objs - List of objects (or directories) to check access for
?t_accessfile - named access control file (default: VSC_ACCESS_FILE)
?t_user - check access for a named user (default: current user)

t - user is permitted to perform the action
nil - user is not permitted to perform the action

With the optional accessfile and user arguments, use this procedure to
verify changes to the access control file before release.

1) Does the current user have permission to checkout data in opamp?
vscUserCheckAccess('checkout ddGetObj("opamp"))

2) Does the user 'wayne' have permission to delete data in opamp using the given access file?
vscUserCheckAccess('delete ddGetObj("opamp")  ?accessfile "versic.access.new" ?user "wayne")

19 vscUserGetHierarchy Get the cellviews [and files] (ddObjs) in a hierarchy

t_lib - top-level library name
t_cell - top-level cell name
t_view - top-level view name
?l_inclibs - traverse into the named libraries. defaults to the top-level library
?l_switchViews - view patterns to traverse into
?l_listViews - view patterns to appear in results. skill-format wildcards are supported in switchViews and listViews; v matching is done on "^<pattern>$"
?s_listMode - list mode determines which views to list for each cell. valid values: ('all, 'listViews, 'switchViews). default 'all
?s_switchMode - switch mode determines which views to traverse valid values: ('all, 'allSwitch, 'firstSwitch 'instance) default: 'instance
?s_getFiles - list library-level and/or cell-level files valid values: (nil 'all, 'cell, 'library) default: nil

A disembodied property list:

list(nil
'cvs <list of cellview dd objects>
'files <list of file dd objects>)

 
20 vscUserCheckoutHierarchy Checkout a cell/cellview hierarchy

t_lib - top-level library name
t_cell - top-level cell name
?l_views - list of top-level view names
?l_inclibs - traverse into the named libraries

t - all cellviews in hierarchy scope are checked out by current user
nil - some cellviews could not be checked out

1) Checkout all cellviews in the (opamp, opamp) hierarchy, in any library
vscUserCheckoutHierarchy("opamp" "opamp" ?inclibs ddGetLibList()~>name)

2) Checkout all layout views in the (opamp, opamp) hierarchy that are in the opamp library
vscUserCheckoutHierarchy("opamp" "opamp" ?views '("layout") ?inclibs list("opamp"))

21 vscUserCheckinHierarchy Checkin a cell/cellview hierarchy

t_lib - top-level library name
t_cell - top-level cell name
?l_views - list of top-level view names
?l_inclibs - traverse into the named libraries

t_revision - revision or change number of successful checkin

nil - checkin failed on one or more cellviews in hierarchy

1) Checkin all cellviews in the (opamp, opamp) hierarchy, in any library
vscUserCheckinHierarchy("opamp" "opamp" ?inclibs ddGetLibList()~>name)

2) Checkin all layout views in the (opamp, opamp) hierarchy that are in the opamp library
vscUserCheckinHierarchy("opamp" "opamp" ?views '("layout") ?inclibs list("opamp"))

22 vscUserCancelHierarchy Cancel checkout/revert a cell/cellview hierarchy

t_lib - top-level library name
t_cell - top-level cell name
?l_views - list of top-level view names
?l_inclibs - traverse into the named libraries

t - All checked out cellviews in hierarchy were cancelled/reverted
nil - Cancel/revert failed for one or more cellviews in hierarchy

1) Cancel checkout of all cellviews in the (opamp, opamp) hierarchy, in any library
vscUserCancelHierarchy("opamp" "opamp" ?inclibs ddGetLibList()~>name)

2) Cancel checkout of all layout views in the (opamp, opamp) hierarchy that are in the opamp library
vscUserCancelHierarchy("opamp" "opamp" ?views '("layout") ?inclibs list("opamp"))

23 vscUserCopy Copy a cell or a cellview or a hierarchy

l_from - source data list (t_lib, t_cell, [l_views])
l_to - to data list (t_lib, [t_cell], [t_view])
?b_add - non-nil value to add copied data to the DM system
?b_history - non-nil value to copy with history ?b_commit - non-nil value to checkin copied data

?t_message - log message
?l_inclibs - include libs (if set, copy hierarchically)
?t_category - put copied data in a category

t - Copy was successful
nil - Copy failed or is incomplete

1) Copy (opamp,opamp,layout) to (opamp,opamp,layout_new), with history
vscUserCopy('("opamp" "opamp" "layout") '("opamp" "opamp" "layout_new") ?add t ?history t ?message "Copied layout to layout_new")

24 vscUserRetrieve Retrieve a previous version of data to new cell/cellviews

?t_lib - library name
?t_cell - cell name
?t_view - view name (omit to retrieve all views)
?d_revision - revision number
?t_suffix - suffix for retrieved data (default '_r<revision>')
?t_mode - "cellview" (default) or "cell"
"cellview" - Retrieve data to 'cell/cellview_<suffix>'
"cell" - Retrieve data to 'cell_<suffix>/cellview'

"lib" - Retrieve data to 'lib_<suffix>'

t - Retrieve was successful
nil - Retrieve failed or is incomplete

1) Retrieve rev 1000 of all cellviews in opamp,opamp to '<viewname>_r1000'
vscRetrieve(?lib "opamp" ?cell "opamp" ?revision 1000)

25 vscUserUpdateAllLibs Update all local managed libraries None

t - libraries were updated

nil - no local managed libraries

vscUserUpdateAllLibs()
26 vscUserCompareCellviews

Compare two cellviews, optionally report results in a file

db_cvIdA - reference cellview (db_cvId)
db_cdIdB - compare cellview (db_cvId)
?t_reportFile <file> - Name of report file
?b_display <t|nil> - Optionally display the results
?b_instProps<t|nil> - Optionally compare properties on instances (May significantly affect performance)
?b_shapeProps <t|nil> - Optionally compare properties on shapes (May significantly affect performance)
?b_layConns <t|nil> - Optionally compare connectivity on shapes (May significantly affect performance)

l_diff - a disembodied property list of differences

list(nil
instDiffs (list of instance differences)
shapeDiffs (list of instance differences)
viaDiffs (list of via differences))

nil - no differences

cvId_A = dbOpenCellview(<lib> <cell> <view>)
cvId_B = dbOpenCellview(<lib> <cell> <view>)
diffs = vscUserCompareCellviews(cvId_A cvId_B)
instDiffs = diffs->instDiffs

27 vscUserIsObjCurrent Is object in workarea the latest version? d_obj - ddObj

t - object in the workarea is the latest version

nil - a newer version of the object exists in the repository or the object does not exist or is unmanaged

1) Is all the data in the library opamp the latest version? vscUserIsObjCurrent(ddGetObj("opamp"))