Multiplication Problem on Microblaze Software

Hi,

I want to do multiplication operation in my Microblaze's Test_Applicatio in Xilinx Plaform Studio. But i get some errors.can you help me?

This my code

temp1=j=16; temp2=temp1*0.5;//error occurs when i use " * "

*com2=(temp2);

These are the error messages

/cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real region ilmb_cntlr_dlmb_cntlr is full (TestApp_Memory/executable.elf sectio .text) /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real region ilmb_cntlr_dlmb_cntlr is full (TestApp_Memory/executable.elf sectio .text) /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .init [00000050 -> 00000073] overlaps section .text [00000050 -

00002463] /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .fini [00000074 -> 0000008f] overlaps section .text [00000050 - 00002463] /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .rodata [00000090 -> 00000374] overlaps section .text [00000050 - 00002463] /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .data [0000037c -> 000003a7] overlaps section .text [00000050 - 00002463] /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .ctors [000003a8 -> 000003af] overlaps section .text [00000050 - 00002463] /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .dtors [000003b0 -> 000003b7] overlaps section .text [00000050 - 00002463] /cygdrive/c/EDK/gnu/microblaze/nt/bin/../lib/gcc/microblaze/3.4.1/../../../../microblaze/bin/ld.real section .jcr [000003b8 -> 000003bb] overlaps section .text [00000050 - 00002463] collect2: ld returned 1 exit status make: *** [TestApp_Memory/executable.elf] Error 1
Reply to
mfgunes
Loading thread data ...

You're doing some floating point multiplication which causes the floating point math libraries to be linked in, which is then causing you to run out of code memory space.

Try dividing by 2 instead of * 0.5.

If you really do want to do floating point math, you'll have to increase the size of your memory.

Cheers, Jon

Reply to
Jon Beniston

Hi, I increased the size of the memory and i checked the "Enable Floatin Point Unit".Still i am facing with same errors.

Test_Application

Reply to
mfgunes

Hi,

You are mixing int and floating-point types without an explicit type-casting. The default implicit type-casting in C for floating point is to use double-precision. Since the HW FPU for microblaze is only for single-precision, the software-based double precision library is needed and this libary will be linked in to your application.

You should avoid implicit type-casting and you also have to decide if you need double precision floating point or single precision. This example can be done completely using integer operation and would make the program size much smaller.

You can check the size of the program with mb-size and see if it fits into the memory.

Göran Bilski

Reply to
Göran Bilski

Keep increasing the memory until the error messages go away.

If that is "too much memory" then you cannot use floating-point.

Note that "multiply by 0.5" is equivalent to "divide by 2" is equivalen to (for integer variables) "shift right by 1".

Reply to
RCIngham

Hi,

float deneme1; float deneme2; float deneme; deneme1=1.1; deneme2=1.1; deneme=deneme1*deneme2;

I changed the code like that.still i am facing with the same error.

Reply to
mfgunes

Hi,

float deneme1; float deneme2; float deneme; deneme1=1.1; deneme2=1.1; deneme=deneme1*deneme2;

I changed the code like that.still i am facing with the same error.

Reply to
mfgunes

Hi,

So how large is your program and how much memory do you have in your system?

Göran

Reply to
Göran Bilski

Ah, so that's how Word got as big as it did :-)

If you don't mind truncating instead of rounding:

5.0/2.0=2.5, which most people would expect to round up to 3.

If you do it in integer land, 5/2 = 2 5 shr 1 = 2 with the bit representing .5 thrown away, unless you take pains to keep it.

If this doesn't matter for your application that's fine.

On a side note, I'd rather write (and then later read) "/2" if that's what I mean than use a shift (irrespective of rounding issues). A decent compiler will do the shift for me if that's the best way of doing it.

Cheers, Martin

--
martin.j.thompson@trw.com 
TRW Conekt - Consultancy in Engineering, Knowledge and Technology
http://www.conekt.net/electronics.html
Reply to
Martin Thompson

The system have 64 KB memory.And the program is not so large.

system?

Reply to
mfgunes

Hi,

Can you do a mb-size on the final .elf file?

Göran Bilski

Reply to
Göran Bilski

Size of the .elf file is 23 KB

Reply to
mfgunes

Have you enabled "Mark to initialize BRAM" on multiple software applications in XPS? Can you share some more information on your system and your settings?

Göran

Reply to
Göran Bilski

Yes i enabled "Mark to initialize BRAM". I have two lmb bram controller connected to dlmb bus.One port of eac controller is external.This external ports is connected to brams in IS project.(bram controllers in XPS, brams in ISE.)I have some other RT designs connected to these brams.I will write data to bram in ISE then read the data with microblaze then make some floating point operations i microblaze and write the data to other bram.

Fatih

applications

Reply to
mfgunes

Yes i enabled "Mark to initialize BRAM". I have two lmb bram controller connected to dlmb bus.One port of eac controller is external.This external ports is connected to brams in IS project.(bram controllers in XPS, brams in ISE.)I have some other RT designs connected to these brams.I will write data to bram in ISE then read the data with microblaze then make some floating point operations i microblaze and write the data to other bram.

Fatih

applications

Reply to
mfgunes

I think that you shouldn't have the BRAMs in the ISE. Place them in XPS and then do the other bram ports as external ports. Doubt that this is the issue since the linker complains that your memory is full. Have you checked how the linker scripts look like?

Göran

Reply to
Göran Bilski

This system is working for integers etc...I controlled the values wit debugger and leds on my board. I have problems on floating poin operations. I think i can beat this problem with using fix point librar instead of doing operations with floats...Is there any fix point librar in EDK?

is

Reply to
mfgunes

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.