eTPU_C
My threads aren't starting as expected. What's wrong?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:33. eTPU_CEnsure that you give as much information to the compiler in the if()..else if()..else expressions as possible. Explicitly test lsr, m1/m2, pin, and flag0/flag1. Most importantly, add the hsr test explicitly, as the first term evaluated in an if() expression. Remember that hsr is always tested whether or not it's present in the thread expression.
What causes threads to start?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:31. eTPU_CThreads are started by eTPU events (host/link service or match/capture events). Execution starts at the ETPU_function associated with a channel.
How should I structure my code?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:29. eTPU_CThere are a few rules to follow:
-
Functions that might not get linked in to the final executable should be put in libraries (modules with #pragma library and #pragma endlibrary directives at the beginning and end, respectively). This instructs the compiler to omit generating code for them if they're not invoked.
Is an eTPU_C available for Linux or Mac?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:26. eTPU_C | LinuxeTPU_C is a Windows executable. It should run under a Windows emulator or environment on Linux or Mac. However, we have little experience running it in these environments and cannot offer technical support for platform-specific issues. eTPU_C relies only on core functions in Windows that should be well supported in alternative environments.
Issues previously experienced include slow speed of execution, display and interactivity problems, and outright crashes.
How do I interpret the reports the compiler generates?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:24. eTPU_CeTPU_C generates some reports in the listing file that describe variables and ETPU_functions.
00F8 clocal signed int16 0200 0203
This type of report appears in the RAM usage map. It reports on the location that a variable occupies in RAM (some values also represent registers or parameter offsets) and its type.
How do I generate a S-record file of the executable?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:20. eTPU_CTo generate an S-record executable file, do the following:
-
Open your project in BCLIDE.
-
Choose , and click on the Compiler Properties tab.
-
In the Hex Dump File dropdown box, choose either "S1", "S2", or "S3" for the appropriate S-record output.
I need to combine one eTPU executable into another eTPU executable. How can I do this?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:17. eTPU_C | linkingUse the BClink directive ETPUIMAGE. During this linking, the specified executable will be linked in to the final executable. eTPU_C will perform checks to prevent conflicts between the two executables.
- Export the first executable with the following eTPU_C host interface macro in the first linker command file.
#pragma write msc, ( ::ETPUcode );
What is Absolute Code Mode?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:14. eTPU_C | linkingAbsolute Code Mode in Byte Craft Limited compilers generates executable code from the compiler without a linking step. Absolute Code Mode still allows you to select object code from libraries and include it as part of an application.
Isn't hand-optimized code more efficient?
Submitted by Kirk Zurell on Wed, 2007-11-21 15:08. eTPU_C | optimizationThere is no technical reason why compiled code on the eTPU cannot be as tight as hand-optimized code. The ISO C standard for embedded systems overcomes previous C language limitations related to embedded.
There are three things that the eTPU_C compiler can do very well that hand optimization finds difficult.
- Computers are very good at accounting.
My simulator is reporting that a MDU sub-instruction is "sampling the condition flags". Is this a problem?
Submitted by Kirk Zurell on Tue, 2007-11-20 21:55. eTPU_CNo. This will not affect the correctness of the code. You can often disable this type of warning in the simulator software.

eTPU_C:
C6808: