Dear TI,
If I write a *.cla file, it is correctly compiling anything directly in the *.cla file. However if I include a support function, say ComplexMatrix.h and I call a function in the *.cla file say I call:
ComplexMatrix_DoSomething( parameters );
It is placing the ComplexMatrix_DoSomething function in GSxMemory with the main CPU application.
So the question is...
Case 1:
I have myFile.cla
I call MyFunc(params) from another file call it... myFile2.c and myFile2.h
I include myFile2.h in myFile.cla.
Everything compiles and links fine, but I find that the actual function in myFile2.c is place in GSxRam (main CPU linker file puts it there) and it successful puts all functions IN myfile.cla in the LSx ram.
In Case 1... myFile.cla is the ONLY file that calls myFunc(params) so no usage of myFUnc(params) in a file in the CPU main function
Case 2:
I have a common support functions like complexmatrix, where I use complex matrix data in both the CLA and the CPU code... so I will call various functions like:
ComplexMatrix_Add(params) or ComplexMatrix_GetData(params), and I will do this in the myFile.cla code and the myCPUfile.c (a file associated with the application running on the CPU)
In this case both the CLA and the CPU will call the function to operate on data. I include the associated header file say ComplexMatrix.h in both the CPU code, and the myFile.cla code.
My understanding was to use the compiler test for
#if defined(__TMS320C28XX_CLA__)
#elif defined(__TMS320C28XX__)
#endif
I think the main objective is:
How can I write one function that can be called by both the CLA and CPU...
and also, if I write that one function but it happens to only be called by say the CLA how to get it to recognize that it is only called by the CLA and complile the CLA version of it.
So if I write ComplexMatrix_Add(params) and I'm going to call it from (Assume written in C for now not assembler) how can I include it in a file called myCLA.cla and myCPU.c (both including ComplexMatrix.h) and have it create the ComplexMatrix_Add(params) function that gets put in LSx memory (ClaProg is default memory space) and a copy in CPU GSx memory... without duplication?
Or am I forced to separate everything that will go on the CLA into a *.cla file?
I'm thinking because the CLA has different assembler, that it will have to compile two different copies of the same function, so when the CLA calls it it gets a CLA version of it, and when the CPU calls it it gets the CPU version...
it feels like I'll have to have ComplexMatrix.c
and ComplexMatrix.cla
even though they could be identical files, so that it compiles one (.c one) for the CPU and copiles the other (.cla) for the CLA.
However if the files are identical, I would have duplicate function names, so this goes down the path of having
ComplexMatrix_AddCLA(params)
ComplexMatrix_AddCPU(params)
which I'd very much like to avoid ...
Hopefully you see the goal of not having to maintain two duplicate copies of CPU and CLA c code for common support functions.
Any suggestions on how to accomplish that?