UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
6,477 Views
Registered: ‎11-13-2007

How do I add a new code section to my project?

I have a  fully operational PPC system  on a Virtex4 and I want to move a few routines onto BRAM and get them out of slower external DRAM. 

  

I've added a new section to the linker script (as shown), but I can't figure out how to encompass certain routines with directives to locate the code the way I want.

 

.fastcode : {

   __fastcode_start = .;

   *(.fastcode)

   __fastcode_end = .;

} > ppc405_0_iocm_cntlr

 

 

 

Has anyone done this, and if so, how? 

 

 

0 Kudos
5 Replies
Highlighted
Observer joshua_
Observer
6,461 Views
Registered: ‎02-27-2009

Re: How do I add a new code section to my project?

Try:

  void fastfunction() __attribute__((section("fastcode")));

 

And then in your header file:

  extern void fastfunction() __attribute__((section("fastcode")));

 

I got the syntax for this from

 

  http://developer.apple.com/documentation/developertools/gcc-3.3/gcc/Function-Attributes.html

 

which just seems like a HTMLization of the gcc info pages, so it should be applicable to Xilinx's gcc, too.

Tags (2)
0 Kudos
Explorer
Explorer
5,835 Views
Registered: ‎11-13-2007

Re: How do I add a new code section to my project?

Thanks for the suggestion Joshua. (I've been away from this issue for a while)

 

I can't seem to get this to work. The tools says:

 

error: no memory region specified for loadable section `fastcode'

 

Has anyone actually gotten this to work?

0 Kudos
Xilinx Employee
Xilinx Employee
5,815 Views
Registered: ‎08-01-2007

Re: How do I add a new code section to my project?

A new section needs to be added to the linker script too.

 

You can open linker script generator and add this section.

0 Kudos
Explorer
Explorer
5,808 Views
Registered: ‎11-13-2007

Re: How do I add a new code section to my project?

OK but how do I indicate in the code that certain parts of code belong in that section? The majority of the code lives in the .text section and I never indicate that...it just defaults there. How can I tell it to keep certain functions, or certain object files in the new section?
0 Kudos
Xilinx Employee
Xilinx Employee
5,788 Views
Registered: ‎08-01-2007

Re: How do I add a new code section to my project?


akleica wrote:
OK but how do I indicate in the code that certain parts of code belong in that section? The majority of the code lives in the .text section and I never indicate that...it just defaults there. How can I tell it to keep certain functions, or certain object files in the new section?

After adding a section in Linker scripter generator, Joshua's method helps to do this job.

Message Edited by sutongqi on 05-04-2009 10:53 PM
0 Kudos