• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. How to format an expression when using a UI template for...

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 6566
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to format an expression when using a UI template for creating custom calculator functions

Volker T
Volker T over 2 years ago

Dear all,

I want to add a custom calculator function.

Apparently, it is possible to format the output, such that unlike the simple order of function name and parameters, something completely different can be sent to calculator buffer.

Let's take the settlingTime() function as an example. It simply fowards all parameters to calculator buffer, such that the function call is something like this:

settlingTime(signal 20n t 50n t 1 nil "time" )

Now assume I would like to manipulate the output by doing some formatting, such that the output sent to calculator buffer upon clicking "OK", for example, is

settlingTime(dB20(signal) 20n t 50n t 1 nil "time" )

(This is a useless example in practice, I just want to make clear that some manipulation shall take place instead of just combining the function name with the parameters sepcified by the template UI file.)

In chapter F "Working With Function Templates" of Virtuoso Visualization and Analysis XL User Guide, there is an example, which may show what I need:

START OF CITATION

Example 3: Signature described by a format statement: compression.ocn

Location:

(<CDS_INST_DIR>/tools/dfII/etc/tools/wavescan/measures/compress.ocn)
...
9 analysis (nil
10   general (nil
11       ;; args (signal ...)
12 format ("compression(dB20(harmonic(%s, %s)), ?x %s, ?compress %s)" signal harmNumber xpoint compressiondb)
...


The compression function is one of those examples where the expression does not conform to a simple rule of function name plus name/value pairs for the parameters. We have to use the format statement (line 12 above).

The format uses %s to substitute in the values of the named parameters (signal, harmNumber, xpoint, and compressiondb).

END OF CITATION

As I understand it, format() does what I want, but unluckily, I cannot find the example code in my installation, and I don't know WHERE exactly to put the staetment in the template UI file and what other parts to remove (like the "outputs(result)" line, or anything else.

Can anyone help?

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 2 years ago

    I've never used the format directive - instead I prefer to have my functions simply map their arguments as defined by using the "fx" button on the calculator function panel. However, I can see cases where you might want to do a little more complex mapping, and so if you're looking for the full example, it's at <ICinstDir>/tools/dfII/etc/tools/viva/functionTemplates in the file compression.ocn

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information