TI中文支持网
TI专业的中文技术问题搜集分享网站

CLA与CPU可以调用同一个函数吗。.cla文件里定义的函数在主函数里可以调用吗

CLA与CPU可以调用同一个函数吗。.cla文件里定义的函数在主函数里可以调用吗

Susan Yang:

您可以看一下  给出的回复

The reason the code is being placed in GS (.text) is that its in a .c file so the C28x compiler compiles it. The CLA compiler only acts on .cla file.

What you can do is this

1. define the function in a single .c file, say single_func.c

#ifdef _TMSc28x__

foo_c28x()

#elif defined (__TMS320FCLA__)

foo_cla()

#else 

#error "Something is wrong"

#endif// 

{

code here

}

2. in a .cla file

#include single_func.c

Now when you build the preprocesser will substitute the code in the .cla file and once the CLA compiler is invoked it will recognize the function foo_cla() and compile for the CLA – it will stick it in Cla1Prog.

The C28x compiler will compile the file, single_func.c, for the c28x and stick the code in .text. You end up with the same function compiled twice, with different names on different ISAs in different memory sections, but it allows you to maintain a single function.

CLA与CPU可以调用同一个函数吗。.cla文件里定义的函数在主函数里可以调用吗

liang wang:

回复 Susan Yang:

没大看明白 能稍微指点一下子吗

赞(0)
未经允许不得转载:TI中文支持网 » CLA与CPU可以调用同一个函数吗。.cla文件里定义的函数在主函数里可以调用吗
分享到: 更多 (0)