create_hw_device - 2020.2 English

Vivado Design Suite Tcl Command Reference Guide (UG835)

Document ID
UG835
Release Date
2020-11-18
Version
2020.2 English

Create a hw_device (jtag chain) on an open target

Syntax

create_hw_device [‑idcode <arg>] [‑irlength <arg>] [‑mask <arg>]
    [‑part <arg>] [‑quiet] [‑verbose]

Usage

Name Description
[-idcode] hexadecimal device id code
[-irlength] decimal device ir length
[-mask] hexadecimal device mask value
[-part] part type of device to create
[-quiet] Ignore command errors
[-verbose] Suspend message limits during command execution

Categories

Hardware

Description

The Vivado hardware manager supports programming of hardware devices through the use of Serial Vector Format (SVF) files. SVF files are ASCII files that contain both programming instructions and configuration data. These files are used by ATE machines and embedded controllers to perform boundary-scan operations. The SVF file captures the JTAG commands needed to program the bitstream directly into a Xilinx device, or indirectly into a flash memory device. The SVF file can be written using the write_hw_svf command, or applied to an open hw_target through the execute_hw_svf command. Refer to the Vivado Design Suite User Guide: Programming and Debugging (UG908) for more information.

The specific process for creating the hw_svf file is:
  1. Create an SVF target using create_hw_target.
  2. Open the SVF target.
  3. Create one or more devices on the SVF target using create_hw_device.
  4. Program the devices using commands like program_hw_devices.
  5. Write the SVF file of operation commands using write_hw_svf.

The create_hw_device command creates a hw_device object on an open SVF target, adding it to the JTAG chain. This device can be queried and programmed like other hw_targets using commands like get_hw_devices and program_hw_devices.

You can create both Xilinx devices and user-defined parts to add to the JTAG chain on the open SVF hw_target. For Xilinx devices, simply specify a recognized part number and the Vivado tool will define it with the appropriate details. For user-defined parts you must specify the JTAG ID code, IR length, and mask details using the appropriate options. User-defined parts are added as space-holder devices to the JTAG chain as on the SVF hw_target. You can get the user-part with get_hw_devices command, and query the properties of the part with report_property, but you cannot program user-parts.

Important: You should create all the devices to define the JTAG chain for the SVF target, before performing any operations on the JTAG chain. If you mix create_hw_device commands with programming commands the JTAG chain referenced in the SVF file will be improperly defined and will not work during execute_hw_svf.

After creating the hw_device on the SVF target, you can exercise the device with supported operations such as associating a bitstream file (.bit) and programming the device:

set_property PROGRAM.FILE {C:/Data/design.bit} [current_hw_device]  
program_hw_devices [current_hw_device]

The create_hw_device command returns nothing if successful, and returns an error if it fails.

Arguments

-idcode <arg> - (Optional) Specifies the JTAG ID code for the user-defined device. This is not required when specifying a Xilinx part.

-irlength <arg> - (Optional) Specifies the JTAG Instruction Register (IR) length for the user-defined device. This is not required when specifying a Xilinx part.

-mask <arg> - (Optional) Specifies the mask used to read the Data Registers (DR) from the device in the JTAG chain. The mask defines which bits in the device response are valid. Masked bits will be ignored. This is not required when specifying a Xilinx part.

-part <arg> - Specifies a Xilinx part for the device, or specifies a user-defined part name.

-quiet - (Optional) Execute the command quietly, returning no messages from the command. The command also returns TCL_OK regardless of any errors encountered during execution.
Note: Any errors encountered on the command-line, while launching the command, will be returned. Only errors occurring inside the command will be trapped.
-verbose - (Optional) Temporarily override any message limits and return all messages from this command.
Note: Message limits can be defined with the set_msg_config command.

Examples

The following example creates an SVF target, opens that target, and creates a new hw_device on the target:
create_hw_target my_svf_target  
open_hw_target  
create_hw_device -part xc7k325t 
This example demonstrates the correct order of creating multiple devices on an SVF target. An SVF target is created and opened, then a Xilinx device, a user part, and a second Xilinx device are created on the current target. The bitstream properties are defined for the two Xilinx devices, the devices are programmed, and an SVF file is written:
open_hw  
connect_hw_server  
create_hw_target my_svf_target  
open_hw_target  
create_hw_device -part xc7k325t  
create_hw_device -idcode 01234567 -irlength 8 -mask ffffffff -part userPart1  
create_hw_device -part xcku9p  
set_property PROGRAM.FILE {C:/Data/k7_design.bit} [lindex [get_hw_devices] 0]  
set_property PROGRAM.FILE {C:/Data/ku_design.bit} [lindex [get_hw_devices] 2]  
program_hw_devices [lindex [get_hw_devices] 0]  
program_hw_devices [lindex [get_hw_devices] 2]  
write_hw_svf C:/Data/myDesign.svf