`Reference Manual
`
`Revision 4.1, September 2005
`
`This document contains information on a new product.
`Specifications and information herein are subject to
`change without notice.
`(c) Freescale Semiconductor, Inc. 2005, All rights
`
`AQUILA - Ex. 2007
`
`
`
`LICENSOR is defined as Freescale Semiconductor, Inc. LICENSOR reserves the right to make
`changes without further notice to any products included and covered hereby. LICENSOR makes
`no warranty, representation or guarantee regarding the suitability of its products for any particular
`purpose, nor does LICENSOR assume any liability arising out of the application or use of any
`product or circuit, and specifically disclaims any and all liability, including without limitation
`incidental, consequential, reliance, exemplary, or any other similar such damages, by way of
`illustration but not limitation, such as, loss of profits and loss of business opportunity. "Typical"
`parameters which may be provided in LICENSOR data sheets and/or specifications can and do
`vary in different applications and actual performance may vary over time. All operating
`parameters, including "Typicals" must be validated for each customer application by customer’s
`technical experts. LICENSOR does not convey any license under its patent rights nor the rights of
`others. LICENSOR products are not designed, intended, or authorized for use as components in
`systems intended for surgical implant into the body, or other applications intended to support life,
`or for any other application in which the failure of the LICENSOR product could create a situation
`where personal injury or death may occur. Should Buyer purchase or use LICENSOR products for
`any such unintended or unauthorized application, Buyer shall indemnify and hold LICENSOR and
`its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, cost,
`damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim
`of personal injury or death associated with such unintended or unauthorized use, even if such claim
`alleges that LICENSOR was negligent regarding the design or manufacture of the part.
`Freescale and
` are registered trademarks of Freescale Semiconductor, Inc. Freescale, Inc. is an
`Equal Opportunity/Affirmative Action Employer.
`All other tradenames, trademarks, and registered trademarks are the property of their respective
`owners.
`
`SC140 DSP Core Reference Manual
`
`
`
`Table of Contents
`
`About This Book
`Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
`Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
`Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
`Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
`
`Chapter 1
`Introduction
`Target Markets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-1
`Architectural Differentiation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-2
`Core Architecture Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-3
`Typical System-On-Chip Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-4
`Variable Length Execution Set (VLES) Software Model . . . . . . . . . . . . . . . .1-5
`
`1.1
`1.2
`1.3
`1.3.1
`1.3.2
`
`Chapter 2
`Core Architecture
`Architecture Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-1
`Data Arithmetic Logic Unit (DALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-2
`Data Register File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
`Multiply-Accumulate (MAC) Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
`Bit-Field Unit (BFU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
`Shifter/Limiters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
`Address Generation Unit (AGU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-3
`Stack Pointer Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
`Bit Mask Unit (BMU). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-4
`Program Sequencer Unit (PSEQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
`Enhanced On-Chip Emulator (EOnCE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
`Instruction Set Accelerator Plug-in (ISAP) Interface . . . . . . . . . . . . . . . . . . . .2-5
`Memory Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-5
`DALU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-6
`DALU Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-6
`Data Registers (D0–D15) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-8
`Multiply-Accumulate (MAC) Unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-10
`Bit-Field Unit (BFU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-12
`Data Shifter/Limiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-13
`Scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-14
`Limiting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-14
`Scaling and Arithmetic Saturation Mode Interactions . . . . . . . . . . . . . . .2-16
`DALU Arithmetic and Rounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
`
`2.1
`2.1.1
`2.1.1.1
`2.1.1.2
`2.1.1.3
`2.1.1.4
`2.1.2
`2.1.2.1
`2.1.2.2
`2.1.3
`2.1.4
`2.1.5
`2.1.6
`2.2
`2.2.1
`2.2.1.1
`2.2.1.2
`2.2.1.3
`2.2.1.4
`2.2.1.5
`2.2.1.6
`2.2.1.7
`2.2.2
`
`SC140 DSP Core Reference Manual
`
`iii
`
`
`
`Data Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-17
`2.2.2.1
`Data Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-18
`2.2.2.2
`Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-20
`2.2.2.3
`Division. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-20
`2.2.2.4
`Unsigned Arithmetic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-20
`2.2.2.5
`Rounding Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-21
`2.2.2.6
`Arithmetic Saturation Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-25
`2.2.2.7
`Multi-Precision Arithmetic Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-26
`2.2.2.8
`Viterbi Decoding Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-30
`2.2.2.9
`Address Generation Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-31
`2.3
`AGU Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-31
`2.3.1
`AGU Programming Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-34
`2.3.2
`Address Registers (R0–R15) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-35
`2.3.2.1
`Stack Pointer Registers (NSP, ESP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-35
`2.3.2.2
`Offset Registers (N0–N3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-36
`2.3.2.3
`Base Address Registers (B0–B7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-36
`2.3.2.4
`Modifier Registers (M0–M3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-36
`2.3.2.5
`Modifier Control Register (MCTL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-37
`2.3.2.6
`Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-38
`2.3.3
`Register Direct Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-38
`2.3.3.1
`Address Register Indirect Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-38
`2.3.3.2
`PC Relative Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-40
`2.3.3.3
`Special Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-41
`2.3.3.4
`Memory Access Width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-42
`2.3.3.5
`Memory Access Misalignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-42
`2.3.3.6
`Addressing Modes Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-43
`2.3.3.7
`Address Modifier Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-45
`2.3.4
`Linear Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-45
`2.3.4.1
`Reverse-carry Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-45
`2.3.4.2
`Modulo Addressing Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-45
`2.3.4.3
`Multiple Wrap-Around Modulo Addressing Mode . . . . . . . . . . . . . . . . .2-47
`2.3.4.4
`Arithmetic Instructions on Address Registers . . . . . . . . . . . . . . . . . . . . . . . .2-48
`2.3.5
`Bit Mask Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-49
`2.3.6
`Bit Mask Test and Set (Semaphore Support) Instruction . . . . . . . . . . . . .2-50
`2.3.6.1
`Semaphore Hardware Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . .2-51
`2.3.6.2
`Move Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-51
`2.3.7
`2.4 Memory Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-55
`2.4.1
`SC140 Endian Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-56
`2.4.1.1
`SC140 Bus Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-56
`2.4.1.2
`Memory Organization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-57
`2.4.1.3
`Data Moves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-58
`2.4.1.4
`Multi-Register Moves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-60
`2.4.1.5
`Instruction Word Transfers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2-62
`2.4.1.6
`Memory Access Behavior in Big/Little Endian Modes . . . . . . . . . . . . . .2-64
`
`iv
`
`SC140 DSP Core Reference Manual
`
`
`
`Chapter 3
`Control Registers
`Core Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
`Status Register (SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-1
`Exception and Mode Register (EMR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-7
`Clearing EMR Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
`PLL and Clock Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3-10
`
`3.1
`3.1.1
`3.1.2
`3.1.2.1
`3.2
`
`Chapter 4
`Emulation and Debug (EOnCE)
`Debugging System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-1
`4.1
`Overview of the Combined JTAG and EOnCE Interface. . . . . . . . . . . . . . . . . . . .4-2
`4.2
`Cascading Multiple SC140 EOnCE Modules in a SoC . . . . . . . . . . . . . . . . . .4-2
`4.2.1
`JTAG Scan Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-3
`4.2.2
`Activating the EOnCE Through the JTAG Port . . . . . . . . . . . . . . . . . . . . . . . .4-6
`4.2.3
`Enabling the EOnCE Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-6
`4.2.4
`DEBUG_REQUEST and ENABLE_EONCE Commands. . . . . . . . . . . . . . . .4-7
`4.2.5
`Reading/Writing EOnCE Registers Through JTAG. . . . . . . . . . . . . . . . . . . . .4-7
`4.2.6
`4.3 Main Capabilities of the EOnCE Module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-10
`4.3.1
`EOnCE Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-10
`4.3.2
`EOnCE Dedicated Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-11
`4.3.3
`Debug State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-11
`4.3.4
`Debug Exception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-12
`4.3.5
`Executing an Instruction while in Debug State . . . . . . . . . . . . . . . . . . . . . . .4-12
`4.3.6
`Software Downloading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-12
`4.3.7
`EOnCE Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-14
`4.3.8
`EOnCE Actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-15
`4.3.9
`Event and Action Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-15
`4.4
`EOnCE Enabling and Power Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-16
`4.5
`EOnCE Module Internal Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-16
`4.5.1
`EOnCE Controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-16
`4.5.2
`Event Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-18
`4.5.3
`Event Detection Unit (EDU). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-20
`4.5.3.1
`Address Event Detection Channel (EDCA) . . . . . . . . . . . . . . . . . . . . . . .4-22
`4.5.3.2
`Data Event Detection Channel (EDCD) . . . . . . . . . . . . . . . . . . . . . . . . . .4-24
`4.5.3.3
`Optional External Event Detection Address Channels . . . . . . . . . . . . . . .4-25
`4.5.4
`Event Selector (ES). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-25
`4.5.5
`Trace Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-26
`4.5.5.1
`Change of Flow and Interrupt Tracing . . . . . . . . . . . . . . . . . . . . . . . . . . .4-28
`4.5.5.2
`Writing to the Trace Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-29
`4.5.5.3
`Reading the Trace Buffer (TB_BUFF). . . . . . . . . . . . . . . . . . . . . . . . . . .4-29
`4.5.5.4
`Trace Unit Programming Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-29
`4.6
`EOnCE Register Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-30
`4.6.1
`Reading or Writing EOnCE Registers Using Core Software . . . . . . . . . . . . .4-33
`4.6.2
`Real-Time JTAG Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-33
`4.6.3
`Real-Time Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-34
`
`SC140 DSP Core Reference Manual
`
`v
`
`
`
`4.6.4
`4.7
`4.7.1
`4.7.2
`4.7.3
`4.7.4
`4.7.5
`4.7.6
`4.7.6.1
`4.7.6.2
`4.7.6.3
`4.7.7
`4.7.8
`4.7.9
`4.7.10
`4.7.11
`4.8
`4.8.1
`4.8.2
`4.8.3
`4.8.4
`4.9
`4.9.1
`4.9.1.1
`4.9.1.2
`
`4.9.1.3
`4.9.2
`4.9.2.1
`4.9.2.2
`4.9.2.3
`4.10
`4.10.1
`4.10.2
`4.10.3
`
`4.10.4
`4.10.5
`4.11
`4.11.1
`4.11.2
`4.11.3
`4.11.4
`
`General EOnCE Register Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-34
`EOnCE Controller Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-36
`EOnCE Command Register (ECR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-36
`EOnCE Status Register (ESR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-37
`EOnCE Monitor and Control Register (EMCR). . . . . . . . . . . . . . . . . . . . . . .4-41
`EOnCE Receive Register (ERCV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-43
`EOnCE Transmit Register (ETRSMT). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-43
`EE Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-44
`EE Signals as Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-44
`EE Signals as Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-45
`EE Signals Control Register (EE_CTRL) . . . . . . . . . . . . . . . . . . . . . . . .4-45
`Core Command Register (CORE_CMD) . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-48
`PC of the Exception Execution Set (PC_EXCP) . . . . . . . . . . . . . . . . . . . . . .4-49
`PC of the Next Execution Set (PC_NEXT) . . . . . . . . . . . . . . . . . . . . . . . . . .4-49
`PC of Last Execution Set (PC_LAST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-49
`PC Breakpoint Detection Register (PC_DETECT) . . . . . . . . . . . . . . . . . . . .4-49
`Event Counter Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-50
`Event Counter Control Register (ECNT_CTRL) . . . . . . . . . . . . . . . . . . . . . .4-50
`Event Counter Value Register (ECNT_VAL) . . . . . . . . . . . . . . . . . . . . . . . .4-52
`Extension Counter Value Register (ECNT_EXT) . . . . . . . . . . . . . . . . . . . . .4-53
`EC Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-53
`Event Detection Unit (EDU) Channels and Registers . . . . . . . . . . . . . . . . . . . . .4-54
`Address Event Detection Channel (EDCA) . . . . . . . . . . . . . . . . . . . . . . . . . .4-54
`EDCA Control Registers (EDCAi_CTRL). . . . . . . . . . . . . . . . . . . . . . . .4-54
`EDCA Reference Value Registers A and B
`(EDCAi_REFA, EDCAi_REFB) . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-57
`EDCA Mask Register (EDCAi_MASK) . . . . . . . . . . . . . . . . . . . . . . . . .4-57
`Data Event Detection Channel (EDCD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-58
`EDCD Control Register (EDCD_CTRL) . . . . . . . . . . . . . . . . . . . . . . . . .4-58
`EDCD Reference Value Register (EDCD_REF) . . . . . . . . . . . . . . . . . . .4-61
`EDCD Mask Register (EDCD_MASK) . . . . . . . . . . . . . . . . . . . . . . . . . .4-61
`Event Selector (ES) Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-61
`Event Selector Control Register (ESEL_CTRL) . . . . . . . . . . . . . . . . . . . . . .4-61
`Event Selector Mask Debug State Register (ESEL_DM) . . . . . . . . . . . . . . .4-63
`Event Selector Mask Debug Exception
`Register (ESEL_DI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-64
`Event Selector Mask Enable Trace Register (ESEL_ETB) . . . . . . . . . . . . . .4-64
`Event Selector Mask Disable Trace Register (ESEL_DTB) . . . . . . . . . . . . .4-65
`Trace Unit Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-65
`Trace Buffer Control Register (TB_CTRL) . . . . . . . . . . . . . . . . . . . . . . . . . .4-65
`Trace Buffer Read Pointer Register (TB_RD) . . . . . . . . . . . . . . . . . . . . . . . .4-69
`Trace Buffer Write Pointer Register (TB_WR) . . . . . . . . . . . . . . . . . . . . . . .4-69
`Trace Buffer Register (TB_BUFF). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-69
`
`vi
`
`SC140 DSP Core Reference Manual
`
`
`
`Chapter 5
`Program Control
`Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-1
`Instruction Pipeline Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-2
`Instruction Pre-Fetch and Fetch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
`Instruction Dispatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
`Address Generation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-4
`Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-5
`Instruction Grouping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-5
`Grouping Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-6
`Serial Grouping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7
`Prefix Grouping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-7
`Prefix Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
`Two-Word Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-8
`One-Word Low Register Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
`Conditional Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-9
`Prefix Selection Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-10
`Instruction Reordering Within an Execution Set . . . . . . . . . . . . . . . . . . . . . .5-12
`Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14
`Sequential Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15
`DALU Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
`Move Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
`Bit Mask Instruction Timing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16
`Change-Of-Flow Instruction Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-17
`Direct, PC-Relative, and Conditional COF . . . . . . . . . . . . . . . . . . . . . . .5-18
`Delayed COF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-19
`COF Execution Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-19
`Memory Access Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-21
`Memory Access Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-22
`Implicit Push/Pop Memory Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-24
`Memory Stall Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-24
`Hardware Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-25
`Loop Programming Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-25
`Loop Start Address Registers (SAn). . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-25
`Loop Counter Registers (LCn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-26
`Status Register (SR) Loop Flag Bits. . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-26
`Loop Notation and Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-26
`Loop Initiation and Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-27
`Loop Nesting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-28
`Loop Iteration and Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-28
`Loop Control Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-29
`Loop Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-32
`Stack Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-32
`SC140 Single Stack Memory Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-32
`SC140 Dual Stack Memory Use. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-33
`Stack Support Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-34
`Shadow Stack Pointer Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-35
`
`5.1
`5.1.1
`5.1.1.1
`5.1.1.2
`5.1.1.3
`5.1.1.4
`5.2
`5.2.1
`5.2.1.1
`5.2.1.2
`5.2.2
`5.2.2.1
`5.2.2.2
`5.2.3
`5.2.4
`5.2.5
`5.3
`5.3.1
`5.3.1.1
`5.3.1.2
`5.3.1.3
`5.3.2
`5.3.2.1
`5.3.2.2
`5.3.2.3
`5.3.3
`5.3.3.1
`5.3.3.2
`5.3.3.3
`5.4
`5.4.1
`5.4.1.1
`5.4.1.2
`5.4.1.3
`5.4.2
`5.4.3
`5.4.4
`5.4.5
`5.4.6
`5.4.7
`5.5
`5.5.1
`5.5.2
`5.5.3
`5.5.4
`
`SC140 DSP Core Reference Manual
`
`vii
`
`
`
`Fast Return from Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-36
`5.5.5
`5.6 Working Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-37
`5.6.1
`Normal Working Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-37
`5.6.2
`Exception Working Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-37
`5.6.3
`Typical Working Mode Usage Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-38
`5.6.3.1
` Dual-stack RTOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-38
`5.6.3.2
` Single-stack RTOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-39
`5.6.4
`Working Mode Transitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-39
`5.6.4.1
`From Exception to Normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-39
`5.6.4.2
`From Normal to Exception mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-39
`5.7
`Processing States. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-41
`5.7.1
`Processing State Change Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-41
`5.7.2
`Processing State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-42
`5.7.3
`Execution State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-43
`5.7.4
`Reset Processing State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-43
`5.7.5
`Debug State. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44
`5.7.6
`Wait Processing State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-44
`5.7.7
`Stop Processing State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-45
`5.8
`Exception Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-46
`5.8.1
`Interrupt Vector Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-48
`5.8.1.1
`Vector Base Address Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-48
`5.8.1.2
`Programming Exception Routine Addresses . . . . . . . . . . . . . . . . . . . . . .5-48
`5.8.2
`Return From Exception Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-49
`5.8.3
`Maskable Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
`5.8.3.1
`Interrupt Priority Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
`5.8.3.2
`Controlling All Interrupt Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
`5.8.4
`Non-Maskable Interrupts (NMI). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
`5.8.5
`Internal Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-50
`5.8.5.1
`Illegal Exception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-51
`5.8.5.2
`DALU Overflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
`5.8.5.3
`TRAP Exception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
`5.8.5.4
`Debug Exception. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
`5.8.6
`Exception Interface to the Pipeline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
`5.8.6.1
`Exception Routine Fetch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-52
`5.8.6.2
`Exception Mode Execution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
`5.8.7
`Exception Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-53
`
`Chapter 6
`Instruction Set Accelerator Plug-In
`Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-57
`ISAP - SC140 Schematic Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-58
`Single ISAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-58
`Multiple ISAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-59
`ISAP instructions and instruction encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-60
`ISAP Memory Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-60
`ISAP-core register transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-61
`Immediate Data Transfer to ISAP registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-62
`
`SC140 DSP Core Reference Manual
`
`6.1
`6.2
`6.2.1
`6.2.2
`6.3
`6.4
`6.5
`6.6
`
`viii
`
`
`
`6.7
`6.7.1
`6.7.1.1
`6.7.1.2
`6.7.2
`6.7.3
`6.8
`6.8.1
`6.8.2
`6.8.3
`6.8.4
`
`Core Assembly Syntax with an ISAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-63
`Identification of ISAP instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-63
`Working with One ISAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-63
`Working with Multiple ISAPs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-64
`An Example of the Definition Flexibility of an ISAP . . . . . . . . . . . . . . . . . .6-65
`Conditional Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-66
`Programming Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-67
`ISAP Functions that Interact With the Core . . . . . . . . . . . . . . . . . . . . . . . . . .6-67
`Grouping rules for explicit ISAP instructions . . . . . . . . . . . . . . . . . . . . . . . .6-68
`Rules for implicit AGU instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-68
`Sequencing rules for T bit update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6-69
`
`Chapter 7
`Programming Rules
`VLES Sequencing Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-1
`7.1
`VLES Grouping Semantics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-1
`7.2
`SC140 Pipeline Exposure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3
`7.3
`Programming Rule Notation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3
`7.4
`Grouping Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3
`7.4.1
`Prefix Instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3
`7.4.1.1
`Conditional Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3
`7.4.1.2
`Assembler Reordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-3
`7.4.1.3
`Sequencing Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-4
`7.4.2
`Cycle Counts. . . . . . . . . . . . . . . . . . . . . . . .