08-11-2016 12:51 PM
I set up a project in SDSoC to test the c-callable sample library using a FIR filter provided by Xilinx. The platform is the ZedBoard and the target OS is Standalone. With that configuration I was able to build and execute the test application on the ZedBoard. I'm working on a simple application to test a c-callable library of an IP block that was created using SDSoC. When building the test application that calls the library, I see the following error.
ERROR: [SDSoC 0-0] Caller and callee data size differ for argument 0 of call 'foo' in 'main.c' @40\n
Data motion generation exited with return code 1
- errors detected
ERROR: [SDSoC 0-0] Exiting sds++ : Error when calling 'XidanePass --platform zed --dmclkid 2 --repo C:/.../SDDebug/_sds/.cdb/xd_ip_db.xml --dmdb C:/Xilinx/SDSoC/2016.2/data/DM.db -os standalone '
sds++ log file saved as C:/.../SDDebug/_sds/reports/sds.log
ERROR: [SDSoC 0-0] Build failed
make: *** [test.elf] Error 1
The error appears to indicate that the output_param array size doesn't match the expected size. However I believe they are the same. I'm using SDSoC 2016.2 (with the 07/16 build date). Please see attached for a code snippet.
Any suggestions for a solution to this build error? What am I missing here?
Thank you,
Anthony
08-11-2016 01:51 PM
Hi Anthony,
Im not quite sure what the problem is. Can you post an actual failing example? I was not able to reproduce the error you reported, in fact with a couple tweaks to the code I was able to get it to compile and build all the way.
Sam
Heres my changed version:
#include "xil_io.h" #define BLOCK_LENGTH 16ULL #define MAX_IO_BUFFER_SIZE 2048ULL enum enum_t{TYPE_0}; int foo(uint8_t output_param[MAX_IO_BUFFER_SIZE], const uint8_t input_param[MAX_IO_BUFFER_SIZE], uint32_t length, const uint8_t config1[16], const enum_t type, uint8_t const config2[BLOCK_LENGTH]) { return 0; } int main(int argc, char* argv[]) { uint8_t output[MAX_IO_BUFFER_SIZE] = {0}; uint8_t input[MAX_IO_BUFFER_SIZE] = {0}; uint32_t length = BLOCK_LENGTH; uint8_t config_1[16] = {0}; uint8_t config_2[BLOCK_LENGTH] = {0}; (void)foo(output, input, length, config_1, TYPE_0, config_1); return 0; }
08-12-2016 11:29 AM
Hi Sam,
The problem is that when building the test application that pulls in the c-callable library wrapping a hardware ip block, the build prints the error previously reported when running the 'XidanePass...' command.
The error indicates that there is a data size mismatch in the argument 0 array passed to the hardware. I've verified that they are the same using the macros provided in the snippet. Replacing the c-callable library with an empty foo declaration would result in compilation from a software only perspective as you've performed.
Therefore, there appears to be an issue in the software - hardware linking that is causing this data size mismatch error. It appears that the software side of the interface is good, based on your response. What can be done to verify the hardware side?
Thanks for taking the time to look into this.
Regards,
Anthony
08-12-2016 11:37 AM
Hi Anthony,
Its kindave hard to guess what might be wrong without looking at the code.
Can you boil your application/c-callable lib down to something you're willing to post that still fails in the same way? Im happy to help you debug.
Sam
08-12-2016 01:00 PM
This may not be the issue in question, but one thing to ensure is that the fcnmap.xml metadata file does not use any macros for values. The resulting error messages when there are macros are admittedly unhelpful, and will be improved in a future release.
For example,
<!-- invalid: cannot use macro MAX_IO_BUFFER_SIZE for value -->
<xd:arg xd:name="input_param"
xd:swRootName="input_param"
xd:direction="in"
xd:busInterfaceRef="s_axi_AXILiteS"
xd:hwName="input_param"
xd:portInterfaceType="axilite"
xd:aximmMasterRef="m_axi_gmem"
xd:aximmMasterDirection="in"
xd:aximmMasterDataWidth="32"
xd:aximmMasterArraySize="MAX_IO_BUFFER_SIZE"
xd:dataWidth="8"
xd:offset="0x20"/>
<!-- ok -->
<xd:arg xd:name="input_param"
xd:swRootName="input_param"
xd:direction="in"
xd:busInterfaceRef="s_axi_AXILiteS"
xd:hwName="input_param"
xd:portInterfaceType="axilite"
xd:aximmMasterRef="m_axi_gmem"
xd:aximmMasterDirection="in"
xd:aximmMasterDataWidth="32"
xd:aximmMasterArraySize="1024"
xd:dataWidth="8"
xd:offset="0x20"/>
08-12-2016 01:38 PM
Jhwang,
Thank you for the suggestion. I have confirmed that we are already not using any macros in the fcnmap.xml file for the c-callable library.
Regards,
Anthony