cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
7,367 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
Highlighted
Explorer
Explorer
13,837 Views
Registered: ‎05-31-2015

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.

View solution in original post

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

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.

View solution in original post

0 Kudos