cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
507 Views
Registered: ‎09-02-2018

SIGSEGV in accel_wait() when running SDSoc Example on custom PetaLinux platform

Jump to solution

Hi,

I'm trying to run the Array Partitioning example on a custom platform. The example runs fine in standalone configuration, so I tried to move to PetaLinux.

The project was built successfully, but on the first run I got this: 

root@Ultra96:~# ./array_part.elf 
ERROR: unable to open xlnk

I fixed this by enabling the CONFIG_XILINX_APF and CONFIG_XILINX_DMA_APF kernel modules, and adding: 

xlnk {
    compatible = "xlnx,xlnk-1.0";
};

into the Device Tree. 

But now I'm getting a SIGSEGV: 

root@Ultra96:~# ./array_part.elf
Seg fault @ (nil)

The GDB trace shows that something gets wrong int the accel_wait() function: 

root@Ultra96:~# gdb ./array_part.elf
...
(gdb) run
Starting program: /home/root/array_part.elf
...
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()

(gdb) where
#0  0x0000000000000000 in ?? ()
#1  0x00000000004040ec in accel_wait ()
#2  0x0000000000403a28 in zero_copy_wait ()
#3  0x0000000000402a84 in cf_wait ()
#4  0x0000000000401b70 in _p0_matmul_partition_accel_1_noasync (in1=0x7fbf6f2000, in2=0x7fbf6cf000, out=0x7fbf6cb000, mat_dim=64) at matmul.cpp:116
#5  0x0000000000401f08 in main (argc=1, argv=0x7ffffffc88) at /home/bluetiger/dev/XIlinx/SDx/array_part/Debug/_sds/swstubs/main.cpp:103

From the disassembly, I did not figured out what accel_wait() is trying to do: 

(gdb) disas accel_wait
Dump of assembler code for function accel_wait:
   0x00000000004040c8 <+0>:	stp	x29, x30, [sp,#-32]!
   0x00000000004040cc <+4>:	mov	x29, sp
   0x00000000004040d0 <+8>:	str	x19, [sp,#16]
   0x00000000004040d4 <+12>:	mov	x19, x0
   0x00000000004040d8 <+16>:	cbnz	w1, 0x40410c <accel_wait+68>
   0x00000000004040dc <+20>:	nop
   0x00000000004040e0 <+24>:	ldr	w1, [x19,#48]
   0x00000000004040e4 <+28>:	ldp	x0, x2, [x19,#32]
   0x00000000004040e8 <+32>:	blr	x2
   0x00000000004040ec <+36>:	cbz	w0, 0x4040e0 <accel_wait+24>    <<< FAILS HERE
   0x00000000004040f0 <+40>:	ldr	w1, [x19,#52]
   0x00000000004040f4 <+44>:	mov	w0, #0x1                   	// #1
   0x00000000004040f8 <+48>:	add	w1, w1, w0
   0x00000000004040fc <+52>:	str	w1, [x19,#52]
   0x0000000000404100 <+56>:	ldr	x19, [sp,#16]
   0x0000000000404104 <+60>:	ldp	x29, x30, [sp],#32
   0x0000000000404108 <+64>:	ret
   0x000000000040410c <+68>:	ldr	w1, [x0,#48]
   0x0000000000404110 <+72>:	ldp	x0, x2, [x0,#32]
   0x0000000000404114 <+76>:	blr	x2
   0x0000000000404118 <+80>:	cbnz	w0, 0x4040f0 <accel_wait+40>
   0x000000000040411c <+84>:	ldr	x19, [sp,#16]
   0x0000000000404120 <+88>:	ldp	x29, x30, [sp],#32
   0x0000000000404124 <+92>:	ret
End of assembler dump.

Any ideas about what could be wrong?

Thanks,
Attila

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
478 Views
Registered: ‎09-02-2018

Re: SIGSEGV in accel_wait() when running SDSoc Example on custom PetaLinux platform

Jump to solution

Ignore this.

I rebuilt the project and now it works fine: 

root@Ultra96:~# ./array_part.elf
Number of CPU cycles running application in software: 19550092
Number of CPU cycles running application in hardware: 152666
Speed up: 128.058
Note: Speed up is meaningful for real hardware execution only, not for emulation.
TEST PASSED

 

View solution in original post

0 Kudos
1 Reply
Highlighted
Adventurer
Adventurer
479 Views
Registered: ‎09-02-2018

Re: SIGSEGV in accel_wait() when running SDSoc Example on custom PetaLinux platform

Jump to solution

Ignore this.

I rebuilt the project and now it works fine: 

root@Ultra96:~# ./array_part.elf
Number of CPU cycles running application in software: 19550092
Number of CPU cycles running application in hardware: 152666
Speed up: 128.058
Note: Speed up is meaningful for real hardware execution only, not for emulation.
TEST PASSED

 

View solution in original post

0 Kudos