cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Anonymous
Not applicable
8,741 Views

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
Highlighted
Xilinx Employee
Xilinx Employee
10,674 Views
Registered: ‎08-07-2007

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

View solution in original post

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

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
Highlighted
Anonymous
Not applicable
8,693 Views

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
Highlighted
Newbie
Newbie
8,684 Views
Registered: ‎04-28-2009

You have to use printf for floating point support.

xil_printf has floating point removed to reduce the library footprint.

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

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

View solution in original post

0 Kudos
Highlighted
Anonymous
Not applicable
8,661 Views

thank you! 

amit

0 Kudos
Highlighted
Participant
Participant
8,419 Views
Registered: ‎12-04-2008

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
Highlighted
Participant
Participant
8,413 Views
Registered: ‎12-04-2008

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
Highlighted
Observer
Observer
8,405 Views
Registered: ‎02-26-2009

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
Highlighted
Participant
Participant
8,396 Views
Registered: ‎12-04-2008

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
Highlighted
Historian
Historian
7,076 Views
Registered: ‎02-25-2008

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
Highlighted
Participant
Participant
7,074 Views
Registered: ‎12-04-2008
Yes, is it a problem?
0 Kudos
Highlighted
Observer
Observer
7,039 Views
Registered: ‎02-26-2009

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

 

FV

0 Kudos
Highlighted
Participant
Participant
7,036 Views
Registered: ‎12-04-2008

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

 

N

0 Kudos
Highlighted
Historian
Historian
7,031 Views
Registered: ‎02-25-2008

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
Highlighted
Participant
Participant
7,015 Views
Registered: ‎12-04-2008

HI again,

 

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

 

N

0 Kudos
Highlighted
Contributor
Contributor
7,007 Views
Registered: ‎09-03-2007

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
Highlighted
Xilinx Employee
Xilinx Employee
6,993 Views
Registered: ‎08-07-2007

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