GitXplorerGitXplorer
X

XSDB-dbg

public
6 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
6ac7e6f31d29c20a32b4a334e04ec692252f5d2c

Fix linting errors and update source

XX-Ryl669 committed 2 years ago
Unverified
747cfb0057e8997069c5073cd94ec39ec9f96e56

Update readme

XX-Ryl669 committed 2 years ago
Unverified
ebff8b95dd9269ebaf0566b85e98fc851d4c242e

Update icons and prepare to publish

XX-Ryl669 committed 2 years ago
Verified
ab40043881fa28eb4163b94952183ad5a30d1e71

Merge pull request #2 from X-Ryl669/dependabot/npm_and_yarn/minimatch-and-mocha-3.1.2

XX-Ryl669 committed 2 years ago
Verified
d5989e3ef8ff1c741f886e86138bfda1474a27a0

Bump minimatch and mocha

ddependabot[bot] committed 2 years ago
Verified
7038634e20b9a6bb2163dce8a8d890331788612b

Merge pull request #1 from X-Ryl669/dependabot/npm_and_yarn/json5-2.2.3

XX-Ryl669 committed 2 years ago

README

The README file for this repository.

Debug

VS Marketplace

Native VSCode debugger. Supports Xilinx's XSDB / XSCT. Shamelessly inspired by webfreak's debug extension.

This allow to use VSCode instead of the horrible and hacky VITIS software to develop and debug on Xilinx's CPU.

Installation

Press ctrl-p (cmd+p on OS X) and run ext install X-Ryl669.xsdb-debug in visual studio code and install Xilinx's XSDB (via Vitis). See Usage for details on how to set it up.

Preview

Usage

Image with red circle around a gear and a red arrow pointing at GDB and LLDB

Or if you already have an existing debugger in your project setup you can click "Create Configuration" or use the auto completion instead:

Visual studio code debugger launch.json auto completion showing alternative way to create debuggers

Open your project and click the debug button in your sidebar. At the top right press the little gear icon and select XSDB. It will automatically generate the configuration you need.

Please focus on the xsdb_target_filter argument used to select the CPU to debug in XSDB/XSCT world. This extension is able to debug multiple targets (CPU) of the same architecture which would appear as multiple thread in VSCode.

The argument symbol_mapper can be used to specify an addr2line compliant software to map from address to symbols. Since you can debug any target with XSCT/XSDB debugger, this includes architectures that aren't documented or tooled by AMD/Xilinx. Typically, Xilinx Versal's AI Engine are CPU without a documented architecture, nor any tools. The Xilinx provided's compiler will output an incomplete ELF file for such target with no architecture described in it. Yet, these ELF files do have debug information that can be used with usual addr2line tool to map basic address to function and file+line.

XSDB/XSCT protocol doesn't support getting symbol from address, nor does it support getting address from symbol for all symbols.

Use autorun to send TCL initialization commands to discover new targets (like AI Engine's cores). In order to capture those commands, you'll like need to run VITIS software at least once to display its XSCT console and copy and paste the initialisation commands.

Attaching to existing processes

This debugger works only by attaching to an HW server. It does so by launching an XSDB instance and then asking it to connect to any HW server. You can not start or stop a software with this debugger (the dow command is not supported). This means that your system must be autonomous and start by its own. The debugger can pause and resume the software on the target.

Example configuration for AI Engine

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "xsdb",
            "request": "launch",
            "target": "ip/aie/Work",
            "cwd": "${workspaceRoot}",
            "valuesFormatting": "parseText",
            "showDevDebugOutput": true,
            "printCalls": true,
            "xsdb_target_filter": "{name =~\"core*\"}",
            "autorun": [
                "source /path/to/Xilinx/Vitis/2022.2/scripts/vitis/util/aie_debug_init.tcl",
                "targets -set -nocase -filter {name =~\"Versal*\"}", 
                "init_aie_debug -work-dir {${workspaceRoot}/aie/Work} -use-current-target -name AIEngine -jtag"
            ],
            // It's not correct for the AI engine CPU architecture, but it seems it's more or less working to perform the mapping
            "symbol_mapper": "/path/to/Xilinx/Vitis/2022.2/gnu/aarch64/lin/aarch64-none/bin/aarch64-none-elf-addr2line -e $1 -fC $2",
            "env": {
                "XILINX_VITIS": "/path/to/Xilinx/Vitis/2022.2"
            }
        }
    ]
}