Product Documentation
Virtuoso Text Editor User Guide
Product Version IC23.1, August 2023

A


Virtuoso Text Editor and HDL Package Setup Functions

This topic lists the Cadence® SKILL functions associated with Virtuoso® Text Editor and Virtuoso HDL Package Setup.

Only the functions listed below are supported for public use. All other functions, regardless of their name or prefix, and undocumented aspects of the functions described below, are private and are subject to change at any time.

Related Topics

Working With Text Cellviews

HDL Package Setup

hdlPkgCreateEnvSetupFile

hdlPkgCreateEnvSetupFile( 
t_fileName 
[ ?formatLList { t | nil }]
)
=> t / nil

Description

Saves the environment variables used by the HDL Package Setup from the current Virtuoso setup database into a specified file. Each name-value pair for a variable is printed in the following format:

envSetVal(t_tool[.Partition] t_varName s_varType g_newValue)

Arguments

t_fileName

The name of the file in which the settings are saved. You can use shell environment variables to specify the file name. If the specified file exists, it is overwritten. Otherwise, a new file is created.

?formatLList { t | nil }

Specifies whether long lists must be formatted. If set to t, each sublist is printed in a new line for the values of the environment variables, hdlPkgMakeLibTree and hdlPkgXrunArgsFileTableList.

Valid values are t and nil. The default is t.

The default value t makes the file more readable but formatting of the long-list string can take additional time. For faster performance, set ?formatLList to nil.

Value Returned

t

The environment variables used by the HDL Package Setup are saved in a file.

nil

An error was reported.

Examples

Before making a call to the function, ensure the following:

The following example describes how to use the hdlPkgCreateEnvSetupFile function in the CIW to save the HDL Package Setup settings from the current Virtuoso session.

hdlPkgCreateEnvSetupFile("$PROJ/myHDLPkgSetup")
=> t

Contents of the file "$PROJ/myHDLPkgSetup", when ?formatLList is set to t.

