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!

AR# 39143

14.6 EDK - How do I place or locate a variable in a particular address range?

Description

I would like to create a new section for some of the more critical variables. How do I assign certain variables to this section, and locate it to a specific memory?

Solution

The variables to be relocated can be tagged to exist in a specific linker section during declaration:

... 
u8 Table[TABLE_SIZE]__attribute__ ((section (".FPGA_BRAM"))) ;
...

In the linker script, the entire section is then added to a memory range whose physical address and range is generally defined at the top of the linker script:

... 
.FPGA_BRAM : {
*(.FPGA_BRAM)
} >xps_bram_if_cntlr_0
...

See the section attribute chapter in the GCC documentation:
http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html

AR# 39143
Date Created 11/16/2010
Last Updated 09/04/2013
Status Active
Type General Article
Tools
  • EDK - 10.1 sp2
  • EDK - 10.1
  • EDK - 10.1 sp1
  • More
  • EDK - 10.1 sp3
  • EDK - 11.1
  • EDK - 11.2
  • EDK - 11.3
  • EDK - 11.4
  • EDK - 11.5
  • EDK - 12.1
  • EDK - 12.2
  • EDK - 12.3
  • EDK - 13.1
  • Less