-
Install the needed tools
Ubuntu:
sudo apt update sudo apt install gdb-multiarch git cmake build-essential lldb # development tools sudo apt install libelf-dev libsdl2-dev libvncserver-dev libslirp-dev # dependencies
-
Run the setup script to fetch the compiled Linux kernel from avp64_sw and the source files for debugging
<avp64 root>/vscode/setup.bash
-
Install the VSCode extensions
- In the end of the setup script, VSCode opens
- Import the avp64.code-profile by following the instructions here. This install the required extensions
-
Configure the project
- Press F1 and type CMake: Configure
- Select the C++ compiler
-
Build the project
- Press F1 and type CMake: Build
-
Install the project
- The project is configured to be installed at
<avp64 root>/build/{debug|release}/
. (This setting can be changed in the <avp64 root>/.vscode/settings.json file) - To install the project, press F1 and type CMake: Install
- The project is configured to be installed at
-
Open the Debug view (Ctrl+Shift+D)
-
At the top, after the green arrow, select Debug AVP64
-
Press the green arrow to start AVP64
-
Change to the terminal window (Ctrl+Shift+`) to see the the output of avp64. The VP waits for a debugger to connect. Sample output:
SystemC 2.3.3-MachineWare GmbH --- Jul 26 2024 14:01:36 Copyright (c) 1996-2018 by all Contributors, ALL RIGHTS RESERVED [I 0.000000000] system.term0: listening on port 52010 [I 0.000000000] system.term1: listening on port 52011 [I 0.000000000] system.term2: listening on port 52012 [I 0.000000000] system.term3: listening on port 52013 [D 0.000000000] created slirp ipv4 network 10.0.0.0/24 [D 0.000000000] created slirp ipv6 network fec0:: [I 0.000000000] system: starting infinite simulation using 100 us quantum [I 0.000000000] system.cpu: waiting for GDB connection on port 5555 [I 0.000000000] system.cpu.arm0: listening for GDB connection on port 52100 [I 0.000000000] system.cpu.arm1: listening for GDB connection on port 52101
-
Connect the debugger by going back to the Debug view (Ctrl+Shift+D)
-
At the top, after the green arrow, select Debug Target SW
-
Press the green arrow to connect the debugger
-
You can control the target using the control panel at the top. You can use the dropdown menu to switch between debugging avp64 and the target software.