Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Notation: Commands led by $ runs in the terminal, while those led by xsct% runs in xsct/xsdb. Lines starts with # are comments.

Step 0. Launch xsct/xsdb

xsct/xsdb are bundled with Xilinx Vivado/Vitis. On a machine with these tools install (e.g. enzian-build/enzian-server), run the following commands:

$ source /opt/Xilinx/Vivado/2022.1/settings64.sh
$ DISPLAY=dummy xsdb

$ source /opt/Xilinx/Vitis/2022.1/settings64.sh
$ xsct

Step 1. Connect to hardware server

xsct/xsdb works as the frontend. It needs to connect to a hardware server to get access to devices.

...

For debugging purpose, add -symbols option. It starts the symbol server so that addresses can be mapped to source files once symbols are loaded.

Step 2. Select a target

xsct/xsdb operates on a selected target.

List all targets

xsct% targets
  1  PS TAP
     2  PMU
     3  PL
        4  Legacy Debug Hub
  5  PSU
     6  RPU
        7  Cortex-R5 #0 (No Power)
        8  Cortex-R5 #1 (No Power)
     9  APU
       10  Cortex-A53 #0 (Running)
       11  Cortex-A53 #1 (Reset)
       12  Cortex-A53 #2 (Reset)
       13  Cortex-A53 #3 (Reset)

As we can see, targets are in hierarchy.

Select a target by index

xsct% target 9
# Run targets again and you will see '*' beside target 9

Select a target by filtering

xsct/xsdb supports setting targets based on filtering. This is good for automation.

...

# Get a full list of (human-unreadable) information
xsct% targets -target-properties

# Filtering is also supported there
xsct% targets -target-properties -filter {target_id == 10}

Step 3. Use xsdb/xsct

xsdb/xsct use the same Tcl language as Vivado/Vitas. It’s also possible to write commands in a file and execute it with xsdb/xsct from the shell directly.

Execute a Tcl script that contains commands

Inside xsct/xsdb:

xsct% source some_script.tcl

...

View file
namerun_fpga.tcl
height250

Control the execution

rst        # reset
con        # continue
stp/nxt    # step/next
stpi/nxti  # step/next instruction

Load Symbols

memmap -file /some/elf/file

Breakpoints

bpadd <addr>/<func>/<line>
bpremove <num>/-all
bplist
bpenable/bpdisable

Printing

print <var>
locals
rrd  # print registers
bt

...