Ensure that you give as much information to the compiler in the
if()..else if()..else expressions as possible. Explicitly test
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.
Threads are started by eTPU events (host/link service or match/capture events). Execution starts at the ETPU_function associated with a channel.
There 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.
eTPU_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.
eTPU_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.
To generate an S-record executable file, do the following:
Open your project in BCLIDE.
Choose Compiler Properties tab., and click on the
In the Hex Dump File dropdown box, choose either "S1", "S2", or "S3" for the appropriate S-record output.
Use 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 );
Absolute 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.
There 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_C
No. This will not affect the correctness of the code. You can often disable this type of warning in the simulator software.