GDB and simulator

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

GDB and simulator

Postby upcFrost » Wed Feb 21, 2018 1:21 pm

Hi,

Can someone plz tell me how to use e-sim and e-gdb together?

I'm away from my board, and I'm trying to test my compiler against matmul-16. This example requires passing matrices from host, so i'm trying to use e-sim like this (different example, hello_world here)

Code: Select all
e-sim --host `pwd`/hello_world.elf -p parallella16 --wait-attach 0x808 --external-fetch


And this is where I'm getting stuck. e-sim spawns a number of cores except the one I specified, but I don't get how to attach this single core to the sim.

If i'm trying to use the usual approach with e-gdb -> target sim -> load -> start, it will just spawn yet another sim process without connecting to the existing one. Am I missing something?
Current LLVM backend for Epiphany: https://github.com/upcFrost/Epiphany. Commits and code reviews are welcome
upcFrost
 
Posts: 37
Joined: Wed May 28, 2014 6:37 am
Location: Moscow, Russia

Re: GDB and simulator

Postby upcFrost » Wed Feb 21, 2018 4:43 pm

Somehow managed to run gdb and sim together.

First started e-gdb as

Code: Select all
e-gdb e_matmul.elf -ex "target sim" -ex "sim e-coreid 0x808" -ex "sim e-rows 4" -ex "sim e-cols 4" -ex "sim e-external-fetch" -ex "sim e-first-core 0x808"


Next, started e-sim as

Code: Select all
e-sim --host `pwd`/matmul.elf ../../device/Release/e_matmul.elf -p parallella16 --external-fetch --wait-attach 0x808 --verbose


now i'm getting "RESETCORE asserted at 0xb64" error after a couple of steps.
Current LLVM backend for Epiphany: https://github.com/upcFrost/Epiphany. Commits and code reviews are welcome
upcFrost
 
Posts: 37
Joined: Wed May 28, 2014 6:37 am
Location: Moscow, Russia

Re: GDB and simulator

Postby upcFrost » Thu Mar 22, 2018 9:31 am

Meh, ok, somehow managed to fix the code without using debugger. Man it sucks, but whatever :roll:
Current LLVM backend for Epiphany: https://github.com/upcFrost/Epiphany. Commits and code reviews are welcome
upcFrost
 
Posts: 37
Joined: Wed May 28, 2014 6:37 am
Location: Moscow, Russia

Re: GDB and simulator

Postby olajep » Wed Apr 04, 2018 12:33 pm

Glad to see you were able solve it!

When passing --host to e-sim you also need to pass
"-ex environment operating" to e-gdb.
(e-sim is a frontend for e-run, 'e-sim --host ...' implies 'e-run --environment operating ...')


The GDB simulator framework provides three environments which the epiphany target maps as follows:

user:
For standalone single-core programs
Interrupts will stop the simulation.
Anything that puts the core in IDLE state, e.g. asserting RESETCORE, will stop the simulation.
workgroup_cfg section set by simulator
Command line options supported
Started from Entry point address in ELF header (usually the _start symbol)

virtual:
For standalone multi-core programs
workgroup_cfg section set by simulator
Started by triggering the SYNC interrupt

operating:
For programs with a host part
Corresponds to e-sim --host flag
Core started in IDLE mode


The default environment for e-gdb and e-run is 'user'
The default environment passed by e-sim to e-run is 'virtual'. The --host flag changes that to 'operating'

// Ola
_start = 266470723;
olajep
 
Posts: 139
Joined: Mon Dec 17, 2012 3:24 am
Location: Sweden

Re: GDB and simulator

Postby upcFrost » Wed May 02, 2018 8:03 pm

Thanks for the explanation, I think I'll really need it when I'll get to work with matmul example once again :D
Current LLVM backend for Epiphany: https://github.com/upcFrost/Epiphany. Commits and code reviews are welcome
upcFrost
 
Posts: 37
Joined: Wed May 28, 2014 6:37 am
Location: Moscow, Russia


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: Bing [Bot] and 6 guests