Program address space

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

Moderator: aolofsson

Program address space

Postby dafer » Thu May 15, 2014 5:04 pm

Hi, and sorry if this question has been answered elsewhere, but I have searched the manual and forum without being able to find an answer to my question.

When I load the program onto the core using e_load or e_load_group, how can I know where the code is loaded to? From the example programs I have been able to guess that the code probably is loaded into the address space 0x00000000-0x00001FFF in the cores local memory address space. But what is the actuall rule for deciding what address space the program gets loaded into. Say for example if the compiled file is 16kb instead of 8kb. Alternatively, if I know my program actually only is taking up half of the compiled files actuall space, can I safetly overwrite the other half with data produced at runtime?
dafer
 
Posts: 2
Joined: Mon Dec 17, 2012 3:24 am

Re: Program address space

Postby ysapir » Fri May 16, 2014 1:36 am

The location of code and data is determined by the LInker Script (the *.ldf) file you use. If using the provided LDF, it will be one of fast.ldf, internal.ldf or legacy.ldf.

By default, the fast and internal models put the user code in the internal memory, starting at the base of the first bank, after the vector table. The fast model puts the library code in the external memory. The legacy model puts all code and data in the external memory.

Whatever model you use, you can explicitly change the placement of your objects using the "SECTION()" { "__attribute__ ((section (x))) } attribute keyword.

You can check the placement and size of your allocated objects using the e-objdump command.
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: Program address space

Postby dafer » Fri May 16, 2014 8:11 am

Thanks! I guess I should read up on linkers then.
dafer
 
Posts: 2
Joined: Mon Dec 17, 2012 3:24 am


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 26 guests

cron