
Avoiding Unprotected Operations
4-16
4.5 Avoiding Unprotected Operations
This section describes pipeline conflicts that the pipeline-protection mecha-
nism does not protect against. These conflicts are avoidable, and this section
offers suggestions for avoiding them.
4.5.1 Unprotected Program-Space Reads and Writes
The pipeline protects only register and data-space reads and writes. It does
not protect the program-space reads done by the PREAD and MAC instruc-
tions or the program-space write done by the PWRITE instruction. Be careful
with these instructions when using them to access a memory block that is
shared by data space and program space.
As an example, suppose a memory location can be accessed at address
00
0D50
16
in program space and address 0000
0D50
16
in data space. Consid-
er the following lines of code:
; XAR7 = 000D50 in program space
; Data1 = 000D50 in data space
ADD
@Data1,AH
; Store AH to data−memory location
; Data1.
PREAD
@AR1,*XAR7
; Load AR1 from program−memory
; location given by XAR7.
The operands @Data1 and *XAR7 are referencing the same location, but the
pipeline cannot interpret this fact. The PREAD instruction reads from the
memory location (in the R2 phase) before the ADD writes to the memory loca-
tion (in the W phase).
However, the PREAD is not necessary in this program. Because the location
can be accessed by an instruction that reads from data space, you can use
another instruction, such as a MOV instruction:
ADD
@Data1,AH
; Store AH to memory location Data1.
MOV
AR1,*XAR7
; Load AR1 from memory location
; given by XAR7.
4.5.2 An Access to One Location That Affects Another Location
If an access to one location affects another location, you may need to correct
your program to prevent a pipeline conflict. You only need to be concerned
about this kind of pipeline conflict if you are addressing a location outside of
a protected address range. (See section 4.5.3.). Consider the following exam-
ple:
MOV
@DataA,#4
; This write to DataA causes a
; peripheral to clear bit 15 of DataB.
$10:
TBIT @DataB,#15 ; Test bit 15 of DataB.
SB
$10,NTC
; Loop until bit 15 is set.
Содержание TMS320C28x
Страница 30: ...1 12...
Страница 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Страница 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Страница 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Страница 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Страница 585: ...This page intentionally left blank 7 32 This page intentionally left blank...