XCENA Debugging Helper CLI Guide
xcena_cli
is a command-line tool useful for debugging XCENA devices. It can perform various device information queries and configuration changes.
Installation Requirements
Before using the CLI tool, you need to install the required Python modules. Install them using pip:
pip install click # Command line interface creation kit
pip install pandas # Data manipulation library
pip install pyvcd # Value Change Dump file manipulation
pip install serial # Serial port communication
pip install pexpect # Automation of interactive applications
Getting Started
To run the CLI, execute the xcena_cli
file as follows:
user@linux-pc:~$ xcena_cli
Basic Options
--help
: Displays command usage and descriptions.
Usage: xcena_cli [OPTIONS] COMMAND [ARGS]...
XCENA Debugging Helper
Options:
--help Show this message and exit.
Commands:
num-device
device-info <device_id>
csr-slave <device_id> <msub_id> <cluster_id> <mu_id>
debug-pc <device_id>
debug-error <device_id>
dump <device_id> <start_addr(hex)> <size(hex) <= 0x2000 > [length=2] [-l littleEndian]
Command List
num-device
- Displays the number of currently connected devices.
# Input example
user@linux-pc:~$ xcena_cli num-device
# Output example
Number of devices : 1
device-info
- Queries information about a specific device.
# Input example
# device-info <device_id>
user@linux-pc:~$ xcena_cli device-info 0
# Output example
SVN Revision: 0x2abf # Target device's FPGA SVN version
DDR Start Address: 0x20000000000 # DDR Start address
DDR Size: 16GB # DDR Size
ADMIN_MU Bitmap = 0x1 # Admin MU Bitmap
HIO_MU Bitmap = 0x1 # Hio MU Bitmap
MSUB Bitmap = 0x1 # MSUB Bitmap
MSUB_CLST Bitmap = 0x1 # Cluster Bitmap for each MSUB
MSUB_CLST_MU Bitmap = 0x1 # MU Bitmap for each MSUB Cluster
Num Sub per Device = 1 # Number of SUBs per Device
Num Cluster per Sub = 1 # Number of Clusters per SUB
Num Mu per Cluster = 1 # Number of MUs per Cluster
csr-slave
- Queries the CSR of Slave MU.
- The target MU must exist in the device info bitmap.
# Input example
# csr-slave <device_id> <msub_id> <cluster_id> <mu_id>
user@linux-pc:~$ xcena_cli csr-slave 0 0 0 0
# Output example
MU 0 0 0 0 400c0000
MV_TOP_CSR_MON_MU_ID = 0x0000_0000_0000_0000
MV_TOP_CSR_MON_PERFORMANCE = 0x0000_0000_0000_0000
MV_TOP_CSR_REG_FETCH_STALL = 0x0000_0000_0000_0001
MV_TOP_CSR_REG_W1C = 0x0000_0000_0000_0000
MV_TOP_CSR_REG_REMAP_4M = 0x0000_0000_0000_0000
REG_REMAP_BASE_4M_SEG[30:0] = 0 (0x0)
REG_REMAP_L0C_EN[31:31] = 0 (0x0)
# Invalid target example
# csr-slave <device_id> <msub_id> <cluster_id> <mu_id>
user@linux-pc:~$ xcena_cli csr-slave 0 0 0 8
Invalid MSUB0_CLST0_MU8 (Bitmap: 0xff)
user@linux-pc:~$ xcena_cli csr-slave 0 0 1 0
Invalid MSUB0_CLST1 (Bitmap: 0x1)
user@linux-pc:~$ xcena_cli csr-slave 0 1 0 0
Invalid MSUB1 (Bitmap: 0x1)
debug-pc
- Debugs the program counter of a specific device.
# Input example
# debug-pc <device_id>
user@linux-pc:~$ xcena_cli debug-pc 0
# Output example
======== MSUB[0] CLST[0] ========[Admin: 0x21814]========[Master: 0x213f4]========
| S0 | S1 | S2 | S3 | S4 | S5 | S6 | S7 |
T0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 |
T1 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 |
T2 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 |
T3 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 | 0x0 |
debug-error
- Debugs the error log of a specific device.
# Input example
# debug-error <device_id>
user@linux-pc:~$ xcena_cli debug-error 0
# Output example
===== HIO[0] print_mu_error =====
MV_TOP_CSR_MON_IRQ = 0x0000_0000_0000_0000
my_error[0:0] = 0 (0x0)
ext_error[1:1] = 0 (0x0)
clust_mu_error[2:2] = 0 (0x0)
mon_irq_sw_break[7:4] = 0 (0x0)
mon_irq_inst0[11:8] = 0 (0x0)
mon_irq_error_dmb_lock[15:12] = 0 (0x0)
mon_irq_error_wb_lock[19:16] = 0 (0x0)
mon_irq_trap_error_vec[23:20] = 0 (0x0)
mon_irq_axi_bresp_error[27:24] = 0 (0x0)
mon_axi_berror_id[31:28] = 0 (0x0)
mon_irq_axi_rresp_error[35:32] = 0 (0x0)
mon_axi_rerror_id[39:36] = 0 (0x0)
mon_irq_cop_div_zero[43:40] = 0 (0x0)
mon_cop_error_tid[47:44] = 0 (0x0)
...
dump
- Queries a memory dump from a specific address.
start_addr(hex)
: Starting address (hex format)size(hex) <= 0x2000
: Query size (hex format) (maximum 0x2000)[length=2]
: Unit length (default: 2)[-l littleEndian]
: Endian format (default: little endian)
# Input example
# dump <device_id> <start_addr(hex)> <size(hex) <= 0x2000 > [length=2] [-l littleEndian]
user@linux-pc:~$ xcena_cli dump 0 0x2000A000000 0x100
# Output example
============================================
| M L | M L |
============================================
0x2000a000000 |0x0000_0000_0000_1234|0x0000_0000_0000_0008|
0x2000a000010 |0x0000_0000_0000_2f00|0x0000_0000_0000_0000|
0x2000a000020 |0x0000_0000_0000_0001|0x0000_0000_0000_0000|
0x2000a000030 |0x0000_0000_0000_0000|0x0000_0000_0000_0001|
0x2000a000040 |0x0000_0000_0000_0000|0x0000_0000_0000_0000|
0x2000a000050 |0x0000_0000_0000_0000|0x0000_0000_0000_0000|
0x2000a000060 |0x0001_0000_0000_0000|0x0000_0000_0000_0002|
0x2000a000070 |0x0000_0000_0000_0001|0x0000_0000_0000_0001|
0x2000a000080 |0x0000_0000_0000_0000|0x0000_0000_0000_0020|
0x2000a000090 |0x0000_0000_0000_0004|0x0000_0000_0000_0008|
0x2000a0000a0 |0x0000_0000_0000_0004|0x0000_0200_0a00_0198|
0x2000a0000b0 |0x0000_0000_0000_0008|0x0000_0200_0a00_01a0|
0x2000a0000c0 |0x0000_0000_0000_0100|0x0000_0200_0a00_02a0|
0x2000a0000d0 |0x0000_0000_0000_0100|0x0000_0000_4000_0000|
0x2000a0000e0 |0x0000_0200_0000_0000|0x0000_0201_0000_0000|
0x2000a0000f0 |0x0000_0000_0100_0000|0x0000_0201_0200_0000|