Force Constant - 2024.1 English

Vivado Design Suite User Guide: Logic Simulation (UG900)

Document ID
UG900
Release Date
2024-05-30
Version
2024.1 English

The Force Constant option lets you fix a signal to a constant value, overriding the assignments made within the HDL code or another previously applied constant or clock force.

Force Constant and Force Clock are options in the Objects or wave window right-click menu (as shown in the following figure) or in the text editor (source code).

Tip: Double-click an item in the Objects, Sources, or Scope window to open it in the text editor. For additional information about the text editor, see the Vivado Design Suite User Guide: Using the Vivado IDE (UG893).
Figure 1. Force Options

The Force options are disabled for the objects for which the Vivado simulator does not support forcing. The type of object or limitations in the Vivado simulator's modeling for those objects might be the cause for not supporting such objects.

Tip: To force a module or entity port whose Force options are disabled, try forcing its connected actual signal one scope level up. Use the add_force Tcl command (for example, add_force myObj 0) to view the reason why the options are disabled.

When you select the Force Constant option, the Force Constant dialog box opens so you can enter the relevant values, as shown in the following figure.

Figure 2. Force Constant Dialog Box

The following are Force Constant option descriptions:

  • Signal name: Displays the default signal name, that is, the full path name of the selected object.
  • Value radix: Displays the current radix setting of the selected signal. You can choose one of the supported radix types: Binary, Hexadecimal, Unsigned Decimal, Signed Decimal, Signed Magnitude, Octal, and ASCII. The GUI then disallows entry of the values based on the Radix setting. For example, if you choose Binary, no numerical values other than 0 and 1 are allowed.
  • Force value: Specifies a force constant value using the defined radix value. (For more information about radixes, see Changing the Default Radix and Using Analog Waveforms.)
  • Starting after time offset: Starts after the specified time. The default starting time is zero. Time can be a string, such as 10 or 10 ns. When you enter a number without a unit, the Vivado simulator uses the default (ns).
  • Cancel after time offset: Cancels after the specified time. Time can be a string such as 10 or 10 ns. If you enter a number without a unit, the default simulation time unit is used.

    Tcl command:

    add_force /testbench/TENSOUT 1 200 -cancel_after 500