Amsskillref
Amsskillref
SKILL Reference
Product Version IC6.1.7
July 2017
© 2006–2017 Cadence Design Systems, Inc. All rights reserved.
Portions © Regents of the University of California, Sun Microsystems, Inc., Scriptics Corporation. Used by
permission.
Printed in the United States of America.
Cadence Design Systems, Inc. (Cadence), 2655 Seely Ave., San Jose, CA 95134, USA.
Product AMS contains technology licensed from, and copyrighted by: Regents of the University of California,
Sun Microsystems, Inc., Scriptics Corporation, and other parties and is © 1989-1994 Regents of the
University of California, 1984, the Australian National University, 1990-1999 Scriptics Corporation, and other
parties. All rights reserved.
Open SystemC, Open SystemC Initiative, OSCI, SystemC, and SystemC Initiative are trademarks or
registered trademarks of Open SystemC Initiative, Inc. in the United States and other countries and are
used with permission.
Trademarks: Trademarks and service marks of Cadence Design Systems, Inc. contained in this document
are attributed to Cadence with the appropriate symbol. For queries regarding Cadence’s trademarks,
contact the corporate legal department at the address shown above or call 800.862.4522. All other
trademarks are the property of their respective holders.
Restricted Permission: This publication is protected by copyright law and international treaties and
contains trade secrets and proprietary information owned by Cadence. Unauthorized reproduction or
distribution of this publication, or any portion of it, may result in civil and criminal penalties. Except as
specified in this permission statement, this publication may not be copied, reproduced, modified, published,
uploaded, posted, transmitted, or distributed in any way, without prior written permission from Cadence.
Unless otherwise agreed to by Cadence in writing, this statement grants Cadence customers permission to
print one (1) hard copy of this publication subject to the following conditions:
1. The publication may be used only in accordance with a written agreement between Cadence and its
customer.
2. The publication may not be modified in any way.
3. Any authorized copy of the publication or portion thereof must include all original copyright,
trademark, and other proprietary notices and this permission statement.
4. The information contained in this document cannot be used in the development of like products or
software, whether for internal or external use, and shall not be used for the benefit of any other party,
whether or not for consideration.
Disclaimer: Information in this publication is subject to change without notice and does not represent a
commitment on the part of Cadence. 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: Use, duplication, or disclosure by the Government is subject to restrictions as set forth
in FAR52.227-14 and DFAR252.227-7013 et seq. or its successor
Virtuoso AMS Designer Environment SKILL Reference
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Licensing Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Related Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
What’s New and KPNS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Installation, Environment, and Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Virtuoso Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Additional Learning Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Video Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Virtuoso Videos Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Rapid Adoption Kits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Help and Support Facilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Feedback about Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Understanding Cadence SKILL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Using SKILL Code Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Sample SKILL Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Accessing API Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Typographic and Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Identifiers Used to Denote Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1
AMS Designer SKILL Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
amsCheckCV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
amsIsPresent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
amsNetlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
amsProcessCellViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
amsUpdateTextviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
amsUIOptionsForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
amsUIRunNetlisterForm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
vmsUpdateCellViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2
SKILL Functions Supported for Netlisting . . . . . . . . . . . . . . . . . . . . . 33
amsError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
amsGetInstanceName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
amsGetNetlister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
amsGetPortExpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
amsGetUniqueName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
amsInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
amsMapName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
amsMtlinePrintParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
amsMtlineTermOrder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
amsNportTermOrder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
amsPrint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
amsPrintAlias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
amsPrintAliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
amsPrintAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
amsPrintAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
amsPrintInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
amsPrintInstanceMasterName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
amsPrintInstanceParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
amsPrintInstanceParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
amsPrintInstancePorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
amsPrintIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
amsPrintIOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
amsPrintParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
amsPrintParameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
amsPrintPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
amsPrintPorts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
amsPrintWire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
amsPrintWires . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
amsSpectreToVams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
amsWarning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Preface
The SKILL programming language lets you customize and extend your design environment.
SKILL provides a safe, high-level programming environment that automatically handles many
traditional system programming operations, such as memory management. SKILL programs
can be immediately executed in the Cadence environment.
This user guide is aimed at developers and designers of integrated circuits and assumes that
you are familiar with Cadence® SKILL language programming.
Scope
Unless otherwise noted, the functionality described in this guide can be used in both mature
node (for example, IC6.1.7) and advanced node (for example, ICADV12.3) releases.
Label Meaning
(Advanced Nodes Only) Features supported only in advanced node
releases that require an advanced node
license.
Licensing Requirements
For information about licensing in the Virtuoso design environment, see Virtuoso Software
Licensing and Configuration Guide.
Related Documentation
Virtuoso Tools
■ VirtuosoAMS Designer Environment User Guide
Video Library
The Video Library on the Cadence Online Support website provides a comprehensive list of
videos on various Cadence products.
To view a list of videos related to a specific product, you can use the Filter Results feature
available in the pane on the left. For example, click the Virtuoso Layout Suite product link
to view a list of videos available for the product.
You can also save your product preferences in the Product Selection form, which opens when
you click the Edit icon located next to My Products.
In addition, Cadence offers the following training courses on Virtuoso Analog Design
Environment L SKILL:
■ SKILL Language Programming Introduction
■ SKILL Language Programming
■ Advanced SKILL Language Programming
To explore the full range of training courses provided by Cadence in your region, visit
Cadence Training or write to [email protected].
Note: The links in this section open in a separate web browser window when clicked in
Cadence Help.
For more information, see Getting Help in Virtuoso Design Environment User Guide.
Customer Support
For assistance with Cadence products:
■ Contact Cadence Customer Support
Cadence is committed to keeping your design teams productive by providing answers to
technical questions and to any queries about the latest software updates and training
needs. For more information, visit https://www.cadence.com/support.
■ Log on to Cadence Online Support
Customers with a maintenance contract with Cadence can obtain the latest information
about various tools at https://support.cadence.com.
For more information about the SKILL language, see Getting Started in the SKILL
Language User Guide.
You can copy these examples from the manual and paste them directly into the Command
Interpreter Window (CIW) or use the code in non-graphical SKILL mode.
axlGetRunStatus
axlGetRunStatus(
t_sessionName Required argument
[ ?optionName t_optionName ] Optional keyword argument
[ ?historyName t_historyName ] Optional keyword argument
)
=> l_statusValues Return value
The first argument t_sessionName is a required argument, where t signifies the data type
of the argument. The second and third arguments ?optionName t_optionName and
?historyName t_historyName are optional keyword arguments (identified by a
question mark), which are specified in name-value pairs and can be placed in any order
during the function call.
The return value is the value that the SKILL API returns after evaluating the expression. In
this case, it is a list of status values, l_statusValues .
Example
axlSession=axlGetWindowSession( hiGetCurrentWindow())
=> "session0"
axlGetRunStatus("session0" ?historyName "Interactive.10" ?optionName "tests")
=> (1 2)
Return value Value of the session Question mark and argument Question mark and argument
name argument name before the value of the name before the value of the
keyword argument keyword argument
If a command-line or SKILL expression is too long to fit within the paragraph margins of this
document, the remainder of the expression is moved to the next line and indented. In code
excerpts, a backslash ( \ ) indicates that the current line continues on to the next line.
1
AMS Designer SKILL Functions
The following table lists the public SKILL functions associated with the AMS Designer
environment. See the cross-references for syntax, descriptions, and examples.
■ amsCheckCV
■ amsIsPresent
■ amsNetlist
■ amsProcessCellViews
■ amsUpdateTextviews
■ amsUIOptionsForm
■ amsUIRunNetlisterForm
■ vmsUpdateCellViews
amsCheckCV
amsCheckCV(
d_cvId
g_genNetlist
[ s_markerFuncSym ]
)
=> l_numCount
Description
Runs AMS checks on the given cellview. The exact nature of checks and severity of violations
is set by AMS Designer environment variables. This function checks the cellview only if the
amsDirect.vlog checkOnly environment variable is set to t.
Arguments
Value Returned
Example
To run AMS checks and netlist a previously opened cellview, you might use
amsCheckCV( cv t )
The number of errors and warnings is returned as a list, and a verilog.vams netlist file is
also generated for the cellview.
To run AMS checks on a previously opened cellview and enable the markers,
amsIsPresent
amsIsPresent(
)
=> t / nil
Description
Arguments
None
Value Returned
Example
You can test for the presence of the AMS netlisting capability like this:
if( isCallable( ’amsIsPresent )
then
;; Yes, AMS Netlisting capability is included
...
else
;; No, AMS Netlisting capability is not present
...
)
amsNetlist
amsNetlist(
t_libName
t_cellName
t_viewName
[ ?checkOnly g_checkOnly ]
[ ?netlist g_netlist ]
[ ?netlistMode s_netlistMode ]
[ ?compile g_compile ]
)
=> t / nil
Description
Runs the AMS netlister on the specified cellviews and, depending upon the passed
arguments, performs one or more of the following operations: 1) checks cellviews; 2) checks
and netlists cellviews; 3) checks, netlists and compiles cellviews; 4) compiles cellviews.
To generate a netlist, the amsNetlist function calls the following netlist procedures, in the
order given.
1. amsPrintComments
2. amsPrintHeaders
3. amsPrintModule
4. amsPrintFooters
You cannot override the amsNetlist function, so you cannot change the order in which the
procedures are called. You can, however, override the individual procedures.
Arguments
Value Returned
Example
amsProcessCellViews
amsProcessCellViews(
t_libName
t_cellName
t_viewName
[ ?checkOnly g_checkOnly ]
[ ?netlist g_netlist ]
[ ?compile g_compile ]
[ ?netlistNode s_netlistMode ]
[ ?compileMode s_compileMode ]
)
=> t / nil
Description
Performs, depending upon the passed arguments, one or more of the following operations: 1)
checks cellviews; 2) checks and netlists cellviews; 3) checks, netlists, and compiles netlisted
cellviews; 4) compiles Verilog-AMS, Verilog (digital), Verilog-A, VHDL (digital), and
VHDL-AMS files in cellviews.
Arguments
?compileMode s_compileMode
A symbol with the value ‘whenNetlist or ‘all. The
‘whenNetlist value specifies that only cellviews that
are netlisted are compiled. The ‘whenNetlist value is
the default.
The ‘all value specifies that all cellviews are compiled,
whether newly netlisted or not.
Value Returned
Examples
amsUpdateTextviews
amsUpdateTextviews(
t_libName
[ ?cellName t_cellName ]
[ ?viewName t_viewName ]
[ ?incremental g_incremental ]
)
=> t / nil
Description
Creates a Virtuoso database, depending on the passed arguments, for the following:
■ for all the text views in the library
■ for all the text views of the specified cell in the library
■ for all the text views in the library that have the specified view name
■ for the specified text view, given that the view is a text view
■ for all the text views in the configuration, given that the specified view is a config view
■ for all the text views that do not have an existing Virtuoso database or have a database
with an older timestamp than the specified text view
Arguments
Value Returned
Notes
If you have text views in read-only libraries, you must set an environment variable in
.cdsinit file. It specifies the directory where the Virtuoso database for such text views must
be created. You should set the environment variable as shown below:
envSetVal("ams.netlisterOpts" "amsTempDirForShadows" 'string’"<pathToDirectory>")
Automatic creation of the Virtuoso database for read-only Verilog-A and VHDL-AMS text
views is not supported.
Examples
To create a Virtuoso database for all the text views of mycell in mylib:
amsUpdateTextviews("myLib" ?cellName "mycell" )
To create a Virtuoso databse for all the text views in the config view of mycell in mylib:
amsUIOptionsForm
amsUIOptionsForm(
)
Description
Pops up the AMS Options form, which is used to set environment variables.
Arguments
None
Value Returned
None
Example
amsUIOptionsForm()
amsUIRunNetlisterForm
amsUIRunNetlisterForm(
)
Description
Opens the AMS Netlister form, which is used to run the AMS Netlister on specified cellviews.
Arguments
None
Value Returned
None
vmsUpdateCellViews
vmsUpdateCellViews(
[ ?lib t_lib ]
[ ?cell t_cell ]
[ ?view t_view ]
[ ?viewt t_viewType ]
)
=> t / nil
Description
Updates AMS Designer information with the current state of verilog, systemVerilog, veriloga,
verilogams and vhdl text views. You might use this function, for example, when you have
updated a Verilog-AMS source file outside of the AMS Designer environment. You might also
use it when you receive a Verilog-AMS library in a single source file, bring it into the
Library.Cell:View structure using xmvlog -use5x, and then need to prepare the library for
use in the AMS Designer environment. See also customization variable
vmsDoNotCheckMasterFileWritable.
Note: If you run this function without any arguments, a pop-up appears asking for lib/cell/view
and viewType information.
Arguments
?lib t_lib A string, which is the name of a library or a list of library names to
look in for cellviews to update. If this argument is not specified
(with just "") or is specified as nil, all libraries defined in the
cds.lib file are searched.
?cell t_cell A string, which is the name of a cell or a list of cell names to be
searched for update in the libraries. If this argument is not
specified (with just "") or is specified as nil, all cells are
searched.
?view t_view A string, which is the name of a cellview or a list of cellview names
to be searched for update. If this argument is not specified (with
just "") or is specified as nil, all views are searched.
Value Returned
Examples
The next example updates verilogAMS views in all the cells in the myLib library.
vmsUpdateCellViews(?lib "myLib" ?view "verilogAMS" ?viewt "VerilogAMSText" )
2
SKILL Functions Supported for Netlisting
The SKILL functions specifically developed for use in custom netlisting procedures can be
divided into those that replicate the default netlisting behavior and those that perform lower-
level helping functions. These two varieties are listed in the following tables and are described
in detail in the remainder of this appendix.
The default netlisting procedures reproduce the default behavior of the AMS netlister. For
example, if you want the netlister to print the default headers in the default format, leave the
headersProc field of the formatter object set to the default netlisting procedure,
amsPrintHeaders.
The default netlisting procedures take into account information that might be required to
create a netlist. For that reason, customized netlist procedures often run default netlisting
procedures after setting up the appropriate data.
The netlisting helper functions provide specific behaviors that you can combine to create the
overall custom behavior that you need.
amsError
amsError(
A_formatterId
t_msg
)
=> t / nil
Description
Helper function that prints t_msg in the form of an error message and increments the error
count. The message is added to the log file. Calling this function causes netlisting to fail,
although processing to detect further netlisting problems continues.
Arguments
Value Returned
Example
You enter the following code in your netlist procedures override file. The code defines an
instance parameter netlist procedure that includes the amsError function.
;; Function that checks a custom structure. The structure can have
;; n fingers, where n must be between 1 and 10. This function only checks--
;; the parameter is actually printed by amsPrintInstanceParameters.
(defun MyFingersProc (formatter cellview instance)
(let (fingers)
(setq fingers instance->id->numFingers)
(when (or (lessp fingers 1)
(greaterp fingers 10)
) ; or
(amsError formatter
(sprintf nil
“Number of fingers (%d) must be between 1 and 10 (%s)\n”
fingers instance->name
) ; sprintf
) ; amsError
) ; when
;; Just print the parameters
(amsPrintInstanceParameters formatter cellview instance )
) ; let
) ; defun
If the number of fingers is outside the range, this function generates error messages like the
following ones:
Error: Number of fingers (12) must be between 1 and 10 (I2)
Error: Number of fingers (-2) must be between 1 and 10 (I1)
amsGetInstanceName
amsGetInstanceName(
A_formatterId
A_instanceId
[ x_iteration ]
)
=> t_instanceName / nil
Description
Helper function that returns the print name of the instance specified by A_instanceId or
the print name of the specified iteration of the instance.
Arguments
Value Returned
Example
This netlisting procedure uses the amsGetInstanceName function to retrieve the print name
of the instance so that it can be used by the amsPrintInstanceParameter function and
written to the netlist.
;; Customize the parameter "r" for resistor to be 4K always.
(defun MYPrintInstanceParameters (formatterId cvId instanceId)
(if (instanceId->masterName == "resistor") then
(amsPrint formatterId "#(")
;; Go through the list of parameters for resistor
(foreach param instanceId->parameters
(unless (equal param (car instanceId->parameters))
(amsPrint formatterId ",")
); unless
amsGetNetlister
amsGetNetlister(
)
=> A_netlisterId / nil
Description
Returns the ID of the top-level netlister object. This netlister object contains the global options
applicable to the AMS netlister. The object is available throughout the life of the UNIX process
that is running the AMS netlister and is a unique object for that process.
Arguments
None
Value Returned
Example 1
You enter the following code in your netlist procedures override file. The code uses the
amsGetNetlister function to obtain the information necessary to implement other
functions.
netlisterId = amsGetNetlister()
;; Get the Verilog-AMS formatterId.
vlogFormId = netlisterId->vlog
;; Override the default comment printing function.
vlogFormId->commentsProc = ‘MyCommentsProc
Example 2
ams:28164120
You list the information and values contained in the netlister object by typing the following
command in the CIW.
netlisterID->??
amsGetPortExpr
amsGetPortExpr(
A_formatterId
A_portId
[ x_iteration ]
)
=> t_portExpr / nil
Description
Helper function that gets the port expression for the passed port object. It can also get the
expression for the port of an iterative instance at the passed index.
Arguments
Value Returned
Example
This code prints the port name and its expression as a message in the log file. It uses the
amsGetPortExpr helper function to get the port expression.
(defun MYPrintPorts (formatterId cellviewId)
(let (ports)
(setq ports cellviewId->ports
) ; setq
(amsPrint formatterId "( ")
(foreach port ports
;; cellview ports can have null port->expr
(if (port->expr == nil) then
sprintf(portExpr "No Port Expr")
else
sprintf(portExpr "%s" port->expr)
)
sprintf(tempStr "Port Name: %s, Port Expr: %s\n", port->name,
amsGetPortExpr(formatterId port) )
amsInfo(formatterId tempStr)
(unless (equal port (car ports))
(amsPrint formatterId ", ")
); unless
(amsPrintPort formatterId port)
) ; foreach
(amsPrint formatterId " );")
) ; let
);;defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->portsProc = ‘MYPrintPorts
amsGetUniqueName
amsGetUniqueName(
A_formatterId
s_objectType
)
=> t_objectName / nil
Description
Helper function that generates a unique, legal Verilog-AMS name for the specified object
type. (A unique name is a name that is not already in the database.) If you need to insert a
new object in the netlist, you can call this function to obtain a non-conflicting, unique name.
Arguments
Value Returned
Example
amsInfo
amsInfo(
A_formatterId
t_msg
)
=> t / nil
Description
Helper function that prints t_msg in the form of an informational message added to the log
file.
Arguments
Value Returned
Example
You enter the following code in your netlist procedures override file. The code includes the
amsInfo function as shown.
netlisterId = amsGetNetlister()
;; Get the Verilog-AMS formatterId.
vlogFormId = netlisterId->vlog
;; Override the default comment printing function.
vlogFormId->commentsProc = ‘MyCommentsProc
;; My function to print comments
(defun MyCommentsProc (formatterId cellViewId)
(amsInfo formatterId "Formatting with MyFormatter.\n June 23,2003.\n")
;; We’ve overridden the original comment printing function, so next
;; line writes the original comments to the netlist.
(amsPrint formatterId formatterId->comments)
);defun
After you load the netlist procedures override file, the following message appears in the log
when you netlist.
Info: Formatting with MyFormatter.
June 23, 2003.
amsMapName
amsMapName(
A_formatterId
A_cellViewId
t_name
[ s_objectType ]
)
=> t_mappedName / nil
Description
Helper function that checks whether the specified name is a legal Verilog-AMS identifier. If
the name is legal, the function returns the name. If the name is not a valid Verilog-AMS
identifier, the identifier is mapped.
Only the net, instance, and alias types are collision mapped. A name to be used as an
instance master name does not need to be collision mapped so it is only checked for validity
and, if necessary, mapped to a legal Verilog-AMS name.
Arguments
Value Returned
Example
This example uses the amsMapName function to check and, if necessary, map the newParam
name so that it does not clash with the name of an existing parameter.
;; Display the listed parameters
(while (newParam != nil)
amsPrint(formatterId "\nparameter ")
mappedParamName = amsMapName(formatterId cvId newParam ’parameter)
amsPrint(formatterId mappedParamName)
amsPrint(formatterId "= 0;")
paramList = cdr(paramList)
newParam = car(paramList)
); while
amsMtlinePrintParams
amsMtlinePrintParams(
A_formatterId
A_cellViewId
A_instanceId
)
=> t / nil
Description
Helper function that prints the r, l, g, c, rskin, and gdloss parameters in the matrix format
used by the mtline component. The n and subcktfile parameters are not printed but all
other parameters are printed as they are by the amsPrintParameters function.
Arguments
Value Returned
Example
amsMtlineTermOrder
amsMtlineTermOrder(
A_instanceId
)
=> l_termOrder / nil
Description
Helper function that generates an appropriately ordered list of pins for the mtline component.
The mtline component provided in analogLib is a parameterized cell (Pcell) where the
number of terminals depends upon the number of transmission lines specified by the user.
The transmission lines, which are specified as the property value n on the schematic
instance, determine the number of pins for the instance. The amsMtlineTermOrder
function generates a list of these pins in the order necessary for an AMS simulation. To use
the function, it is normally provided as the value in the CDF termOrder field in the ams
simulation information (simInfo) section of the mtline device.
Arguments
Value Returned
Example
amsNportTermOrder
amsNportTermOrder(
A_instanceId
)
=> l_termOrder / nil
Description
Helper function that generates an appropriately ordered list of pins for the nport component.
The nport component provided in analogLib is a parameterized cell (Pcell) where the
number of ports is specified by the user as the property value p on the schematic instance.
The amsNportTermOrder function generates a list of these ports in the order necessary for
an AMS simulation. To use the function, it is normally provided as the value in the CDF
termOrder field in the ams simulation information (simInfo) section of the nport device.
Arguments
Value Returned
Example
amsPrint
amsPrint(
A_formatterId
t_msg
[ s_sectionId ]
)
=> t / nil
Description
Helper function that writes the specified string to the netlist. This function uses the AMS
netlister internal IO buffering method, which generates automatic line breaks to ensure that
line widths are reasonable.
Arguments
Value Returned
If you omit the s_sectionId option, the default value is determined from the
formatterId field being overwritten. The defaults are listed in the following table. Because
the default function for the moduleProc field (amsPrintModule) cannot be overridden, that
field is not included in the table. The corresponding netlist sections listed in the third column
are illustrated in the Identifying the Sections of a Netlist.
If the formatterId field being Then the default value for Corresponding to
overridden is... s_sectionId is... this netlist section...
attributesProc ’VLOG_INSTANCES when Instances
A_objectId is an instanceId.
Example 1
You enter the following code in your netlist procedures override file. The code includes the
amsPrint function as shown.
netlisterId = amsGetNetlister()
;; Get the Verilog-AMS formatterId.
vlogFormId = netlisterId->vlog
;; Override the default comment printing function.
;; Overriding the commentsProc field means the default
;; for s_sectionId is ’INCLUDES_LIST.
vlogFormId->commentsProc = ‘MyCommentsProc
;; My function to print comments
(defun MyCommentsProc (formatterId cellViewId)
(amsPrint formatterId "// Formatted with MyFormatter.\n// June 23, 2003.\n")
);defun
After you load the netlist procedures override file, new netlists contain the specified
comments, followed by an empty line. The default comments provided by AMS Designer no
longer appear.
// Formatted with MyFormatter.
// June 23, 2003.
Example 2
You enter the following code in your netlist procedures override file. The code includes the
amsPrint function as shown.
netlisterId = amsGetNetlister()
;; Get the Verilog-AMS formatterId.
vlogFormId = netlisterId->vlog
; The default s_sectionId of MYPrintInstance is set to ’VLOG_INSTANCES’
; because MYPrintInstance is set on the instanceProc field.
vlog->instanceProc = ‘MYPrintInstance
;; My function to print instances
(defun MYPrintInstance (formatterId cellViewId instanceId)
(amsPrint formatterId "\n//Comment 1 in ’VLOG_INSTANCES\n")
(amsPrint formatterId "\n//Comment 2 in ’INCLUDES_LIST\n" ’INCLUDES_LIST)
(amsPrintInstance formatterId cellViewId instanceId)
);defun
The custom netlist procedure MYPrintInstance overrides the default netlist procedure for
the field instanceProc. Therefore, ’VLOG_INSTANCES becomes the default
s_sectionId for any use of the amsPrint function within the MYPrintInstance
function.
In this example, the first amsPrint function call does not specify the s_sectionId so the
default ’VLOG_INSTANCES value is used to print Comment 1. The second amsPrint
function call explicitly specifies the s_sectionId as ’INCLUDES_LIST so the
’INCLUDES_LIST value is used to print Comment 2. (Comment 2 appears twice in the
netlist because it is printed for each instance and there are two instances.) As a result, the
netlist includes comments as shown here.
// Verilog-AMS netlist generated by the AMS netlister, version 5.0.33.110.
// Cadence Design Systems, Inc.
‘include "disciplines.vams"
‘include "constants.vams"
//Comment 2 in ’INCLUDES_LIST
//Comment 2 in ’INCLUDES_LIST
module comparator ( inp,inn,out );
input inp;
input inn;
output out;
parameter chivalue=5.0;
//Comment 1 in ’VLOG_INSTANCES
pmos4 #(.l(3u), .region("triode"), .w(40u))
(* integer library_binding = "amslib";
integer cds_net_set[0:0]= {"bulk_n"};
integer bulk_n = "cds_globals.\\vdd! "; *)
M11 ( net92, cds_globals.„nd! , net79, cds_globals.\vdd! );
//Comment 1 in ’VLOG_INSTANCES
amsPrintAlias
amsPrintAlias(
g_formatterId
g_aliasId
)
=> t / nil
Description
Generates instances of the cds_alias module with the format illustrated by the following
examples.
cds_alias #(.width(1))
(* integer library_binding = "basic";·
integer view_binding = "functional"; *)
ams_alias_inst_0 (net015, net014[0]);
cds_alias #(.width(2))
(* integer library_binding = "basic";·
integer view_binding = "functional"; *)
ams_alias_inst_1 ({ net06[0],net06[1] }, {net09[3],net09[7] });
You can use this function to print particular aliases. For example, to effectively suppress some
aliases, you can override the amsPrintAliases function, then iterate over the aliases using
this function to print just the ones you want.
If you override the amsPrintAliases function and choose not to use this amsPrintAlias
helper function, you must ensure that the library_binding and view_binding attributes
are printed properly. The elaborator cannot resolve cds_alias instantiations without these
attributes.
Arguments
Value Returned
Example
In this example, the amsPrintAlias helper function is used to write the alias instance in the
netlist as usual. In addition, the name and association list of every alias object is printed as
an informational message in the log file.
(defun MYPrintAliases (formatterId cellviewId)
(let (aliases)
aliases = cellviewId->aliases
;; Now, print all the alias association list, one by one
(foreach alias aliases
sprintf(tempStr "Alias Name: %s Assocs: %L\n\n\n" alias->name alias->assocs)
amsInfo(formatterId tempStr)
amsPrintAlias(formatterId alias)
)
)
);;
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->aliasesProc = ‘MYPrintAliases
amsPrintAliases
amsPrintAliases(
A_formatterId
A_cellViewId
A_instanceId
)
=> t / nil
Description
Default netlisting procedure to generate the alias declarations for the cellview and print them
one by one.
Arguments
Value Returned
Example
In this example, the amsPrintAliases default netlisting procedure writes the alias
instances into the netlist as usual. The name and association list of every alias object is
printed as an informational message in the log file.
(defun MYPrintAliases (formatterId cellviewId)
(let (aliases)
aliases = cellviewId->aliases
;; Print the alias association list, one by one
(foreach alias aliases
sprintf(tempStr "Alias Name: %s Assocs: %L\n\n\n" alias->name alias->assocs)
amsInfo(formatterId tempStr)
)
amsPrintAliases(formatterId cellviewId)
)
);;
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->aliasesProc = ‘MYPrintAliases
amsPrintAttribute
amsPrintAttribute(
g_formatterId
g_attributeId
)
=> t / nil
Description
Arguments
Value Returned
Example
This example uses the amsPrintAttribute helper function to write the attribute in the
netlist.
(defun MYPrintAttributes (formatterId objectId)
(let (attrs attr)
(if (objectId->attributes) then
attrs = objectId->attributes
(if (formatterId->ifdefLanguageExtensions) then
amsPrint(formatterId "‘ifdef INCA\n")
)
amsPrint(formatterId "(*\n")
(foreach attr attrs
amsPrintAttribute(formatterId attr)
)
amsPrint(formatterId " *)\n")
(if (formatterId->ifdefLanguageExtensions) then
amsPrint(formatterId "‘endif\n")
)
);;endif
); let
);;defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->attributesProc = ‘MYPrintAttributes
amsPrintAttributes
amsPrintAttributes(
A_formatterId
A_objectId
)
=> t / nil
Description
Default netlisting procedure for printing the attributes of the object specified by
A_objectId.
Be aware that attributes play an important role in controlling elaboration and simulation. If you
are netlisting for the AMS simulator, for example, omitting attributes can have the following
consequences:
To help avoid problems such as those listed in the table, use the default
amsPrintAttributes function as a helper function in your customized netlisting procedure
when you override the instancePortProc. That way, the AMS netlister continues to
generate the attributes for the netlist.
Arguments
Value Returned
Example
In this example, you have a function called isDigitalGate, which determines whether a
gate is a digital gate. You use that function to determine whether to print the attributes to the
netlist. If the attributes do need to be printed, use the default function
amsPrintAttributes to do the work.
;; Do not print attributes for instances of digital gates.
(defun DontPrintInstanceAttributesForDigitalGates (formatterId objectId)
;; Determine if it is an instance of a digital gate.
digitalGate = isDigitalGate(objectId->masterName)
(if (digitalGate == nil) then
amsPrintAttributes(formatterId objectId)
);; if
)
;; =======================================================================
;; Set up area
;; =======================================================================
netlisterId = amsGetNetlister()
formatterId = netlisterId->vlog
formatterId->attributesProc = ‘DontPrintInstanceAttributesForDigitalGates
amsPrintInstance
amsPrintInstance(
A_formatterId
A_cellViewId
A_instanceId
)
=> t / nil
Description
Default netlisting procedure for printing an instance, including the instance master name, the
instance parameters override list, the attributes for the instance, the name of the instance,
and the instance port list.
Arguments
Value Returned
Example
In this example, the default amsPrintInstance function is called to print the instance as
usual, then additional monitoring code is inserted in the netlist automatically.
;; =======================================================================
;; A custom netlist procedure to generate $display for listed signals.
;; =======================================================================
(defun MYInstanceSignalMonitor (formatterId cellviewId instanceId)
;; Call the default instance procedure
amsPrintInstance(formatterId cellviewId instanceId)
(progn
;; Check for property CLOCK_MONITOR on the instance
;;
(when instanceId->id->CLOCK_MONITOR
(setq signal_list (parseString instanceId->id->CLOCK_MONITOR))
monitor_signal = car(signal_list)
print_debug_signals = 0
(if (monitor_signal != nil) then
amsPrint(formatterId "\n// Debug signals at every clock transition")
amsPrint(formatterId "always @(posedge(clock) or negedge(clock))\n")
amsPrint(formatterId "begin")
amsPrint(formatterId " $display($stime, 'Signal values are:');")
print_debug_signals = 1
); if
;; Display the listed signals
(while (monitor_signal != nil)
display_signal = strcat(" $display('" monitor_signal ": %b', " mon
itor_signal "); ")
amsPrint(formatterId display_signal)
signal_list = cdr(signal_list)
monitor_signal = car(signal_list)
)
amsPrintInstanceMasterName
amsPrintInstanceMasterName(
A_formatterId
A_cellViewId
A_instanceId
)
=> t / nil
Description
Default netlisting procedure for printing the name of an instance master. By overriding this
function, you can modify the name of the instance master.
Arguments
Value Returned
Example
You enter the following code in your netlist procedures override file.
(setq MYNetlister (amsGetNetlister))
;; Override the function that prints the master name.
MYNetlister->vlog->instanceMasterNameProc = ‘MYInstMasterNameProc
(defun MYInstMasterNameProc ( formatterId cellViewId instanceId )
;; Check the name of the instance "fingers" property. Use the value
;; to generate the name of the master.
(setq numFingers instanceId->id->fingers)
(if (numFingers != nil) then
;; print the custom instance master name.
(amsPrint formatterId (sprintf nil "\n%s_%d"
instanceId->masterName numFingers) )
else
;; print using the default instance master name netlist procedure.
amsPrintInstanceMasterName(formatterId cellViewId instanceId)
); if
t
) ; defun
The MYInstMasterNameProc procedure generates and prints master names like nmos_1
or nmos_3 if the instance of nmos has 1 or 3 fingers and a master name like capacitance
if the instance of capacitance has no property called fingers.
amsPrintInstanceParameter
amsPrintInstanceParameter(
A_formatterId
t_instanceName
A_parameterId
)
=> t / nil
Description
You can use this function to filter the parameters of an instance. For example, you can
override the amsPrintInstanceParameters function, then iterate over the parameters
using this amsPrintInstanceParameter function to print the parameters you want to
retain.
Arguments
Value Returned
Example
amsPrintInstanceParameters
amsPrintInstanceParameters(
A_formatterId
A_cellViewId
A_instanceId
)
=> t / nil
Description
If possible, do not override this function. Instead, consider changing the parameters list
directly and then calling the amsPrintInstanceParameters function to print the changed
list.
Arguments
Value Returned
Example
This example illustrates how you can change the individual parameter values and then use
the amsPrintInstanceParameters function to print the changed list.
(defun MYPrintInstanceParameters ( formatterId cellViewId instanceId )
(foreach parameter instanceId->parameters
;; Change the individual parameter values
parameter->value = <newVal>
...
) ; foreach
;; Delete parameters in the parameter list
instanceId->parameters = newList
;; But call the default procedure
(amsPrintInstanceParameters formatterId cellViewId instanceId)
) ; defun
amsPrintInstancePorts
amsPrintInstancePorts(
A_formatterId
A_instanceId
[ x_iteration ]
)
=> t / nil
Description
Default netlisting procedure for printing the port list of an instance or of a particular iteration
of an instance. The ports in the port list are arranged according to the value specified by the
CDF termOrder property, if the termOrder property exists for the instance. Otherwise, the
order of the ports is undetermined. The amsPrintInstancePorts function prints the port
list by order or by named port maps, according to the effective options and settings.
The amsPrintInstancePorts functions does not print punctuation at the end of the port
list, nor does it insert newline characters to break lines. However, the underlying
implementation of amsPrint can insert newline characters at appropriate places to control
line lengths.
Arguments
Value Returned
Example
amsPrintIO
amsPrintIO(
A_formatterId
A_ioId
)
=> t / nil
Description
Helper function that prints the port specified by A_ioId. If A_ioId has an inherited net
expression, the expression is printed as an attribute.
Arguments
Value Returned
Example
amsPrintIOs
amsPrintIOs(
A_formatterId
A_cellViewId
)
=> t / nil
Description
Default procedure to generate the IO declarations for the port list of the cellview and print
them one by one. Also prints inherited net expressions as attributes.
Arguments
Value Returned
Example
To print IOs sorted by name you might write a function like this.
(defun MYIONetProc ( formatterId cellViewId)
;; Prints the IO list
(foreach io (sort cellViewId->IOs (lambda (a b) (alphalessp a->name b->name)))
(amsPrintIO formatterId io)
) ; foreach
t
) ; defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->iosProc = ‘MYIONetProc
amsPrintParameter
amsPrintParameter(
A_formatterId
A_parameterId
)
=> t / nil
Description
Arguments
Value Returned
Example
This example changes the default value for the frequency parameter, then uses the
amsPrintParameter function to write the parameter to the netlist.
/* Change the default value only for the parameter named "frequency" */
(foreach param cvId->parameters
(if (param->name == "frequency") then
param->value = "0"
); if
(amsPrintParameter formatterId param)
); foreach
amsPrintParameters
amsPrintParameters(
A_formatterId
A_cellViewId
)
=> t / nil
Description
Default netlisting procedure for generating the parameter declarations for a cellview and
printing the declarations one by one. The parameters are obtained from the base cell CDF
and from parameters on the instances of the cellview being netlisted that have pPar
references. The list of parameters is determined by the ams section of the simInfo (which can
be used to specify parameters to include and parameters to exclude) as well as by library and
cell CDF.
Arguments
Value Returned
Example
This example code first calls the default amsPrintParameters function to write the regular
parameters to the netlist. The remainder of the code checks for custom parameters, and if
they exist, uses the amsPrint function to write them to the netlist too.
;; print the default CBN parameters
amsPrintParameters(formatterId cvId)
(let (newParam printInfo)
;; Check for property CUSTOM_PARAMS on the CBN
;;
(when cvId->id->CUSTOM_PARAMS
(setq paramList (parseString cvId->id->CUSTOM_PARAMS))
newParam = car(paramList)
printInfo = 0
amsPrintPort
amsPrintPort(
g_formatterId
g_portId
[ x_iteration ]
)
=> t / nil
Description
Helper function that prints the port specified by g_portId. If the instance master is a
primitive device, this function prints ports with connections specified by order by printing the
port expression. If the instance master is not a primitive device, but there is a port expression
involved, the function prints ports with connections specified by order. If the instance master
is not a primitive device, and there is no port expression involved, the function prints ports
with connections specified by name.
Arguments
Value Returned
Example
This code prints the port name and its expression as a message in the log file. It uses the
amsPrintPort helper function to netlist the port in the cellview.
(defun MYPrintPorts (formatterId cellviewId)
(let (ports)
(setq ports cellviewId->ports
) ; setq
(amsPrint formatterId "( ")
(foreach port ports
;; cellview ports can have null port->expr
(if (port->expr == nil) then
);;defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->portsProc = ‘MYPrintPorts
amsPrintPorts
amsPrintPorts(
A_formatterID
A_cellViewId
)
=> t / nil
Description
Default netlisting procedure for generating the port list of a cellview and printing the ports one
by one. The ports in the list are arranged according to the termOrder, termMap, or portOrder,
if those characteristics are specified. The port list also contain any ports specified in the
extraTerminals section of the ams simulation information (simInfo).
Arguments
Value Returned
Example
This example code prints the port name and its expression as a message in the log file. It then
uses the amsPrintPorts default netlist procedure to netlist the ports of the cellview.
(defun MYPrintPorts (formatterId cellviewId)
(let (ports)
(setq ports cellviewId->ports
) ; setq
(foreach port ports
(if (port->expr == nil) then
sprintf(portExpr "No Port Expr")
else
sprintf(portExpr "%s" port->expr)
)
sprintf(tempStr "Port Name: %s, Port Expr: %s\n", port->name, portExpr)
amsInfo(formatterId tempStr)
) ; foreach
amsPrintPorts(formatterId cellviewId)
) ; let
);;defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->portsProc = ‘MYPrintPorts
amsPrintWire
amsPrintWire(
g_formatterId
g_wireId
)
=> t / nil
Description
Prints the wire (or other type if net type or net discipline are defined) specified by g_wireID.
If necessary, this function also prints a wire declaration.
Arguments
Value Returned
Examples
This example collects and prints out information about the characteristics of each wire and
then writes the wire to the netlist in the usual way.
(defun MYPrintWires (formatterId cellviewId)
(let (wires)
wires = cellviewId->wires
(foreach wire wires
(if (car(wire->range) == nil) then
lsb = "nil"
else
sprintf(lsb "%d" car(wire->range))
)
(if (cadr(wire->range) == nil) then
msb = "nil"
else
sprintf(msb "%d" cadr(wire->range) )
)
(if (wire->type == nil) then
type = "nil"
else
type = wire->type
)
(if (wire->discipline == nil) then
discipline = "nil"
else
discipline = wire->discipline
)
sprintf(tempStr "Wire Name: %s, Range: [%s:%s], Type: %s, Discipline: %s\n"
wire->name lsb msb type discipline)
amsInfo(formatterId tempStr)
amsPrintWire(formatterId wire)
) ; foreach
) ; let
);;defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->wiresProc = ‘MYPrintWires
amsPrintWires
amsPrintWires(
A_formatterId
A_cellViewId
)
=> t / nil
Description
Default netlist procedure to generate the wire declarations for the cellview and print them one
by one. Individual wires are collapsed and merged where necessary to form a single
declaration. If holes exist in the ranges (sparse buses), the wires are over-declared.
Arguments
Value Returned
Example
This code prints the wire name, its range, type and discipline as a message in the log file. It
then uses the amsPrintWires default netlist procedure to netlist the required wires in the
cellview.
(defun MYPrintWires (formatterId cellviewId)
(let (wires)
wires = cellviewId->wires
(foreach wire wires
(if (car(wire->range) == nil) then
lsb = "nil"
else
sprintf(lsb "%d" car(wire->range))
)
(if (cadr(wire->range) == nil) then
msb = "nil"
else
sprintf(msb "%d" cadr(wire->range) )
)
(if (wire->type == nil) then
type = "nil"
else
type = wire->type
)
(if (wire->discipline == nil) then
discipline = "nil"
else
discipline = wire->discipline
)
sprintf(tempStr "Wire Name: %s, Range: [%s:%s], Type: %s, Discipline: %s\n"
wire->name lsb msb type discipline)
amsInfo(formatterId tempStr)
) ; foreach
amsPrintWires(formatterId cellviewId)
) ; let
);;defun
;; Set up the custom netlist procedure
netId = amsGetNetlister()
vlog = netId->vlog
vlog->wiresProc = ‘MYPrintWires
amsSpectreToVams
amsSpectreToVams(
s_netlistDirectory
)
=> t / nil
Description
Reads netlist.oss in the specified directory and writes it to netlist.vams in the same
directory after translating the Spectre-language statements between _ANALOG_BEGIN and
_ANALOG_END to the Verilog-AMS language. If netlist.vams already exists, this function
overwrites it.
Note: You can edit netlist.oss and call this function to translate to Verilog-AMS.
Argument
Value Returned
t Successful translation.
nil Unsuccessful translation.
Example
amsSpectreToVams("/cds/user123/simulation/my_cell/ams/config_ams/netlist/")
amsWarning
amsWarning(
A_formatterId
t_msg
)
=> t / nil
Description
Helper function that prints the given string in the form of a warning added to the log file.
Arguments
Value Returned
Example
You enter the following code in your netlist procedures override file. The code includes the
amsWarning function as shown.
netlisterId = amsGetNetlister()
;; Get the Verilog-AMS formatterId.
vlogFormId = netlisterId->vlog
;; Override the default comment printing function.
vlogFormId->commentsProc = ‘MyCommentsProc
;; My function to print comments
(defun MyCommentsProc (formatterId cellViewId)
(amsWarning formatterId "Too many closing parentheses.\n Ignoring extra
parentheses and continuing.\n")
);defun
After you load the netlist procedures override file, the following message appears when you
netlist.