Page 1 of 1

Proper way to get the registers from core to the host

PostPosted: Tue Dec 16, 2014 10:26 pm
by dmarquez
Hi everybody,

I am currently working on a simple debugger. For that end I am trying to read the general purpose registers of all cores from core 0 and write that to the host. To do that, after waking up all the cores and sending them to idle, I use the following code (in C, only for core 1 1, from core 0):

Code: Select all
int registers[128];
e_read(&e_group_config, (void*)registers, 1, 1,
   (void*)PAGE_REG, 128 * sizeof(int));

e_write(&e_emem_config, (void*)registers, 0, 0,
   (void*)REG_ADDRESS, 128 * sizeof(int));


REG_ADDRESS corresponds to a random address I chose which is in host memory (0x01002000). PAGE_REG corresponds to 0xF0000.

This does not seem to work, since all positions in the array "registers" contain the same value: the value of register R0 for the corresponding core. I could not find anything in the documentation or the forums on this.

What would be the proper way of getting the register values?

Thanks in advance!

Re: Proper way to get the registers from core to the host

PostPosted: Wed Dec 31, 2014 2:06 pm
by aolofsson
Sorry for the slow reply..so ust to confirm you you are tying to run the following program in core 1,1:

1.) Read register values from core 0,0 into and place them in the variable registers (why 128?)
2.) Copy the registers[128] values to DRAM.

At first look, I think your REG_ADDRESS is wrong...(that is the address as seen from the host)

https://github.com/adapteva/epiphany-li ... B/fast.ldf

Andreas

Re: Proper way to get the registers from core to the host

PostPosted: Thu Jan 08, 2015 7:26 pm
by dmarquez
No problem, I continue working on.
In my example, I try to read a register, from a remote core. The number 128 that you mention is a mistake, the registers count is 64.

Have you an example for reading register from a remote core?. I realize that it is not possible to read if the core is running. The core must to be halt for make the reading?

Thanks in advance,
David.