PULP Community
Debug the simulated code - Printable Version

+- PULP Community (https://pulp-platform.org/community)
+-- Forum: PULP's Community forum (https://pulp-platform.org/community/forumdisplay.php?fid=1)
+--- Forum: PULP General questions (https://pulp-platform.org/community/forumdisplay.php?fid=2)
+--- Thread: Debug the simulated code (/showthread.php?tid=309)



Debug the simulated code - angramemnos - 02-24-2023

Hello forum,

I want to ask if there is any way to debug the C code that is running on the pulp-runtime. The solutions that I find (pulp-debug-bridge, openocd and gdb)  works with pulp-sdk and as far I know the sdk is no longer working. Thank you for helping.


RE: Debug the simulated code - Cristiano - 02-24-2023

Hi angramemnos

I am looking for a similar thing as you. I am using the GVSoC tool (that is inside the SDK) to emulate the Pulp platform and run C code applications over it.

Trying to reply your question, the SDK is working!

- Clone the SDK from github: https://github.com/pulp-platform/pulp-sdk
- You will need the RISC-V GNU Compiler. You can use one already build, the version v1.0.16 works fine: https://github.com/pulp-platform/pulp-riscv-gnu-toolchain/releases/tag/v1.0.16
Important 1: you should use Ubuntu 18.04 Bionic Beaver 64-Bit. I tried with Ubuntu 22 and it didn't work. Also, you will need Python 3 installed. They recommend version 3.8 at least
Important 2: clone from github using the --recurse-submodules
You will need to manage some error during the sdk managing. If you stop, write here and I will try to help you.

Even able to run the SDK/GVSoC, I am not able to debug the C code application instruction by instruction. And in this point I have the same doubts that you.

1) Does the Pulp platform emulated through the GVSoC have the capability to debug applications instruction by instruction?

2) If yes, what are the tool used together the GVSoC that provide the application instruction debug? Debug_bridge (+ GDB)? Openocd (+ GDB)? Other?

I saw in the link below that debug_bridge is not more being used for debug...
https://pulp-platform.org/community/archive/index.php?thread-117.html

I tried to setup the debug_bridge and got some errors like:

a) During the pulp builder clone, the following error:
"Cloning into '.../pulp-builder/pulp-runtime'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

b) Besides the inconsistence in the cloning, going ahead with the installation.
According the Readme file, to build the pulp_builder we should run the script build-debug-bridge (./scripts/build-debug-bridge)
I noted in the cloned repository there is no this script. Instead, there are one called build-runtime
Trying to run this "build-runtime" scripts I got the error:

+ make -C json-tools all install BUILD_DIR=/home/cristiano/Documents/pulp-builder/build/json-tools INSTALL_DIR=/home/cristiano/Documents/pulp-builder/install/ws
make: Entering directory '/home/cristiano/Documents/pulp-builder/json-tools'
make: *** No rule to make target 'all'. Stop.
make: Leaving directory '/home/cristiano/Documents/pulp-builder/json-tools'

Please, could someone help us with some tips about the C code debugging over Pulp SDK/GVSoC?


RE: Debug the simulated code - Cristiano - 03-02-2023

Please, could someone help us with some tip?