[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[microblaze-uclinux] Using impulse's C-to-FPGA tool with Petalinux ...



Hi all !

I am evaluating the tool "C-to-FPGA' from the Impulse company
http://www.impulseaccelerated.com/.
This tool can generate HW accelerators with an FSL interface from a
description in the C language.
They have a tutorial for a prebuilt uClinux system.

I am tempting to use the latest Petalinux distribution with the
example of the tutorial, that is to substitute the windows-version
prebuilt uclinux cross-tools with an up-to-date Petalinux environment.

Following the steps of the Impulse tutorial, step 5 has to be replace
with the configuration of the linux kernel.
In my case, I have configured a system with kernel version 2.6, the
glibc library and a MMU.
Then in step 6 (building the software) the Makefile have to be changed
in order to use the Petalinux cross-tools.

In particular the original Makefile compiles with mb-gcc, I have
changed for mb-linux-gcc and it would links the final executable with
the following command (after variable substitution)

$ make -f Makefile_orig -n | tail -1
/opt/Impulse/CoDeveloper3/uClinux/elf2flt/ld-elf2flt -Os -g -elf2flt
-L/opt/Impulse/CoDeveloper3/uClinux/lib/uClibc/lib -o img img_sw.o
tiff.o co_init.o libimpulsec.a
/opt/Impulse/CoDeveloper3/uClinux/lib/uClibc/lib/crt0.o -lc
/opt/Impulse/CoDeveloper3/uClinux/tools/lib/gcc-lib/microblaze/2.95.3-4/libgcc.a
/opt/Impulse/CoDeveloper3/uClinux/tools/microblaze/lib/libc_hard_shift.a
-lc

that I have simply changed in

$ make -f Makefile_petalinux -n | tail -1
mb-linux-gcc -o img img_sw.o tiff.o co_init.o libimpulsec.a

It compiles without claiming, but when I test the executable on the
target with arguments, I have a segmentation fault.
So the build should not be ok.


# ./img
usage: fpga_edge <input file> <output file>
# ./img peppers.tiff output.tiff
Edge Detect Demo
----------------
Running...
Segmentation fault



Any idea of what should be missing ?
Bellow the original Makefile.


Nicolas


---
ifeq ($(FSL),)
FSL = 0
endif
IMPULSEC_HOME=/opt/Impulse/CoDeveloper3
UCLINUX=$(IMPULSEC_HOME)/uClinux
UCLIB_INC=$(UCLINUX)/lib/uClibc/include
UCLIB_LIB=$(UCLINUX)/lib/uClibc/lib
MB_GCC_LIB=$(UCLINUX)/tools/lib/gcc-lib/microblaze/2.95.3-4
MB_LIB=$(UCLINUX)/tools/microblaze/lib
MB_GCC=mb-gcc
MB_LD=$(UCLINUX)/elf2flt/ld-elf2flt
MB_AR=mb-ar
CFLAGS=-Os -g -fomit-frame-pointer -DIMPULSE_FIRST_FSL=$(FSL) -Dlinux
-D__linux__ -Dunix -D__uClinux__ -DEMBED -I$(UCLIB_INC) -fno-builtin
-mno-xl-soft-mul -O -mno-xl-soft-div -mxl-barrel-shift
LFLAGS=-Os -g -elf2flt -L$(UCLIB_LIB)
LIBS=$(UCLIB_LIB)/crt0.o -lc $(MB_GCC_LIB)/libgcc.a
$(MB_LIB)/libc_hard_shift.a -lc

img:	img_sw.o tiff.o co_init.o libimpulsec.a
	$(MB_LD) $(LFLAGS) -o $@ img_sw.o tiff.o co_init.o libimpulsec.a $(LIBS)

libimpulsec.a: co_stream.o co_signal.o co_register.o co_memory.o
co_process.o co_type.o
	$(MB_AR) -r $@ co_stream.o co_signal.o co_register.o co_memory.o
co_process.o co_type.o

.c.o:
	mb-gcc $(CFLAGS) -o $@ -c $<

clean:
	rm -rf *.o img
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/