Product Documentation
Spectre AMS Designer and Xcelium Simulator Mixed-Signal User Guide
Product Version 22.09, September 2022

value

The Tcl value command prints the current value of the specified objects using the last format specifier preceding the object name argument. If no format is specified, a default format is used.

Objects specified as arguments to the value command must have read access. An error is printed if an object does not have read access.

The value command is supported on user-defined nettypes (UDNs).

 value Command Syntax

value [format ...] object_name...
    -potential
    -flow

value Command Options

This section describes the options that you can use with the Tcl value command.

formats

You can use the following format specifiers to specify the formats:

  • %c: character
  • %s: string
  • %b: binary
  • %d: unsigned decimal

    Use the -signed option to print the value as a signed decimal value.

  • %o: octal
  • %x: hexadecimal
  • %h: same as %x
  • %f: floating-point number
  • %e: real number in mantissa-exponent form
  • %g: use %e or %f, whichever is shorter
  • %t: decimal time scaled from the timescale of the object's module to the simulation's timescale
  • %v: strength value—wires only

To revert to the default format, use %.

If no format is specified, the default format depends on the object type. The following are the default formats:

  • %d: time
  • %d: integer
  • %g: real
  • $vlog_format87reg
  • $vlog_format: wire

The $vlog_format is a predefined Tcl variable that defaults to %h. You can set this variable to %b, %o, or %d.

For VHDL, values are returned in a format that resembles the appropriate VHDL syntax for the object type. If one of the radix format specifiers (%b, %o, %d, or %x) is given, the format affects the format of integer values and of bit and std_logic values. The value is shown without any added VHDL syntax, such as double or single quotes. Otherwise, the format specifier is ignored for VHDL values. The VHDL literal format (%v) is the default format. For example:

xcelium> value :vector
"101010111100"
xcelium> value %b :vector
101010111100
xcelium> value %h :vector
ABC
xcelium> value :enum
'1'
xcelium> value %d :enum
1
xcelium> value %b :enum
1

The value of a digital net that is associated with a mixed signal depends on whether the enclosing module is an ordinary module or a connect module. The value of a digital net within an ordinary module is the resolved value of the connect module drivers that drive the net. The value of a digital net within a connect module is the resolved value of the ordinary module drivers that drive the net. See "Driver-Receiver Segregation".

You can also use the pound sign (#) as a shortcut to the value command. When used on an analog branch, the # shortcut accesses the potential across the branch, not the flow.

You can use wildcard characters in the argument to a value command. 

  • The asterisk ( * ) matches any number of characters.
  • The question mark ( ? ) matches any one character.

You cannot use wildcard characters inside escaped names

-potential

Returns the potential of analog branches that are specified on the command line immediately following the -potential option. This option is ignored for any other kind of object.

-flow

Returns the flow value of analog branches that are specified on the command line immediately following the -flow option. Returns the flow value of analog objects that have existing Tcl current probes. This option is ignored for any other kind of object.

value Command Example

You have an analog branch declared in Verilog-AMS source code like this:

branch (p,n) res;

You can return the potential of the branch like this:

xcelium> value res
0.626

Where the flow of the res and bar branches are 0.111mA and 2.3mA respectively, and the potential of the p_n branch is 4.666V, using the command

xcelium> value -flow res bar -potential p_n

returns

0.000111 0.00023 4.666

The following sequence of value commands displays the current value of data in a variety of formats.

xcelium> value data
4'h2
xcelium> value %o data
4'o02
xcelium> value %b data
4'b0010
xcelium> value %d data
4'd2
xcelium> value %g data
2
xcelium> value %f data
2.000000
xcelium> value %e data
2.000000e+00

xcelium> value %b data %d q
4'b0010 4'd1
xcelium> value % data %d data %b data
4'h2 4'd2 4'b0010

The following command shows the error message that is displayed when you run in regression mode and use the value command on an object that does not have read access.

xcelium> value clk
xmsim: *E,RDACRQ: Object does not have read access: hardrive.clk.

Related Topics



 ⠀
X