/**************************************************************************
Virtuoso HDL Package Setup
***************************************************************************/
envSetVal("hdlPkg" "hdlPkgEnableHdlSetup"   'toggle '(t))
envSetVal("hdlPkg" "hdlPkgProjDir" 'string "$PROJ/compileScratch")
envSetVal("hdlPkg" "hdlPkgEnableUVM" 'toggle '(t))
envSetVal("hdlPkg" "hdlPkgUVMVersion" 'string "IEEE")
envSetVal("hdlPkg" "hdlPkgEnableUPF" 'toggle '(t))
envSetVal("hdlPkg" "hdlPkgUseHdlvar" 'toggle '(nil))
envSetVal("hdlPkg" "hdlPkgHdlvarFile" 'string "")
envSetVal("hdlPkg" "hdlPkgAdvancedMode" 'toggle '(t))
envSetVal("hdlPkg" "hdlPkgUseXmlibdirname" 'toggle '(t))
envSetVal("hdlPkg" "hdlPkgXmlibdirname" 'string "XM2109")
envSetVal("hdlPkg" "hdlPkgMakeLibTree" 'string "(
(t \"pkgLib\" \"$PROJ/pkg_source/bill_pkg.sv\" \"\")
(t \"pkgLib\" \"$PROJ/pkg_source/fred_pkg.sv\" \"\")
)")
envSetVal("hdlPkg" "hdlPkgXrunArgsFileTableList" 'string "(
(t \"$PROJ/user_1.f\")
(nil \"$PROJ/user_2.f\")
)")

Contents of the file "$PROJ/myHDLPkgSetup", when ?formatLList is set to nil.

/**************************************************************************
Virtuoso HDL Package Setup
***************************************************************************/
envSetVal("hdlPkg" "hdlPkgEnableHdlSetup" 'toggle '(t)) envSetVal("hdlPkg" "hdlPkgProjDir" 'string "$PROJ/compileScratch") envSetVal("hdlPkg" "hdlPkgEnableUVM" 'toggle '(t)) envSetVal("hdlPkg" "hdlPkgUVMVersion" 'string "IEEE") envSetVal("hdlPkg" "hdlPkgEnableUPF" 'toggle '(t)) envSetVal("hdlPkg" "hdlPkgUseHdlvar" 'toggle '(nil)) envSetVal("hdlPkg" "hdlPkgHdlvarFile" 'string "") envSetVal("hdlPkg" "hdlPkgAdvancedMode" 'toggle '(t)) envSetVal("hdlPkg" "hdlPkgUseXmlibdirname" 'toggle '(t)) envSetVal("hdlPkg" "hdlPkgXmlibdirname" 'string "XM2109") envSetVal("hdlPkg" "hdlPkgMakeLibTree" 'string "((t \"pkgLib\" \"$PROJ/pkg_source/bill_pkg.sv\" \"\")(t \"pkgLib\" \"$PROJ/pkg_source/fred_pkg.sv\" \"\"))") envSetVal("hdlPkg" "hdlPkgXrunArgsFileTableList" 'string "((t \"$PROJ/user_1.f\")(nil \"$PROJ/user_2.f\"))")

Related Topics

hdlPkgExportXrunArgs

hdlPkgExportXrunArgs

hdlPkgExportXrunArgs( 
t_fileName 
[ ?format { t | nil } ]
[ ?isExpandPath { t | nil } ]
[ ?userSpecOnly { t | nil } ]
)
=> t / nil 

Description

Exports the xrun arguments corresponding to environment variables used by the HDL Package Setup from the current Virtuoso setup database into the specified file.

Arguments

t_fileName

The name of the file in which the xrun arguments are saved. You can use shell environment variables to specify the file name. If the specified file exists, it is overwritten. Otherwise, a new file is created.

?format { t | nil }

Specifies that each xrun argument must be printed in a new line.

Valid values are t and nil. The default is t.

?isExpandPath { t | nil }

Specifies that the specified relative file path or the file path containing shell environment variables must be expanded.

Valid values are t and nil. The default is nil.

?userSpecOnly { t | nil }

Specifies that only the user-specified options are exported.

When ?userSpecOnly is set to t, the -xmlibdirpath, -cdslib fileName options are ignored in all cases.

The settings specified for ?userSpecOnly and the hdl.var file check box in the Virtuoso HDL Package Setup form determine whether the user-specified -hdlvar option is ignored or considered during export.

When ?userSpecOnly is set to t:

  • If the hdl.var file check box is not enabled, a dummy hdl.var file is automatically generated, but ignored during export because it is not user-specified.
  • If the hdl.var file check box is enabled and a valid hdl.var file is specified, no dummy file is generated. The user-specified hdl.var file is exported.

When ?userSpecOnly is set to nil:

  • If the hdl.var file check box is not enabled, a dummy hdl.var is generated and exported.
  • If the hdl.var file check box is enabled, no dummy file is generated. The user-specified hdl.var file is exported irrespective of the value set for ?userSpecOnly.

Value Returned

t

The environment variables used by the HDL Package Setup are saved in a file.

nil

An error was reported.

Examples

Before making a call to the function, ensure the following:

The following example describes how to use the hdlPkgExportXrunArgs function in the CIW to export the xrun arguments corresponding to the HDL Package Setup settings from the current Virtuoso session into a file.

hdlPkgExportXrunArgs("$PROJ/xrunArgs_exported")
=> t

Contents of the file $PROJ/xrunArgs_exported when ?userSpecOnly is set to t.

// Virtuoso HDL Package Setup
// User Name: xxxxxxx
// Save Time: Mar 16 02:35:52 2022
// Xcelium Version: 22.03-a001-20220315
// IC subversion: ICADVM20.1-64b.XXXX.xxx
// -xmlibdirpath $PROJ/compileScratch -xmlibdirname XM2109 // -cdslib $PROJ/compileScratch/cds.lib // -hdlvar $PROJ/compileScratch/hdl.var -uvm -uvmhome CDNS-IEEE -makelib worklib -sv ${_XRUNROOT_}/inca/files/1801/upf_package.sv -endlib -f $PROJ/user_1.f -makelib pkgLib $PROJ/pkg_source/bill_pkg.sv -endlib -makelib pkgLib $PROJ/pkg_source/fred_pkg.sv -endlib

Contents of the file $PROJ/xrunArgs_exported when ?userSpecOnly is set to nil.

// Virtuoso HDL Package Setup
// User Name: xxxxxxx
// Save Time: Mar 16 02:35:52 2022
// Xcelium Version: 22.03-a001-20220315
// IC subversion: ICADVM20.1-64b.XXXX.xxx
-xmlibdirpath $PROJ/compileScratch -xmlibdirname XM2109 -cdslib $PROJ/compileScratch/cds.lib -hdlvar $PROJ/compileScratch/hdl.var -uvm -uvmhome CDNS-IEEE -makelib worklib -sv ${_XRUNROOT_}/inca/files/1801/upf_package.sv -endlib -f $PROJ/user_1.f -makelib pkgLib $PROJ/pkg_source/bill_pkg.sv -endlib -makelib pkgLib $PROJ/pkg_source/fred_pkg.sv -endlib

Related Topics

hdlPkgCreateEnvSetupFile

teDiscardEdits

teDiscardEdits(
d_cvId
)
=> t / nil

Description

Rolls back the recent updates being done in all the opened editors displaying the specified cellview to the last saved changes.

Arguments

d_cvId

Cellview ID of the schematic in which the edits have been discarded.

Value Returned

t

Successfully reverted edits in the cellview.

nil

The changes in the cellview could not be reverted.

Example

Consider that the myCellView is the id of text cellview opened in Virtuoso Text Editor. You can discard the edits as shown here:

myCellView = ddGetObj(“myLib” “myCell” “myVerilogView”)
teDiscardEdits(myCellView)

teGetCursorPosition

teGetCursorPosition(
[ g_windowId ]
)
=> charPosition / nil

Description

Returns the character position of the cursor in the current or specified Virtuoso Text Editor window.

The character position that this function returns is different from the line and character position displayed at the bottom-right side of the Virtuoso Text Editor window. The function counts all the characters before the current position starting from zero, and does not consider the line number. See the following figure.

Arguments

g_windowId

The optional window ID of the Virtuoso Text Editor session.

Value Returned

charPosition

The numeric character position of the cursor.

nil

The character position is not retrieved because of an error.

Example

Consider that a text cellview is opened in Virtuoso Text Editor whose window ID is 2. The following are the first two lines of the text cellview:

//systemVerilog HDL for "demo_lib", "can_counter" "systemVerilog"
module can_counter ( clk, load, count, dispense, empty );

Place the cursor after module and just before can_counter on the second line. Notice that the line and character position displayed at the bottom-right corner of the window is L2 C8 for line 2 and character 8.

As illustrated below, run teGetCursorPosition from Virtuoso CIW to get the character position in the text cellview. Then run the same function to display the character position on window ID 2. Run the function using another window ID and notice the return value.

teGetCursorPosition()
73
teGetCursorPosition(window(2))
73
teGetCursorPosition(window(1))
nil

teIsModified

teIsModified(
d_cvId
)
=> t / nil

Description

Checks if a given text cellview been modified since last save.

Arguments

d_cvId

Cellview ID of the schematic which is being checked.

Value Returned

t

The text cellview has been modified by any active text editor.

nil

The cellview is not a text cellview or was not modified.

Example

Consider that the myCellView is the ID of the text cellview opened in Virtuoso Text Editor. You can check for the edits as shown here:

myCellView = ddGetObj(“myLib” “myCell” “myVerilogView”)
when(teIsModified(myCellView) info(“CellView is modified\n”))

teSave

teSave(
d_cvId
)
=> t / nil

Description

Saves the edits done in the text editor cellview.

Arguments

d_cvId

Cellview ID of the schematic which is being saved.

Value Returned

t

The text cellview has been saved.

nil

The text cellview has not been saved.

Example

Consider that the myCellView is the ID of the text cellview opened in Virtuoso Text Editor. You can save the edits as shown here:

myCellView = ddGetObj(“myLib” “myCell” “myVerilogView”)
teSave(myCellView)

teSaveWithDerivedData

teSaveWithDerivedData(
d_cvId
)
=> t / nil

Description

Saves the in-memory content of the text editor open for the given cellview and generates the derived data (typically, creates a shadow database).

Arguments

d_cvId

Cellview ID of the schematic which is being saved.

Value Returned

t

The text cellview has been saved and derived data created successfully.

nil

The the cellView is not a text cellview, has not been saved, or the derived data could not be created.

Example

Consider that the myCellView is the ID of the text cellview opened in Virtuoso Text Editor. You can save the edits as shown here:

myCellView = ddGetObj(“myLib” “myCell” “myVerilogView”)
teSaveWithDerivedData(myCellView)

teSetCursor

teSetCursor(
x_charPosition
[ g_windowId ]
)
=> t / nil

Description

Places the cursor on the specified character position in the current or specified Virtuoso Text Editor window.

Arguments

x_charPosition

The character position where you want to place the cursor.

g_windowId

The optional window ID of the Virtuoso Text Editor session.

Value Returned

t

The cursor is placed at the specified character position.

nil

The cursor is not placed because of an error.

Example

Consider that a text cellview is opened in Virtuoso Text Editor whose window ID is 2. The following are the first two lines of the text cellview:

//systemVerilog HDL for "demo_lib", "can_counter" "systemVerilog"
module can_counter ( clk, load, count, dispense, empty );

Place the cursor after module and just before can_counter on the second line. As illustrated below, run teGetCursorPosition from Virtuoso CIW to get the character position. Run teSetCursor to place the cursor on the fifth character. Notice that the line and character position displayed at the bottom-right corner of the Virtuoso Text Editor window becomes L1 C6 for line 1 and character 6. Run teGetCursorPosition again. Now, place the cursor in the begining of the text cellview using teSetCursor for the window ID 2.

teGetCursorPosition()
73
teSetCursor(5)
t
teGetCursorPosition()
5
teSetCursor(0 window(2))
t

teSetEditMode

teSetEditMode(
d_cvId
d_mode
)
=> t / nil

Description

Sets the editing mode for the specifed cellview to read-only(r)or editable(a) based on the value of the mode argument.

Arguments

d_cvId

Cellview ID of the schematic which is being set to the edit mode.

d_mode

The editing mode.

Value Returned

t

The edit mode of the text cellview changed successfully.

nil

The edit mode of the text cellview could not be changed.

Example

Consider that the myCellView is the ID of the text cellview opened in Virtuoso Text Editor. You can set the edit mode as shown here:

myCellView = ddGetObj(“myLib” “myCell” “myVerilogView”) 
teSetEditMode(myCellView "a")

teRegPostExtractTrigger

teRegPostExtractTrigger(
s_symbol
)
=> t / nil

Description

Registers a user-defined function that is triggered after the text editor extraction completes.

Arguments

s_symbol

SKILL symbol for the trigger function.

This trigger function further accepts the following two arguments:

  • ddId: The ddId of the lib/cell/view being checked, which is fetched from the ddGetObj SKILL function.
  • success: A boolean, indicating success or failure.

Value Returned

t

The trigger was registered successfully.

nil

The trigger could not be registered.

Examples

The following example shows how the ExampTextPostExtract trigger procedure uses the ddID argument to retrieve the lib/cell/view names and the success argument to report a successful operation. The viewType and lib/cell/view names let you make the trigger function dependent upon the language used. The teRegPostExtractTrigger function is then used to register the trigger function.

procedure(ExampTextPostExtract(ddId success) 
    letseq(
     ( (viewName ddId~>name) 
(cellName ddId~>cell~>name)
(libName ddId~>lib~>name)
(masterId ddGetObj(libName cellName viewName "*"))
(viewType ddMapGetFileViewType(masterId))
)
printf("Library %L Cell %L View %L ViewType %L was extracted with success %L\n" libName cellName viewName viewType success )
)
)
teRegPostExtractTrigger('ExampTextPostExtract)

Related Topics

teRegPreExtractTrigger

teRegPreExtractTrigger

teRegPreExtractTrigger(
s_symbol
)
=> t / nil

Description

Registers a user-defined function that is triggered before the text editor extraction starts.

Arguments

s_symbol

SKILL symbol for the trigger function.

This trigger function further accepts the following argument:

  • ddId: The ddId of the lib/cell/view being checked, which is fetched from the ddGetObj SKILL function.

Value Returned

t

The trigger function was registered successfully.

nil

The trigger function could not be registered.

Examples

The following example shows how the ExampTextPreExtract trigger function uses the ddID argument to retrieve the lib/cell/view names. The viewType and lib/cell/view names let you make the trigger function dependent upon the language used.The teRegPreExtractTrigger function is then used to register the trigger function.

procedure((ExampTextPreExtract(ddId) 
    letseq(
     ( (viewName ddId~>name) 
(cellName ddId~>cell~>name)
(libName ddId~>lib~>name)
(masterId ddGetObj(libName cellName viewName "*"))
(viewType ddMapGetFileViewType(masterId))
)
printf("Library %L Cell %L View %L ViewType %L will be extracted\n" libName cellName viewName viewType )
)
)
teRegPostExtractTrigger('ExampTextPreExtract)

Related Topics

teRegPostExtractTrigger

teUnRegPostExtractTrigger

teUnRegPostExtractTrigger(
s_symbol
)
=> t / nil

Description

Unregisters functions previously registered by you so that they are no longer triggered after the text editor functionality is being run.

Arguments

s_symbol

SKILL symbol for the trigger function.

Value Returned

t

The trigger was unregistered successfully.

nil

The trigger could not unregister.

Example

You can unregister post trigger as shown here:

;; define post trigger
defun( postTrigger (cvId success)
   info("*** postTrigger called with lcv = '%s %s %s' and success = %L\n"
        cvId~>parent~>parent~>name cvId~>parent~>name cvId~>name success)
;; The success can have one of the following values: t, nil, or unknown.
;; ‘unknown’ refers to the scenario when there are warnings displayed but cannot determine if the operation was successful or not.
t
)
;; register post trigger
teRegPostExtractTrigger('postTrigger)
;; unregister post trigger
teUnRegPostExtractTrigger('postTrigger)

teUnRegPreExtractTrigger

teUnRegPreExtractTrigger(
s_symbol
)
=> t / nil

Description

Unregisters functions previously registered by you so that they are no longer triggered prior to running the text editor functionality.

Arguments

s_symbol

SKILL symbol for the trigger function.

Value Returned

t

The trigger was unregistered successfully.

nil

The trigger could not unregister.

Example

You can unregister pre trigger as shown here:

;; define pre trigger
defun( preTrigger (cvId)
   info("*** preTrigger called with lcv = '%s %s %s'\n"
        cvId~>parent~>parent~>name cvId~>parent~>name cvId~>name)
t
)
;; register pre trigger
teRegPreExtractTrigger('preTrigger)
;; unregister pre trigger
teUnRegPreExtractTrigger('preTrigger)

hdlGenerateTextDatabase

hdlGenerateTextDatabase( 
t_libName
t_cellName
t_viewName
) 
=> t / nil

Description

Generates the text database for analog and digital languages without requiring the Text Editor.

Arguments

t_libName

Specifies the library name of the cellview.

t_cellName

Specifies the name of the cellview.

t_viewName

Specifies the view name of the cellview.

Value Returned

t

If the database is generated successfully.

nil

If the database generation failed.

Example

To generate the text database for a given cell and print terminals:

when(hdlGenerateTextDatabase("myLib" "myCell" "myView")
    cv = dbOpenCellViewByType("myLib" "myCell" "myView")
    when(cv
        cv~>terminals~>name
    )

)


Return to top
 ⠀
X