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: 
Adventurer
Adventurer
7,308 Views
Registered: ‎11-10-2012

share executable among microblazes

Jump to solution

Hello,

 

I'd like to have a program in DDR memory and then execute it with multiple microblazes.

In order to do that, i first compiled+linked the code within one microblaze' project (with the linker script i put the sections where i want). When i executed the code with this same microblaze it worked fine. But, when i put a second microblaze to execute from this , i can see that it gets lost (goes to bad addresses).

I've also noticed that if i compile+link the code with the second microblaze then it's the first one who gets lost. So my first question is, culd be possible that the final executable is processor dependent?, even if looking at the assembler it doesn't looks like that?

Anyway, i've created a separate SDK C project which uses the microblaze' toolchain. Whitin this project i create the executable and load it into DDR memory . Then, i tried with only one microblaze and it doesn't work. This time the microblaze doesn't get lost but the execution doesn't do what it is supposed to do.

 

Can  someone please help with this?

 

Thanks in advance.

Best regards,

Yaset

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
11,856 Views
Registered: ‎11-10-2012

Re: share executable among microblazes

Jump to solution

Hi,

For those who are interested, i think i have the answer. When i use a separate .elf file (the code i want to share) the .bss section is not initialized because the loading of the program is made by myself. So i see it is normal that the initialization is done by myself too !! That's what i did, i set to zeros the .bss section after loading and it works ok.

Hope this can help someone.

 

Regards,

Yaset

View solution in original post

7 Replies
Xilinx Employee
Xilinx Employee
7,287 Views
Registered: ‎08-02-2007

Re: share executable among microblazes

Jump to solution

Hi,

 

Are you specifying a different start address for both the applications in DDR? I am suspecting that the start of both the applications is at 0x0000_0000 offset of DDR.

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
7,276 Views
Registered: ‎11-10-2012

Re: share executable among microblazes

Jump to solution

Hi ,

Thanks for answering.

Are you talking about the program's entry point? If it is, this is not a problem cause i first load this program into the ddr and then i load other program into the processor' local memory which sets the entry point at a local address (just what i want).

 

Otherwise, after posting this message, i found one of the problems. It is related to global static variables which should be initialized to zero. I read that the linker puts zero initialized global variables into the .bss section instead of the .data section in order to save space (the space that would be used to store the initial value, i.e. zero) The problem is that such variables are never initialized; so i use now the -fno-zero-initialized-in-bss linker option to force the linker put those variables into the .data section. Now the variables are initialized to zero but i don't know why they weren't in the .bss section.

 

My program works better (it is a mpeg decoder ) there are still hiden errors to find...thanks again.

 

Yaset

0 Kudos
Scholar sampatd
Scholar
7,268 Views
Registered: ‎09-05-2011

Re: share executable among microblazes

Jump to solution

Could you please clarify a bit more?

 

global declaration such as:

static int i; 

 

will be in the BSS segment since this would be uninitialized data. 

 

global declaration such as:

int i=1;

 

would be in .data segment since this would be initialized data. 

 

All the local variables in the stack. 

0 Kudos
Adventurer
Adventurer
7,260 Views
Registered: ‎11-10-2012

Re: share executable among microblazes

Jump to solution

You are right sampatd.

 

I'm talking about global declaration such as :

static int a = 0;

I expected it to go into .data since it is an initialized variable. Then i understood that it goes to .bss because this section is always initialized to zero. Like this, the linker doesn't  need to store the zero value of variable a in the executable.

 

The problem is that my .bss section is not initialized to zero (i look at it after loading the program). My solution was to use a linker's option (-fno-zero-initialized-in-bss) to force it to put my zero initialized variables into .data section (like any other initialized variable as you said). Then it works, i see my variables initialized to zero.

 

Tell me if it's more clear now please.

 

Regards,

Yaset

0 Kudos
Scholar stephenm
Scholar
7,185 Views
Registered: ‎05-06-2012

Re: share executable among microblazes

Jump to solution
Looks like you are trying to use lockstep operation?
See page 88 of the micro blaze ref guide below:
http://www.xilinx.com/support/documentation/sw_manuals/xilinx13_2/mb_ref_guide.pdf#page88
0 Kudos
Adventurer
Adventurer
7,135 Views
Registered: ‎11-10-2012

Re: share executable among microblazes

Jump to solution

Hi,

I dont't think i need to use the lockstep operation since, in my case, the microblazes execute the same code but never at the same time. What  do you think?

 

Thanks

0 Kudos
Highlighted
Adventurer
Adventurer
11,857 Views
Registered: ‎11-10-2012

Re: share executable among microblazes

Jump to solution

Hi,

For those who are interested, i think i have the answer. When i use a separate .elf file (the code i want to share) the .bss section is not initialized because the loading of the program is made by myself. So i see it is normal that the initialization is done by myself too !! That's what i did, i set to zeros the .bss section after loading and it works ok.

Hope this can help someone.

 

Regards,

Yaset

View solution in original post