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
Observer amitcrathod
Observer
8,637 Views
Registered: ‎02-23-2009

Co-processor inerface

Jump to solution

hi !! I have a sparten 3e starter board. i am using microblaze. in my application i want to send 10 integer data in a group of two(2) to coprocessor throgh FSL link. my co-processor should multiply both the number & give the result back and then should take next two integer number.

i have created my peripheral in import it.

i use putfsl( data[i] ,0) 

        putfsl( data[i] ,0) 

        putfsl( data[i] ,0)

      putfsl( data[i] ,0)

      putfsl( data[i] ,0)  and than getfsl(out[i],0)

                                                  getfsl(out[i],0).....

 

but on terminal i got only first two numbers output...not others...can anybody help me??

pls.

amit 

 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
10,570 Views
Registered: ‎08-07-2007

Re: Co-processor inerface

Jump to solution

Hi Amit,

 

To print out the floating with printf(), please also make sure that the heap and stack has been set to a proper size. REfer to http://www.xilinx.com/support/answers/29787.htm please.

 

-XF

0 Kudos
17 Replies
Xilinx Employee
Xilinx Employee
8,614 Views
Registered: ‎08-06-2007

Re: Co-processor inerface

Jump to solution

Hi,

 

Since you do all puts before you do all gets, you need to make sure that the coprocessor is not stuck on waiting for the result to be read(get).

This would create a stall condition where the coprocessor is waiting on MicroBlaze to read the data and MicroBlaze is waiting on the coprocessor to accept more data.

 

Göran

0 Kudos
Observer amitcrathod
Observer
8,589 Views
Registered: ‎02-23-2009

Re: Co-processor inerface

Jump to solution

thanx Goran !

i got the sollution. now my problem is how to print floating data to terminal? xil_printf(" %f ",data) is not showing data..pls help

amit 

0 Kudos
Newbie wtomko
Newbie
8,580 Views
Registered: ‎04-28-2009

Re: Co-processor inerface

Jump to solution

You have to use printf for floating point support.

xil_printf has floating point removed to reduce the library footprint.

0 Kudos
Xilinx Employee
Xilinx Employee
10,571 Views
Registered: ‎08-07-2007

Re: Co-processor inerface

Jump to solution

Hi Amit,

 

To print out the floating with printf(), please also make sure that the heap and stack has been set to a proper size. REfer to http://www.xilinx.com/support/answers/29787.htm please.

 

-XF

0 Kudos
Observer amitcrathod
Observer
8,557 Views
Registered: ‎02-23-2009

Re: Co-processor inerface

Jump to solution

thank you! 

amit

0 Kudos
Participant naim32
Participant
8,315 Views
Registered: ‎12-04-2008

Re: Co-processor inerface

Jump to solution

Hi all,

 

I tried to change the stack size but I was encountered with this error. Do I change the stack and heap size from the linker script of my new software application? If it is true, I set these values to (stack=0x2000 and heap=0x800) and by the way, I have my dlmb and ilmb set to 64K. What seems to be the problem?

 

Thanks

 

 

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze-xilinx-elf/4.1.1/../../../../microblaze-xilinx-elf/bin/ld.real: region dlmb_cntlr_ilmb_cntlr is full (test_kalman/executable.elf section .stack)


collect2: ld returned 1 exit status


make: *** [test_kalman/executable.elf] Error 1

0 Kudos
Participant naim32
Participant
8,309 Views
Registered: ‎12-04-2008

Re: Co-processor inerface

Jump to solution

ooh one more thing... whe I used to use xil_printf, the program runs normally but no floating display. Now that I am using printf, the program doesnt display anything, it just halts... can anyone help? I changed the heap and stack values from the compiler options (because I am not using a linker) but do I have to set the program start address? If so, where can I get it?

 

Thanks

0 Kudos
Observer fventrone
Observer
8,301 Views
Registered: ‎02-26-2009

Re: Co-processor inerface

Jump to solution

From what memory are you running this program? When you add the printf() it really bloats your code size. You may not have enough memory to run your program.

 

Regards,

FV

0 Kudos
Participant naim32
Participant
8,292 Views
Registered: ‎12-04-2008

Re: Co-processor inerface

Jump to solution

I am running it from the BRAM (no DDR or SRAM are involved). The problem with the code is that when it reaches a function call, the system just freezes. What seems to be the problem and how can I fix it?

 

Thanks,

N

0 Kudos
Historian
Historian
6,972 Views
Registered: ‎02-25-2008

Re: Co-processor inerface

Jump to solution

naim32 wrote:

I am running it from the BRAM (no DDR or SRAM are involved). The problem with the code is that when it reaches a function call, the system just freezes. What seems to be the problem and how can I fix it?

 

Thanks,

N


Do you have 64k bytes of BRAM?

 

-a

----------------------------Yes, I do this for a living.
0 Kudos
Participant naim32
Participant
6,970 Views
Registered: ‎12-04-2008

Re: Co-processor inerface

Jump to solution
Yes, is it a problem?
0 Kudos
Observer fventrone
Observer
6,935 Views
Registered: ‎02-26-2009

Re: Co-processor inerface

Jump to solution

You got to check your code size. Mine would not fit in my 64k BRAM.

 

FV

0 Kudos
Participant naim32
Participant
6,932 Views
Registered: ‎12-04-2008

Re: Co-processor inerface

Jump to solution

how do you find that? or is it just the .c file size?

 

N

0 Kudos
Historian
Historian
6,927 Views
Registered: ‎02-25-2008

Re: Co-processor inerface

Jump to solution

naim32 wrote:

how do you find that? or is it just the .c file size?

 

N


Look for the last report after the make process completes.You'll see a marker: 

 

************************ Determining Size of ELF File ******************

 

followed by a report:

 

powerpc-eabi-size main.elf
   text       data        bss        dec        hex    filename
  32562        872      10348      43782       ab06    main.elf

 

You can also launch an EDK shell, and run

 

$  mb-size -t main.elf

 

(assuming main.elf is the name of your application's executable.)

 

-a

----------------------------Yes, I do this for a living.
0 Kudos
Participant naim32
Participant
6,911 Views
Registered: ‎12-04-2008

Re: Co-processor inerface

Jump to solution

HI again,

 

from your example, what is the main.elf file size? I mean how do you calculate it in KBytes?

 

N

0 Kudos
Contributor
Contributor
6,903 Views
Registered: ‎09-03-2007

Re: Co-processor inerface

Jump to solution

You may not use printf at all even if you need to print floating point numbers. You just need to use xil_printf in a smart way when you need to print a floating point number. Try the follwoing code:

 

 

void print_float(float Input)
{
/*
* cast input and remove floating part
*/

long int fix_part = (long int) Input;
/*
* remove integer part, multiply by 1000 to adjust to 3 decimal points then cast to integer
*/
long int frac_part = (long int) (Input*1000.0 - fix_part*1000);

xil_printf("%d", fix_part);
xil_printf(".%d\r\n", frac_part);
}

 

printf requires much of memory space that not available in typical embedded applications and this is why you must not use it in an embedded application unless the compiler provides a target optimized version. The GCC compiler in EDK uses the standard library for printf and there is no optimized version of it.

 

see the same issue at the following link http://forums.xilinx.com/xlnx/board/message?board.id=EDK&message.id=6676#M6676

 

 

Regards

Mohamed Yousef

Message Edited by digital_mind on 06-07-2009 11:00 AM
0 Kudos
Xilinx Employee
Xilinx Employee
6,889 Views
Registered: ‎08-07-2007

Re: Co-processor inerface

Jump to solution

Hi naim32,

 

It's very likely that your BRAM is not large enough to store your application.  Since you are not using a linker script, the default linker script will be used and it will assume that there's enough memory space to hold the application.

 

To verify if the applicaiton has been linked to an address that out of the range of the BRAM, you can use mb-objdump command to dump the elf file and check out the address mapping.

 

-XF

0 Kudos