Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE
Tool/software:
Hello!
I am working on a multicore project, and I utilize the CLA on CPU 2 Subsystem. The way I have structured my project is basically as follows:
- core1 (main.c)
- core2 (main.c, cla.cla, cla.h - bridges core and cla)
- lib/ (bunch of c and h files) - this is a linked folder for both core1 and core2 projects
- mem.h
(Using CCS v12 and C2000Ware 5.04.00)
Basically, lib implements a LOT of my functionality and is meant to be used by either core, and the CLAs. I support variations by using preprocessor directives to check if symbols such as CPU1/CPU2/CLA and FLASH/RAM are defined - to basically alter definitions at compile time. Similarly - mem.h basically aliases the names for the different message RAMs using the same concept. This approach has worked very well for me- as I can alter project properties in CCSv12 to get everything to compile from pretty much the same source (lib).
I am running into issues extending this functionality to the parts of the code that are going to be run on the CLA. I basically want to set a predefined symbol for when JUST CLA.CLA is being compiled into an .obj file. For example,
I would like to alias the CPU-CLA message RAM addresses in mem.h based on whether a symbol called CLA/CPU1/CPU2 is defined or not - to create .obj files for the CPU and CLA which are then linked to the .out file. (call it cla_read buffer when being compiled with CLA, and cpu_write_buffer for cpu)
Another use case could be to check for the CLA symbol and use the CLAMAth library in some cases - else use alternative functions that work on CPUs.
I have gone through the CLA SW development guide, multicore development guide. Optimizing Compiler guides and have a question - Is there a way for me to set a symbol definition for JUST the compilation of the CLA code. If the CPU and CLA share some common source (mem.h) is it possible to get 2 .objs (compiled with CPU and CLA symbol respectively) that are then linked to the remainder of the executable).
I realize that the shared source is much easier to across cores since the build and link are seperate for each subsytem. Is there a clean way to achieve something similar for the CLA?