eTPU_C

eTPU_C

My threads aren't starting as expected. What's wrong?

Ensure 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.

eTPU_C

What causes threads to start?

Threads are started by eTPU events (host/link service or match/capture events). Execution starts at the ETPU_function associated with a channel.

eTPU_C

How should I structure my code?

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 an eTPU_C available for Linux or Mac?

|

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

How do I interpret the reports the compiler generates?

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.

eTPU_C

How do I generate a S-record file of the executable?

To generate an S-record executable file, do the following:

  1. Open your project in BCLIDE.

  2. Choose Project|Properties, and click on the Compiler Properties tab.

  3. In the Hex Dump File dropdown box, choose either "S1", "S2", or "S3" for the appropriate S-record output.

eTPU_C

I need to combine one eTPU executable into another eTPU executable. How can I do this?

|

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.

  1. Export the first executable with the following eTPU_C host interface macro in the first linker command file.
    #pragma write msc, ( ::ETPUcode );
    
eTPU_C

What is Absolute Code Mode?

|

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.

eTPU_C

Isn't hand-optimized code more efficient?

|

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.

  1. Computers are very good at accounting.
eTPU_C

My simulator is reporting that a MDU sub-instruction is "sampling the condition flags". Is this a problem?

No. This will not affect the correctness of the code. You can often disable this type of warning in the simulator software.

Syndicate content