C66x CorePac
C66x CorePac
CorePac
User Guide
Release History
Contents
Release History. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ø-ii
List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ø-x
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ø-xiv
List of Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ø-xviii
Preface ø-xix
About This Manual. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ø-xix
Notational Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ø-xix
Related Documentation from Texas Instruments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ø-xx
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ø-xx
Chapter 1
Chapter 2
Chapter 3
3.7.1.1 Protection Checks on DSP, IDMA and Other System Master Accesses . . . . . . . . . . . . . . . . . . . . . . . . . .3-23
3.7.1.2 Additional Protection Checks on Program Initiated Cache Coherence Operations. . . . . . . . . . . . . .3-23
3.7.2 L1D Memory Protection Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-23
3.7.2.1 Memory Protection Attribute Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-24
3.7.2.2 Memory Protection Lock Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-26
3.7.2.3 Memory Protection Fault Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-26
3.7.3 Protection Checks on Accesses to Memory Protection Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-28
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Miscellaneous 13-1
13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-2
13.2 C66x CorePac Revision ID Register (MM_REVID) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-2
Appendix A
Appendix B
Index IX-1
List of Tables
Table 2-1 L1P Cache Registers Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Table 2-2 Cache Size Specified by the L1PMODE bit in the L1PCFG Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Table 2-3 Switching L1P Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Table 2-4 L1P Global Coherence Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Table 2-5 L1P Block Cache Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Table 2-6 L1P Specific Cache Control Operations Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Table 2-7 L1P Configuration Register (L1PCFG) Field Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Table 2-8 L1P Cache Control Register (L1PCC) Field Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Table 2-9 L1P Invalidate Base Address Register (L1PIBAR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Table 2-10 L1P Invalidate Word Count Register (L1PIWC) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Table 2-11 L1P Invalidate Register (L1PINV) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Table 2-12 Permissions for L1P Cache Control Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12
Table 2-13 L1P Miss Pipelining Performance (Average Number of Stalls per Execute Packet) (TBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14
Table 2-14 Permission Bits Examined With Each Fetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Table 2-15 Memory Protection Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Table 2-16 Memory Page Protection Attribute Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17
Table 2-17 Memory Page Protection Attribute. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Table 2-18 Memory Protection Fault Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Table 2-19 L1P Memory Protection Fault Address Register (L1PMPFAR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Table 2-20 L1P Memory Protection Fault Set Register (L1PMPFSR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Table 2-21 L1P Memory Protection Fault Clear Register (L1PMPFCLR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Table 2-22 Permissions for L1P Memory Protection Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Table 3-1 Data Access Address Set Field Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Table 3-2 Cache Size Specified by the L1DMODE in the L1DCFG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Table 3-3 Switching L1D Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
Table 3-4 Global Coherence Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Table 3-5 Block Cache Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Table 3-6 L1D Specific Cache Control Operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Table 3-7 L1D Cache Configuration Register (L1DCFG) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Table 3-8 L1D Cache Control Register (L1DCC) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Table 3-9 L1D Invalidate Register (L1DINV) Field Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Table 3-10 L1D Writeback Register (L1DWB) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Table 3-11 L1D Writeback-Invalidate Register (L1DWBINV) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Table 3-12 L1D Invalidate Base Address Register (L1DIBAR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Table 3-13 L1D Invalidate Word Count Register (L1DIWC) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Table 3-14 L1D Writeback Base Address Register (L1DWBAR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Table 3-15 L1D Writeback-Invalidate Word Count Register (L1DWIWC) Field Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Table 3-16 Permissions for L1D Cache Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17
Table 3-17 L1D Performance Summary (TBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21
Table 3-18 Memory Protection Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
Table 3-19 L1D Memory Protection Attribute Register Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24
Table 3-20 Memory Protection Register (MPPAxx) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Table 3-21 Memory Protection Defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Table 3-22 Memory Protection Fault Address Register (L1DMPFAR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Table 3-23 Memory Protection Fault Set Register (L1DMPFSR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
Table 3-24 Memory Protection Fault Clear Register (L1DMPFCR) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28
Table 3-25 Permissions for L1D Memory Protection Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28
Table 4-1 Cache Registers Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Table 4-2 L2MODE Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
Table 4-3 Cache Size Specified by L2CFG.L2MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Table 4-4 Switching L2 Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
Table 4-5 Freeze Mode Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
Table 12-2 Power-Down Controller Command Register (PDCCMD) Field Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
Table 12-3 Permissions for PDC Command Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
Table 13-1 Miscellaneous Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Table 13-2 C66x CorePac Revision ID Register (MM_REVID) Field Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
Table A-1 List of General Terms and Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
Table B-1 List of Cache-Related Terms and Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-1
List of Figures
Figure 1-1 C66x CorePac Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Figure 2-1 Data Access Address Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Figure 2-2 L1P Configuration Register (L1PCFG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Figure 2-3 L1P Cache Control Register (L1PCC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Figure 2-4 L1P Invalidate Base Address Register (L1PIBAR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Figure 2-5 L1P Invalidate Word Count Register (L1PIWC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Figure 2-6 L1P Invalidate Register (L1PINV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Figure 2-7 Memory Page Protection Attribute Registers (L1PMPPAx). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Figure 2-8 L1P Memory Protection Fault Address Register (L1PMPFAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Figure 2-9 L1P Memory Protection Fault Set Register (L1PMPFSR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20
Figure 2-10 L1P Memory Protection Fault Clear Register (L1PMPFCLR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21
Figure 3-1 Data Access Address Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Figure 3-2 L1D Cache Configuration Register (L1DCFG). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Figure 3-3 L1D Cache Control Register (L1DCC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Figure 3-4 L1D Invalidate Register (L1DINV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Figure 3-5 L1P Writeback Register (L1DWB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Figure 3-6 L1D Writeback-Invalidate Register (L1DWBINV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14
Figure 3-7 L1D Invalidate Base Address Register (L1DIBAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Figure 3-8 L1D Invalidate Word Count Register (L1DIWC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15
Figure 3-9 L1D Writeback Base Address Register (L1DWBAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Figure 3-10 L1D Writeback-Invalidate Word Count Register (L1DWIWC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
Figure 3-11 Address to Bank Number Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18
Figure 3-12 Potentially Conflicting Memory Accesses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
Figure 3-13 Memory Protection Register (MPPAxx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-25
Figure 3-14 Memory Protection Fault Address Register (L1DMPFAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-26
Figure 3-15 Memory Protection Fault Set Register (L1DMPFSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27
Figure 3-16 Memory Protection Fault Clear Register (L1DMPFCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28
Figure 4-1 L2 Memory Banking Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Figure 4-2 L2 Cache Address Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Figure 4-3 L2 Configuration Register (L2CFG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14
Figure 4-4 L2 Writeback Base Address Register (L2WBAR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15
Figure 4-5 L2 Writeback Word Count Register (L2WWC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
Figure 4-6 L2 Writeback-Invalidate Base Address Register (L2WIBAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
Figure 4-7 L2 Writeback-Invalidate Word Count Register (L2WIWC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Figure 4-8 L2 Invalidate Base Address Register (L2IBAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17
Figure 4-9 L2 Invalidate Word Count Register (L2IWC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Figure 4-10 L2 Writeback Register (L2WB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18
Figure 4-11 L2 Writeback-Invalidate Register (L2WBINV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Figure 4-12 L2 Invalidate Register (L2INV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19
Figure 4-13 Memory Attribute Register (MARn). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26
Figure 4-14 L2 Memory Protection Page Attribute Registers (L2MPPAn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Figure 4-15 Level 2 Memory Protection Fault Address Register (L2MPFAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
Figure 4-16 Level 2 Memory Protection Fault Set Register (L2MPFSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33
Figure 4-17 Level 2 Memory Protection Fault Clear Register (L2MPFCLR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34
Figure 4-18 MDMA Bus Error Register (MDMAERR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36
Figure 4-19 MDMA Bus Error Clear Register (MDMAERRCLR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37
Figure 5-1 IDMA Channel 0 Transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Figure 5-2 IDMA Channel 1 Transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Figure 5-3 Example of IDMA Channel 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Figure 5-4 IDMA Channel 0 Status Register (IDMA0_STAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8
Figure 5-5 IDMA Channel 0 Mask Register (IDMA0_MASK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9
Figure 5-6 IDMA Channel 0 Source Address Register (IDMA0_SOURCE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Figure 11-10 L2 Error Detection Correctable Parity Error Counter Register (L2EDCPEC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-10
Figure 11-11 L2 Error Detection Non-correctable Parity Error Counter Register (L2EDNPEC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-10
Figure 12-1 Power-Down Controller Command Register (PDCCMD) (0181 0000h) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4
Figure 13-1 C66x CorePac Revision ID Register (MM_REVID) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2
List of Examples
Notational Conventions
This document uses the following conventions:
• Commands and keywords are in boldface font.
• Arguments for which you supply values are in italic font.
• Terminal sessions and information the system displays are in screen font.
• Information you must enter is in boldface screen font.
• Elements in square brackets ([ ]) are optional.
The information in a caution or a warning is provided for your protection. Please read
each caution and warning carefully.
Trademarks
TMS320C66x and C66x are trademarks of Texas Instruments Incorporated.
All other brand names and trademarks mentioned in this document are the property of Texas Instruments
Incorporated or their respective owners, as applicable.
The following sections provide an overview of the main components and features of the
C66x CorePac.
1.1 "Introduction" on page 1-2
1.2 "C66x CorePac Overview" on page 1-3
1.1 Introduction
C66x CorePac is the name used to designate the hardware that includes the following
components: C66x DSP, Level 1 program (L1P) memory controller, Level 1 data (L1D)
memory controller, Level 2 (L2) memory controller, Internal DMA (IDMA), external
memory controller (EMC), extended memory controller (XMC), bandwidth
management (BWM), interrupt controller (INTC) and powerdown controller (PDC).
RAM/ RAM/
cache cache
256 256
256 64
256 Power down
Instruction fetch Interrupt
128 controller
C66x DSP
Register Register
file A file B
64 64
XMC EMC
Bandwidth mgmt 32 CFG
64 Prefetch CFG Switch
Memory protect L1D MPAX Fabric
IDMA0
Cache control IDMA1
MDMA SDMA
8 x 32 256 128
RAM/ DMA
MSMC Switch Fabric
cache
The C66x DSP is not described further in this document. For more information on the
C66x DSP, see the C66x DSP and Instruction Set Reference Guide (SPRUGH7) in
‘‘Related Documentation from Texas Instruments’’ on page ø-xx.
For more information on the L1P cache/memory, see Chapter 2 on page 2-1.
For more information on the L1D cache/memory, see Chapter 3 on page 3-1.
If you configure part of internal memory as cache, the L2 controller provides a means
of writing back changes made to its contents, or invalidating the cache's contents
altogether. This can be performed on a block or global basis. These actions constitute
coherence operations that you specify; that is, they are intended to make the cached
information coherent with the original memory location's content. Writebacks and
invalidations also occur automatically by virtue of how cache architectures operate.
These activities are generally called coherence operations throughout this document.
Coherence operations are described in more detail in Chapter 2 on page 2-1, Chapter
3 on page 3-1, and Chapter 4 on page 4-1.
The IDMA data transfers occur in the background of DSP operation. That is, once a
channel transfer is programmed, it happens concurrent with other DSP activity, and
without additional DSP intervention.
Note—This port does not provide access to those control registers found within
the DSP or the CorePac.
• Slave DMA (SDMA)—The slave DMA provides access to resources inside the
C66x CorePac to system masters found outside the C66x CorePac such as DMA
controllers, SRIO, etc. That is, transfers initiated outside the C66x CorePac where
the C66x CorePac is the slave in the transaction.
The CFG bus is always 32 bits wide, and should always be accessed as 32-bit values
using 32-bit load /store instructions or the IDMA. The SDMA port is 128 bits wide.
Memory protection and address extension are provided together in a new unit called
MPAX. The MPAX unit defines 16 segments of runtime-selectable size that project
C66x CorePac’s 32-bit logical address space into a larger 36-bit physical address space.
In addition, each segment has a corresponding set of permissions to control accesses to
that segment. The two together provide a convenient mechanism for multiple DSPs to
cooperate in a large shared memory. The memory protection scheme is also designed
to coordinate with other memory protection units and firewalls that may be in the
system.
Prefetch support in XMC aims to reduce the read miss penalty for streams of data
entering C66x CorePac. Hence prefetching helps to reduce stall cycles and thereby
improves memory read performance to MSMC RAM and EMIF.
Interrupts provide the means to redirect normal program flow due to the presence of
an external or internal hardware signal. Exceptions are similar in that they also redirect
program flow, but they are normally associated with error conditions in the system.
The C66x CorePac includes an interrupt controller that allows up to 128 system events
to be routed to the DSP interrupt/exception inputs. These 128 events can either be
directly connected to the maskable interrupts, or grouped together as interrupts or
exceptions. These various routing choices allow a great deal of flexibility in event
handling.
An error event is signaled when an interrupt is signaled to the DSP and there is already
a flag pending for this interrupt. In addition to routing events, the interrupt controller
detects when the DSP misses an interrupt. You can use this error event to notify the
DSP when it misses a real time event. The INTC hardware saves the missed interrupt
number in a register so that corrective action can be taken.
Memory protection is defined globally, but implemented locally. Thus, the overall
protection scheme is defined for the entire C66x CorePac, but each resource
implements its own protection hardware. This distributed method of memory
protection means you only need to learn one memory protection interface, while the
C66x remains flexible enough to support future peripherals and memories.
To implement the memory protection scheme, the memory map is divided into “pages”
and each page has an associated set of permissions. Invalid accesses are signaled with
an exception and reported to the system in memory fault registers. Additionally, MPA
supports privilege modes (supervisor and user) and memory locks.
Due to the distributed implementation of the memory protection scheme, the overall
definitions are described in Chapter 10 on page 10-1. See each resource's chapter for
specific details for MPA implementation.
2.1 Introduction
2.1.1 Purpose of the Level 1 Program (L1P) Memory and Cache
The purpose of the Level 1 program (L1P) memory and cache is to maximize
performance of the code execution. The configurability of the L1P cache offers the
flexibility required in many systems.
2.1.2 Features
The L1P memory and cache provide the memory flexibility that is required in devices
that use the C66x CorePac.
• Configurable L1P cache size: 0K, 4K, 8K, 16K, and 32K
• Memory protection
• Cache block and global coherence operations
The L1P memory's base address is constrained to 1 MB boundaries. The total size of
L1P memory must be a multiple of 16 Kbytes.
The actual memory configuration is device-specific. See the device-specific data sheet
for more information.
It is possible to convert part or all of L1P into cache. L1P supports cache sizes of 4K, 8K,
16K, and 32K.
L1P cache converts memory from RAM to cache by starting at the top of the L1P
memory map and working downwards. To explain, the highest addresses of L1P
memory are the first to become cache.
The cache controller initializes after resetting to either “all RAM” or “maximal cache.”
See the device-specific data manual for specific behavior.
The operation of the L1P cache is controlled through several registers. Table 2-1
provides a summary of these registers. These registers are mentioned throughout this
section and will be described in more detail in Section 2.5.
Table 2-1 L1P Cache Registers Summary
Address Acronym Register Description Section
0184 0020h L1PCFG Level 1 Program Configuration Register Section 2.5.2.1
0184 0024h L1PCC Level 1 Program Cache Control Register Section 2.5.2.2
0184 4020h L1PIBAR Level 1 Program Invalidate Base Address Register Section 2.5.2.3
0184 4024h L1PIWC Level 1 Program Invalidate Word Count Register Section 2.5.2.4
0184 5028h L1PINV Level 1 Program Invalidate Register Section 2.5.2.5
The offset of 5 bits accounts for the fact that an L1P line size is 32 bytes. The cache
control logic ignores bits 0 through 4 of the address. The set field indicates the L1P
cache line address where the data would reside, if it were cached. The width of the set
field depends on the amount of L1P configured as cache. L1P uses the set field to look
up and check the tag for any already-cached data from that address, as well as the valid
bit, which indicates whether the address in the tag actually represents a valid address
held in cache.
The tag field is the upper portion of the address that identifies the true physical location
of the data element. On a program fetch, if the tag matches and the corresponding valid
bit is set, then it is a “hit,” and the data is read directly from the L1P cache location and
returned to the DSP. Otherwise, it is a “miss” and the request is sent on to the L2
controller for the data to be fetched from its location in the system. Misses may or may
not directly result in DSP stalls.
The DSP cannot write data to L1P under normal circumstances. The L1P cache
configuration dictates the size of the set and tag fields.
The L1P controller implements a read-allocate cache. This means that the L1P will
fetch a complete line of 32 bytes on a read miss.
Note—In general, a larger value of L1PMODE specifies a larger cache size (up
to the size of the implemented L1P memory). The maximum L1P cache size is
the smaller of “largest power-of-2 that fits in L1P RAM size” and 32K.
The actual range of L1P cache modes is constrained by the size of L1P memory. For
example, the L1P cache can be no larger than 16K when L1P memory is only 16K in
size. Thus, the encoding s 011b through 111b are mapped to 16K cache on devices
whose L1P memory is only 16K.
On these devices, the L1PMODE settings 100b through 111b select the 16K cache
mode, as opposed to the 32K cache mode. Thus, modes 000b through 011b always
select the requested size, 0K through 16K. Modes 100b through 111b select the
maximum size implied by the size of L1P memory (16K or 32K).
As a result of this policy, programs wanting no more than a certain amount of cache
should program the value corresponding to this upper bound. Programs that want “as
much cache as possible” should program 111b into L1PMODE.
When programs initiate a cache mode change, the L1P cache itself invalidates its
current contents. This ensures that no false hits occur due to changing interpretation
of cache tags.
While the invalidation is necessary to ensure correct cache behavior, it is not sufficient
to prevent data loss due to portions of L1P RAM becoming cache. Thus, to safely
change L1P cache modes, applications must adhere to the procedure in Table 2-3.
Table 2-3 Switching L1P Modes
To switch from. . . To. . . The program must perform the following steps. . .
A mode with no or some L1P cache A mode with more L1P cache 1. DMA, IDMA or copy any needed data out of the affected range of L1P RAM.
(If none requires saving, no DMA is necessary).
2. Write the desired cache mode to the L1PMODE field in the L1PCFG register.
3. Read back L1PCFG. This stalls the DSP until the mode change completes.
A mode with some L1P cache A mode with less or no L1P cache 1. Write the desired cache mode to the L1PMODE field in the L1PCFG register.
2. Read back L1PCFG. This stalls the DSP until the mode change completes.
While in freeze mode, the L1P cache will service read hits normally. Read hits return
data from the cache. In freeze mode, the L1P cache will not allocate new cache lines on
read misses, nor will it cause any existing cache contents to be marked invalid.
The OPER field in the L1PCC register controls whether L1P is frozen or it is operating
normally, as shown in Example 2-1.
The DSP places L1P into freeze mode by writing 001b to the OPER field in the L1PCC
register. The DSP returns L1P to normal operation by writing 0b to the OPER field in
the L1PCC register.
The POPER field in the L1PCC register holds the previous value of the OPER field. The
value of the OPER field is copied to the POPER field in the L1PCC register on writes to
the L1PCC register. Copying the value of the OPER field to the POPER field alleviates
the cycle cost of reading the L1PCC register (in order to save the previous value of the
OPER field) before it is written. If the POPER field is not in the L1PCC register, the
program must read, write, and then read again to fully freeze the cache while recording
its previous operating mode. If the POPER field is in the L1PCC register, this operation
reduces to a single write followed by a read.
When you write to the L1PCC register, the following operations occur:
1. The OPER field copies to the POPER field in the L1PCC register.
2. The POPER field loses its previous value.
3. The OPER field updates according to the value that the DSP writes to bit 0 of the
L1PCC register. Thus, writing to the L1PCC register only modifies the OPER
field in this register.
Programs cannot directly modify the POPER field with a single write. This is not
problematic since the value held in the POPER field does not change the behavior of
L1P cache and only interests programs that have recently written to the OPER field.
The software must perform a write to the L1PCC register followed by a read of the
L1PCC to ensure that the L1PCC updates. Performing a write to followed by a read of
the L1PCC register guarantees that the requested mode is in effect.
The goal of the OPER field in the L1PCC register is to avoid the substantial DSP cycle
penalty and code size involved in a read-write-reread sequence that would otherwise be
necessary. Thus, applications may quickly freeze L1P and record the previous “freeze”
state of L1P with the short sequence of code in Example 2-1.
Example 2-1 L1P Quick Freeze Example Code Sequence
The L1PCC can be used for unfreezing the cache in a manner similar to how it was
frozen. Example 2-2 illustrates how this is performed:
Example 2-2 Restore Example Code Sequence for the OPER bit in the L1PCC
; Assume A1 holds value read in at the end of the L1P Quick Freeze
Example Code Sequence above.
MVKL L1PCC, A0 ; Point to L1PCC
MVKH L1PCC, A0 ;
|| SHRU A1, 16, A1 ; Shift POPER field into OPER's position
The L1D cache also supports a freeze mode. See Chapter 3 on page 3-1 for more details
on the L1D cache freeze mode.
Example 2-3 illustrates a sequence that freezes both L1D and L1P.
Example 2-3 Example Code Sequence for Freezing L1D and L1P Simultaneously
MVKL L1DCC, A0 ; \
|| MVKL L1PCC, B0 ; |__ Generate L1DCC pointer in A0
MVKH L1DCC, A0 ; | and L1PCC pointer in B0
|| MVKH L1PCC, B0 ; /
|| MVK 1b, A1 ; \___ OPER encoding for 'freeze'
|| MVK 1b, B1 ; / in both A1 and B1.
STW A1, *A0 ; Write to L1DCC.OPER
|| STW B1, *B0 ; Write to L1PCC.OPER
LDW *A0,A1 ; Get old freeze state into A1 from L1DCC
|| LDW *B0,B1 ; Get old freeze state into B1 from L1PCC
NOP 4
; At this point, L1D and L1P are frozen.
; The old value of L1DCC.OPER is in bit 16 of A1.
; The old value of L1PCC.OPER is in bit 16 of B1.
You can globally invalidate the L1P cache under software control. The program must
write a 1 to the I bit of the L1PINV register in order to initiate a global invalidation
operation.
During the global invalidation of the L1P cache, no writeback operation is performed
because code is not modified.
The I bit of the L1PINV register resets to 0 upon completion of the global coherence
operation. The program can poll this field to detect the completion of the operation.
The polling code must be located outside the L1P cache.
You can also globally invalidate the L1P cache by setting the IP bit in the L2CFG
register to 1. The IP bit provides backward compatibility with C66x devices. You should
not use the IP bit in new applications; use the L1PINV register for new applications.
The L1P invalidate word count field of the L1PIWC sets to 0 upon completion of the
block coherence operation. The program can poll this field to detect the completion of
the operation. The polling code must be located outside of the affected block of the L1P
cache.
On the C66x DSP, it is recommended that programs wait for block coherence
operations to complete before continuing. To issue a block coherence operation:
The MFENCE instruction is new to the C66x DSP. It stalls the DSP until all outstanding
memory operations complete. For further information about MFENCE instruction, see
the C66x DSP and Instruction Set Reference Guide (SPRUGH7) in ‘‘Related
Documentation from Texas Instruments’’ on page ø-xx.
Table 2-6 lists the registers for the L1P specific cache control operations registers. See
the device-specific data manual for the memory address of these registers.
Table 2-6 L1P Specific Cache Control Operations Registers
Address Acronym Register Description Section
0184 0020h L1PCFG Configures the size of L1P cache Section 2.5.2.1
0184 0024h L1PCC Controls L1P operating mode (freeze / normal) Section 2.5.2.2
0184 4020h L1PIBAR Section 2.5.2.3
Specified range is invalidated in L1P without being written back
0184 4024h L1PIWC Section 2.5.2.4
0184 5028h L1PINV Entire contents of L1P is invalidated without being written back Section 2.5.2.5
See Chapter 4 on page 4-1 for a detailed list of the available cache control operations
provided.
In addition to the L1P-specific registers listed above, the L1P cache is directly affected
by writes to L2-specific controls as well. See Chapter 4 on page 4-1 for the complete list
of cache control operations and their affect on the L1P cache.
R-0 R/W-0h or 7h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L1P cache control register (L1PCC) is shown in Figure 2-3 and described in
Table 2-8.
Figure 2-3 L1P Cache Control Register (L1PCC)
31 17 16 15 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L1P invalidate base address register (L1PIBAR) is shown in Figure 2-4 and
described in Table 2-9.
Figure 2-4 L1P Invalidate Base Address Register (L1PIBAR)
31 0
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 2-9 L1P Invalidate Base Address Register (L1PIBAR) Field Descriptions
Bit Field Value Description
31-0 L1PIBAR 0-FFFF FFFFh 32-bit base address for block invalidation.
The L1P invalidate word count register (L1PIWC) defines the size of the block
invalidation that the coherence operation will act upon. The size is defined in 32-bit
words.
The L1P invalidate word count register (L1PIWC) is shown in Figure 2-5 and described
in Table 2-10.
Figure 2-5 L1P Invalidate Word Count Register (L1PIWC)
31 16 15 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 2-10 L1P Invalidate Word Count Register (L1PIWC) Field Descriptions
Bit Field Value Description
31-16 Reserved 0 Reserved
15-0 L1PIWC 0-FFFFh Word count for block invalidation.
Reserved I
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 2-12 summarizes who may access which L1P cache control registers.
Table 2-12 Permissions for L1P Cache Control Registers
Register Supervisor User
L1PCFG R/W R
L1PCC R/W R/W
L1PINV R/W R/W
L1PIBAR W W
L1PIWC R/W R/W
An L1P miss that misses in L2 cache stalls the DSP until the L2 retrieves the data from
external memory and transfers the data to the L1P, which then returns the data to the
DSP. This delay depends upon the type of external memory used to hold the program,
as well as other aspects of system loading.
The C66x DSP allows an execute packet to span two fetch packets. This spanning does
not change the penalty for a single miss. However, if both fetch packets are not present
in L1P, two cache misses occur.
For L1P miss pipelining to be effective, there must be multiple outstanding cache
misses. The C66x DSP fetch pipeline accomplishes this by attempting to fetch one new
fetch packet every cycle, as long as there is room in the fetch pipeline. To understand
how this works, it is necessary to understand the nature of the fetch pipeline itself.
The fetch and decode pipeline is divided into 6 stages leading up to, but not including
the first execution stage, E1. The stages are:
• PG: Program Generate
• PS: Program Send
• PW: Program Wait
• PR: Program Read
• DP: Dispatch
• DC: Decode
The C6000 DSP instructions are grouped into two groupings: fetch packets and execute
packets. The DSP fetches instructions from memory in fixed bundles of 8 instructions,
known as fetch packets. The instructions are decoded and separated into bundles of
parallel-issue instructions known as execute packets. A single execute packet may
contain between 1 and 8 instructions. Thus, a single fetch packet may contain multiple
execute packets. An execute packet may also span two fetch packets on the C66x DSP.
The program read (PR) stage of the pipeline is responsible for identifying a sequence of
execute packets within a sequence of fetch packets. The dispatch (DP) stage is
responsible for extracting and dispatching them to functional units.
As a result of the disparity between fetch packets and execute packets, the entire fetch
pipeline need not advance every cycle. Rather, the PR pipeline stage only allows the
program wait (PW) stage to advance its contents into the PR stage when the DP stage
has consumed the complete fetch packet held in PR. The stages before PR advance as
needed to fill in gaps. Thus, when there are no cache misses, the early stages of the fetch
pipeline are stalled while the DP stage pulls the individual execute packets from the
current fetch packet. These stalls are referred to as dispatch stalls.
The C66x DSP takes advantage of these dispatch stalls by allowing the earlier stages of
the pipeline to advance toward DP while cache misses for those stages are still pending.
Cache misses may be pending for the PR, PW, and PS pipeline stages. It is not necessary
to expose these cache stalls to the DSP because the DP stage stalls the PR stage with a
dispatch stall while it consumes the fetch packets in the PR stage of the pipeline. When
a fetch packet is consumed completely; however, the contents of the PW stage must
advance into the PR stage. At this point, the DSP stalls if DP requests an execute packet
from PR for which there is still an outstanding cache miss.
When a branch is taken, the fetch packet containing the branch target advances
through the fetch pipeline every cycle until the branch target reaches the E1 pipeline
stage. Branch targets override the dispatch stall described above. As a result, they do not
gain as much benefit from miss pipelining as other instructions. However, the fetch
packets that immediately follow a branch target do benefit. Although the code in the
fetch packets that follows the branch target may not execute immediately, the branch
triggers several consecutive fetches for this code. Thus, it pipelines any misses for that
code. In addition, no stalls are registered for fetch packets that were requested prior to
the branch being taken, but that never made it to the DP pipeline stage.
The following software sequence is required to power down the C66x CorePac:
1. Enable power-down by setting the MEGPD field in the PDCCMD register to 1.
2. Enable the DSP interrupt(s) that you want to wake the C66x CorePac up; disable
all others.
3. Execute an IDLE instruction.
The C66x CorePac stays in powered-down mode until the interrupts enabled in step 2
above are awakened.
All three memory controllers feature two exception outputs which are routed to the
C66x CorePac interrupt controller. One of these exception outputs indicates that a
DSP-triggered (“local”) memory exception occurred. The other indicates that a
DMA-triggered (“remote”) exception occurred. Most programs will likely route the
DSP-triggered exception input to the DSP’s exception input and the DMA-triggered
input to an interrupt input.
The permissions associated with the registers are checked for reads of its registers. L1P
checks writes off of its registers. It will signal a DSP-triggered memory exception in
response to disallowed writes. The details of the exception are recorded in
L1PMPFAR/L1PMPFSR, and L1P signals a DSP memory protection exception event
(L1P_CMPA) to the interrupt controller.
Each DMA/IDMA access is checked against the SR/SW/UR/UW and accessor ID fields
for the corresponding memory protection page. DMA/IDMA accesses to L1P memory
index into the 16 memory protection pages.
Upon an invalid access to L1P memory via a DMA or IDMA, the L1P signals an
exception. The details of this exception are recorded in L1PMPFAR/L1PMPFSR. L1P
signals a DMA memory protection exception event (L1P_DMPA) to the interrupt
controller.
See the device-specific data manual to determine the page size and number of pages
used on a particular device.
Table 2-16 Memory Page Protection Attribute Registers (Part 1 of 2)
Address Acronym Register Description Section
0184 A640h L1PMPPA16 Level 1 Memory Page Protection Attribute Register 16 Section 2.8.2.1.1
0184 A644h L1PMPPA17 Level 1 Memory Page Protection Attribute Register 17 Section 2.8.2.1.1
0184 A648h L1PMPPA18 Level 1 Memory Page Protection Attribute Register 18 Section 2.8.2.1.1
0184 A64Ch L1PMPPA19 Level 1 Memory Page Protection Attribute Register 19 Section 2.8.2.1.1
0184 A650h L1PMPPA20 Level 1 Memory Page Protection Attribute Register 20 Section 2.8.2.1.1
0184 A654h L1PMPPA21 Level 1 Memory Page Protection Attribute Register 21 Section 2.8.2.1.1
0184 A658h L1PMPPA22 Level 1 Memory Page Protection Attribute Register 22 Section 2.8.2.1.1
0184 A65Ch L1PMPPA23 Level 1 Memory Page Protection Attribute Register 23 Section 2.8.2.1.1
0184 A660h L1PMPPA24 Level 1 Memory Page Protection Attribute Register 24 Section 2.8.2.1.1
See the device-specific data manual to determine the page size and number of pages
used on a particular device.
The general structure of the memory page protection attribute register (L1PMPPAxx)
is shown in Figure 2-7 and described in Table 2-11.
Figure 2-7 Memory Page Protection Attribute Registers (L1PMPPAx)
31 16
Reserved
R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Fault Address
R-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 2-19 L1P Memory Protection Fault Address Register (L1PMPFAR) Field Descriptions
Bit Field Value Description
31-0 Fault Address 0-FFFF FFFFh Reserved
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 2-20 L1P Memory Protection Fault Set Register (L1PMPFSR) Field Descriptions (Part 1 of 2)
Bit Field Value Description
31-16 Reserved 0 Reserved
15-9 FID 0-7Fh Bit 6:0 of faulting requestor. If ID is narrower than 7 bits, the remaining bits return 0.
If ID is wider than 7 bits, the additional bits get truncated. FID =0 if LOCAL =1.
8 LOCAL
0 Normal operation.
1 Access was a "LOCAL" access.
Table 2-20 L1P Memory Protection Fault Set Register (L1PMPFSR) Field Descriptions (Part 2 of 2)
Bit Field Value Description
7-6 Reserved 0 Reserved
5 SR Supervisor read access type.
0 Normal operation.
1 Indicates a Supervisor read request.
4 SW Supervisor write access type.
0 Normal operation.
1 Indicates a Supervisor write request.
3 Reserved 0 Reserved
2 UR User read access type.
0 Normal operation.
1 Indicates a User read request.
1 UW User write access type.
0 Normal operation.
1 Indicates a User write request.
0 Reserved 0 Reserved
R-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 2-21 L1P Memory Protection Fault Clear Register (L1PMPFCLR) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved
0 MPFCLR Command to clear the L1DMPFAR.
0 No effect.
1 Clear L1DMPFAR and L1DMPFCR.
The L1PMPFAR and L1PMPFSR registers only store enough information for one fault.
Generally, the hardware records the information about the first fault and generates an
exception only for that fault. L1P has a notion of “local” (DSP triggered) and “remote”
(DMA/IDMA triggered) faults. The L1P allows a “local” fault to replace a “remote”
fault and generate a new exception.
The fault information is held until the software clears it by writing a 1 to the MPFCLR
bit in the L1PMPFCR register. Writing a 0 to the MPFCLR bit in the L1PMPFCR
register has no effect.
Table 2-22 summarizes which L1P memory protection registers are accessible by role
and what protection checks are performed in the C66x CorePac.
Table 2-22 Permissions for L1P Memory Protection Registers
Register Supervisor User
L1PMPFAR R R
L1PMPFSR R R
L1PMPFCR W /
L1PMPPAxx R/W R
3.1 Introduction
3.1.1 Purpose of the Level 1 Data (L1D) Memory and Cache
The purpose of the L1D memory and cache is to maximize performance of the data
processing. The configurability of the L1D memory and cache offers the flexibility to
use L1D cache or L1D memory in a system.
3.1.2 Features
The L1D memory and cache provide the following features:
• Configurable L1D cache size: 0K, 4K, 8K, 16K, 32K
• Memory protection
• Cache block and global coherence operations
The L1D memory's base address is constrained to 1MB boundaries. The total size of
L1D memory must be a multiple of 16K bytes.
The actual memory configuration is device-specific. See the device-specific data sheet
for more information.
The cache controller design supports a range of cache sizes, from 4K through 32K.
However, a given device may implement less than 32K of L1D RAM.
The L1D cache converts L1D memory to cache starting at the highest L1D memory
address in L1D and working downwards.
The L1D memory is initialized as either “All RAM” or “maximal cache” at reset. See the
device-specific data manual for specific behavior.
The operation of the L1D Cache is controlled through several registers. These registers
are described in more detail in Section 3.4.
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The offset of six bits accounts for the fact that an L1D line size is 64 bytes. The cache
control logic ignores bits 0 through 5 of the address (the byte, bank, and sub-line fields).
Bits 0 through 5 only determine which bank and which bytes within a bank to access;
thus, they are irrelevant to the cache's tag compare logic. The set field indicates that the
L1D cache line address where the data would reside, if it were cached. The width of the
set field depends on the amount of L1D that you configure as cache, as defined in
Table 3-1 below. Use the set field to look up and check the tags in each way for any
already-cached data from that address as well as the valid bit, which indicates whether
the address in the tag actually represents a valid address held in cache.
The tag field is the upper portion of the address that identifies the true physical location
of the data element. The cache compares the tag to the stored tags for both ways of the
L1D cache.
If one of the tags matches and you set the corresponding valid bit is set on reads, then
it is a “hit,” and the data cache returns data to the DSP directly from the L1D cache.
Otherwise, the read is a “miss”, and the DSP stalls while the request is sent on to the
Level 2 (L2) memory to fetch the data from its location elsewhere in the system.
The DSP can also write data to L1D. When the DSP performs a store, the L1D performs
the same tag comparison as it does for reads. If a valid matching tag is found, then the
write is a “hit”, and the data is written directly into the L1D cache location. Otherwise,
the write is a “miss” and the data is queued in the L1D write buffer. This buffer is used
to prevent DSP stalls on write misses. Since the DSP does not wait for data to return on
writes, there is no reason to stall during the L2 access.
The L1D cache configuration determines the size of the set and tag fields, as shown in
Table 3-1.
Table 3-1 Data Access Address Set Field Width (Part 1 of 2)
L1DMODE Setting
in the L1DCFG Register Amount of L1D Cache 'X' Bit Position Description
000b 0K N/A L1D is all RAM
001b 4K 10 32 L1D cache lines
010b 8K 11 64 L1D cache lines
011b 16K 12 128 L1D cache lines
100b 32K 13 256 L1D cache lines
Another characteristic of the data cache is the ability to evict data from the L1D cache
to L2. Since the DSP is able to modify the contents of the L1D cache, it must be capable
of updating the data in its true physical location. This occurs when a new L1D line
replaces one that has been modified, or when the DSP tells the L1D cache to write back
modified data through software control.
The L1D cache is a read-allocate-only cache. This means that the L1D cache will fetch
a complete line of 64 bytes only on a read miss. Write misses are sent directly to L2
through the L1D write buffer. The replacement strategy calls for the least-recently-used
(LRU) L1D line to be replaced with the new line. This keeps the most recently-accessed
data in the L1D cache at all times.
L1D is writeback cache. Write hits are processed directly within L1D. The update is not
passed to L2 or the rest of the memory system immediately. When a cache line is
modified, that line's associated “dirty bit” is set to 1. L1D writes back only dirty lines
when evicting them to make room for newly-cached data, when the program initiates
a manual coherence operation to force its writeback, or when the DSP initiates a
long-distance read to a non-cacheable memory having a set match.
The L1DMODE field in the L1DCFG register selects the L1D cache mode according to
Table 3-2.
Table 3-2 Cache Size Specified by the L1DMODE in the L1DCFG
L1DMODE Setting in L1DCFG Register Amount of L1D Cache
000b 0K
001b 4K
010b 8K
011b 16K
100b 32K
101b Reserved. Maps to 32K
110b
111b "Maximal Cache" Maps to 32K
The actual range of L1D cache modes is constrained by the size of L1D.
In general, a larger value of L1DMODE specifies a larger cache size, up to the size of the
implemented L1D memory. The maximum L1D cache size is the smaller of “largest
power-of-2 that fits in L1D RAM size” and 32K.
For example, when L1D is only 16K in size, the L1D cache can be no larger than 16K.
In this case, the encoding s 011b through 111b maps to 16K. On these devices,
L1DMODE settings 100b through 111b will select the 16K cache mode as opposed to
the 32K cache mode. That is, modes 000b through 011b always select the requested size,
0K through 16K. Modes 100b through 111b selects the maximum size implied by the
size of L1D memory: 16K or 32K.
As a result of this policy, programs wanting no more than a certain amount of cache
should program the value corresponding to this upper bound. Programs that want “as
much cache as possible” should program 111b into L1DMODE.
When programs initiate a cache mode change, the L1D cache itself writes back and
invalidates its current contents without loss of data.
The L1D cache services read hits and write hits normally while in freeze mode, with the
small exception that the LRU bit is not modified. Read hits return data from the cache.
Write hits update the cached data for the cache line and mark it dirty, as necessary. The
LRU bit is not updated. The LRU bit is the bit which indicates the least recently used
way for the affected cache line). In freeze mode, the L1D cache does not allocate new
cache lines on read misses, nor will it evict any existing cache contents in freeze mode.
Write misses in the L1D write buffer are queued normally.
In freeze mode, the L1D cache still responds normally to cache-coherence commands
issued from L2 (snoop-read, snoop-write), as well as any program-initiated cache
controls (writeback, invalidate, writeback-invalidate, and mode change). L1D’s freeze
mode has no impact on whether L2 allocates cache lines. Likewise, L2’s freeze mode has
no impact on whether L1D allocates cache lines.
The OPER field in the L1DCC register controls the L1D freeze mode. The DSP places
L1D into freeze mode by writing 1 to the OPER field. The DSP returns L1D to normal
operation by writing 0 to the OPER field in the L1DCC register.
The POPER field in the L1DCC register holds the previous value of the OPER field. The
value of OPER in the L1DCC register is copied to the POPER field in the L1DCC
register on writes to the L1DCC register. This alleviates the cycle cost of reading the
L1DCC register (in order to save OPER's previous value) before it is written. If the
POPER field is not in the L1DCC register, the program must read, write, and then read
again to fully freeze the cache while recording its previous operating mode. If the
POPER field is in the L1DCC register, this operation only requires a single write
followed by a read.
The following operations occur when you perform a write to the L1DCC register:
1. The content of the OPER field copies to the POPER field in the L1DCC register.
2. The POPER field loses its previous value.
3. The OPER field updates according to the value that the DSP writes to bit 0 of the
L1DCC register. Thus, the write to the L1DCC register only modifies the OPER
field in the L1DCC register.
In order to ensure that the L1PCC register updates, the software must perform a write
to the L1PCC register followed by a read of the L1PCC register. This guarantees that
the requested mode is in effect.
Programs cannot directly modify the POPER field with a single write.
The goal of the OPER and the POPER fields in the L1DCC register is to avoid the DSP
cycle penalty and code size involved in a read-write-reread sequence that would
otherwise be necessary. Thus, applications may quickly freeze L1D and record the
previous “freeze” state of L1D with the short sequence of code in Example 3-1.
You can use the L1DCC register for unfreezing the cache in a manner similar to how it
was frozen. Example 3-2 illustrates the code sequence.
Example 3-2 L1DCC.OPER Restore Example Code Sequence
Note—Both L1D and L1P offer freeze modes via this sort of mechanism. (See
Chapter 2 on page 2-1 for more information on implementing L1P). It is often
desirable to freeze both caches together. Therefore, consecutive writes to the
L1DCC register and to the L1PCC register followed by reading both the
L1DCC register and the L1PCC register is sufficient to ensure that both L1P
and L1D are frozen. Example 3-3 illustrates a sequence that freezes both L1P
and L1D.
Example 3-3 Example Code Sequence for Freezing L1P and L1D Simultaneously
MVKL L1DCC, A0 ; \
|| MVKL L1PCC, B0 ; |__ Generate L1DCC pointer in A0
MVKH L1DCC, A0 ; | and L1PCC pointer in B0
|| MVKH L1PCC, B0 ; /
|| MVK 1, A1 ; \____ OPER encoding for 'freeze'
|| MVK 1, B1 ; / in both A1 and B1.
NOP 4
; At this point, L1P and L1D are frozen.
; The old value of L1DCC.OPER is in bit 16 of A1.
; The old value of L1PCC.OPER is in bit 16 of B1.
In order to initiate a global invalidation operation, the program must write a 1 to the I
bit of the L1DINV register.
Upon completion of the global invalidate operation, the I bit of the L1DINV register
resets to 0. The program can poll this bit to detect the completion of the operation.
In order to initiate a global writeback operation, the program needs to write a 1 to the
C bit of the L1DWB register.
The C bit of the L1DWB register resets to 0 upon completion. The program can poll
this bit to detect the completion of the operation.
Table 3-4 provides a summary of the L1D global cache coherence operations.
Table 3-4 Global Coherence Operations
Cache Operation Register Used L1D Effect
L1D Writeback L1DWB All updated data written back to L2 / external, but left valid on L1D.
L1D Writeback with L1DWBINV All updated data written back to L2 / external.
Invalidate All lines invalidated within L1D.
L1D Invalidate L1DINV All lines invalidated in L1D. Updated data is dropped.
You can also globally invalidate the L1D cache by setting the ID bit in the L2CFG
register to 1 for legacy reasons. The ID field is provided for backward compatibility
with C64x devices, but it should not be used in new applications. New applications
should use the L1DINV register.
Writing a non-zero value to the word count field in the L1DXXWC register initiates a
block coherence operation. The word count field sets to 0 upon completion of the block
coherence operation. The program can poll this field to detect the completion of the
operation.
On the C66x DSP, it is recommended that programs wait for block coherence
operations to complete before continuing. To issue a block coherence operation:
The MFENCE instruction is new to the C66x DSP. It stalls the DSP until all outstanding
memory operations complete. For further information about MFENCE instruction, see
the C66x DSP and Instruction Set Reference Guide (SPRUGH7) in ‘‘Related
Documentation from Texas Instruments’’ on page ø-xx.
Table 3-5 provides a summary of the L1D block cache coherence operations.
Table 3-5 Block Cache Operations
Cache Register
Operation Used L1D Effect
L1D Writeback L1DWBAR Updated data written back to L2 /external, but left valid in L1D.
L1DWWC
L1D Writeback L1DWIBAR Updated data written back to L2 /external. All lines in range invalidated
with Invalidate L1DWIWC within L1D.
L1D Invalidate L1DIBAR All lines in range invalidated in L1D. Updated data is dropped.
L1DIWC
Two simultaneous accesses to the same bank incur a one-cycle stall penalty, except
under the following special cases:
• The memory accesses are both writes to non-overlapping bytes within the same
word. Therefore, bits 31-2 of the address are the same.
• The memory accesses are both reads that access all or part of the same word.
Thus, bits 31-2 of the address are the same. In this case, the two accesses may
overlap.
• One or both of the memory accesses is a write that misses L1D and is serviced by
the write buffer instead. (See section Section 3.5.3 for information on the write
buffer).
• The memory accesses form a single nonaligned access. Nonaligned accesses do
not cause bank-conflict stalls, even though the memory system may subdivide
them into multiple accesses.
Notice that a read access and a write access in parallel to the same bank always causes a
stall. Two reads or two writes to the same bank may not stall as long as the above
conditions are met.
Simultaneous DSP and DMA/IDMA accesses to distinct L1D memory banks do not
stall. Accesses to the same bank result in a conflict between DSP and DMA/IDMA. One
or the other stall based on the rules described in Chapter 8 on page 8-1.
Snoop-read is sent to L1D when L2 detects that the L1D cache holds the requested line,
and that the line is dirty. L1D responds by returning the requested data.
Snoop-write is sent to L1D when L2 detects that the L1D holds the requested line. It
does not matter if the line is modified within L1D. The L1D updates its contents
accordingly.
L2 keeps a shadow copy of L1D's tag memory. L2 consults its local copy of the L1D tags
to decide whether a snoop command to L1D is warranted.
L2 primarily updates its shadow tags in response to L1D read miss requests, and
secondarily in response to L1D victim writebacks. When L1D issues a read request, it
also indicates whether or not the line is allocated within L1D; and if so, what way within
the set the line is allocated in. L2 can update the corresponding set in its shadow tags
from this information.
In addition to tracking which addresses are present in L1D cache, L2 tracks also tracks
whether or not those lines are dirty in the C66x DSP.
In addition to the L1D-specific registers listed above, the L1D cache is directly affected
by writes to L2-specific controls as well. See Chapter 4 on page 4-1 for the complete list
of cache control operations and their effect on the L1D cache.
R-0 R/W-0h or 7h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved POPER
R-0 R-0
15 1 0
Reserved OPER
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved I
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved C
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved C
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-12 L1D Invalidate Base Address Register (L1DIBAR) Field Descriptions
Bit Field Value Description
31-0 L1DIBAR 0-FFFF FFFFh Defines the base address for the L1D block invalidate operation.
R-0
15 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-13 L1D Invalidate Word Count Register (L1DIWC) Field Descriptions
Bit Field Value Description
31-16 Reserved 0 Reserved
15-0 L1DIWC 0-FFFFh Word count for block invalidation
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-14 L1D Writeback Base Address Register (L1DWBAR) Field Descriptions
Bit Field Value Description
31-0 L1DWBAR 0-FFFF FFFFh Defines the base address for the L1D block writeback operation
Reserved
R-0
15 0
L1D Writeback-Invalidate Word Count (L1DWIWC)
R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-15 L1D Writeback-Invalidate Word Count Register (L1DWIWC) Field Descriptions
Bit Field Value Description
31-16 Reserved 0 Reserved
15-0 L1DWIWC 0-FFFFh Word count for block invalidation
Table 3-16 summarizes which L1D cache control registers are accessible and what
protection checks are performed in the C66x CorePac according to role.
Table 3-16 Permissions for L1D Cache Control Registers
Register Supervisor User
L1DCFG R/W R
L1DCC R/W R/W
L1DWIBAR W W
L1DWIWC R/W R/W
L1DWBAR W W
L1DWWC R/W R/W
L1DIBAR W W
L1DIWC R/W R/W
L1DWB R/W R/W
L1DWBINV R/W R/W
L1DINV R/W R
The banks are interleaved based on the low-order bits of the address. Specifically, for
aligned memory accesses, address bits [4:2] determine the bank number. The mapping
of bits to bank number varies with the device endian mode.
In Figure 3-11, bits 4-2 of the address select the bank and bits 1-0 select the byte within
the bank.
Figure 3-11 Address to Bank Number Mapping
31 16
15 5 4 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The shaded areas in Figure 3-12 show combinations of parallel accesses that may result
in bank-conflict stalls according to the LSBs of addresses for the two accesses. Two
simultaneous accesses to the same bank incur a one-cycle stall penalty, except under the
following special cases:
• The memory accesses are both writes to non-overlapping bytes within the same
word. Thus, bits 2 through 31 of the address are the same.
• The memory accesses are both reads that access all or part of the same word.
Thus, bits 2 through 31 of the address are the same. In this case, the two accesses
may overlap.
• The memory accesses form a single nonaligned access. Nonaligned accesses do
not cause bank-conflict stalls, even though the memory system may subdivide
them into multiple accesses.
Notice that a read access and a write access in parallel to the same bank always causes a
stall. Two reads or two writes to the same bank may not stall as long as the above
conditions are met.
DSP and DMA/IDMA accesses to distinct L1D memory banks do not stall. Accesses to
the rules same bank results in a conflict between DSP and DMA/IDMA. One or the
other stalls based on the rules described in Chapter 8 on page 8-1.
Bits
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 0 0
4−0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
00000
00001
00010
00011
00100
00101
00110
00111
01000
01001
01010
01011
01100
01101
Byte
01110
01111
10000
10001
10010
10011
10100
10101
10110
10111
11000
11001
11010
11011
11100
11101
11110
11111
00000
00010
00100
00110
01000
01010
01100
Halfword
01110
10000
10010
10100
10110
11000
11010
11100
11110
00000
00100
01000
Word
01100
10000
10100
11000
11100
00000
01000
DW
10000
11000
Reads that miss L1D stall the DSP while the requested data is fetched. The L1D is a
read-allocate cache, and so it will allocate a new line for the requested data.
An L1D read miss that also misses L2 stalls the DSP while the L2 retrieves the data from
external memory. Once the data is retrieved, it is stored in L2 and transferred to the
L1D. The external miss penalty varies depending on the type and width of external
memory used to hold external data, as well as other aspects of system loading.
If there are two read misses to the same line in the same cycle, only one miss penalty is
incurred. Similarly, if there are two accesses in succession to the same line and the first
one is a miss, the second access does not incur any additional miss penalty.
The process of allocating a line in L1D can result in a victim writeback. Victim
writebacks move updated data out of L1D to the lower levels of memory. When
updated data is evicted from L1D, the cache moves the data to the victim buffer. Once
the data is moved to the victim buffer, the L1D resumes processing of the current read
miss. Further processing of the victim writeback occurs in the background. Subsequent
read and write misses, however, must wait for the victim writeback to process. If the
read misses do not conflict with existing victims, the read misses are pipelined with the
victim writebacks in order to reduce the performance penalty.
The L1D pipelines read misses. Consecutive read misses to different lines may overlap,
reducing the overall stall penalty.
Write misses do not stall the DSP directly. Write misses are queued in the write buffer
that is between L1D and L2. Although the DSP does not always stall for write misses,
the write buffer can stall the DSP under various circumstances. Section 3.5.3 describes
the effects of the write buffer.
Writes that miss L1D do not stall the DSP unless the write buffer is full. If the write
buffer is full, a write miss can indirectly stall the DSP until there is room in the buffer
for the write. The write buffer can also stall the DSP by extending the time for a read
miss. Reads that miss L1D are not processed as long as the write buffer is not empty.
Once the write buffer empties, the read miss processes. This is necessary as a read miss
may overlap an address for which a write is pending in the write buffer.
The L2 can process a new request from the write buffer every L2 cycle (L2 cycle = 2 x
DSP cycles), provided that the requested L2 bank is not busy. You can merge multiple
elements within a buffer together for a single memory access if they are contiguous in
memory to reduce the potential for buffer stalls and DMA contention.
The write buffer allows write requests to merge and merges two write misses into a
single transaction, provided that the write request obeys the following rules:
• The new write miss resides within the same 128-bit quad-word as the
immediately preceding write miss.
• The two writes are to locations in L2 SRAM (not to locations that may be held in
L2 cache)
• The first write has just been placed in the write buffer queue
• The second write is presently being placed in the buffer queue
• The first write has not yet been presented to the L2 controller
• Both writes have the same privilege level
Table 3-17 presents a summary of the L1D performance. The configuration features 3
wait states for L2SRAM, 8 x 128 bit banks which is made up of two physical banks with
four subbanks each. This configuration is available in the KeyStone devices.
Table 3-17 L1D Performance Summary (TBD)
L2 Type 3 wait state, 8 x 128-bit banks
Parameter L2 SRAM L2 Cache
Single Read Miss
2 Parallel Read Misses (pipelined)
M Consecutive Read Misses (pipelined)
M Consecutive Parallel Read Misses (pipelined)
The C66x CorePac stays in powered-down mode until the interrupt(s) that you enabled
in step 2, above wake them up.
If a DMA access occurs to the L1D, L1P, or L2 memory while the C66x CorePac is
powered-down, the power-down controller (PDC) wakes up all three memory
controllers. When the DMA access has been serviced, the PDC will power-down the
memory controllers again.
See Chapter 12 on page 12-1 for more information about the PDCCMD register and
the power-down capabilities of the C66x CorePac.
The L1D memory controllers feature two exception outputs that are routed to the C66x
interrupt controller. One of these exception outputs indicates that a DSP-triggered
“local” memory exception (L1D_CMPA) occurred. The other indicates that a system
master-triggered “remote” exception (L1D_DMPA) occurred.
However, user code cannot globally invalidate L1D cache or change the size of L1D
cache. Only supervisor code may initiate a global invalidation or change the amount of
memory allocated to cache.
Table 3-18 lists the registers for the L1D memory protection. See the device-specific
data manual for the memory address of these registers.
Table 3-18 Memory Protection Registers
Address Acronym Register Description Section
0184 AExxh L1DMPPAxx Memory Protection Page Attribute Register Section 3.7.2.1
0184 AC00h L1DMPFAR Memory Protection Fault Address Register Section 3.7.2.3.1
0184 AC04h L1DMPFSR Memory Protection Fault Set Register Section 3.7.2.3.2
0184 AC08h L1DMPFCR Memory Protection Fault Clear Register Section 3.7.2.3.3
See the device-specific data manual to determine the page size and number of pages
used on a particular device.
The memory protection (MPPAxx) register is shown in Figure 3-13 and described in
Table 3-20.
Figure 3-13 Memory Protection Register (MPPAxx)
31 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AID5 AID4 AID3 AID2 AID1 AID0 AIDX LOCAL Reserved SR SW Reserved UR UW Reserved
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
In contrast to L2 and L1P, L1D does not implement the SX (supervisor execute) and
UX (user execute) bits. The SX and UX fields in the L1DMPPA register always read as
zero and do not respond to writes.
R-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-22 Memory Protection Fault Address Register (L1DMPFAR) Field Descriptions
Bit Field Value Description
31-0 Fault Address 0-FFFF FFFFh Address of the fault.
Reserved
R-0
15 9 8 7 6 5 4 3 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-23 Memory Protection Fault Set Register (L1DMPFSR) Field Descriptions
Bit Field Value Description
31-16 Reserved 0 Reserved.
15-9 FID 0-7Fh Bits 6:0 of ID of faulting requestor. If ID is narrower than 7 bits, the remaining bits return 0. If ID is wider than 7 bits, the
additional bits get truncated.
FID = 0. If LOCAL = 1.
8 LOCAL LOCAL access.
0 Normal operation.
1 Access was a LOCAL access.
7-6 Reserved 0 Reserved
5 SR Supervisor read access type.
0 Normal operation.
1 Indicates a supervisor read request.
4 SW Supervisor write access type.
0 Normal operation.
1 Indicates a supervisor write request.
3 Reserved 0 Reserved
2 UR User read access type.
0 Normal operation.
1 Indicates a user read request.
1 UW User write access type.
0 Normal operation.
1 Indicates a user write request.
0 Reserved 0 Reserved
Reserved
R-0
15 0
MPFCLR
W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 3-24 Memory Protection Fault Clear Register (L1DMPFCR) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved.
0 MPFCLR Command to clear the L1DMPFAR register.
0 No effect.
1 Clear the L1DMPFAR and the L1DMPFCR registers.
Chapter 10 on page 10-1 provides the definition and meanings for these registers.
The L1DMPFAR and L1DMPFSR registers only store enough information for one
fault. The hardware records the information about the first fault and generates an
exception only for that fault.
The fault information is preserved until software clears it by writing a 1 to the MPFCLR
field in the L1DMPFCR register. Writing a 0 to the MPFCLR field in the L1DMPFCR
has no effect. L1D ignores the value written to bits 31:1 of the L1DMPFCR register.
Table 3-25 summarizes which L1D memory protection registers are accessible and
what protection checks are performed in the C66x CorePac according to role.
Table 3-25 Permissions for L1D Memory Protection Registers
Register Supervisor User
L1DMPFAR R R
L1DMPFSR R R
L1DMPFCR W /
L1DMPPAxx R/W R
4.1 Introduction
4.1.1 Purpose of the Level 2 (L2) Memory and Cache
The L2 memory controller provides an on-chip memory solution between the faster
level 1 memories (L1D, L1P) and slower external memories. It is advantageous in that
it supports larger memory sizes than the L1 memories, while providing faster access
than external memories.
Similar to the L1 memories, you can configure L2 to provide both cached and
non-cached (i.e., addressable) memories.
4.1.2 Features
The L2 memory and cache provides the memory flexibility required in a device using
the C66x CorePac:
• Configurable L2 cache size: 32KB, 64KB, 128KB, 256KB, 512KB or 1MB
• Memory protection
• Supports cache block and global coherence operations
The C66x CorePac L2 memory is organized as two physical 128-bit wide banks, each
with four sub-banks. A given 128-bit bank may accept a new request every cycle, as long
as the requested sub-bank is not busy.
The two 128-bit banks are interleaved on the least significant bit (LSB) of the 128-bit
address. A 256-bit dataphase straddles both physical banks, and occupies the same
sub-bank in both physical banks.
... ...
0xF0 0xE0
0x70 0x60
... ...
0xD0 0xC0
0x50 0x40
... ...
0xB0 0xA0
0x30 0x20
... ...
0x90 0x80
0x10 0x00
4.3 L2 Cache
The C66x CorePac default configuration maps all L2 memory as RAM. The L2 memory
controller supports 32KB, 64KB, 128KB, 256KB, 512KB or 1MB of 4-way
set-associative cache.
The operation of the L2 cache is controlled through several registers. Table 4-1
provides a summary of these registers. These registers are mentioned throughout this
section and are described in more detail in Section 4.4.
Table 4-1 Cache Registers Summary
Acronym Register Description Section
L2CFG Level 2 Configuration Register Section 4.4.2
L2WBAR Level 2 Writeback Base Address Register Section 4.4.3.1.1
L2WWC Level 2 Writeback Word Count Register Section 4.4.3.1.2
L2WIBAR Level 2 Writeback-Invalidate Base Address Register Section 4.4.3.1.3
L2WIWC Level 2 Writeback-Invalidate Word Count Register Section 4.4.3.1.4
L2IBAR Level 2 Invalidate Base Address Register Section 4.4.3.1.5
L2IWC Level 2 Invalidate Word Count Register Section 4.4.3.1.6
L2WB Level 2 Writeback Register Section 4.4.3.2.1
L2WBINV Level 2 Writeback-Invalidate Register Section 4.4.3.2.2
L2INV Level 2 Invalidate Register Section 4.4.3.2.3
MARn Memory Attribute Registers Section 4.4.4
Figure 4-2 outlines this function for the various sizes of cache supported.
Figure 4-2 L2 Cache Address Organization
31 x+1 x 7 6 0
TAG SET OFFSET
The offset of 7 bits accounts for the fact that an L2 line size is 128 bytes. The cache
control logic ignores this portion of the address. The set field indicates the L2 cache line
address where the data would reside within each way, if it were cached. The width of
the set field depends on the amount of L2 configured as cache, as defined in Table 4-2.
The L2 controller uses the set field to look up and check the tags in each way for any
already-cached data. It also looks up the valid bit, which indicates whether the contents
of the line are considered valid for purposes of a tag compare.
The L2 cache configuration dictates the size of the set and tag fields, as described in
Table 4-2.
Table 4-2 L2MODE Description
L2MODE Setting
of the L2CFG Register Amount of L2 Cache X Bit Position Description
000b 0K N/A L2 is all RAM
001b 32K 12 64 L2 cache lines
010b 64K 13 128 L2 cache lines
011b 128K 14 256 L2 cache lines
100b 256K 15 512 L2 cache lines
101b 512K 16 1024 L2 cache lines
110b 1024K 17 2048 L2 cache lines
111b Maximal cache. Maps to 1024K.
The tag field is the upper portion of the address that identifies the true physical location
of the cache line. The cache compares the tag field for a given address to the stored tag
in all four ways of the L2 cache.
If any of the tags match and the cached data is valid, then the access is a “hit”, and the
element is read directly from or written directly to the L2 cache location. Otherwise, it
is a “miss”, and the requestor remains stalled while the L2 fetches a complete line from
its system memory location. On read misses, the data is passed directly to the
appropriate L1 cache as part of the fetch. On write misses, the L2 merges the write with
the fetched line.
Since the contents of the L2 can be modified, the L2 cache is able to update the data in
its true physical location. The L2 cache is a writeback cache, meaning that it writes out
updates only when it needs to. Data is evicted from the L2 cache, written back to its
proper location in system memory. This occurs when a new L2 line replaces one that
has been modified, or when the L2 controller is told by the DSP (via software) to write
back modified data. In the event of an eviction or writeback, the data is sent to its
location in system memory through the XMC.
The L2 controller implements a read and write-allocate cache. This means that the L2
will fetch a complete line of 128 bytes on any miss for a cacheable location, regardless
of whether it is a read or a write. The replacement strategy is identical to that of the L1D,
in that the least-recently-used (LRU) L2 line is replaced with the new line.
In response to a local reset, the L2 cache is left in its current operating mode. However,
the entire contents of the cache are invalidated. All requestors are stalled while this
invalidation takes place.
If Level 1 cache support is enabled within the C66x CorePac, then the L2 controller
takes the necessary steps to ensure that the Level 1 caches respond in the same manner
as the L2 to the resets.
Typically, programs set the L2 mode shortly after reset and leave it unchanged.
However, some programs change the L2 cache mode on the fly, particularly around OS
task switches in a complex system. Be careful to maintain memory system coherence
and correct cache operation by ensuring that you follow this procedure.
Table 4-4 outlines the required steps that you must perform:
Table 4-4 Switching L2 Modes
To Switch From To The Program Must Perform the Following Steps:
A mode with no or some L2 cache A mode with more L2 cache 1. DMA, IDMA or copy any needed data out of the affected range of L2 RAM (If
none requires saving, no DMA is necessary).
2. Wait for completion of any DMAs/IDMAs issued in the previous step.
3. Write the desired cache mode to the L2MODE field in the L2CFG register.
4. Read back the L2CFG register. This stalls the DSP until the mode change
completes.
A mode with some L2 cache A mode with less or no L2 cache 1. Write the desired cache mode to the L2MODE field in the L2CFG register.
2. Read back the L2CFG register. This stalls the DSP until the mode change
completes.
When a program writes a new cache mode to the L2CFG register, the L2 performs the
following steps:
• L2 cache is written back and invalidated if it is enabled.
• The L2 cache sets to the requested mode.
Note—Changing L2's mode does not affect the contents of either L1 cache.
The freeze mode affects the operation of L2 cache only. L2 RAM is not affected by this
mode. L2’s freeze mode has no impact on L1D or L1P caches. Likewise, the L1's freeze
modes have no impact on L2 cache.
The L2 cache responds to read and write hits normally when in freeze mode. L2 sends
read and write misses directly to external memory, as if L2 cache were not present. The
L2 never allocates a new cache line while frozen. Lines may only be evicted from L2
during freeze mode by program-initiated cache coherence operations, as defined in
Section 4.3.6.
Table 4-5 provides a summary of the L2 freeze mode, set through the L2CC field in the
L2CFG register.
Table 4-5 Freeze Mode Summary
L2 Cache L2 Cache Enabled L2 Cache Freeze
L2 Mode L2MODE Enabled L2CC = 0 L2CC = 0 L2CC = 1
All RAM 000 No effect, because L2 is all RAM.
Mixed cache and RAM 1000 Cache operates normally. Cache frozen. Hits proceed normally. L1D misses are serviced as long-distance accesses
or all cache. for requested bytes only. L1P misses serviced as long-distance fetch for 1 fetch packet.
No LRU updates in this mode.
Table 4-6 lists all of the L2 global cache commands and the operations they perform on
each of the three caches.
Table 4-6 Global Coherence Operations
Cache Operation Register Used L1P Effect L1D Effect L2 Effect
L2 Writeback L2WB No effect All updated data written All updated data written
back to L2/external, but back externally, but left
left valid in L1D. valid in L2 cache.
L2 Writeback L2WBINV All lines All updated data written All updated data written
with Invalidate invalidated in L1P back to L2/external. All back externally. All lines
lines invalidated within invalidated in L2.
L1D.
L2 Invalidate L2INV All lines All lines invalidated in All lines invalidated in L2.
invalidated in L1P L1D. Updated data is Updated data is dropped.
dropped.
Programs initiate global cache operations by writing a 1 to the appropriate register bit
for each of the L2WB, L2WBINV, and L2INV registers.
Programs can write a 1 to the control register to initiate the coherence operation for the
L2WB, L2WBINV, and L2INV registers. The control register sets to 0 upon completion
of the operation. Programs can poll this bit to determine when the command
completes.
/* ---------------------------------------------------------------- */
/* Write back and Invalidate anything held in cache. */
/* ---------------------------------------------------------------- */
L2WBINV = 1;
/* ---------------------------------------------------------------- */
/* OPTIONAL: Spin waiting for operation to complete. */
/* ---------------------------------------------------------------- */
while ((L2WBINV & 1) != 0)
;
The hardware does not require programs to poll for completion of these commands.
The hardware may, however, stall programs while the global commands proceed.
Global cache operations work correctly regardless of the L2 freeze state. Further, global
cache operations do not change the frozen state of the L2 cache.
Table 4-7 lists all of the block cache commands and the operation they perform on each
of the three caches.
Table 4-7 Block Cache Operations
Cache Operation Register Used L1P Effect L1D Effect L2 Effect
L2 Writeback L2WBAR No effect Updated data written Updated data written
back to L2/external, but back externally, but left
L2WWC
left valid in L1D valid in L2 cache.
L2 Writeback L2WIBAR All lines in range Updated data written Updated data written
with Invalidate invalidated in L1P back to L2/external. All back externally. All lines in
L2WIWC
lines in range invalidated range invalidated in L2.
with L1D.
L2 Invalidate L2IBAR All lines in range All lines in range All lines in range
L2IWC invalidated in L1P invalidated in L1D. invalidated in L2. Updated
Updated data is dropped. data is dropped.
Programs initiate block cache operations by writing a word address to the base address
register, and then writing a word count to the word count register. (Writing 1 to WC
indicates a length of 4 bytes). If necessary, C66x CorePac enforces one or both of the
following:
• Only one program-initiated coherence operation may be in progress at a time.
• Writes to either L2XXBAR or L2XXWC stall while another block or global cache
coherence operation is in progress.
The L2XXBAR/L2XXWC mechanism for setting up block cache operations allows you
to specify ranges down to word granularity. However, the memory system operates at
cache-line granularity. Thus, all cache lines that overlap the range specified are acted
upon.
On the C66x DSP, it is recommended that programs wait for block coherence
operations to complete before continuing. To issue a block coherence operation:
Example 4-2 gives the pseudo-code sequence of the block coherence operation.
/* ---------------------------------------------------------------- */
/* Write base address of array to Base Address Register. */
/* Then write the length of the array, in words, to the Word */
/* Count register. */
/* ---------------------------------------------------------------- */
L2WBAR = &array[0];
L2WWC = sizeof(array) / sizeof(int);
/* ---------------------------------------------------------------- */
/* Wait for coherence operation to complete. */
/* ---------------------------------------------------------------- */
asm (" MFENCE");
Writing to the L2XXBAR register sets up the base address for the next cache coherency
operation. Writing a non-zero value to L2XXWC initiates the operation. Programs
should not rely on the contents of L2XXBAR after or during a cache control operation;
rather, programs should always write a new value to L2XXBAR prior to writing
L2XXWC. Reading L2XXWC returns a non-zero value while a block cache operation
is in progress, and zero when it is complete. Block cache operations work correctly
regardless of the L2 freeze state.
The L2 controller offers registers that control whether certain ranges of memory are
cacheable, and whether one or more requestors are actually permitted to access these
ranges. The registers are referred to as MARs (memory attribute registers). A complete
list of MAR registers is provided in Section 4.4.4.
Note—Using the volatile keyword in the C language does not protect a variable
from being cached. If an application uses a memory location periodically
updated by external hardware, in order to protect this operation in C code
follow these two steps:
•
Use the volatile keyword to prevent the code generation tools from incorrectly
optimizing the variable.
• You must program the MAR register of the range containing the variable to
prevent caching.
4.3.7.1 MAR Functions
Each MAR register implements two bits - Permit Copies (PC) and Prefetchable
Externally (PFX). The PC bit in each MAR register controls whether the cache may
hold a copy of the affected address range. If PC = 1, the affected address range is
cacheable. If PC = 0, the affected address range is not cacheable. The PFX bit in each
MAR register is used to convey to the XMC whether a given address range is
prefetchable. If PFX = 1, the affected address range is prefetchable. If PFX = 0, the
affected address range is not prefetchable.
Because MAR0 through MAR15 are read-only, the software does not need to
manipulate these registers.
Whenever MAR registers are updated dynamically, programs must follow the
following sequence to ensure that all future accesses to the particular address range are
not cached in L1 and L2 caches.
1. Ensure that all addresses within the affected range are removed from the L1 and L2
caches. This is accomplished in one of the following ways. Any one of the following
operations should be sufficient.
Note that the block-oriented cache controls can only operate on a 256K-byte address
range at a time, so multiple block writeback-invalidate operations may be necessary to
remove the entire affected address range from the cache.
4.3.7.4 L1 Interaction
When L1P or L1D makes a request to L2 for an address that is not held in L2 RAM or
L2 cache, the L2 controller queries the corresponding MAR register for that address. If
the permit copies (PC) bit in the MAR register is 0, the L2 cache controller treats this
as a non-cacheable access and initiates a long-distance access. If the access is a long
distance read, the DSP stalls until the read data returns and the L1D will write-back
dirty data if present in the LRU cache set that matches the non-cacheable memory
address.
Concerning L1D long distance requests, the net result of the PC bit in the MAR is to
prevent non-cacheable data from being stored in the L2 and L1D caches. Thus, when
PC = 0 in a given MAR register, neither the L1D nor the L2 cache retains a copy of data
accessed within the address range covered by that MAR.
The MAR registers have no effect on L1P. If L1P is enabled, it will always cache
program fetches regardless of MAR configuration.
2. Coherence between the C66x CorePac's L2 RAM segments and L1P cache is not
maintained.
3. Coherence between the external memory and cached copies in L1 or L2 caches is
not maintained.
The following sections outline the functions that provide the L2-RAM-to-L1cache
coherence.
The cache coherence protocol implements some features which are different from the
ones implemented in the C64x devices. In the C64x protocol, coherence is supported
between DMAs and L1D in L2, but not between DMAs and L1P. Also, in the C64x
memory architecture, L1D cache is kept inclusive within L2, and thus requires snoops
in response to L2 cache activity. The C64x+/C66x CorePac removes this inclusiveness,
thus limiting snoops to those triggered by DMA activity. L1 and L2 are still coherent
with respect to each other, even though L1 is not inclusive within L2.
Cache A is inclusive in cache B, if A's contents are always a subset of B's. If a line is held
in A, but not in B, then A is not inclusive in B. A non-cacheable write may hit in L2 if
the address was previously cacheable. This can happen if applications dynamically
change the settings of the MAR registers.
Table 4-8 lists the coherence commands L2 can issue to L1D on a per-cache-line basis.
Table 4-8 L2 to L1D Coherence Commands
Snoop Command Name L1D Action Triggered by
SNPR Snoop Read L1D sends L2 the contents of the DMA read from L2 RAM when L1D
requested half-line in L1D. Does not shadow tags say line is present and
modify the dirty/valid/LRU state for modified in L1D.
the line.
SNPW Snoop Write Up to 256 bits of new data is sent DMA write to L2 RAM when L1D
from L2 to L1D. L1D and L2 both shadow tags say line is present in L1D.
update their respective copies of the Whether the line is modified in L1D
data. The dirty and valid bits for the does not matter.
line in L1D do not change.
L1D victim writebacks also do not update L2’s LRU if they hit in L2. They do update
L2’s dirty status as needed.
When DMA/IDMA read L2 RAM, the L2 consults the shadow tag. If the given address
is marked as 'valid' and 'dirty' in L1D, the L2 sends a snoop-read request for the address
to L1D. L1D responds with the requested data.
The snoop-read leaves the data valid in L1D, and does not evict or write back the data
to L2. As a consequence, a buffer allocated in L1D is to left allocated in L1D so that
algorithms running on the DSP can subsequently refill the buffer without incurring
cache miss penalties.
15 10 9 8 7 4 3 2 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L2 writeback word count register (L2WWC) is shown in Figure 4-5 and described
in Table 4-12.
Reserved
R-0
15 0
R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved
R-0
15 0
R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L2 invalidate base address register (L2IBAR) is shown in Figure 4-8 and described
in Table 4-15.
Figure 4-8 L2 Invalidate Base Address Register (L2IBAR)
31 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L2 invalidate word count register (L2IWC) is shown in Figure 4-9 and described
in Table 4-16.
Figure 4-9 L2 Invalidate Word Count Register (L2IWC)
31 16
Reserved
R-0
15 0
R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L2 writeback register (L2WB) is shown in Figure 4-10 and described in Table 4-17.
R-0
15 1 0
Reserved C
R/W-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved C
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved I
R-0 R/SW-0
Legend: R = Read only; W = Write only; -n = value after reset; R/SW = Read/writable by the supervisor only
Table 4-20 below lists the memory attribute memory mapped control registers. The
shaded portion in the table indicates MAR registers that are read-only
Table 4-20 Memory Attribute Registers (Part 1 of 6)
Address Acronym Register Description Defines Attributes for. . .
0184 8000h MAR0 Memory Attribute Register 0 Local L2 RAM (fixed)
0184 8004h MAR1 Memory Attribute Register 1 0100 0000h - 01FF FFFFh
0184 8008h MAR2 Memory Attribute Register 2 0200 0000h - 02FF FFFFh
0184 800Ch MAR3 Memory Attribute Register 3 0300 0000h - 03FF FFFFh
0184 8010h MAR4 Memory Attribute Register 4 0400 0000h - 04FF FFFFh
0184 8014h MAR5 Memory Attribute Register 5 0500 0000h - 05FF FFFFh
0184 8018h MAR6 Memory Attribute Register 6 0600 0000h - 06FF FFFFh
0184 801Ch MAR7 Memory Attribute Register 7 0700 0000h - 07FF FFFFh
0184 8020h MAR8 Memory Attribute Register 8 0800 0000h - 08FF FFFFh
0184 8024h MAR9 Memory Attribute Register 9 0900 0000h - 09FF FFFFh
0184 8028h MAR10 Memory Attribute Register 10 0A00 0000h - 0AFF FFFFh
0184 802Ch MAR11 Memory Attribute Register 11 0B00 0000h - 0BFF FFFFh
0184 8030h MAR121 Memory Attribute Register 12 0C00 0000h - 0CFF FFFFh
0184 8034h MAR131 Memory Attribute Register 13 0D00 0000h - 0DFF FFFFh
0184 8038h MAR141 Memory Attribute Register 14 0E00 0000h - 0EFF FFFFh
0184 803Ch MAR151 Memory Attribute Register 15 0F00 0000h - 0FFF FFFFh
0184 8040h MAR16 Memory Attribute Register 16 1000 0000h - 10FF FFFFh
0184 8044h MAR17 Memory Attribute Register 17 1100 0000h - 11FF FFFFh
0184 8048h MAR18 Memory Attribute Register 18 1200 0000h - 12FF FFFFh
0184 804Ch MAR19 Memory Attribute Register 19 1300 0000h - 13FF FFFFh
0184 8050h MAR20 Memory Attribute Register 20 1400 0000h - 14FF FFFFh
0184 8054h MAR21 Memory Attribute Register 21 1500 0000h - 15FF FFFFh
0184 8058h MAR22 Memory Attribute Register 22 1600 0000h - 16FF FFFFh
0184 805Ch MAR23 Memory Attribute Register 23 1700 0000h - 17FF FFFFh
0184 8060h MAR24 Memory Attribute Register 24 1800 0000h - 18FF FFFFh
0184 8064h MAR25 Memory Attribute Register 25 1900 0000h - 19FF FFFFh
0184 8068h MAR26 Memory Attribute Register 26 1A00 0000h - 1AFF FFFFh
0184 806Ch MAR27 Memory Attribute Register 27 1B00 0000h - 1BFF FFFFh
0184 8070h MAR28 Memory Attribute Register 28 1C00 0000h - 1CFF FFFFh
0184 8074h MAR29 Memory Attribute Register 29 1D00 0000h - 1DFF FFFFh
0184 8078h MAR30 Memory Attribute Register 30 1E00 0000h - 1EFF FFFFh
0184 807Ch MAR31 Memory Attribute Register 31 1F00 0000h - 1FFF FFFFh
0184 8080h MAR32 Memory Attribute Register 32 2000 0000h - 20FF FFFFh
0184 8084h MAR33 Memory Attribute Register 33 2100 0000h - 21FF FFFFh
0184 8088h MAR34 Memory Attribute Register 34 2200 0000h - 22FF FFFFh
0184 808Ch MAR35 Memory Attribute Register 35 2300 0000h - 23FF FFFFh
0184 8090h MAR36 Memory Attribute Register 36 2400 0000h - 24FF FFFFh
0184 8094h MAR37 Memory Attribute Register 37 2500 0000h - 25FF FFFFh
0184 8098h MAR38 Memory Attribute Register 38 2600 0000h - 26FF FFFFh
0184 809Ch MAR39 Memory Attribute Register 39 2700 0000h - 27FF FFFFh
0184 80A0h MAR40 Memory Attribute Register 40 2800 0000h - 28FF FFFFh
0184 80A4h MAR41 Memory Attribute Register 41 2900 0000h - 29FF FFFFh
Legend: R = Read only; W = Write only; -n = value after reset; SRW = Read/writable by the supervisor only
While the L2 memory controller makes the “PC” field in the MAR registers visible to
the L1D memory controller, it does not make the “PFX” field visible to the L1D
memory controller.
To support MSMC, the L2 memory controller forces the MAR.PC bit corresponding to
the MSMC memory to 1 (always MAR12.PC through MAR15.PC). This makes the
MSMC memory always cacheable within L1D when accessed by its primary address
range. Secondary ranges may exist due to aliases configured with XMC’s MPAX
unit—these ranges are governed by their corresponding MAR.PC bits.
The L2 cache indicates to the XMC if a given line-fill was triggered by a L1P memory
controller or L1D memory controller request. This enables the prefetch buffer to apply
different filtering to each request.
Table 4-23 summarizes which L2 cache control registers are accessible according to
role.
Table 4-23 Permissions for L2 Cache Control Registers
Register Supervisor User
L2CFG R/W R
L2INV R/W R
L2WB R/W R/W
L2WBINV R/W R/W
L2WBAR/WC R/W R/W
L2WIBAR/WC R/W R/W
L2IBAR/WC R/W R/W
MARxx R/W R
4.5 L2 Power-Down
The C66x CorePac architecture provides several power-down features. Some features
are transparent. Others are controlled through software. The power-down features can
be divided into two groups: dynamic and static. Dynamic power-down features are
used at run-time for a limited period of time, whereas static power-down features are
used for a longer period of time when the DSP is in idle mode. These power-down
features are controlled through registers that are local to the specific module or part of
the power-down controller (PDC). Read Chapter 12 on page 12-1 prior to reading this
section in order to understand this section better.
The C66x CorePac stays in powered-down until awakened by the interrupt(s) enabled
in step 2, above.
If a DMA access occurs to the L1D, L1P, or L2 memory while the C66x CorePac is
powered-down, the PDC wakes all three memory controllers. When the DMA access
has been serviced, the PDC will again power-down the memory controllers.
See Chapter 12 on page 12-1 for more information about the PDCCMD register and
the power-down capabilities of the C66x CorePac.
4.6.1 Protection Checks on DSP, IDMA and Other System Master Accesses
Memory protection checks are performed for accesses that are serviced directly by the
L2 from L1P, L1D, IDMA, and other system masters on devices that include memory
protection support.
The L2 memory controller feature two exception outputs that are routed to the
C66x CorePac interrupt controller. One of these exception outputs indicates that a
DSP-triggered “local” memory exception (L2_CMPA) occurred. The other indicates
that a system master-triggered “remote” exception (L2_DMPA) occurred. It is
expected that most programs route the DSP-triggered exception input to the DSP’s
exception input and the system master triggered input to an interrupt input.
L2 does not perform protection checks on DSP reads that arrive in L2, regardless of
whether they hit or miss in L2. Reads ultimately return the access permissions to the
requestor, thereby deferring the check to L1D or L1P. In contrast, L2 checks all DSP
writes that hit L2, or that miss L2 and subsequently allocate a line in the L2 cache. L2
does not check permissions on non-cacheable writes that miss L2. Therefore, L2 checks
all DSP accesses that end at L2, and defers checks for other access to the controller (L1P,
L1D, or external peripheral) that ultimately services the access.
All system masters and IDMA accesses (reads and writes) to L2 memory are always
checked. System masters and IDMA accesses to addresses held in L2 cache are not
checked. L2 (or EMC) performs protection checks before issuing snoop-write
commands to L1D for addresses held in L1D cache.
The L2 controller determines whether a given request is allowed or not allowed based
on the privilege associated with the request, and the permission settings on the address
range that the request accesses. Chapter 10 on page 10-1 sets the exact rules for these
checks forth.
L2 asserts an exception and denies the request if a given request has insufficient
permission. Reads that are not allowed return garbage and writes that are not allowed
are killed before the underlying memory is written. The L2 only permission-checks
DSP writes that miss L2 if they are cacheable within L2 or later stages of the memory
system if they are not cacheable.
•
Memory Protection Fault (MPFxR) registers. Each peripheral that generates
memory protection faults provides MPFAR, MPFSR, and MPFCLR registers for
recording the details of the fault.
4.6.2.1 L2 Memory Protection Registers
Table 4-24 below lists the memory attribute registers.
Table 4-24 L2 Memory Protection Registers
Address Acronym Register Description Section
0184 A2xxh L2MPPAxx Level 2 Memory Protection Page Attribute Registers Section 4.6.2.2
0184 A000h L2MPFAR Level 2 Memory Protection Fault Address Register Section 4.6.2.4.1
0184 A004h L2MPFSR Level 2 Memory Protection Fault Set Register Section 4.6.2.4.2
0184 A008h L2MPFCR Level 2 Memory Protection Fault Clear Register Section 4.6.2.4.3
See the device-specific data manual to determine the page size and number of pages
used on a particular device.
Each page in L2 has 16 memory protection bits associated with it, as shown in
Figure 4-14. The default value of the protection bits in these 32 memory protection
pages is determined at reset. Table 4-27 illustrates the default configuration.
Reserved
R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R/W-config input
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 4-26 Memory Protection Page Attribute Registers (MPPAn) Field Descriptions (Part 1 of 2)
Bit Field Value Description
31-16 Reserved 0 Reserved
15 AID5 Controls access from ID = 5.
0 Access denied.
1 Access granted.
14 AID4 Controls access from ID = 4.
0 Access denied.
1 Access granted.
13 AID3 Controls access from ID = 3.
0 Access denied.
1 Access granted.
12 AID2 Controls access from ID = 2.
0 Access denied.
1 Access granted.
Table 4-26 Memory Protection Page Attribute Registers (MPPAn) Field Descriptions (Part 2 of 2)
Bit Field Value Description
11 AID1 Controls access from ID = 1.
0 Access denied.
1 Access granted.
10 AID0 Controls access from ID = 0.
0 Access denied.
1 Access granted.
9 AIDX Controls access from ID >= 6.
0 Access denied.
1 Access granted.
8 LOCAL Controls access from DSP to local memories (L1/L2)
0 Access denied.
1 Access granted.
7-6 Reserved 0 Reserved
5 SR Supervisor read access type.
0 Normal operation.
1 Indicates a supervisor read request.
4 SW Supervisor write access type.
0 Normal operation.
1 Indicates a supervisor write request.
3 SX Supervisor execute access type.
0 Normal operation.
1 Indicates a supervisor execute request.
2 UR User read access type.
0 Normal operation.
1 Indicates a user read request.
1 UW User write access type.
0 Normal operation.
1 Indicates a user write request.
0 UX User execute access type.
0 Normal operation.
1 Indicates a user execute request.
Fault Address
R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 4-29 Level 2 Memory Protection Fault Address Register (L2MPFAR) Field Descriptions
Bit Field Value Description
31-0 Fault Address 0-FFFF FFFFh Fault Address
R-0
15 9 8 7 6 5 4 3 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 4-30 Level 2 Memory Protection Fault Set Register (L2MPFSR) Field Descriptions
Bit Field Value Description
31-16 Reserved 0 Reserved
15-9 FID 0-7Fh Bit 6:0 of ID of faulting requestor. If ID is narrower than 7 bits, the remaining bits return 0. If ID is wider than 7 bits, the
additional bits get truncated.
FID = 0 if LOCAL = 1.
8 LOCAL 0 Normal operation.
1 Access was a "LOCAL" access
7-6 Reserved 0 Reserved
5 SR Supervisor read access type.
0 Normal operation.
1 Indicates a supervisor read request.
4 SW Supervisor write access type.
0 Normal operation.
1 Indicates a supervisor write request.
3 Reserved 0 Reserved
2 UR User read access type.
0 Normal operation.
1 Indicates a user read request.
1 UW User write access type.
0 Normal operation.
1 Indicates a user write request.
0 Reserved 0 Reserved
Reserved MPFCLR
R-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 4-31 Level 2 Memory Protection Fault Clear Register (L2MPFCLR) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved
0 MPFCLR Command to clear the L2MPFCR register.
0 No effect.
1 Clear the L2MPFAR and the L2MPFCR registers.
The memory access protection fault registers in Chapter 10 on page 10-1 defines the
definition and meanings of these registers.
The L2MPFAR and L2MPFSR registers only store enough information for one fault.
Generally, the hardware records the information about the first fault and generates an
exception only for that fault. L2 has a notion of “local” (DSP triggered) and “remote”
(system masters/IDMA triggered) faults. A “local” fault is allowed to replace a “remote”
fault and generate a new exception: this rule can be stated succinctly as: If the LOCAL
field of the MPFSR register = 0, and the pending exception sets it to 1, the hardware
records the new fault and signals the new exception.
The fault information is held until software clears it by writing a 1 to the MPFCLR field
in the L2MPFCR register. There is no effect if software writes a 0 to the MPFCLR field
in the L2MPFCR register. L2 ignores the value written to bits 1 through 31 L2MPFCR
register.
Table 4-32 summarizes which L2 memory protection registers are accessible by role
and what protection checks are performed in the C66x CorePac.
Table 4-32 Permissions for L2 Memory Protection Registers
Register Supervisor User
L2MPFAR R R
L2MPFSR R R
L2DMPFCR W /
L2DMPPAxx R/W R
When a MDMA bus error is detected, MDMAERREVT event is generated and the
error information is stored in the MDMAERR register. Future errors will be ignored
and will not generate MDMAERREVT event. Once the user clears the MDMAERR
register (by writing a ‘1’ to the MDMAERRCLR bit) future errors will be
recognized/latched and the MDMAERREVT error event will occur.
Here is an example when MDMAERREVT error can occur. The MPAX unit will report
memory protection violations on accesses to the programmed segments (based on the
access privilege settings in the XMPAXLn segment registers). If the incoming logical
address does not match any of the segments (but is within the MDMA space), the XMC
controller will consider this as an access with no permissions and report this back to the
L2 controller, which will flag it as the MDMAERREVT event and report it in the
MDMAERR register.
The MDMA bus error register (MDMAERR) is shown in Figure 4-18 and described in
Table 4-34.
Figure 4-18 MDMA Bus Error Register (MDMAERR)
31 29 28 16
ERR Reserved
R-0 R-0
15 12 11 8 7 3 2 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved CLR
R-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 4-35 MDMA Bus Error Clear Register (MDMAERRCLR) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved
0 CLR Clear register
0 Writes have no effect
1 Writing a 1 clears all bits in the MDMAERR register. Once an error is detected, the
MDMA bus error register must be cleared before additional errors can be detected and
stored.
5.1 Introduction
This section describes the purpose and features of the IDMA controller.
5.1.2 Features
The IDMA controller allows rapid data transfers between all local memories. It
provides a fast way to page code and data sections into any memory-mapped RAM
local to the C66x CorePac. The key advantage of the IDMA controller is that it allows
for transfers between slower (Level 2 - L2) and faster (Level 1 - L1D and L1P) memory.
IDMA can provide lower latency than the cache controller since the transfers take place
in the background of DSP operation, thereby removing stalls due to cache.
In summary:
• Optimized for burst transfers of memory blocks (contiguous data).
• Allows access to and from any local memory (L1P, L1D, L2 (pages 0 and 1), and
external CFG (but, source and destination cannot both be in CFG). CFG is only
accessible to channel 0. No CFG to CFG transfers.
• Indicates transfer completion through programmable interrupts to the DSP.
IDMA controller also provides the ability to do a block fill of memory, where the IDMA
controller issues a block of writes using a fill value that you program.
The operation of the IDMA is controlled through several registers. Table 5-1 provides
a summary of these registers. These registers are mentioned throughout this section
and are described in more detail in Section 5.4.
Table 5-1 IDMA Register Description
Register Description
IDMA0_STAT IDMA0 Status Register
IDMA0_MASK IDMA0 Mask Register
IDMA0_SOURCE IDMA0 Source Address Register
IDMA0_DEST IDMA0 Destination Address Register
IDMA0_COUNT IDMA0 Block Count Register
IDMA1_STAT IDMA1 Status Register
IDMA1_SOURCE IDMA1 Source Address Register
IDMA1_DEST IDMA1 Destination Address Register
IDMA1_COUNT IDMA1 Block Count Register
The external configuration space includes the peripheral registers located outside of the
C66x CorePac whereas the internal configuration space includes the registers located
inside of the C66x CorePac. Any register described in this document belongs to the
internal configuration space. For example, the registers that are used to control the level
1 data (L1D) cache are part of the internal configuration space. The internal
configuration space is only accessible by the DSP using direct load/store instructions.
IDMA channel 0 can only access the external configuration space. It accesses blocks of
32 contiguous registers at a time. To implement this, IDMA channel 0 has five registers:
status, mask, source address, destination address, and block count.
Define a block of 32 words that contain the values to initialize the CFG registers in a
local memory (L1P, L1D, and L2). Then, the IDMA channel 0 is programmed to
transfer these values to the CFG registers.
A mask register is provided since it is not always desirable to program all of the 32
contiguous locations. That is, some locations may be reserved and may not represent
actual registers; thus, you should not program them.
The mask register is a 32-bit register. Each bit in this register maps to one of the 32
words in the block that is going to be transferred. For example, bit 0 maps to word 0,
bit 1 maps to word 1, etc. If you set the mask bit to 1, then the corresponding word in
the block does not transfer.
Source Destination
address 0 1 4 5 6 address 0 1 4 5 6
8 10 12 8 10 12
22 23 22 23
27 29 31 27 29 31
On the first cycle of operation that the IDMA controller operation is stopped, an
exception is generated and any pending IDMA channel 0 requests are then processed.
An exception on IDMA channel 0 does not affect IDMA channel 1 in any way.
For each of the IDMA channels, one transfer can be active at any given time. The DSP
can update the parameters to queue a subsequent transfer; but, the transfer is not
initiated until the active transfer completes. This allows two transfers (active and
pending) to be outstanding from the DSP at any given time.
Example 5-2 shows how 32 QDMAs can be issued, modifying only the source address,
destination address, and options for each QDMA, as is possible in a video application.
See the EDMA documentation for more information about the QDMA.
the options field of the count register. Figure 5-2 shows a transfer using IDMA
channel 1.
Figure 5-2 IDMA Channel 1 Transaction
Source Destination
address address
1 1
2 2
3 3
4 4
5 5
... ...
For each of the IDMA channels, one transfer can be active at any given time. The DSP
can update the parameters to queue a subsequent transfer, but the transfer does not
initiate until the active transfer completes. This allows two transfers per channel to be
outstanding from the DSP at any given time.
This example depicts using the IDMA return output data at its location in memory and
to page in new data to fast memory for processing, as shown in Figure 5-3.
Figure 5-3 Example of IDMA Channel 1
L2
L1D 1 inBuff
inBuffFastA 4
Ping
outBuffFastA 2
3
inBuffFastB
Pong 6
outBuffFastB 5 outBuff
Each of the registers is accessible for read/write access by the DSP. Access to each of the
IDMA registers must be 32-bit aligned. Half word and byte writes to the IDMA
registers write the entire register, and thus you should avoid them for proper operation.
Nonaligned word and double word accesses result in unpredictable operation, and so
you should avoid them as well.
Reserved
R-0
15 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The IDMA channel 0 mask register (IDMA0_MASK) is shown in Figure 5-5 and
described in Table 5-4.
Figure 5-5 IDMA Channel 0 Mask Register (IDMA0_MASK)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
M31 M30 M29 M28 M27 M26 M25 M24 M23 M22 M21 M20 M19 M18 M17 M16
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
SOURCEADDR
R/W-0
15 5 4 0
SOURCEADDR Reserved
R/W-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 5-5 IDMA Channel 0 Source Address Register (IDMA0_SOURCE) Field Descriptions
Bit Field Value Description
31-5 SOURCEADDR 0-7FF FFFFh Source address. Must point to a 32-byte aligned (for example, block-aligned) memory location local to the
C66x CorePac or to a valid configuration register space.
4-0 Reserved 0 Reserved
DESTADDR
R/W-0
15 5 4 0
DESTADDR Reserved
R/W-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 5-6 IDMA Channel 0 Destination Address Register (IDMA0_DEST) Field Descriptions
Bit Field Value Description
31-5 DESTADDR 0-7FF FFFFh Destination address. Must point to a 32-byte (window) aligned memory location local to the C66x
CorePac or to a valid configuration register space.
4-0 Reserved 0 Reserved
The IDMA channel 0 count register (IDMA0_COUNT) is shown in Figure 5-8 and
described in Table 5-7.
Figure 5-8 IDMA Channel 0 Count Register (IDMA0_COUNT)
31 29 28 27 16
15 4 3 0
Reserved COUNT
R-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved
R-0
15 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
SOURCEADDR
R/W-0
15 0
SOURCEADDR
R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 5-9 IDMA Channel 1 Source Address Register (IDMA1_SOURCE) Field Descriptions
Bit Field Value Description
31-0 SOURCEADDR 0-FFFF FFFFh Source address. Must point to a word-aligned memory location local to the C66x CorePac. When
performing a block fill (FILL = 1 in IDMA1_COUNT), the source address is the fill value. Note that
when performing a fill mode transfer, all 32-bits of the SOURCEADDR field are used when performing a
memory transfer, the two LSBs are implemented as 00b.
R/W-0
15 2 1 0
DESTADDR Reserved
R/W-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 5-10 IDMA Channel 1 Destination Address Register (IDMA1_DEST) Field Descriptions
Bit Field Value Description
31-2 DESTADDR 0-3FFF FFFFh Destination address. Must point to a word-aligned memory location local to the C66x CorePac
1-0 Reserved 0 Reserved
The IDMA channel 1 count register (IDMA1_COUNT) is shown in Figure 5-12 5 and
described in Table 5-11.
Figure 5-12 IDMA Channel 1 Count Register (IDMA1_COUNT)
31 29 28 27 17 16
15 0
COUNT
R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
A transfer count of zero is a possible programming option. The IDMA engine handles
a count of zero by “completing” the transfer immediately (i.e., if the INT bit in the
IDMA1_COUNT register asserts IDMA_INT1 to the DSP even though no data
actually transfers). If a subsequent transfer is pending, it begins immediately.
6.1 Introduction
The external memory controller (EMC) is a bridge from the CorePac to the rest of the
device. It includes two ports:
• Configuration registers (CFG)—This port provides access to the
memory-mapped registers which control various peripherals and resources on
C66x devices.
Note—This port does not provide access to those control registers found within
the DSP or the CorePac.
• Slave DMA (SDMA)—The slave DMA provides access to resources inside the
C66x CorePac to system masters found outside the C66x CorePac such as DMA
controllers, SRIO, etc. That is, transfers initiated outside the C66x CorePac where
the C66x CorePac is the slave in the transaction.
Encodings 110b and 111b output ID numbers 6 and 7, respectively. The L1D memory
controller, L1P memory controller, and L2 memory controller endpoints interpret both
as AIDX in the C66x CorePac.
At power up, PAMAP0 through PAMAP7 contain the values 0 through 7, respectively.
PAMAP8 through 15 all contain the value 7. This makes C66x CorePac behave
identically to C64x+ for PrivIDs >= 6.
The CFG bus error register (ECFGERR) is shown in Figure 6-1 and described in
Table 6-4.
Figure 6-1 CFG Bus Error Register (ECFGERR)
31 29 28 16
ERR Reserved
R-0 R-0
15 12 11 8 7 3 2 0
Reserved XID Reserved STAT
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R-0
15 1 0
Reserved CLR
R-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 6-5 CFG Bus Error Clear Register (ECFGERRCLR) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved
0 CLR Clear register
0 Writes have no effect
1 Writing a 1 clears all bits in the ECFGERR register. Once an error is detected, the CFG
bus error register must be cleared before additional errors can be detected and stored.
7.1 Introduction
The Extended Memory Controller (XMC) serves as the L2 memory controller’s
MDMA path to the MSMC. XMC has three additional responsibilities: Memory
protection, Address extension, and Prefetch.
Memory protection and address extension are provided together in a unit called
MPAX. The MPAX defines 16 segments of runtime-selectable size that project C66x
CorePac’s 32-bit address space into a larger 36-bit address space. In addition, each
segment has a corresponding set of permissions to control accesses to that segment.
The two together provide a convenient mechanism for multiple DSPs to cooperate in a
large shared memory. The memory protection scheme is also designed to coordinate
with other memory protection units and firewalls that may be in the system.
Prefetch support in XMC aims to reduce the read miss penalty for streams of data
entering C66x CorePac. Hence prefetching helps to reduce stall cycles and thereby
improves memory read performance to MSMC RAM and EMIF.
The XMC handles all reads and writes in this address range itself and does not present
these accesses to the outside world. The XMC also performs all protection checks
associated with these accesses, separately of the segment-based protection MPAX
provides, although it uses MPAX’s protection fault registers to report faults related to
its memory-mapped registers. The XMC reports protection faults (MDMAERREVT
event) for invalid accesses to implemented registers as well as accesses to
unimplemented address space.
The MPAX combines memory protection and address extension into one unified
process. The memory protection step determines what types of accesses are permitted
on various address ranges within C66x CorePac’s 32-bit address map. The address
extension step projects those accesses onto a larger 36-bit address space.
Address Nomenclature In this document, C66x CorePac 32-bit addresses are written in hexadecimal as
2345_ABCD. 36-bit system addresses are written in hexadecimal as 1:2345_ABCD.
RADDR PERM
Section 7.3.1.3 ‘‘MPAX Register Reset Defaults’’ on page 7-7 provides details about the
MPAX register power up state.
The PERM field is divided into various single-bit subfields. Figure 7-3 ‘‘MPAXL.PERM
Subfield Layout’’ shows the layout of this field, and Table 7-3 ‘‘Summary of Permission
Bits in MPAXL.PERM’’ summarizes the meaning of each bit.
The MPAX range registers can describe segment sizes from 4GB down to 4KB using the
“SEGSZ” field. The following table describes the encoding.
Table 7-4 MPAXH.SEGSZ Segment Size Encoding
SEGSZ Meaning SEGSZ Meaning SEGSZ Meaning SEGSZ Meaning
00000b Seg. disabled 01000b Rsvd (Disabled) 10000b 128KB 11000b 32MB
00001b Rsvd (Disabled) 01001b Rsvd (Disabled) 10001b 256KB 11001b 64MB
00010b Rsvd (Disabled) 01010b Rsvd (Disabled) 10010b 512KB 11010b 128MB
00011b Rsvd (Disabled) 01011b 4KB 10011b 1MB 11011b 256MB
00100b Rsvd (Disabled) 01100b 8KB 10100b 2MB 11100b 512MB
00101b Rsvd (Disabled) 01101b 16KB 10101b 4MB 11101b 1GB
00110b Rsvd (Disabled) 01110b 32KB 10110b 8MB 11110b 2GB
00111b Rsvd (Disabled) 01111b 64KB 10111b 16MB 11111b 4GB
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
RADDR PERM
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The XMC configures MPAX segments 0 and 1 so that C66x CorePac can access system
memory. The power up configuration is that segment 1 remaps 8000_0000 –
FFFF_FFFF in C66x CorePac’s address space to 8:0000_0000 – 8:7FFF_FFFF in the
system address map. This corresponds to the first 2GB of address space dedicated to
EMIF by the MSMC controller.
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
RADDR PERM
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
8:8000_0000
FFFF_FFFF Segment 15 Disabled 8:7FFF_FFFF
Segment 14 Disabled
Segment 13 Disabled
Segment 12 Disabled
Segment 11 Disabled 8:0000_0000
7:FFFF_FFFF
Segment 10 Disabled
Segment 9 Disabled Upper 60GB
8000_0000
7FFF_FFFF Segment 8 Disabled
Segment 7 Disabled
Segment 6 Disabled
Segment 5 Disabled
Segment 4 Disabled 1:0000_0000
0C00_0000 Segment 3 Disabled 0:FFFF_FFFF
0BFF_FFFF Segment 2 Disabled
(not remappable )
0000_0000 Segment 1 BADDR = 80000h; RADDR = 800000h; Size = 2GB
C66x CorePac Logical Segment 0 BADDR = 00000h; RADDR = 000000h; Size = 2GB Lower 4GB
32-bit Memory Map
0:8000_0000
0:7FFF_FFFF
0:0C00_0000
0:0BFF_FFFF
0:0000_0000
System Physical
36-bit Memory Map
A logical address resides within a given MPAX segment if its upper address bits match
the corresponding bits in the BADDR field. The number of bits compared is a function
of the SEGSZ. Examples: For 32KB segments, all 17 bits of the BADDR field must
match the upper 17 bits of the C66x CorePac address. For 16MB segments, the upper 8
bits of the BADDR field must match the upper 8 bits of the C66x CorePac address; the
remaining bits are ignored. For 4GB segments, no BADDR bits are consulted and all
addresses match.
From L2 Memory
......
Request Address [31:12]
Controller request
...... Mask
Significant Bit Mask[19:0]
......
Generator
For example, a single 4GB segment in segment 0 (the lowest priority segment) can
describe default permissions and address extension for all accesses, while higher
numbered segments can modify these defaults for specific address ranges.In
Figure 7-12, segment 1 matches 8000_0000 through FFFF_FFFF, and segment 2
matches C000_7000 through C000_7FFF. Because segment 2 is higher priority than
segment 1, its settings take priority, effectively carving a 4K hole in segment 1’s 2GB
address space.
0:0C00_0000
0:0BFF_FFFF
0:0000_0000
To establish default permissions (and a default address extension) for the entire
memory map, use a low numbered segment, such as MPAX segment 0, with a large
segment size. Addresses that do not match other segments will “fall through” and
match this one.
This allows moving ranges of addresses around within MSMC RAM, but it prohibits
moving portions of MSMC RAM address space to different endpoints. C66x CorePac
expects accesses in the address range to go to MSMC RAM, and uses this information
to place the request on a “Fast RAM” path, eliminating a cycle of latency.
Thus, the cacheability of each alias can be controlled independently. This even applies
to MSMC RAM: By making an alias of MSMC RAM at some other address, its
cacheability becomes controlled by the corresponding MAR bits as well, rather than the
default semantic applied to MSMC RAM when accessed at 0C00_0000 – 0C1F_FFFF.
Accesses to MSMC RAM via this alias do not use the “Fast RAM” path and incur an
additional cycle of latency.
Aliases provide a general mechanism for offering different semantics to a given address
range. The following scenarios are applicable:
Table 7-6 MSMC RAM Aliasing Scenarios
Cacheable in
Scenario L1D L1P1 L2 Use Case
MSMC RAM at native address Yes Yes No Shared program and data (coherency managed by software)
(0C00_0000 – 0C1F_FFFF)
MSMC RAM at alias; MAR.PC set to 1 Yes Yes Yes “Private” program/data in MSMC RAM
MSMC RAM at alias; MAR.PC set to 0 No Yes No “Coherent” shared memory in MSMC RAM (coherent because nothing is cached)
1. L1P always caches program fetches when L1PCFG.L1PMODE > 0 and L1PCC.OPER = 0.
FFFF_FFFF
0:0C1F_FFFF
0:0C00_0000
21xx_xxxx MSMC RAM Alias 2
20xx_xxxx MSMC RAM Alias 1
To access these system addresses, C66x CorePac must configure one or more of its
MPAX segments with a RADDR that corresponds to this range. This enables C66x
CorePac to access this address range through some other logical address window.
XMC’s own registers at 0800_0000 – 0800_FFFF are not accessible by any alias. XMC
captures these accesses before MPAX modifies the address.
Fault Address
R +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Figure 7-15 Memory Protection Fault Status and Command Registers—(XMPFSR 0800_0204)
31 9 8 7 6 5 0
R +0 R +0 R +0 R +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Figure 7-16 Memory Protection Fault Status and Command Registers—(XMPFCR 0800_0208)
31 1 0
Reserved MPFCLR
R +0 W +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The XMPFAR and XMPFSR registers store only enough information for one fault.
Generally, the hardware records the information about the first fault and generates an
exception for that fault only.
The XMC holds the fault information until software clears it by writing to 1 to
XMPFCR.MPFCLR. XMC does nothing if software writes 0 to XMPFCR.MPFCLR.
The XMC ignores the value written to bits 31:1 of XMPFCR. Programs, however,
should write 0s to these bits.
Data requests from L1D and L2 are serviced by the 8 entry data prefetch buffer.
Program requests from L1P and L2 are serviced by the 4 entry program prefetch buffer.
The following sections detail how the data prefetch buffer detects streams with its
stream detection filter, and generate prefetch requests once streams are detected.
7.5.1.1 Capacity
The data prefetch buffer contains 8 slots, each holding 128 bytes of data. Each slot has
two 64-byte half-slots that XMC tracks separately. The entire slot is allocated as a single
unit, although prefetch data and hits are tracked separately for the two halves.
In addition to the prefetch buffer, XMC implements stream detection filter built
around a 12-address candidate buffer. This filter stores 12 potential stream head
addresses as logical addresses, along with a single bit to indicate the predicted stream
direction associated with that slot.
Thus, in the prefetch buffer, slot #0 gets used first, followed by slot #1, on up to slot #7.
The count then wraps back to slot #0. Allocation in the stream detection filter’s
candidate buffer proceeds similarly, starting at slot #0, counting to slot #11, and then
wrapping back to slot #0.
The data prefetch buffer prevents a busy slot from getting reused until that slot becomes
unbusy by stalling the allocation request as long as needed. A slot is busy if there is a hit
pending resolution on that slot. This includes a hit that is waiting for a prefetch to
return from the system, as well as a hit that is waiting to return its data to CorePac.
Demand fetches that meet this criteria are compared against the existing entries in the
candidate buffer. L1D requests are compared at 64 byte granularity, whereas L2
requests are compared at 128 byte granularity. What happens next depends on whether
the demand fetch matches an entry in the candidate buffer.
All new streams start while crossing a 128 byte (L1D stream) or 256 byte (L2 stream)
boundary. This property is most important for L1D streams, as it guarantees that the
first two prefetches for the stream always correspond to the two half-slots of a single
slot.
7.5.2.1 Capacity
The prefetch buffer is organized as 4 slots containing 32 bytes (one fetch packet) each.
The program prefetch buffer does not include a stream filter. Instead, it merely assumes
programs fetch in the forward direction. It also only tracks one active program stream.
Each slot has two 32-byte data buffers associated with it, structured as a form of
double-buffer. The prefetch buffer can reallocate a slot immediately if at least one of its
two halves is not busy.
Consider, for example, a double buffer in MSMC. Give it two halves, ping and pong,
with pong appearing after ping in memory. DSP0 writes to the buffer and DSP1 reads
from it, and the two synchronize via an interrupt. Now consider the following series of
events:
1. DSP0 writes 1024 bytes to “ping.”
2. DSP0 interrupts DSP1.
3. DSP1 reads 1024 bytes from “ping.” This triggers the prefetch buffer to read an
additional 128 bytes beyond “ping” and into “pong.”
4. DSP0 writes 1024 bytes to “pong.”
5. DSP0 interrupts DSP1.
6. DSP1 reads 1024 bytes from “pong.”
W W W W W
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The XPFCMD register provides multiple independent command inputs. Each of the
command inputs is independent of the others. Writing 1 to a command input triggers
the corresponding command. Writing 0 has no effect. Thus, one can invalidate the
prefetch buffers without disturbing anything else by writing 1 to XPFCMD.INV and 0
to the other bits. It is legal therefore to write 1 to more than one command bit. For
example, writing 11111b will invalidate the prefetch buffer, load a new Analysis
Counter Enable (ACEN) and reset the analysis counters in a single command write.
Because XPFCMD is not readable, programs can issue a read to XPFACS or any other
readable register in XMC after writing XPFCMD to ensure that XMC has received and
processed the write.
For more information on the analysis counters, see ‘‘Prefetch Buffer Performance
Analysis Registers’’ below. For more information about prefetch buffer coherence
issues and the role of XPFCMD.INV, see Section 7.5.3 ‘‘Prefetch Coherence
Issues—Example’’ on page 7-16.
R, +0 R, +0 R, +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R, +0 R, +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R, +0 R, +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved HIT
R, +0 R, +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved MISS
R, +0 R, +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The data and program prefetch buffers each generate four different events associated
with these counters. Each event corresponds to a single 32-byte dataphase of traffic.
Therefore, events associated with L1D and L2 requests appear to count by 2s.
Table 7-9 Analysis Event Descriptions
Event Counter Description
SENT XPFAC0 A generated prefetch is being sent into the system.
CANCELED XPFAC1 A previously sent prefetch returned with a non-zero status or other error.
HIT XPFAC2 Prefetchable demand fetch received its data from a successful prefetch.
MISS XPFAC3 Prefetchable demand fetch is being sent into the system as a demand fetch.
The counters are each 20 bits wide. This provides for a minimum of 2ms counting
interval for a device operating at 1GHz, assuming XMC manages to keep its CLK/2 data
interface saturated. All four counters halt when any one of XPFAC0 through XPFAC3
reaches 000F_FFFF. This allows one to determine the relative values of all four events
even if the counters were not polled and reset frequently enough.
One can derive a number of useful values from the analysis count totals:
Table 7-11 Values Derivable from Prefetch Analysis Counters
Quantity Corresponding Expression
Total prefetchable demand fetches HIT + MISS
Total valid prefetches SENT - CANCELED
Total bandwidth used SENT - CANCELED + MISS
Wasted bandwidth (unused prefetches) SENT - CANCELED - HIT
Bandwidth amplification (relative %) 100% * ((SENT - CANCELED - HIT) / (HIT + MISS))
Hit rate (%) 100% * (HIT / (HIT + MISS))
Cancel rate (%) 100% * (CANCELED / SENT)
Figure 7-23 shows the layout of these registers. Table 7-12 describes the fields in this
register. Table 7-13 lists the address map for these registers.
Figure 7-23 Prefetch Buffer Address Visibility Register Layout—XPFADDRn (0800_04xx)
31 7 6 5 4 3 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R, +0 RW, +7 R, +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 7-14 XMC MDMA Arbitration Control Register (MDMAARBX) Field Descriptions
Bit Field Value Description
31-19 Reserved 0 Reserved
18-16 PRI 0-7h Priority field
0 Priority 0 (highest)
1h Priority 1
2h Priority 2
3h Priority 3
4h Priority 4
5h Priority 5
6h Priority 6
7h Priority 7 (lowest)
15-0 Reserved 0 Reserved
8.1 Introduction
8.1.1 Purpose of the Bandwidth Management
The purpose of the bandwidth management is to assure that some of the requestors do
not block the resources that are available in the C66x CorePac for extended periods of
time.
Similar to the memory protection capability of the C66x DSP, bandwidth management
(BWM) is defined globally (for the entire C66x CorePac), but implemented locally by
each C66x CorePac resource. To this end, initializing bandwidth management consists
of programming a common set of registers found in each of the C66x CorePac's
resources.
Highest Priority 0
Priority 1
Priority 2
Priority 3
Priority 4
Priority 5
Priority 6
Priority 7
Lowest Priority 8
When multiple requestors contend for a single resource, granting access to the highest
priority requestor solves the conflict. When the contention occurs for multiple
successive cycles, a contention counter guarantees that the lower priority requestor gets
access to the resource every 1 out of n arbitration cycles, where n is programmable by
the MAXWAIT bit (described in Section 8.3).
The BWM works by incrementing a contention counter every time a resource request
is blocked. When a request is allowed to proceed, the stall count resets to 0. When the
stall count reaches the MAXWAIT value, then the lower priority requestor’s value sets
to -1 and is allowed to perform at least one transfer. (The contention counter is not
visible to you).
Table 8-3 shows no arbitration registers for L1P. Indeed, there are no
programmable-bandwidth management registers for the L1P; however, there are
fixed-bandwidth management features in the L1P controller.
Notice that there are a set of arbitration registers for each resource. Each register
corresponds to a different requestor.
The arbitration registers that belong to the same group (DSP, IDMA, SDMA, UC) have
identical default values. They are generalized in Table 8-3 by calling the CPUARB,
IDMAARB, SDMAARB, and UCARB registers.
Table 8-3 Arbitration Register Default Values
Register Bit Default Value Register Exists In...
Acronym Register Name PRI MAXWAIT L1P L1D L2 EMC
CPUARB DSP Arbitration Control Register 1 16 No Yes Yes Yes
IDMAARB IDMA Arbitration Control Register NA 16 No Yes Yes Yes
SDMAARB Slave DMA Arbitration Control Register NA 1 No Yes Yes Yes
UCARB User Coherence Arbitration Control Register NA 32 No Yes Yes No
MDMAARB Master DMA Arbitration Control Register 7 NA No No Yes No
ECFGARBE CFG Arbitration Control Register 7 NA No No No Yes
The default values of CPUARB, IDMAARB, SDMAARB, and UCARB are sufficient for
most applications. These registers define priorities that are internal to the
C66x CorePac. The MDMAARBU register defines priority for MDMA transactions
outside of the C66x CorePac. You may need to change its priority by programming the
MDMAARBU register (as described in Section 8.3.5), depending on the system design.
In most cases, MDMARBU should be programmed to a higher priority (lower value).
The ECFGARBE register defines priority for configuration bus transactions from
EMC.
Both program and data requests use CPUARB values to define the maximum wait time
(MAXWAIT) and priority (PRI). CPUARB values do not only have an affect local to
L1P or L1D. The priority/maximum wait time applied to L1D/L1P cache transactions
is programmed at each block. These values are used to control arbitration at each
relevant access within the C66x CorePac.
Similar to L1D/L1P (via CPUARBD), memory accesses made directly in L2 and EMC
blocks (via the CPUARBU and CPUARBE registers, respectively) use the PRI and
MAXWAIT field values locally for those blocks, and any further transactions resulting
from these requests.
The default value of PRI is set so that the DSP transactions are the second to highest in
the system. This should be a relatively typical value used in most systems, resulting
in the DSP receiving highest priority most of the time, but, a short-real time deadline
peripheral, such as a high speed serial port (that is typically programmed as the
highest-priority transfer for SDMA requests) can interrupt the DSP transfers on a
nearly immediate basis.
The DSP priority is run-time programmable, although you are expected to initialize the
CPUARB registers at system initialization or accept the default values and leave them
unchanged thereafter.
Figure 8-1 DSP Arbitration Control Register (CPUARBD, CPUARBU, CPUARBE)
31 19 18 16
Reserved PRI
R-0 R/W-1h
15 6 5 0
Reserved MAXWAIT
R-0 R/W-10h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
User coherency operations are broken into two types. They are listed with their fixed
priorities relative to other requests in the system:
• Global user coherence is always the highest priority.
• Block-oriented coherence is always the lowest priority.
Since the user coherence priority is fixed the UCARB register does not include a
priority (PRI) bit. Since the global user coherence operations are inherently highest
priority, the MAXWAIT programmability does not apply to global cache operations
and only applies to block-oriented user coherence operations. Block-oriented user
coherency cache operations can affect both L1D and L2 memories; therefore, a version
of the UCARB only exists only in the L2 (UCARBU) and L1D (UCARBD) registers.
The MAXWAIT bit (and the implied priorities) does not control the priority of
coherency operations that result from DMA transactions or DSP transactions, which
have their own registers.
Reserved MAXWAIT
R-0 R/W-20h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 8-5 User Coherence Arbitration Control Register (UCARBD, UCARBU) Field Descriptions
Bit Field Value Description
31-6 Reserved 0 Reserved
5-0 MAXWAIT 0-3Fh Maximum wait time in EMC cycles. EMC cycle = 2 DSP cycle.
0 Always stalls due to a higher priority requestor
1h Maximum wait of 1 cycle (1/2 = 50% access)
2h Maximum wait of 2 cycles (1/3 = 33% access)
3h Reserved
4h Maximum wait of 4 cycles (1/5 = 20% access)
5h-7h Reserved
8h Maximum wait of 8 cycles (1/9 = 11% access)
9h-Fh Reserved
10h Maximum wait of 16 cycles (1/17 = 6% access)
11h-1Fh Reserved
20h Maximum wait of 32 cycles (1/33 = 3% access)
21h-3Fh Reserved
Use the MAXWAIT field to determine the maximum wait time for IDMA transactions.
The priority level is not programmed using the IDMAARB register; therefore, the
IDMAARB register does not include a PRI field. Instead, the priority level is
programmed as part of the IDMA transfer parameters (that is, directly using the IDMA
control registers, described in Chapter 5 on page 5-1). In summary, the IDMA transfer
priority is as follows:
• IDMA channel 0 is always the highest priority.
• IDMA channel 1 has a programmable priority using the PRI field in the IDMA
channel 1 count register (IDMA1_COUNT).
IDMA transactions can affect L1D, L2, and EMC resources; therefore, the MAXWAIT
field exists for each of these resources: L1D (IDMAARBD), L2 (IDMAARBU), and
EMC (IDMAARBE).
Reserved MAXWAIT
R-0 R/W-10h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 8-6 IDMA Arbitration Control Register (IDMAARBD, IDMAARBU, IDMAARBE) Field Descriptions
Bit Field Value Description
31-6 Reserved 0 Reserved
5-0 MAXWAIT 0-3Fh Maximum wait time in EMC cycles. EMC cycle = 2 DSP cycle.
0 Always stalls due to higher priority requestor.
1h Maximum wait of 1 cycle (1/2 = 50% access)
2h Maximum wait of 2 cycles (1/3 = 33% access)
3h Reserved
4h Maximum wait of 4 cycles (1/5 = 20% access)
5h-7h Reserved
8h Maximum wait of 8 cycles (1/9 = 11% access)
9h-Fh Reserved
10h Maximum wait of 16 cycles (1/17 = 6% access)
11h-1Fh Reserved
20h Maximum wait of 32 cycles (1/33 = 3% access)
21h-3Fh Reserved
The SDMA can support multiple active transfers at any point in time. The MAXWAIT
field controls the maximum wait time for all slave DMA transaction. The priority level
is not programmed using SDMAARB; therefore, SDMAARB does not include a PRI
field. The system master dictates the priority level instead. Since priority settings
outside the C66x CorePac are DMA/chip/peripheral specific, see the device-specific
documentation for the priority allocation information.
SDMA transactions can affect L1D, L2, and EMC resources; therefore, the MAXWAIT
field exists for L1D (SDMAARBD), L2 (SDMAARBU), and EMC (SDMAARBE).
Reserved MAXWAIT
R-0 R/W-01h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 8-7 Slave DMA Arbitration Control Register ((SDMAARBD, SDMAARBU, SDMARBE) Field Descriptions
Bit Field Value Description
31-6 Reserved 0 Reserved
5-0 MAXWAIT 0-3Fh Maximum wait time in EMC cycles. EMC cycle = 2 DSP cycle.
0 Always stalls due to higher priority requestor
1h Maximum wait of 1 cycle (1/2 = 50% access)
2h Maximum wait of 2 cycles (1/3 = 33% access)
3h Reserved
4h Maximum wait of 4 cycles (1/5 = 20% access)
5h-7h Reserved
8h Maximum wait of 8 cycles (1/9 = 11% access)
9h-Fh Reserved
10h Maximum wait of 16 cycles (1/17 = 6% access)
11h-1Fh Reserved
20h Maximum wait of 32 cycles (1/33 = 3% access)
21h-3Fh Reserved
The master DMA arbitration control register (MDMAARBU) is shown in Figure 8-5
and described in Table 8-8.
Figure 8-5 Master DMA Arbitration Control Register (MDMAARBU)
31 27 26 24 23 19 18 16
Reserved UPRI Reserved PRI
15 0
Reserved
R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 8-8 Master DMA Arbitration Control Register (MDMAARBU) Field Descriptions
Bit Field Value Description
31-27 Reserved 0 Reserved
26-24 UPRI 0-7h Urgent priority field. This field must be either equal or lesser than PRI field.
0 Priority 0 (highest)
1h Priority 1
2h Priority 2
3h Priority 3
4h Priority 4
5h Priority 5
6h Priority 6
7h Priority 7 (lowest)
23-19 Reserved 0 Reserved
18-16 PRI 0-7h Normal priority field. This field must be either equal or greater than UPRI field.
Not all requestors support PRI = 8 (lowest), this is used to make background transfers lower than all other real-time
requests.
0 Priority 0 (highest)
1h Priority 1
2h Priority 2
3h Priority 3
4h Priority 4
5h Priority 5
6h Priority 6
7h Priority 7 (lowest)
15-0 Reserved 0 Reserved
When sending requests external to CorePac, L2 memory controller picks one of two
priority values to send to XMC. For normal-priority requests, it uses the value of
MDMAARBU.PRI. For urgent-priority requests, it uses the value of
MDMAARBU.UPRI. Most L2 memory controller requests to XMC are not urgent.
Only the following request types are urgent requests:
The CFG arbitration control register (ECFGARBE) is shown in Figure 8-5 and
described in Table 8-8.
Figure 8-6 CFG Arbitration Control Register (ECFGARBE)
31 19 18 16
Reserved PRI
R-0 R/W-7h
15 0
Reserved
R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Interrupt Controller
9.1 Introduction
This section describes the purpose and features of the interrupt controller.
While you can use many of these same system events to drive other peripherals, such
as the EDMA, the C66x CorePac’s interrupt controller is dedicated to managing the
DSP.
9.1.2 Features
The interrupt controller interfaces the system events to the DSP’s interrupt and
exceptions inputs. The interrupt controller supports up to 128 system events.
There are 128 system events that act as inputs to the interrupt controller. They consist
of both internally-generated events (within the C66x CorePac) and chip-level events.
The list of events are enumerated later in Section 9.3. In addition to these 128 events,
the INTC register also receives the non-maskable and reset events and routes straight
through to the DSP.
The interrupt controller outputs various signals to the C66x DSP from these event
inputs:
• One maskable, hardware exception (EXCEP)
• Twelve maskable hardware interrupts (INT4 through INT15)
• One non-maskable signal that you can use as either an interrupt or an exception
(NMI)
• One reset signal (RESET)
For more information on these DSP interrupt/exception signals, see the C66x DSP and
Instruction Set Reference Guide (SPRUGH7) in ‘‘Related Documentation from Texas
Instruments’’ on page ø-xx.
The interrupt controller includes the following modules to facilitate the routing of
events to interrupts and exceptions:
• Interrupt Selector - routes any of the system events to the 12 maskable interrupts
• Event Combiner - reduces the large number of system events down to four
• Exception Combiner - lets any of the system events be grouped together for the
single hardware exception input
RESET RESET
Exception EXCEP
combiner
NMEVT NMI
Event IACK
Event
combiner
flags
EVT[3:0] INUM[4:0]
Interrupt
INT[15:4]
selector
EVT[127:4]
IDROP
INTERR IDROP[15:4]
mask
AEG
AEG event (Advanced
selector Event
Generator)
See Appendix A on page A-1 and Appendix B on page B-1 of this document for
additional definitions of the terms used in this chapter. Appendix A on page A-1
describes general terms used throughout this reference guide and Appendix B on
page B-1 defines terms related to the memory and cache architecture.
The event flag registers capture all system events that are received by the Interrupt
Controller. There are four 32-bit registers to cover the 124 system event inputs. Each
system event is mapped to a specific flag bit (EFxx) in one of the event flag registers.
EF EF EF EF EF EF EF EF EF EF EF EF EF EF EF EF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EF EF EF EF EF EF EF EF EF EF EF EF EF EF EF EF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
All 124 system events are individually mapped to a bit of the four 32-bit EVTFLAGx
registers. This leaves the least significant four bits of EVTFLAG0 (EF03:EF00) not
associated with a system event. These four bits are reserved and always zero. That is,
there are no system event inputs that correspond to these fields. Instead, the system
events associated with events 00 through 03 are generated internal (to the Interrupt
Controller) by the Event Combiner, which are routed to the Interrupt Selector, as
shown in Figure 9-1.
The event flags (EFxx) are latched register bits; that is, they retain the value of 1 for any
event received. The EVTFLAGx registers are read-only and must be cleared through
the write-only Event Clear registers EVTCLR[3:0].
Use the event clear registers to clear the event flag registers. There are four 32-bit event
clear registers. The fields of these registers map one-to-one with the fields of the event
flag registers. Writing a 1 to a specific field in an event clear register causes the
corresponding event flag register field to clear.
EC EC EC EC EC EC EC EC EC EC EC EC EC EC EC EC
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EC EC EC EC EC EC EC EC EC EC EC EC EC EC EC EC
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The event set registers are conceptually similar to the event clear registers. Use the
event set registers to manually set any bit(s) within the event flag registers (e.g., it may
be beneficial to use the event set registers to generate interrupts when testing interrupt
service routines). There are four 32-bit event set registers whose fields map one-to-one
to the fields of the event flag registers. Writing a 1 to a specific field in an event set
register causes the corresponding event flag register to set to 1.
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ES ES ES ES ES ES ES ES ES ES ES ES ES ES ES ES
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The interrupt controller uses the event clear and event set registers, rather than writing
directly to the event flag registers to prevent potential race conditions. Without these
additional registers, the DSP might have otherwise accidentally cleared event flags set
during a read-modify-write operation of the flag bits.
If a new event is received during the same cycle, a clear is specified via an EVTCLRx
register, the new event input takes precedence as an additional precaution against
missing events.
The event combiner divides the 124 system events into four groups. The first group
includes events 4 through 31, the second group includes events 32 through 63, the third
group includes events 64 through 95, and the fourth group includes events 96 through
127. You can combine events within each group to provide a new “combined” event.
These new events are designated EVT0, EVT1, EVT2, and EVT3. These events are
routed to the interrupt selector along with the original 124 system events for a
combined total of 128 events.
The general structure of the event mask register is shown in Figure 9-6.
Figure 9-6 Event Mask Register Structure
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EM EM EM EM EM EM EM EM EM EM EM EM EM EM EM EM
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EM EM EM EM EM EM EM EM EM EM EM EM EM EM EM EM
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The event mask bits within the event mask registers act to enable/mask which received
system events should be combined. The register is zero by default, thus all system
events are unmasked and combined to form the associated EVTx. To mask out an event
source (e.g., disable an event from being combined) the corresponding mask bit must
be set to 1. Note that the event mask bits for events 0 through 3 are reserved, and are
always masked.
The structure of the masked event flag register is shown in Figure 9-7.
Figure 9-7 32-Masked Event Flag Register Structure
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The content of the masked event flag registers is identical to the content of the event
flag registers for the events that are enabled in the event mask registers. By reading the
masked event flag registers, the DSP only sees the event flags pertaining to the
corresponding combined event (EVT [3:0]), which can be useful in interrupt routines
servicing combined events.
Example 9-2 Event Flag
This procedure only evaluates and clears those events combined on EVTx. Further, any
events that are masked in the EVTMASKx register are not be cleared (and they do not
need to clear), even if they are set in the EVTFLAGx register (this allows you to use
them to generate an exception).
Note—The DSP should iterate steps 1 to 4 until no pending events are found
before returning within the interrupt service routine. This ensures that any
events that are received during the interrupt service routine are captured (also
remember that if an event EVTx is received at the same time that its flag is
cleared in the EVTCLRy [x] register, then it will not clear).
EVT0 CPUINT4
EVT1 CPUINT5
CPUINT6
CPUINT7
CPUINT8
Interrupt CPUINT9
selector
CPUINT10
CPUINT11
CPUINT12
CPUINT13
EVT126 CPUINT14
EVT127 CPUINT15
The 128 system events are either event inputs or event combinations generated by the
event combiner. The event combiner logic has the capability of grouping multiple event
inputs to four possible event outputs. These outputs are then provided to the interrupt
selector and treated as additional system events (EVT0 through EVT3).
The event combiner allows for a flexible interrupt routing scheme in addition to the
interrupt selector. This flexibility of the INTC module allows a large number of system
interrupts to be serviced within the C66x CorePac. It also allows a large number of
interrupts to be simultaneously serviced within a DSP, thus increasing interrupt
efficiency.
Figure 9-9 DSP Interrupt Routing Diagram
Event Event
flags combiner
EVT[3:0]
EVT[127:4]
Interrupt
selector INT[15:4]
The order of the DSP interrupts (DSPINT4 through DSPINT15) determines the
priority for pending interrupts. Since any interrupt service routine can be atomic (not
nestable), the DSP interrupt priority only applies to pending interrupts. For more
information regarding the DSP's interrupt features, see the C66x DSP and Instruction
Since the interrupt drop detection logic is within the DSP, only interrupts that are
sourced from a single system event can be detected. The dropping of interrupts based
on combined events can only indicate that one or more of the interrupts in that group
caused the error.
When the DSP detects the dropped error condition, it passes the information back to
the interrupt controller’s interrupt exception status register (INTXSTAT) which
records the dropped interrupt’s number and asserts a system event. This register is
described in Section 9.5.3.2.
Interrupt controller
Event Event
flags combiner
EVT[3:0]
EVT[96]
Interrupt INT[15:4]
selector
IDROP IDROP[15:4]
INTERR
mask
The INTERR event is output from the interrupt controller and is internally routed back
to the system event EVT96, as shown in Figure 9-10.
As INTXERR can only hold a single dropped DSP ID, only the first dropped interrupt
detected is reported by INTERR (EVT96). The interrupt exception status is cleared
through the exception clear register (INTXCLR), which is comprised of only a single
clear bit. Writing a 1 to the CLEAR field in the INTXCLR register resets the INTXSTAT
register to 0. A new IDROPx event can only be detected after the status is cleared by the
hardware.
When servicing the dropped interrupt error event, the service routine should:
1. Read the INTXSTAT register.
To prevent one or more DSP interrupts from generating dropped interrupt errors,
ignore them by programming the dropped interrupt mask register (INTDMASK).
The exception combiner allows the system designer to select a subset of the system
event flags in which to perform an OR operation to determine the EXCEP value.
A block diagram showing the routing of system exceptions through the exception
combiner is shown in Figure 9-11.
Figure 9-11 System Exception Routing Diagram
RESET RESET
Exception
EXCEP
EVT[127:4] selector
NMEVT NMI
Note—Reset and NMI are also shown in this diagram. In fact, when exceptions
are enabled within the C66x DSP, the NMI signal is used as a non-maskable
exception input. These two signals are combined within the DSP along with a
variety of other DSP exceptions. For more information on DSP exceptions, see
the C66x DSP and Instruction Set Reference Guide (SPRUGH7) in ‘‘Related
Documentation from Texas Instruments’’ on page ø-xx.
To allow only a subset of system events to generate an exception to the DSP, the
exception combiner provides a set of four mask registers, EXPMASK[3:0] which are
used to disable the events that are not desired. Since there is only one exception input
to the DSP, all mask registers work in concert to combine up to 128 events to a single
EXCEP output. This allows the DSP to service all available system exceptions.
The general structure of the exception mask register is provided in Figure 9-12:
Figure 9-12 Exception Mask Register Structure
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
XM XM XM XM XM XM XM XM XM XM XM XM XM XM XM XM
R/W-FFFFh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XM XM XM XM XM XM XM XM XM XM XM XM XM XM XM XM
R/W-FFFFh
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The default value of the EXPMASKx registers are all 1s. This means that all events are
masked; therefore, no system events generate an exception unless you program this
register.
Similar to the event combiner discussed in Section 9.2.2, the exception combiner
provides a set of masked exception flags (MEXPFLAGx) in combination with the
exception mask registers. The masked exception flag registers provide a masked view
of the event flag registers (from Section 9.2.1). By reading the masked exception flag
registers, the only DSP sees the event flags pertaining to the DSP’s EXCEP input.
The general structure of the masked exception flag registers is shown in Figure 9-13.
Figure 9-13 Masked Exception Flag Register Structure
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF MXF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The DSP should run an exception service routine to determine the cause of the
exception and respond to the appropriate events upon receiving an exception. When
servicing exceptions, the service routine must first determine whether the exception
was generated internal to the DSP, by the non-maskable exception, or by the EXCEP
signal.
If EXCEP was found to be the cause of the exception, the routine should read the
masked exception flag registers (MEXPFLAG [3:0]) to determine which unmasked
events triggered the exception.
Therefore, all unmasked event flags must clear before the DSP can recognize a new low
to high transition on EXCEP.
Note—The events that are shown as available events are to the C66x CorePac
for chip-level events. Therefore, each new C66x device can use these event
inputs as necessary. See the device-specific data manual for more information
about how these available events are used.
The twelve interrupt signals are reflected in the DSP’s interrupt flag register (IFR), as
shown in Figure 9-14.
Figure 9-14 DSP Event Routing Diagram
CPU
NMI
NMEVT
EVT4
NXF EXF Reserved IXF SXF EFR
EVT5
Event Event
EVT6 flags combiner 31 30 29 2 1 0
INT4
INT5
INT6
INT7
INT8
Interrupt INT9
selector INT10
INT11
INT12
EVT126
INT13
EVT127
INT14
INT15
IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF IF
Reserved 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 IFR
31 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
You must enable interrupts in order for the DSP to recognize them. The DSP requires
individual enables via the interrupt enable register (IER) and via the global interrupt
enable field in the interrupt task register (ITSR.GIE).
Also note that the exception signal (EXCEP) is recorded in the DSP’s exception flag
register (EFR) in Figure 9-15. You must enable exception before the exception flag
registers (EFR) shown can be recognized. Exception recognition is disabled after device
reset for ease of system design and for backward compatibility. You can turn on
exceptions by setting the global exceptions enable field (GEE) in the ITSR register
(ITSR). You should enable exceptions prior to enabling any interrupts to ensure that an
NMI is not received while its mode (exception vs. interrupt) is changing.
When system exceptions are not enabled in the DSP, the non-maskable interrupt
(NMI) acts as an interrupt and when received will post a flag to the BIT1 field in the IFR
register. When system exceptions are enabled in the DSP; however, this flag is not set.
Rather, the exception source is identified in the exception flag register (EFR) to denote
whether the source is NMI, EXCEP, an internal exception, or a software exception
(SWE/SWENR).
All NMI processing shares the NMI interrupt vector, regardless of whether you are
using it as an interrupt or it represents an exception. The DSP only uses its REP register
as a vector as opposed to the NMI vector in the case where the SWENR generates an
exception rather than SWE instruction.
For more detailed information, see the C66x DSP and Instruction Set Reference Guide
(SPRUGH7) in ‘‘Related Documentation from Texas Instruments’’ on page ø-xx.
However, you must use event flags within an interrupt service routine or an exception
service routine when servicing combined system events. These flags are used to
determine the event(s) that initiated an interrupt or exception. In other words, the
DSP’s interrupt flag register (or exception flag register) tell the DSP a combined event
has occurred, then the service routine must use the event flag register to determine the
exact cause(s).
It is also important to note that within the service routine, the appropriate event flag
register bits must be cleared by software in order to receive a subsequent event. If the
event flag(s) does not clear, then a new system event will not be recognized. The new
system event cannot be recognized as a dropped interrupt. This is because the DSP
dropped interrupt logic applies to the DSP interrupt input (not the interrupt controller
event input). Since the events are combined in the Interrupt Controller, the DSP has no
visibility here.
In many systems, it may be tempting to have the service routine read, then clear the
entire event flag register (EVTFLAGx). While this can work fine for some systems, you
must take care that some of the event flags are not being polled by any of the system’s
code. If a particular event must be polled (read occasionally by some code within the
system rather than allowing that event to interrupt the DSP), then indiscriminately
clearing all of the event flag bits may cause unexpected results.
9.5 Registers
The C66x CorePac interrupt controller registers are listed in Table 9-3.
Table 9-3 Interrupt Controller Registers
Address Acronym Register Description Section
0180 0000h to 0180 000Ch EVTFLAG0 Event flag register 0 Section 9.5.1.1
EVTFLAG1 Event flag register 1 Section 9.5.1.1
EVTFLAG2 Event flag register 2 Section 9.5.1.1
EVTFLAG3 Event flag register 3 Section 9.5.1.1
0180 0020h to 0180 002Ch EVTSET0 Event set register 0 Section 9.5.1.2
EVTSET1 Event set register 1 Section 9.5.1.2
EVTSET2 Event set register 2 Section 9.5.1.2
EVTSET3 Event set register 3 Section 9.5.1.2
0180 0040h to 0180 004Ch EVTCLR0 Event clear register 0 Section 9.5.1.3
EVTCLR1 Event clear register 1 Section 9.5.1.3
EVTCLR2 Event clear register 2 Section 9.5.1.3
EVTCLR3 Event clear register 3 Section 9.5.1.3
0180 0080h to 0180 008Ch EVTMASK0 Event mask register 0 Section 9.5.2.1
EVTMASK1 Event mask register 1 Section 9.5.2.1
EVTMASK2 Event mask register 2 Section 9.5.2.1
EVTMASK3 Event mask register 3 Section 9.5.2.1
0180 00A0h to 0180 00ACh MEVTFLAG0 Masked event flag register 0 Section 9.5.2.2
MEVTFLAG1 Masked event flag register 1 Section 9.5.2.2
MEVTFLAG2 Masked event flag register 2 Section 9.5.2.2
MEVTFLAG3 Masked event flag register 3 Section 9.5.2.2
0180 0104h to 0180 010Ch INTMUX1 Interrupt mux register 1 Section 9.5.3.1
INTMUX2 Interrupt mux register 2 Section 9.5.3.1
INTMUX3 Interrupt mux register 3 Section 9.5.3.1
0181 0140h AEGMUX0 Advanced event generator mux register 0 Section 9.5.5
0181 0144h AEGMUX1 Advanced event generator mux register 1 Section 9.5.5
0180 0180h INTXSTAT Interrupt exception status register Section 9.5.3.2
0180 0184h INTXCLR Interrupt exception clear register Section 9.5.3.3
0180 0188h INTDMASK Dropped interrupt mask register Section 9.5.3.4
0180 00C0h to 0180 00CCh EXPMASK0 Exception Mask register 0 Section 9.5.4.1
EXPMASK1 Exception Mask register 1 Section 9.5.4.1
EXPMASK2 Exception Mask register 2 Section 9.5.4.1
EXPMASK3 Exception Mask register 3 Section 9.5.4.1
0180 00E0h to 0180 00ECh MEXPFLAG0 Masked Exception Flag register 0 Section 9.5.4.2
MEXPFLAG1 Masked Exception Flag register 1 Section 9.5.4.2
MEXPFLAG2 Masked Exception Flag register 2 Section 9.5.4.2
MEXPFLAG3 Masked Exception Flag register 3 Section 9.5.4.2
End of Table 9-3
Note—Event flag bits 0 through 3 are reserved and are always 0. There are no
events corresponding to these fields that get routed to the event flag register.
EF31 EF30 EF29 EF28 EF27 EF26 EF25 EF24 EF23 EF22 EF21 EF20 EF19 EF18 EF17 EF16
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EF15 EF14 EF13 EF12 EF11 EF10 EF9 EF8 EF7 EF6 EF5 EF4 EF3 EF2 EF1 EF0
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EF47 EF46 EF45 EF44 EF43 EF42 EF41 EF40 EF39 EF38 EF37 EF36 EF35 EF34 EF33 EF32
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
EF95 EF94 EF93 EF92 EF91 EF90 EF89 EF88 EF87 EF86 EF85 EF84 EF83 EF82 EF81 EF80
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EF79 EF78 EF77 EF76 EF75 EF74 EF73 EF72 EF71 EF70 EF69 EF68 EF67 EF66 EF65 EF64
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
EF127 EF126 EF125 EF124 EF123 EF122 EF121 EF120 EF119 EF118 EF117 EF116 EF115 EF114 EF113 EF112
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EF111 EF110 EF109 EF108 EF107 EF106 EF105 EF104 EF103 EF102 EF101 EF100 EF99 EF98 EF97 EF96
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The event set registers (EVTSETn) are shown in Figure 9-19 through Figure 9-22 and
described in Table 9-5.
Figure 9-19 Event Set Register 0 (EVTSET0)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
ES31 ES30 ES29 ES28 ES27 ES26 ES25 ES24 ES23 ES22 ES21 ES20 ES19 ES18 ES17 ES16
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ES15 ES14 ES13 ES12 ES11 ES10 ES9 ES8 ES7 ES6 ES5 ES4 ES3 ES2 ES1 ES0
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
ES63 ES62 ES61 ES60 ES59 ES58 ES57 ES56 ES55 ES54 ES53 ES52 ES51 ES50 ES49 ES48
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ES47 ES46 ES45 ES44 ES43 ES42 ES41 ES40 ES39 ES38 ES37 ES36 ES35 ES34 ES33 ES32
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
ES95 ES94 ES93 ES92 ES91 ES90 ES89 ES88 ES87 ES86 ES85 ES84 ES83 ES82 ES81 ES80
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ES79 ES78 ES77 ES76 ES75 ES74 ES73 ES72 ES71 ES70 ES69 ES68 ES67 ES66 ES65 ES64
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
ES127 ES126 ES125 ES124 ES123 ES122 ES121 ES120 ES119 ES118 ES117 ES116 ES115 ES114 ES113 ES112
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ES111 ES110 ES109 ES108 ES107 ES106 ES105 ES104 ES103 ES102 ES101 ES100 ES99 ES98 ES97 ES96
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The event clear registers (EVTCLRn) are shown in Figure 9-23 through Figure 9-26
and described in Table 9-6.
Figure 9-23 Event Clear Register 0 (EVTCLR0)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EC31 EC30 EC29 EC28 EC27 EC26 EC25 EC24 EC23 EC22 EC21 EC20 EC19 EC18 EC17 EC16
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EC15 EC14 EC13 EC12 EC11 EC10 EC9 EC8 EC7 EC6 EC5 EC4 EC3 EC2 EC1 EC0
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after rECet; -x, value is indeterminate — see the device-specific data manual
EC63 EC62 EC61 EC60 EC59 EC58 EC57 EC56 EC55 EC54 EC53 EC52 EC51 EC50 EC49 EC48
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EC47 EC46 EC45 EC44 EC43 EC42 EC41 EC40 EC39 EC38 EC37 EC36 EC35 EC34 EC33 EC32
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
EC95 EC94 EC93 EC92 EC91 EC90 EC89 EC88 EC87 EC86 EC85 EC84 EC83 EC82 EC81 EC80
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EC79 EC78 EC77 EC76 EC75 EC74 EC73 EC72 EC71 EC70 EC69 EC68 EC67 EC66 EC65 EC64
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EC111 EC110 EC109 EC108 EC107 EC106 EC105 EC104 EC103 EC102 EC101 EC100 EC99 EC98 EC97 EC96
W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The event mask registers are shown below (Bits EM [3:0] are unused).
The event mask registers (EVTMASKn) are shown in Figure 9-27 through Figure 9-30
and described in Table 9-7.
Figure 9-27 Event Mask Register 0 (EVTMASK0)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
EM31 EM30 EM29 EM28 EM27 EM26 EM25 EM24 EM23 EM22 EM21 EM20 EM19 EM18 EM17 EM16
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EM15 EM14 EM13 EM12 EM11 EM10 EM9 EM8 EM7 EM6 EM5 EM4 EM3 EM2 EM1 EM0
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R-1 R-1 R-1 R-1
Legend: R = Read only; W = Write only; -n = value after rECet; -x, value is indeterminate — see the device-specific data manual
EM63 EM62 EM61 EM60 EM59 EM58 EM57 EM56 EM55 EM54 EM53 EM52 EM51 EM50 EM49 EM48
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EM47 EM46 EM45 EM44 EM43 EM42 EM41 EM40 EM39 EM38 EM37 EM36 EM35 EM34 EM33 EM32
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
EM95 EM94 EM93 EM92 EM91 EM90 EM89 EM88 EM87 EM86 EM85 EM84 EM83 EM82 EM81 EM80
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EM79 EM78 EM77 EM76 EM75 EM74 EM73 EM72 EM71 EM70 EM69 EM68 EM67 EM66 EM65 EM64
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
EM127 EM126 EM125 EM124 EM123 EM122 EM121 EM120 EM119 EM118 EM117 EM116 EM115 EM114 EM113 EM112
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EM111 EM110 EM109 EM108 EM107 EM106 EM105 EM104 EM103 EM102 EM101 EM100 EM99 EM98 EM97 EM96
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The masked event flag registers (MEVTFLAGn) are shown in Figure 9-31 through
Figure 9-34 and described in Table 9-8.
Figure 9-31 Masked Event Flag Register 0 (MEVTFLAG0)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF MEF
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The interrupt mux registers are shown in Figure 9-35 through Figure 9-37 and
described in Table 9-9.
Figure 9-35 Interrupt Mux Register 1 (INTMUX1)
31 30 24 23 22 16
15 14 8 7 6 0
15 14 8 7 6 0
15 14 8 7 6 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The interrupt exception status register (INTXSTAT) is shown in Figure 9-38 and
described in Table 9-10.
Figure 9-38 Interrupt Exception Status Register (INTXSTAT)
31 24 23 16
SYSINT DSPINT
R-0 R-0
15 1 0
Reserved DROP
R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The interrupt exception clear register is shown in Figure 9-39 and described in
Table 9-11.
Figure 9-39 Interrupt Exception Clear Register (INTXCLR)
31 1 0
Reserved CLEAR
R-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The dropped interrupt mask register (INTDMASK) is shown in Figure 9-40 and
described in Table 9-12.
Figure 9-40 Dropped Interrupt Mask Register (INTDMASK)
31 16
Reserved
R-0
15 14 13 12 11 10 9 8 7 6 5 4 3 0
IDM15 IDM14 IDM13 IDM12 IDM11 IDM10 IDM9 IDM8 IDM7 IDM6 IDM5 IDM4 Reserved
R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Note—The exception masks for events 0 through 3 are reserved and always
masked.
The exception combiner mask register (EXPMASKn) is shown in Figure 9-41 through
Figure 9-44 and described in Table 9-13.
Figure 9-41 Exception Combiner Mask Register 0 (EXPMASK0)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
XM31 XM30 XM29 XM28 XM27 XM26 XM25 XM24 XM23 XM22 XM21 XM20 XM19 XM18 XM17 XM16
R/W-FFFFh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XM15 XM14 XM13 XM12 XM11 XM10 XM9 XM8 XM7 XM6 XM5 XM4 XM3 XM2 XM1 XM0
R/W-FFFFh
Legend: R = Read only; W = Write only; -n = value after rECet; -x, value is indeterminate — see the device-specific data manual
XM63 XM62 XM61 XM60 XM59 XM58 XM57 XM56 XM55 XM54 XM53 XM52 XM51 XM50 XM49 XM48
R/W-FFFFh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XM47 XM46 XM45 XM44 XM43 XM42 XM41 XM40 XM39 XM38 XM37 XM36 XM35 XM34 XM33 XM32
R/W-FFFFh
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
XM95 XM94 XM93 XM92 XM91 XM90 XM89 XM88 XM87 XM86 XM85 XM84 XM83 XM82 XM81 XM80
R/W-FFFFh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XM79 XM78 XM77 XM76 XM75 XM74 XM73 XM72 XM71 XM70 XM69 XM68 XM67 XM66 XM65 XM64
R/W-FFFFh
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R/W-FFFFh
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XM111 XM110 XM109 XM108 XM107 XM106 XM105 XM104 XM103 XM102 XM101 XM100 XM99 XM98 XM97 XM96
R/W-FFFFh
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The masked exception flag registers (MEXPFLAGn) are shown in Figure 9-45 through
Figure 9-48 and described in Table 9-14.
Figure 9-45 Masked Exception Flag Register 0 (MEXPFLAG0)
31 30 29 28 27 26 25 24
23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 8
7 6 5 4 3 2 1 0
23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 8
MXF47 MXF46 MXF45 MXF44 MXF43 MXF42 MXF41 MXF40
7 6 5 4 3 2 1 0
23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 8
7 6 5 4 3 2 1 0
23 22 21 20 19 18 17 16
15 14 13 12 11 10 9 8
MXF111 MXF110 MXF109 MXF108 MXF107 MXF106 MXF105 MXF104
7 6 5 4 3 2 1 0
The AEGMUX registers are similar to the interrupt selector registers, in that the event
to be passed on is simply encoded into a selector bitfield. The encoded value selects
between the available system events (EVT[127:4], combined system events (EVT[3:0],
the DSP interrupts (DSPINT[15:4], any interrupt acknowledge (IACK), and exception
acknowledge (EACK). The combined events (EVT[3:0] are available and are set as the
default events.
The advanced event generator mux registers are shown in Figure 9-49 through
Figure 9-50 and described in Table 9-15.
Figure 9-49 Advanced Event Generator Mux Register 0 (AEGMUX0)
31 24 23 16
AEGSEL3 AEGSEL2
R/W-3h R/W-2h
15 8 7 0
AEGSEL1 AEGSEL0
R/W-1h R/W-0h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
AEGSEL7 AEGSEL6
R/W-7h R/W-6h
15 8 7 0
AEGSEL5 AEGSEL4
R/W-5h R/W-4h
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 9-15 Advanced Event Generator Mux Registers (AEGMUXn) Field Descriptions
Bit Field Value Description
31-0 AEGSELn 0-FFh Advanced event generator (AEG) select.
0-7Fh EVT [127:0]: System events 0 to 127
80-BFh Reserved
C0h EXCEP: DSP Exception
C1h NMI: Non-maskable DSP interrupt
C2-C3h Reserved
C4-CFh DSPINT [15:4]: DSP interrupts
D0-DFh Reserved
E0h IACK: Interrupt acknowledge (for any interrupt)
E1h EACK: Exception acknowledge
E2-E3h Reserved
E4-EFh IACK [15:4]: Interrupt acknowledge for specific DSP interrupts
F0-FFh Reserved
Table 9-16 summarizes which interrupt controller registers are accessible according to
role.
Table 9-16 Permissions for Interrupt Controller Registers
Register Supervisor User
EVTFLAGx R R
EVTCLRx W R
EVTSETx W R
EVTMASKx R/W R
MEVTFLAGx R R
EXPMASKx R/W R
MEXPFLAGx R R
INTMUXx R/W R
AEGMUXx R/W R
INTSTAT R R
INTXCLR W R
INTDMASK R/W R
Memory Protection
10.1 Introduction
10.1.1 Purpose of the Memory Protection
Memory protection provides many benefits to a system. Memory protection
functionality can:
• Protect operating system data structures from poorly behaving code.
• Aid in debugging by providing greater information about illegal memory
accesses.
• Allow the operating system to enforce clearly defined boundaries between
supervisor and user mode accesses, leading to greater system robustness.
The C66x CorePac memory protection architecture provides these benefits through a
combination of DSP privilege levels and a memory system permission structure.
Code running on the DSP executes in one of two privilege modes: supervisor mode or
user mode. Supervisor code is considered more trusted than user code. Examples of
supervisor threads include operating system kernels and hardware device drivers.
Examples of user threads include vocoders and end applications.
Supervisor mode is generally granted access to peripheral registers and the memory
protection configuration. User mode is generally confined to the memory spaces that
the OS specifically designates for its use.
DSP accesses as well as internal DMA and other accesses have a privilege level
associated with them. The DSP privilege level is determined as described above. The
Internal DMA accesses that are initiated by the DSP inherit the DSP's privilege level at
the time they are initiated.
Memories typically have power-of-2 page sizes. The sizes of the L1 and the L2 memory
pages are specific to the device. See the device-specific data sheet for more information.
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Figure 10-2 illustrates and Table 10-1 describes the allowed IDs bit field.
Figure 10-2 Allowed IDs Bit Fields
15 14 13 12 11 10 9 8
The above ID assignments for bits AID0 through AID5 apply to all IDMA and DSP
memory accesses other than to the DSP's local L1 and L2 memories. The LOCAL bit
governs DSP accesses to its own local L1 and L2 memories. The AIDX bit maps to IDs
that do not have dedicated AID bits associated with them.
10.2.2.2 Request-Type Based Permissions
The memory protection model defines three fundamental functional access types: read,
write, and execute. Read and write refer to data accesses— accesses originating via the
load/store units on the DSP or via the IDMA engine. Execute refers to accesses
associated with program fetch.
The memory protection model allows controlling read, write, and execute permissions
independently for both user and supervisor mode. This results in 6 permission bits,
shown in Table 10-2.
Table 10-2 Request Type Access Controls
Bit Field Description
5 SR Supervisor may read
4 SW Supervisor may write
3 SX Supervisor may execute
2 UR User may read
1 UW User may write
0 UX User may execute
For each bit, a 1 permits the access type, and a 0 denies it. Thus UX = 1 means that User
Mode may execute from the given page. The memory protection architecture allows
you to specify all six of these bits separately. 64 different encodings are permitted
altogether, although programs might not use all of them.
Invalid accesses are those memory accesses which require greater permissions than
those specified for the page or register involved. The following sections cover the
behavior of the memory protection in the presence of invalid accesses.
The peripherals that implement the MMRs govern accesses to those MMRs. The
MMRs fall into three main categories:
• Memory Protection Page Attribute (MPPA) Registers: These registers store the
permissions associated with each protected page. These are defined in
Section 10.3.1.
• Memory Protection Fault (MPFxR) Registers: Each peripheral that generates
memory protection faults provides MPFAR, MPFSR, and MPFCR registers for
recording the details of the fault. These are defined in Section 10.3.2 and
Section 10.3.2.1.
• Memory Protection Lock (MPLK) Registers: When engaged, the lock disables all
updates to the memory protection entries for that peripheral. The MPLK register
is defined in Section 10.3.3.
• Because each memory implements its own memory protection registers, see the
device-specific data manual for more information about the memory map.
Table 10-3 lists the memory-mapped registers for the memory protection architecture.
See the device-specific data manual for the memory address of these registers.
Table 10-3 Memory Protection Architecture Registers
Acronym Register Description Section
MPPA Memory Protection Page Attribute Section 10.3.1
MPFAR Memory Protection Fault Address Register Section 10.3.2
MPFSR Memory Protection Fault Status Register Section 10.3.2
MPFCR Memory Protection Fault Command Register Section 10.3.2
MPLK Memory Protection Lock Registers Section 10.3.3
Each MPPA register occupies 32 bits in the memory map, but only 16 of these bits are
used. Section 10.2.2 describes the layout and definition of the MPPA register fields.
The C66x memory protection architecture (MPA) specifies three registers: memory
protection fault address register (MPFAR), memory protection fault status register
(MPFSR), and memory protection fault command register (MPFCR).
Memories that implement the memory protection architecture, but cannot generate
exceptions, do not implement these registers.
The hardware records the address of the fault in the memory's memory protection fault
address register (MPFAR). It records the rest of the information regarding the fault in
the memory's memory protection fault status register (MPFSR). Software can write to
the memory protection fault command register (MPFCR) to clear the fault.
R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 10-4 Memory Protection Fault Address Register (MPFAR) Field Descriptions
Bit Field Value Description
31-0 Faulting Address 0-FFFF FFFFh Address of the fault.
Reserved
R-0
15 9 8 7 6 5 4 3 2 1 0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 10-5 Memory Protection Fault Status Register (MPFSR) Field Descriptions
Bit Field Value Description
31-16 Reserved 0 Reserved.
15-9 FID 1Fh Bits 6:0 ID of faulting requestor. If ID is narrower than 7 bits, the remaining bits return 0. If ID is wider than 7 bits, the
additional bits are truncated. FID = 0 if LOCAL = 1.
8 LOCAL 0-1 Access was a "LOCAL" access.
7-6 Reserved 0 Reserved.
5 SR 0-1 When set, indicates a supervisor read request.
4 SW 0-1 When set, indicates a supervisor write request.
3 SX 0-1 When set, indicates a supervisor program fetch request.
2 UR 0-1 When set, indicates a user read request.
1 UW 0-1 When set, indicates a user write request.
0 UX 0-1 When set, indicates a user program fetch request.
R-0 W-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 10-6 Memory Protection Fault Command Register (MPFCR) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved.
0 MPFCLR Command to clear the L1DMPFAR register.
0 No effect.
1 Clear the L1DMPFAR and the L1DMPFCR registers.
MPFAR records the address of the protection violation. MPFSR records the access type,
in a register formatted similarly to the memory protection page attribute register.
The MPFCLR register includes a single command bit for clearing the MPFAR and the
MPFCLR registers.
Caches generate two special access types (line fills and writebacks) that are distinct
from normal functional accesses. The protection hardware indicates faults on cache
writebacks by encoding special patterns into the access type fields.
• Faulting victim writeback sets SW = UW = 1.
You can decode a memory protection fault as follows using this scheme in software:
• If the LOCAL field is set, the request was a local DSP request to its own memories.
Otherwise, the ID of the faulting requestor is in bits 9 through 15 of the fault
status register.
• The value of the access type field (SR, SW, SX, UR, UW, and UX) indicates the
type of access that was at fault, as shown in Table 10-7.
Table 10-7 Interpretation of MPFSR Access Type Field
SR SW SX UR UW UX Meaning
1 0 0 0 0 0 Fault due to supervisor read
0 1 0 0 0 0 Fault due to supervisor write
0 0 1 0 0 0 Fault due to supervisor program fetch
0 0 0 1 0 0 Fault due to user read
0 0 0 0 1 0 Fault due to user write
0 0 0 0 0 1 Fault due to user program fetch
0 1 0 0 1 0 Fault due to cache victim writeback
Others Reserved—may be defined by endpoint
The cache victim writeback code will be reported by XMC when a victim fails its MPAX
check.
Each memory protection block captures its own memory protection fault information.
Thus, each potential memory protection exception source has an associated
MPFAR/MPFSR/MPFCR register set.
The MPFAR and MPFSR registers only store information for one fault. As a result of
the fault, an exception is generated. The fault information is held until software clears
it by writing to MPFCR.
The supervisor clears the recorded fault by writing a 1 to the MPFCLR (bit 0) in the
MPFCR register. Writing a 1 to this bit clears both the MPFAR and the MPFSR
registers. The MPFAR and MPFCR registers do not respond to writes. After the
supervisor clears the fault, the hardware records the next protection violation and
signals an exception when it occurs. Writing a 1 to any other bit of the MPFCR register
has no effect on the memory protection registers. Writing a 0 to the MPFCLR field in
the MPFCR register also has no effect.
The various distinct memory protection blocks do not directly coordinate with each
other. Therefore, a single invalid memory access may generate multiple exceptions in
different blocks before a DSP acknowledges even the first exception. Nonetheless, each
individual memory generates no more than one exception until the DSP clears that
memory's MPFAR and MPFSR registers.
Devices that implement hardware locks on their protection entries implement the six
registers shown in Figure 10-6 through Figure 10-11.
The memory protection lock registers are shown in Figure 10-6 through Figure 10-10
and described in Table 10-9.
Table 10-8 Memory Protection Lock Registers
Address Acronym Register Description Section
0184 AD00h MPLK0 Memory Protection Lock Register 0 Figure 10-6
0184 AD04h MPLK1 Memory Protection Lock Register 1 Figure 10-7
0184 AD08h MPLK2 Memory Protection Lock Register 2 Figure 10-8
0184 AD0Ch MPLK3 Memory Protection Lock Register 3 Figure 10-9
0184 AD10h MPLKCMD Memory Protection Lock Command Register Section 10.3.3.1
0184 AD14h MPLKSTAT Memory Protection Lock Status Register Section 10.3.3.2
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
W-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 10-9 Memory Protection Lock Command Register (MPLKCMD) Field Descriptions
Bit Field Value Description
31-3 Reserved 0 Reserved.
2 KEYR Reset status.
0 No effect.
1 Reset status.
1 LOCK Interface to complete a lock sequence.
0 No effect.
1 Locks the lock provided that the software executed the sequence correctly.
0 UNLOCK Interface to complete an unlock sequence.
0 No effect.
1 Unlocks the lock provided that software executed the sequence correctly.
Reserved LK
R-0 R-0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 10-10 Memory Protection Lock Status Register (MPLKSTAT) Field Descriptions
Bit Field Value Description
31-1 Reserved 0 Reserved
0 LK Indicates the lock's current status.
0 Lock is disengaged.
1 Lock is engaged.
The lock may exist in one of two states: locked or unlocked. Reset places the lock in the
unlocked state via the LK field in the MPLKSTAT register.
Software may engage the lock as long as the lock is currently unlocked. To engage the
lock, the application must perform the following steps exactly:
1. Write a 1 to the KEYR field of the MPLKCMD register. This resets the internal
status for the MPLK0 through MPLK3 registers.
2. Write the key to MPLK0 through MPLK3. All four registers must be written
exactly once. They may be written in any order.
3. Write a 1 to the LOCK field of the MPLKCMD register. This engages the lock.
If programs follow this sequence, the memory protection hardware engages the lock.
The hardware performs the following actions when it engages the lock:
• Sets the LK field of the MPLKSTAT register to 1.
• Establishes the written key (or some subset) as the “unlock” key
• Blocks future writes to all MPPA and MPCFG registers for this memory
Software executes a sequence similar to the locking sequence to unlock the peripheral's
protection registers when they are currently locked:
1. Write a 1 to the KEYR field in the MPLKCMD register. This resets some internal
status for the MPLK0 through the MPLK3 registers.
2. Write the unlock key to MPLK0 through the MPLK3 registers. The hardware
compares the written value with the stored key value. Software must write to all
four registers exactly once. The writes can arrive in any order.
3. Write a 1 to the UNLOCK field in the MPLKCMD register. If the key written in
step 2 matches the stored key, the hardware disengages the lock. If the key written
in step 2 does not match, the hardware signals an exception. The hardware
reports the fault address as the address of the MPLKCMD register.
11.1 Overview
This section describes the Error Detection and Correction (EDC) mechanism of C66x
CorePac L1P and L2 memories. The primary purpose of this feature is to protect the
program code and static data which are not frequently changed. The EDC logic
generates the parity using trees of XOR gates. Errors can be detected by checking the
computed parity against the separately stored parity. The parity bit and valid bit (parity
bit qualifier) is stored in the parity RAM for each memory write. Generated parity
errors can be detected/corrected by Error Detection and Correction logic and an
interrupt/exception is provided for extra processing by system code.
The L1P error detection and L2 error detection and correction mechanisms are
described in the following sections.
Only one kind of parity error can persist at a time. An event will be sent to the DSP
whether the error is a program fetch parity error or a DMA read parity error. The DSP
reacts accordingly (typically invalidate or refetch from L1P memory).
Figure 11-1 illustrates how the computed parities, stored parities and valid bits affect
the outcome of the parity check in the case of program fetches.
Computed Parity[0]
Valid[1]
Computed Parity[1]
Valid[2]
Computed Parity[2]
Valid[3]
Computed Parity[3]
R +0 R +0 R +0 R +0 R +0 R +1 R +0 R +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Writing a ‘0’ to a bit location will not have any effect. Writing a ‘1’ to the location will
result in the command associated with that register bit field being executed. Writing ‘1’
to more than one of DIS, EN and SUSP bits in L1PEDCMD will be treated as invalid
command and such writes will be dropped by retaining the current EDC mode. L1P
memory controller will also trigger an exception when the write is dropped using
“L1P_CMPA” event (DSP memory protection fault from L1P).
R +0 W +0 W +0 R +0 W +0 W +1 R +0 W +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
L1P Error Detection Logic does not initialize the parity RAM when transitioning from
the disabled to the enabled state. Thus, upon entering the enabled state, there may be
invalid parity values in the parity RAM whose corresponding valid bits are also set. To
avoid false parity errors for program code executing from L1P RAM, programs should
write to all L1P RAM addresses prior to executing code from L1P RAM. Programs
executing from L1P cache do not require additional consideration.
While the Error Detect logic is enabled, all 64-bit writes update the stored parity and
valid bits. Writes narrower than 64 bits (or) non-aligned writes will update the parity
RAM to indicate ‘invalid parity’. All 64-bit reads will be parity checked.
Programs can suspend the Error Detect logic by writing a ‘1’ to L1P Error Detection
Command Register Suspend bit (L1PEDCMD.SUSP = ‘1’). While suspended, the L1P
neither checks parity nor updates the valid bits. The purpose of this mode is to test this
logic in emulation mode.
Programs can disable the Error Detect logic at any time by writing a ‘1’ to L1P Error
Detection Command Register Disable bit (L1PEDCMD.DIS = ‘1’). Doing so disables
error detection. While in this mode, the L1P clears the ‘valid’ bits on each parity entry
whenever it sees a write within L1P.
The program fetch parity error (PERR) is signalled as Instruction fetch exception
(IERR.IFX) which is routed as a direct exception to the DSP. For further information
about IFX error, see the C66x DSP and Instruction Set Reference Guide (SPRUGH7) in
‘‘Related Documentation from Texas Instruments’’ on page ø-xx.
L2 RAM L2 RAM
(Bank 0) (Bank 1)
128 data bits + 128 data bits +
parity bits parity bits
L2 READ DATA
L2 READ DATA
PARITY PARITY
DETECT DETECT
CORRECT CORRECT
256 bits
256 bits L2 VICTIM
DATA BUFFER
L1D READ DATA
CORRECT
Reserved BITPOS Reserved NERR VERR DMAERR PERR DERR SUSP DIS Reserved EN
R +0 R +0 R +0 R +0 R +0 R +0 R +0 R +0 R +0 R +1 R +0 R +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Writing a ‘0’ to a bit location will not have any effect. Writing a ‘1’ to the location will
result in the command associated with that register bit field being executed. Writing ‘1’
to more than one of DIS, EN and SUSP bits in L2EDCMD will be treated as invalid
command and such writes will be dropped by retaining the current EDC mode. L2
memory controller will also trigger an exception when the write is dropped using
“L2_CMPA” event (DSP memory protection fault from L2).
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
5 PCLR Program fetch parity error bit cleared in L2EDSTAT, and L2EDADDR cleared
4 DCLR Data fetch parity error bit cleared in L2EDSTAT, and L2EDADDR cleared
1 Reserved
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
R +0 R +0 R +0 R +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Reserved CNT
R +0 RC +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Figure 11-11 L2 Error Detection Non-correctable Parity Error Counter Register (L2EDNPEC)
31 8 7 0
Reserved CNT
R +0 RC +0
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
The L2 EDC logic updates the stored parity information in response to every 128-bit
write on a 128-bit boundary. It calculates the new parity and stores it in the parity RAM
along with the valid bit. If the write is less than 128-bits or non-aligned to a 128-bit
boundary, L2 updates the parity RAM to indicate invalid parity and zeroes the parity
value.
L2 EDC logic generates valid Hamming parity for the following writes:
• L2 line allocations
• L1D victims
• SDMA and IDMA writes that merged to a full 128 bits
• L1D write misses that merged to a full 128 bits
L2 EDC logic invalidates the stored parity on 128-bit words for the following writes:
• L1D write misses that do not write to all 128 bits of a 128-bit word
• SDMA and IDMA writes that do not write to all 128 bits of a 128-bit word
On reset, the L2 EDC logic is disabled. Programs enable the EDC logic by writing a '1'
to the L2 Error Detection Command Register Enable bit (L2EDCMD.EN = '1'). The L2
EDC logic does not initialize the parity RAM when transitioning from the disabled to
the enabled state. Thus, upon entering the enabled state, there may be invalid parity
values in the parity RAM whose corresponding valid bits are also set. To avoid false
parity errors from L2 RAM, programs should follow the EDC setup sequence
mentioned below.
1. Disable EDC
2. Clear any EDC errors
3. Memory scrubbing with IDMA (this generates valid parity)
4. Enable EDC
5. Run application
6. Periodic memory scrubbing with IDMA (optional).
Programs can suspend the EDC logic by writing a ‘1’ to the L2 Error Detection
Command Register Suspend bit (L2EDCMD.SUSP = ‘1’). While suspended, the L2
neither checks parity nor updates the valid bits. The purpose of this mode is to allow
testing of the EDC logic in emulation mode.
Program can disable the EDC logic at any time by writing a ‘1’ to the L2 Error Detection
Command Register Disable bit (L2EDCMD.DIS = ‘1’). Doing so disables error
detection and correction.
Programs can ‘scrub’ the memory periodically to ensure that valid parity is set for all
addresses of interest. This can be achieved within L2 RAM by using IDMA to read and
write a range of L2 RAM addresses. This operation can also be used to correct single-bit
parity errors that occur during normal program operation on 128-bit words that
already have valid parity.
To scrub a range of memory, the program initiates an IDMA with the source and
destination addresses equal to each other; the byte count is set to cover the desired
block. The address range must be 128-bit aligned and a multiple of 128-bits for the
entire range to be scrubbed. As the IDMA reads the block of memory from L2, the EDC
hardware corrects any single-bit errors that might be present on 128-bit words that
have valid parity. When IDMA writes the data back to L2, the EDC generates parity for
the write and marks it valid.
Power-Down Controller
12.1 Introduction
This section provides the purpose and discusses the features of the power-down
controller.
Note—Peripherals located outside of the C66x CorePac may also provide their
own power-down capabilities. These are not covered in this chapter, since they
are outside the scope of this document.
12.2.2 L2 Memory
The C66x CorePac does not support user-controlled dynamic power-down of L2
memory. In KeyStone devices, Retention Until Access (RTA) memories are used as L2
memory. This memory is always in a low leakage mode and wakes up only a block of
memory that is accessed and that block is put back into the low leakage mode again. So
the L2 memory itself takes care of dynamic page based wakeup automatically.
The IDLE instruction is also used as part of the procedure for powering-down the
entire C66x CorePac, as described in Section 12.2.5.
The entire C66x CorePac can be powered-down using the following procedure. Other
than the options previously specified, it is not possible to power-down only part of the
C66x CorePac. Powering-down the C66x CorePac is completely under software
control by programming the C66x CorePac power-down (MEGPD) bit in the
power-down controller command register (PDCCMD).
The C66x CorePac stays in a power-down state until awakened by the interrupt(s) that
are enabled in step 2.
If a DMA access occurs to the L1D, L1P, or L2 memory while the C66x CorePac is
powered-down, the PDC wakes all three memory controllers. When the DMA access
has been serviced, the PDC will again power-down the memory controllers.
Reserved MEGPD
R-0 R/W-0
15 0
Reserved
RW-xxxxh
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table 12-3 summarizes who may access the power-down controller command register.
Table 12-3 Permissions for PDC Command Register
Register Supervisor User
PDCCMD R/W R
Miscellaneous
13.1 Introduction
Table 13-1 lists miscellaneous memory-mapped registers.
Table 13-1 Miscellaneous Registers
Address Acronym Register Description Section
0181 2000h MM_REVID C66x CorePac Revision ID. Section 13.2
The C66x CorePac revision ID register (MM_REVID) is shown in Figure 13-1 and
described in Table 13-2.
Figure 13-1 C66x CorePac Revision ID Register (MM_REVID)
31 16
Reserved
R-0
15 0
REVID
R-x
Legend: R = Read only; W = Write only; -n = value after reset; -x, value is indeterminate — see the device-specific data manual
Table A-1 lists the general terms used throughout this document.
Table A-1 List of General Terms and Definitions
Term Definition
C66x Generic name for the new C6000 DSP architecture.
C66x DSP Designates the DSP hardware (functional units and registers).
C66x CorePac Includes the C66x DSP plus all the supporting hardware for memory, bandwidth
management, interrupt, memory protection, and power-down support.
CFG External configuration space, includes the memory-mapped registers outside the C66x
CorePac.
EDC Error Detection and Correction.
EMC External Memory Controller.
IDMA Internal DMA. It is a DMA engine that is local to the C66x CorePac. It allows transfer of data
between memories local to the C66x CorePac (L1P, L1D, L2) and the external
configuration space.
L1D Generic name for the level 1 data memory. This term may refer to the memory itself or the
memory controller.
L1P Generic name for the level 1 program memory. This term may refer to the memory itself
or the memory controller.
L2 Generic name for the level 2 memory. This term may refer to the memory itself or the
memory controller.
MPAX Memory Protection and Address Extension
MSMC Multicore Shared Memory Controller
XMC Extended Memory Controller
End of Table A-1
Table B-1 lists the cache-related terms used throughout this document that relate to the
C66x memory architecture.
Table B-1 List of Cache-Related Terms and Definitions (Part 1 of 4)
Term Definition
Allocation The process of finding a location in the cache to store newly cached data. This process
can include evicting data that is presently in the cache to make room for the new data.
Associativity The number of line frames in each set. This is specified as the number of ways in the
cache.
Capacity miss A cache miss that occurs because the cache does not have sufficient room to hold the
entire working set for a program. Compare with compulsory miss and conflict miss.
Clean A cache line that is valid and that has not been written to by upper levels of memory or
the DSP. The opposite state for a valid cache line is dirty.
Coherence Informally, a memory system is coherent if any read of a data item returns the most
recently written value of that data item. This includes accesses by the DSP and the
EDMA.
Compulsory miss Sometimes referred to as a first-reference miss. A compulsory miss is a cache miss that
must occur because the data has had no prior opportunity to be allocated in the cache.
Typically, compulsory misses for particular pieces of data occur on the first access of that
data. However, some cases can be considered compulsory even if they are not the first
reference to the data. Such cases include repeated write misses on the same location in a
cache that does not write allocate, and cache misses to non-cacheable locations.
Compare with capacity miss and conflict miss.
Conflict miss A cache miss that occurs due to the limited associativity of a cache, rather than due to
capacity constraints. A fully-associative cache is able to allocate a newly cached line of
data anywhere in the cache. Most caches have much more limited associativity (see
set-associative cache), and so are restricted in where they may place data. This results in
additional cache misses that a more flexible cache would not experience.
Direct-mapped A direct-mapped cache maps each address in the lower-level memory to a single
location in the cache. Multiple locations may map to the same location in the cache. This
is in contrast to a multi-way set-associative cache, which selects a place for the data from
a set of locations in the cache. A direct-mapped cache can be considered a single-way
set-associative cache.
Dirty In a writeback cache, writes that reach a given level in the memory hierarchy may update
that level, but not the levels below it. Thus, when a cache line is valid and contains
updates that have not been sent to the next lower level, that line is said to be dirty. The
opposite state for a valid cache line is clean.
DMA Direct Memory Access. Typically, a DMA operation copies a block of memory from one
range of addresses to another, or transfers data between a peripheral and memory. On
the C66x DSP, DMA transfers are performed by the enhanced DMA (EDMA) engine.
These DMA transfers occur in parallel to program execution. From a cache coherence
standpoint, EDMA accesses can be considered accesses by a parallel processor.
A EMIF (External Memory Interface), 1-4 to 1-5, 7-2, 7-7, 7-14, 7-16
AET (Advanced Event Triggering), 9-22, 9-31 EMU (emulation), 7-2 to 7-3, 7-17, 7-20, 9-31, 11-5, 11-11
architecture, 1-6, 2-2 to 2-4, 2-7, 3-2 to 3-3, 3-18, 4-2 to 4-4, 4-7, emulation, 7-2 to 7-3, 7-17, 7-20, 9-31, 11-5, 11-11
4-12 to 4-13, 4-27 to 4-28, 5-3, 7-13, 8-1, 8-3 to 8-4, 9-3 to 9-4, 9-33, error detection, 11-1 to 11-12, A-1
10-2 to 10-6, 10-9, 10-12, A-1, B-1 error reporting and messages, 1-5, 4-36 to 4-37, 6-3 to 6-4, 7-19, 9-3,
9-10 to 9-11, 9-14, 10-4 to 10-5, 11-1 to 11-12, A-1
B
block coherence, 2-7 to 2-8, 3-9, 3-15, 4-8 to 4-9, 4-15 F
buffer, 2-15, 3-3 to 3-5, 3-10, 3-18, 3-20 to 3-21, 4-13, 4-27, 5-6 to 5-7, 5-12, fault, 1-6, 2-17, 2-20 to 2-21, 3-23 to 3-24, 3-26 to 3-28, 4-30, 4-33 to 4-35,
5-14, 7-14 to 7-17, 7-19 to 7-20, 12-2, B-4 7-2 to 7-3, 7-10, 7-13, 7-20, 8-10, 9-14, 10-5 to 10-8, 10-11, 11-4, 11-8
bus(es), 1-4 to 1-5, 4-36 to 4-37, 6-3 to 6-4, 8-2, 8-4, 8-11, 9-14
G
C global reset, 4-5
capture mode, 3-20, 9-4
clock, 2-3, 3-2 H
configuration, 1-4 to 1-5, 2-2 to 2-4, 2-9 to 2-10, 2-14, 3-2 to 3-3, HPI (Host Processor Interface), 10-3
3-12 to 3-13, 3-21, 4-4 to 4-5, 4-10 to 4-11, 4-14 to 4-15, 4-30, 5-2 to 5-6,
5-10, 6-2 to 6-3, 7-2, 7-7, 7-10, 8-2, 8-4, 8-11, 9-8, 10-2, 10-5, A-1 I
configuration register, 2-3, 2-9 to 2-10, 3-12 to 3-13, 4-4, 4-14 to 4-15, 5-10, inputs, 1-5, 7-17, 9-2, 9-4, 9-9, 9-13 to 9-14
10-5 INTC (Interrupt Controller), ø-xix to ø-xx, 1-2, 1-5, 9-2, 9-9
CPU, ø-xx interface, 1-6, 7-2, 7-13, 7-19, 9-15, 10-10
interrupt, ø-xix to ø-xx, 1-2, 1-5, 2-5, 2-15 to 2-17, 3-5, 3-22 to 3-23, 4-7,
D 4-28 to 4-29, 5-4 to 5-6, 5-11, 5-14, 7-16, 8-5, 9-1 to 9-6, 9-8 to 9-18,
DDR (Double Data Rate) 9-21 to 9-22, 9-25 to 9-27, 9-31 to 9-33, 11-2, 11-5, 11-12, 12-3 to 12-4,
DDR3, ø-xx A-1
debug, 2-18, 3-24, 4-30
debug mode, 2-18, 3-24, 4-30 L
detection, 7-14 to 7-15, 9-10, 9-27, 11-1 to 11-12, A-1 layout, 7-5 to 7-6, 7-20, 10-5
DMA (direct memory access), ø-xix, 1-2, 1-4, 2-5, 2-15 to 2-17, 2-21, 3-5,
3-10 to 3-11, 3-18, 3-20, 3-22, 4-6, 4-12 to 4-13, 4-28, 5-14, 6-2, M
8-2 to 8-4, 8-7 to 8-10, 9-14, 10-2, 11-2 to 11-8, 12-3, A-1, B-1
memory
DSP, ø-xix, 1-2 to 1-6, 2-2 to 2-6, 2-8, 2-13 to 2-17, 2-21, 3-2 to 3-6,
DMA, ø-xix, 1-2, 1-4, 2-5, 2-15 to 2-17, 2-21, 3-5, 3-10 to 3-11, 3-18, 3-20,
3-9 to 3-11, 3-18 to 3-25, 4-5 to 4-6, 4-9, 4-11, 4-13, 4-28 to 4-29, 4-32,
3-22, 4-6, 4-12 to 4-13, 4-28, 5-14, 6-2, 8-2 to 8-4, 8-7 to 8-10, 9-14,
4-35, 5-2 to 5-6, 5-8 to 5-9, 5-11 to 5-12, 5-14, 6-2, 7-16, 8-2 to 8-10,
10-2, 11-2 to 11-8, 12-3, A-1, B-1
9-2 to 9-3, 9-5 to 9-6, 9-8 to 9-16, 9-22, 9-25 to 9-27, 9-31 to 9-32,
EMC, ø-xix, 1-2, 1-4, 4-29, 5-12 to 5-13, 6-1 to 6-3, 8-4 to 8-9, 8-11, 9-14,
10-2 to 10-4, 10-8, 11-2, 11-4 to 11-5, 11-8, 11-12, 12-2 to 12-4, A-1,
A-1
B-1 to B-3
EMIF, 1-4 to 1-5, 7-2, 7-7, 7-14, 7-16
general, ø-xix to ø-xx, 1-2 to 2-4, 2-7 to 2-9, 2-13, 2-15 to 3-5,
E 3-8 to 3-12, 3-18 to 4-7, 4-9 to 4-14, 4-19 to 4-36, 5-1 to 5-10,
EDMA (Enhanced DMA Controller), 2-2, 5-5, 9-2, B-1 5-13 to 5-14, 6-1 to 6-3, 7-1 to 7-3, 7-5 to 7-14, 7-16 to 7-17, 8-2,
EMAC, 10-3 8-4 to 8-5, 8-7, 8-9 to 8-10, 9-3, 9-14, 9-33, 10-1 to 10-12,
EMC (External Memory Controller), ø-xix, 1-2, 1-4, 4-29, 5-12 to 5-13, 11-2 to 11-12, 12-2 to 12-3, 13-2 to A-1, B-1 to B-4
6-1 to 6-3, 8-4 to 8-9, 8-11, 9-14, A-1
L1D (Level-One Data Memory), ø-xix, 1-2 to 1-6, 2-2, 2-6 to 2-7, peripherals, 1-4, 1-6, 6-2, 7-12, 9-2, 10-5, 12-2, B-2
2-15 to 2-17, 2-19, 3-2 to 3-24, 3-26, 3-28, 4-2, 4-4 to 4-5, polling, 2-7 to 2-8
4-7 to 4-15, 4-26 to 4-29, 4-32, 5-2 to 5-4, 5-6, 5-9 to 5-10, port, 1-4, 4-3, 4-30, 5-2, 5-12 to 5-13, 6-2, 7-12, 8-5
5-12 to 5-13, 6-3, 7-10 to 7-11, 7-14 to 7-15, 7-19, 8-2, 8-4 to 8-6, power
8-8 to 8-10, 9-14, 10-3, 10-9, 11-6 to 11-9, 11-11, 12-3, A-1, power down, ø-xix, 1-2, 2-15, 12-3
B-3 to B-4 prefetch, 1-4 to 1-5, 4-26 to 4-27, 7-2 to 7-4, 7-14 to 7-20
L1P (Level-One Program Memory), ø-xix, 1-2 to 1-6, 2-2 to 2-17, PrivID (Privilege Identification), 6-2 to 6-3
2-19 to 2-22, 3-2, 3-7, 3-14, 3-22 to 3-23, 3-26, 4-2, 4-4, 4-7 to 4-9,
4-11 to 4-15, 4-27 to 4-29, 4-32, 5-2 to 5-4, 5-9 to 5-10, 6-3,
Q
7-10 to 7-11, 7-14 to 7-15, 8-2, 8-4 to 8-5, 8-10, 9-14, 10-3, 10-9,
queue, 3-20, 5-4, 5-6
11-2 to 11-9, 12-2 to 12-3, A-1
L2 (Level-Two Unified Memory), ø-xix, 1-2 to 1-6, 2-2, 2-4, 2-9,
2-13 to 2-15, 2-17, 2-19, 3-2 to 3-5, 3-8, 3-10 to 3-12, 3-19 to 3-23, R
3-25 to 3-26, 4-2 to 4-20, 4-26 to 4-33, 4-35 to 4-36, 5-2 to 5-4, 5-6, RAM, 1-4 to 1-5, 2-2 to 2-5, 2-16, 3-2 to 3-3, 3-5, 3-10 to 3-11, 3-18,
5-9 to 5-10, 5-12 to 5-13, 6-3, 7-2, 7-10 to 7-11, 7-14 to 7-15, 7-19, 4-3 to 4-7, 4-11 to 4-13, 4-20, 5-2, 5-9 to 5-10, 7-2, 7-11 to 7-12, 7-14,
8-2, 8-4 to 8-6, 8-8 to 8-10, 9-14, 10-3 to 10-4, 10-9, 11-2, 11-2, 11-4 to 11-6, 11-9 to 11-12
11-6 to 11-12, 12-2 to 12-3, A-1, B-2, B-4 RapidIO, 10-3
map, 1-6, 2-3, 7-6, 7-8, 7-10, 10-5, B-4 reset, 1-3, 2-9 to 2-11, 2-18, 2-20 to 2-21, 3-2 to 3-3, 3-12 to 3-16, 3-18,
MPAX, 1-5, 4-26, 4-36, 7-2 to 7-3, 7-5 to 7-13, 10-8, A-1 3-25 to 3-28, 4-5 to 4-6, 4-11, 4-14 to 4-19, 4-26, 4-30 to 4-31,
MSMC, ø-xx, 1-4 to 1-5, 4-10, 4-26, 7-2, 7-7, 7-11 to 7-12, 7-14, 7-16, A-1 4-33 to 4-34, 4-36 to 4-37, 5-8 to 5-14, 6-3 to 6-4, 7-7 to 7-8, 7-13,
XMC, ø-xix, 1-2, 1-4 to 1-5, 2-17, 3-23, 4-5, 4-10, 4-26 to 4-27, 4-29, 4-36, 7-17 to 7-20, 8-5, 8-7 to 8-9, 8-11, 9-2, 9-4 to 9-7, 9-11 to 9-12, 9-15,
7-1 to 7-2, 7-5, 7-7, 7-9 to 7-14, 7-17 to 7-21, 8-9 to 8-10, 9-18 to 9-32, 10-5 to 10-7, 10-9 to 10-11, 11-3 to 11-5, 11-7 to 11-11,
10-8 to 10-9, A-1 12-4, 13-2
mode
capture, 3-20, 9-4 S
debug, 2-18, 3-24, 4-30 security
module, 4-28, 9-9 general, 10-9
MPAX (Memory Protection and Address Extension), 1-5, 4-26, 4-36, signal, 1-5, 2-16, 9-2 to 9-3, 9-11 to 9-12, 9-15, 11-5, 11-12
7-2 to 7-3, 7-5 to 7-13, 10-8, A-1 sleep mode, 9-14, 12-4
MSMC (Multicore Shared Memory Controller), ø-xx, 1-4 to 1-5, 4-10, 4-26, SRAM (Static RAM), 1-3, 2-2, 2-14, 3-20 to 3-21, 4-11, 8-2
7-2, 7-7, 7-11 to 7-12, 7-14, 7-16, A-1 SRIO (Serial RapidIO) subsystem, 1-4, 6-2
mux, 9-4, 9-17, 9-25, 9-31 to 9-32 status register, 4-10, 5-3, 5-8 to 5-9, 5-12, 7-3, 9-4, 9-10, 9-17, 9-26,
10-5 to 10-11, 11-3, 11-7, 12-4
N
NMI (non-maskable interrupt), 9-2, 9-11, 9-15 to 9-16, 9-32 V
version, 8-6, 13-2
O video, 5-5
on-chip, 4-2
output(s), 2-16, 3-23, 4-29, 5-6 to 5-7, 6-3, 7-11, 9-2, 9-7, 9-9 to 9-11, X
9-13 to 9-15, 9-22, 11-5 XMC (eXtended Memory Controller), ø-xix, 1-2, 1-4 to 1-5, 2-17, 3-23, 4-5,
override, 2-14 4-10, 4-26 to 4-27, 4-29, 4-36, 7-1 to 7-2, 7-5, 7-7, 7-9 to 7-14,
7-17 to 7-21, 8-9 to 8-10, 10-8 to 10-9, A-1
P
performance, 1-5, 2-2, 2-13 to 2-14, 3-2, 3-18, 3-20 to 3-21, 7-2, 7-14, 7-17,
B-2 to B-4
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2013, Texas Instruments Incorporated