eTPU_C
I'm getting the error "OVERWRITING PREVIOUS ADDRESS...Conflict in location of entry table". What's wrong?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:32. eTPU_CThere are two main possibilities:
-
An ETPU_function number is duplicated between two ETPU_functions. Check the #pragma ETPU_function declarations in your program.
-
There are more than 8 ETPU_functions and the entry address table has not been moved. See the #pragma entryaddr directive.
What registers are available for inline assembly?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:18. eTPU_CThe DIOB, A, P in all of its forms (p31_0, p31_16, and so on) are all available for inline assembly essentially without any issues.
The B register is used as a temporary location in expression processing. It is usually freed by the end of a C statement, allowing inline assembly.
How do I perform a read_mer or read_mer12 operation?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:16. eTPU_CUse the read_match() intrinsic function.
How should the host communicate with the eTPU?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:14. eTPU_CThere are a few ways:
-
You can pass information through static locals. The host sets these itself, during initialization.
Use the
::ETPUlocationmacro to identify the offset of the static in the function frame. Rather than assigning the value in::ETPUstaticinitwhich comes from the eTPU_C program, simply set your own initial value.
What other ways can I signal the host?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:12. eTPU_CThere are two other exception types: channel interrupts and data transfer interrupts. In those devices without DMA hardware, the two are indistinguishable. Assign values 0 or 1 to channel.CIRC, or use these macros from eTPUC_common.h.
// Channel control macros #define SetChannelInterrupt() (channel.CIRC = 0) #define SetDataTransferInterrupt() (channel.CIRC = 1)
How do I cause a global exception?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:11. eTPU_CThe eTPU requires a value of 0x02 in the CIRC instruction field.
In C, CIRC is part of the channel structure:
channel.CIRC = 0x02
Alternatively, use a macro from eTPUC_common.h.
#define SetGlobalException() (channel.CIRC = 2)
The ASH WARE simulator warns about an MDU paired with a CCS subinstruction. It calls the choice "puzzling". What's wrong?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:03. eTPU_CThis is effectively a "don't care" operation. The MDU flags are always preserved. The compiler uses CCS for all math operations, except where explicitly disabled by optimization.
How are structure bit fields dealt with?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:01. eTPU_CAs efficiently as possible. Bit fields are packed within 32-bit boundaries. Packed bit fields can have a dramatic impact on the amount of code generated.
Bit Fields
This example declares two structs, one with less than 32 bits of bit fields, and one with more.
eTPU_C is giving "RAM allocated out of default RAM space" warnings. What's wrong?
Submitted by Kirk Zurell on Thu, 2007-11-22 15:00. eTPU_CThis warning can occur when #pragma memory RAM or #pragma memory LOCAL directives declare RAM that doesn't start on a 4-byte boundary. Variable declarations will try to allocate locations partly outside of declared RAM space


New: