Freescale Semiconductor SC140 specifications Lpmark Rules, Lpmark Instruction Type

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 301
Image 301

LPMARK Rules

Do not write explicit binary encodings using DC (declare constant) assembler directives. It cannot be checked for errors by the assembler.

Do not use “reserved” or “--” operand field values in instruction encodings. This maintains software compatibility if a “reserved” or “--” field is defined in the future.

7.7.2.3 Software Development Practices

Programmers should not disable programming rule detection by the assembler and simulator.

Programmers should have an application test suite that provides good dynamic rule test coverage using the simulator.

The assembler cannot detect rule violations across source file boundaries. Partition the application program into separate source files at logical points, using COF instructions to pass program control between source files to avoid possible rule violations.

The linker does not detect programming rules. Do not link several object files into sequential binary code. Use COF instructions to pass program control between linked object files to avoid possible rule violations.

Static detection of hardware loop iterations (LA to SA sequences) requires all of loop body n including the DOENn/DOENSHn instructions, LOOPSTARTn and LOOPENDn directives to be in the same source file. Follow the static detection assumptions given in Section 7.5.1, “Hardware Loop Detection,” on page 7-7.

Do not reassemble disassembled code. The disassembled code may contain hardware loop LPMARKx prefix instructions that are not supported in SC140 source code. Use one LOOPSTARTn and LOOPENDn directive to mark the hardware loop body n in the assembly source code.

Write endian-independent code wherever possible. Document code that is endian-specific.

Document status bit assumptions (such as 32-bit arithmetic saturation mode, SR[SM]) in application programs.

7.8 LPMARK Rules

The SC140 encodes LPMARK bits in the first prefix word to mark the end of hardware loops. The LPMARK bits are automatically encoded by the assembler based on the LOOPSTARTn and LOOPENDn assembly directives. The encoding procedure is defined in the LPMARKx (LPMARKA and LPMARKB) instruction definitions in Appendix A.2, “Instructions.”

Generally, the LPMARKA and LPMARKB instructions are disassembler syntax only for host debugging. The assembler flags their use in source code as a fatal error. However, the LPMARKA and LPMARKB instructions can be used in source code for hardware testing, enabled by an assembler switch.

The LPMARK rules in this section are defined for two purposes - 1) how to construct correct test code using the LPMARKA and LPMARKB instructions, and 2) how the LPMARK bits encoded in the prefix are used by the simulator to detect some SC140 programming rules.

7.8.1 LPMARK Instruction Type

LPMARK is classified as a prefix instruction type for all SC140 programming rules.

SC140 DSP Core Reference Manual

7-51

Page 301
Image 301
Freescale Semiconductor SC140 specifications Lpmark Rules, Lpmark Instruction Type, Software Development Practices