I compiled the MatMult_outer sample for ZCU102 Rev 1.1. The compilation has been done successfully, however, when I run ./Top, the program gives me following error:
root@zcu102:~/matmul# ./Top 1 1 1
[WARNING]: DELITE_NUM_THREADS undefined, defaulting to 1
Executing with 1 thread(s)
placing fringeScalarBase at 7f97903000
placing fringeMemBase at 7f77597000
placing resetHandshakePtr at 7f978f3000
sudo: unable to resolve host zcu102
/lib/firmware ~/matmul
Flashing bitstream...
sudo: unable to resolve host zcu102
~/matmul
accel.bit.bin bitstream loaded onto fpga!
[malloc] virtAddr = 7f77597000, physAddr = 20000000
Allocate mem of size x369*x370 at 0x20000000
[malloc] virtAddr = 7f77597040, physAddr = 20000040
Allocate mem of size x372*x373 at 0x20000040
[malloc] virtAddr = 7f77597080, physAddr = 20000080
Allocate mem of size x375*x376 at 0x20000080
[memcpy HOST -> FPGA] devmem = 20000000, hostmem = 0x2b761f70, size = 4
[memcpy HOST -> FPGA] devmem = 20000040, hostmem = 0x2b761fb0, size = 4
[memcpy HOST -> FPGA] devmem = 20000080, hostmem = 0x2b761ff0, size = 4
[malloc] virtAddr = 7f775970c0, physAddr = 200000c0
[memcpy] dummyBuf = 0x200000c0, (phys = c8a690c0), arraySize = 2621440
Segmentation fault (core dumped)
I inspected and I realized the cause of the error is in the file: FringeContexZCU.h:305:"dummyBuf[i] = 10;" inside of the "void flushCache(uint32_t kb)" function. It seems that line 301: "int *dummyBuf = (int*) malloc(arraySize * sizeof(int));" cannot allocate memory, alought it gives back the address. If I changed the code to "int *dummyBuf = new int [arraySize];" the program continues the execution, however result are different and the assertion at the end of the program fails.
Any help would be appreciated.