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: 
Highlighted
Explorer
Explorer
7,209 Views
Registered: ‎05-31-2015

Variable size and allocation in Xilinx SDK map file

Jump to solution

Hello,

 

                     I am working in Xilinx SDK on microblaze platform. I am generating a map file for my C application. As expected the size for short ,char, int variables are shown as 2,1 and 4 bytes in mapfile. But each of these is allocated 4 byte of address , that I dont want. To be more clear if I have 'short c' declared in my program ,in map file size is 0x2 for c. But address of c is f0 and next allocated variable at f4 , when it is suppose to be at f2. Why does this happen. Suggest method to solve this.

 

Thanks in advance

 

Shalini K

 

 

0 Kudos
1 Solution

Accepted Solutions
Explorer
Explorer
13,679 Views
Registered: ‎05-31-2015

Re: Variable size and allocation in Xilinx SDK map file

Jump to solution

Hello,

 

          I figured it out as that 4 byte variables can only start from 4 byte boundaries. So after a short variable if another short is to be assigned memory ,2 bytes given for each. But if it is an int then since it is 32bit ,it starts fromm 4 byte boundary,So short is given 4 bytes.

0 Kudos
1 Reply
Explorer
Explorer
13,680 Views
Registered: ‎05-31-2015

Re: Variable size and allocation in Xilinx SDK map file

Jump to solution

Hello,

 

          I figured it out as that 4 byte variables can only start from 4 byte boundaries. So after a short variable if another short is to be assigned memory ,2 bytes given for each. But if it is an int then since it is 32bit ,it starts fromm 4 byte boundary,So short is given 4 bytes.

0 Kudos