Floating Point With Xilinx EDK (PPC)?

I'm having trouble using floats with the PPC compiler. Any inclusion of floats produces a pretty indecipherable (to me) linker error. I tried -lm but that doesn't help. Any ideas? Thanks.

-Dave

Reply to
Dave
Loading thread data ...

Posting the error message might help..

Cheers, JonB

Reply to
Jon Beniston

Jon-

So many messages spew out of the build process it's hard to tell what might be relevant. Below is the tail end. Also, the project is the Memec/Insight ultracontroller "Time of Day" design, which I believe derives from a Xilinx example. Thanks.

.comment 0x00000104 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(exit.o) .comment 0x00000138 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(impure.o) .comment 0x0000016c 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(strcpy.o) .comment 0x000001a0 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(strlen.o) .comment 0x000001d4 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/libgcc.a(dp-bit.o) .comment 0x00000208 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/libgcc.a(fp-bit.o) .comment 0x0000023c 0x34 /xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/libgcc.a(_lshrdi3.o) collect2: ld returned 1 exit status make: *** [ppc405_1/code/executable.elf] Error 1 Done.

Reply to
Dave

Hi Dave:

Have you tried using the -lc -lm -lc instead of -lm ? If this does not fix your problem, could you send the entire error log instead of just a snippet.

Thanks Sid

Dave wrote:

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(exit.o)

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(impure.o)

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(strcpy.o)

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/../../../../powerpc-eabi/lib/libc.a(strlen.o)

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/libgcc.a(dp-bit.o)

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/libgcc.a(fp-bit.o)

/xygdrive/c/EDK/gnu/powerpc-eabi/nt/bin/../lib/gcc-lib/powerpc-eabi/2.95.3-4/libgcc.a(_lshrdi3.o)

Reply to
Siddharth Rele

Usually the first error is of most interest.

Cheers, JonB

Reply to
Jon Beniston

That's the only error or warning message. However, scrutinizing the build output I think what's happening is adding a float operation (just f = 1.0/f) pulls in all sorts of libs and is overflowing the available instruction space, which is set to 2048 (bytes? words?).

Thanks to all who tried to help.

-Dave

Reply to
Dave

Then just make it bigger. :) You probably have some sort of BRAM-controller in your design... attached to the PLB, OPB, or OCM-controller. Usually the smallest size available is 8kB, which is too little in most cases, especially when you need a bunch of extra libs.

To get more instruction-side memory, all you have to to is change the address range of the BRAM-controller, EDK takes care of the rest. The size has to be a power of 2 though (8kb, 16kb, 32kb, 64kb...), and you have to make sure you don't use more BRAMs than you have available in your FPGA.. For example, in an xc2vp7 there are 44 BRAMs of 2kb each, so the biggest memory size for your PPC is 64kb.

For example: a base address of 0xFFFF0000 and a high address of

0xFFFFFFFF for your BRAM-controller wuld give you 64kb of memory for your program.

Note that 0xFFFFFFFC must always be included in the address space, since that is the address the PPC starts program execution from.

cu, Sean

Reply to
Sean Durkin

Thanks, Sean. But, the base address and length seem to be specified multiple places. The base address shows up once in the linker script and the length shows up twice (!) in the linker script. Also, the base is in the .pbd file as well. Is there one centralized place to set these parameters?

Reply to
Dave

I don't think so. EDK, at least in version 3.2, does not handle linker scripts at all. That is, you can specify one, but changes you make to the design will not be ported to the linker script. So the linker script you'd have to change yourself.

The information in the .pbd is mostly irrelevant, since that is regenerated every time you reopen the project. Important is what's in the .MHS-file, that's the basis for generating the .pbd.

So, you'd have to change the MHS and the linker script, I guess.

cu, Sean

Reply to
Sean Durkin

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.