EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #122 background imageLoading...
Page #122 background image
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
000D50
16
in program space and address 00000D50
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.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320C28x and is the answer not in the manual?

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals