64-Bit TX System RISC TX49 Family TMPR4955B/TMPR4955C Rev. 1.1 Semiconductor Company The information contained herein is subject to change without notice. 021023_D TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property. In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the “Handling Guide for Semiconductor Devices,” or “TOSHIBA Semiconductor Reliability Handbook” etc. 021023_A The Toshiba products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These Toshiba products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury (“Unintended Usage”). Unintended Usage include atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc. Unintended Usage of Toshiba products listed in this document shall be made at the customer’s own risk. 021023_B The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations. 060106_Q The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of TOSHIBA or others. 021023_C R4000/R4400/R5000 are a trademark of MIPS Technologies, Inc. 060116_X Please use this product in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances. Toshiba assumes no liability for damage or losses occurring as a result of noncompliance with applicable laws and regulations. 060819_AF The products described in this document may include products subject to the foreign exchange and foreign trade laws. 021023_F The products described in this document contain components made in the United States and subject to export control of the U.S. authorities. Diversion contrary to the U.S. law is prohibited. 021023_G © 2006 TOSHIBA CORPORATION All Rights Reserved Preface Thank you for your new or continued patronage of Toshiba semiconductor products. This is the 2006 edition of the user’s manual for the TMPR4955B/TMPR4955C 64-bit RISC microprocessor. This databook is written so as to be accessible to engineers who may be designing a Toshiba microprocessor into their products for the first time. No prior knowledge of this device is assumed. What we offer here is basic information about the microprocessor, a discussion of the application fields in which the microprocessor is utilized, and an overview of design methods. On the other hand, the more experienced designer will find complete technical specifications for this product. Toshiba continually updates its technical information. Your comments and suggestions concerning this and other Toshiba documents are sincerely appreciated and may be utilized in subsequent editions. For updating of the data in this manual, or for additional information about the product appearing in it, please contact your nearest Toshiba office or authorized Toshiba dealer. September 2006 Table of Contents Table of Contents Handling Precautions TMPR4955B/TMPR4955C 1. Introduction ...................................................................................................................................... 1-1 1.1 Overview ....................................................................................................................................... 1-1 1.2 Notation Used in this Manual ........................................................................................................ 1-1 1.2.1 Numerical Notation ................................................................................................................ 1-1 1.2.2 Data Notation ......................................................................................................................... 1-1 1.2.3 Signal Notation ....................................................................................................................... 1-1 1.2.4 Register Notation .................................................................................................................... 1-1 2. Features............................................................................................................................................. 2-1 2.1 Block Diagram............................................................................................................................... 2-2 2.2 Pin Description.............................................................................................................................. 2-3 2.2.1 TMPR4955B/TMPR4955C Pin Out (160-pin QFP) ................................................................ 2-3 2.2.2 TX4955 Pin Description .......................................................................................................... 2-6 3. TX49/H3, TX49/H4 Core’s Registers ............................................................................................... 3-1 3.1 CPU Registers ............................................................................................................................... 3-1 3.2 CP0 Registers ................................................................................................................................ 3-2 3.2.1 Index Register (Reg#0) ............................................................................................................ 3-3 3.2.2 Random Register (Reg#1)........................................................................................................ 3-4 3.2.3 EntryLo0 Register (Reg#2) and EntryLo1 Register (Reg#3)...................................................... 3-5 3.2.4 Context Register (Reg#4) ......................................................................................................... 3-6 3.2.5 PageMask Register (Reg#5) ..................................................................................................... 3-7 3.2.6 Wired Register (Reg#6)............................................................................................................ 3-8 3.2.7 BadVAddr Register (Reg#8) ..................................................................................................... 3-9 3.2.8 Count Register (Reg#9).......................................................................................................... 3-10 3.2.9 EntryHi Register (Reg#10)..................................................................................................... 3-11 3.2.10 Compare Register (Reg#11) ................................................................................................... 3-12 3.2.11 Status Register (Reg#12) ........................................................................................................ 3-13 3.2.12 Cause Register (Reg#13) ........................................................................................................ 3-16 3.2.13 EPC Register (Reg#14) .......................................................................................................... 3-17 3.2.14 PRId Register (Reg#15) ......................................................................................................... 3-18 3.2.15 Config Register (Reg#16)....................................................................................................... 3-19 3.2.16 LLAddr Register (Reg#17)..................................................................................................... 3-21 3.2.17 XContext Register (Reg#20)................................................................................................... 3-22 3.2.18 Debug Register (Reg#23) ....................................................................................................... 3-23 3.2.19 DEPC Register (Reg#24) ....................................................................................................... 3-25 3.2.20 TagLo Register (Reg#28) and TagHi Register (Reg#29) .......................................................... 3-26 3.2.21 ErrorEPC Register (Reg#30).................................................................................................. 3-27 3.2.22 DESAVE Register (Reg#31)................................................................................................... 3-28 3.3 Floating-Point Unit, CP1 ............................................................................................................. 3-29 3.3.1 Floating-Point General Registers (FGRs)............................................................................... 3-29 3.3.2 Floating-Point Control Registers............................................................................................ 3-30 3.3.3 Accessing the FP Control and Implementation/Revision Registers ........................................ 3-34 4. Memory Management System ........................................................................................................... 4-1 4.1 Address Space Overview................................................................................................................ 4-1 4.1.1 Virtual Address Space ............................................................................................................. 4-1 4.1.2 Physical Address Space ........................................................................................................... 4-2 4.1.3 Virtual-to-Physical Address Translation ................................................................................... 4-2 4.1.4 32-bit Mode Address Translation............................................................................................. 4-3 4.1.5 64-Bit Mode Address Translation ............................................................................................ 4-4 4.2 Operating Modes ........................................................................................................................... 4-5 i Table of Contents User Mode Operations ............................................................................................................ 4-5 4.2.1 4.2.2 Supervisor Mode Operations ................................................................................................... 4-7 4.2.3 Kernel Mode Operations ......................................................................................................... 4-9 4.3 Translation Lookaside Buffer ....................................................................................................... 4-15 4.3.1 Joint TLB.............................................................................................................................. 4-15 4.3.2 TLB Entry format ................................................................................................................. 4-15 4.3.3 Instruction-TLB .................................................................................................................... 4-16 4.3.4 Data-TLB.............................................................................................................................. 4-16 4.4 Virtual-to-Physical Address Translation Process ........................................................................... 4-16 5. Cache Organization........................................................................................................................... 5-1 5.1 Memory Organization ................................................................................................................... 5-1 5.2 Cache Organization ....................................................................................................................... 5-2 5.2.1 Cache Sizes ............................................................................................................................. 5-2 5.2.2 Cache Line Lengths ................................................................................................................ 5-2 5.2.3 Organization of the Instruction Cache (I-Cache) ..................................................................... 5-2 5.2.4 Instruction Cache Address Field.............................................................................................. 5-3 5.2.5 Instruction Cache Configuration ............................................................................................. 5-3 5.2.6 Organization of the Data Cache (D-Cache) ............................................................................. 5-4 5.2.7 Data Cache Address Field ....................................................................................................... 5-4 5.2.8 Data Cache Configuration....................................................................................................... 5-4 5.3 Lock Function ............................................................................................................................... 5-5 5.3.1 Lock Bit Setting and Clearing .................................................................................................. 5-5 5.3.2 Operation during Lock ............................................................................................................ 5-6 5.3.3 Example of Data Cache Locking............................................................................................. 5-6 5.3.4 Example of Instruction Cache Locking ................................................................................... 5-6 5.4 The Primary Cache Accessing........................................................................................................ 5-7 5.5 Cache States .................................................................................................................................. 5-7 5.6 Cache Line Ownership .................................................................................................................. 5-8 5.7 Cache Multi-Hit Operation ............................................................................................................ 5-8 5.8 FIFO Replacement Algorithm ....................................................................................................... 5-8 5.9 Cache Testing ................................................................................................................................ 5-9 5.9.1 Cache Disabling ...................................................................................................................... 5-9 5.9.2 Cache Flushing ....................................................................................................................... 5-9 5.10 Cache Operations ........................................................................................................................ 5-10 5.10.1 Cache Write Policy................................................................................................................ 5-11 5.10.2 Data Cache Line Replacement .............................................................................................. 5-11 5.10.3 Instruction Cache Line Replacement ..................................................................................... 5-12 5.11 Manipulation of the Caches by an External Agent ....................................................................... 5-12 6. Write Buffer ...................................................................................................................................... 6-1 7. Debug Support Unit .......................................................................................................................... 7-1 7.1 Features ......................................................................................................................................... 7-1 7.2 EJTAG Interface............................................................................................................................ 7-1 7.3 Debug Unit.................................................................................................................................... 7-2 7.3.1 Extended Instructions ............................................................................................................. 7-2 7.3.2 Extended Debug Registers in CP0 ........................................................................................... 7-2 7.4 Register Map ................................................................................................................................. 7-2 7.5 Processor Bus Break Function........................................................................................................ 7-2 7.6 Debug Exception ........................................................................................................................... 7-2 8. CPU Exception ................................................................................................................................. 8-1 8.1 Introduction................................................................................................................................... 8-1 8.2 Exception Vector Locations ........................................................................................................... 8-1 8.3 Priority of Exception ..................................................................................................................... 8-2 8.4 ColdReset Exception...................................................................................................................... 8-3 8.4.1 Cause ...................................................................................................................................... 8-3 8.4.2 Processing ............................................................................................................................... 8-3 8.4.3 Servicing ................................................................................................................................. 8-3 8.5 SoftReset Exception ....................................................................................................................... 8-4 8.5.1 Cause ...................................................................................................................................... 8-4 ii Table of Contents Processing ............................................................................................................................... 8-4 8.5.2 8.5.3 Servicing ................................................................................................................................. 8-4 8.6 NMI (Non-maskable Interrupt) Exception ..................................................................................... 8-5 8.6.1 Cause ...................................................................................................................................... 8-5 8.6.2 Processing ............................................................................................................................... 8-5 8.6.3 Servicing ................................................................................................................................. 8-5 8.7 Address Error Exception................................................................................................................ 8-6 8.7.1 Cause ...................................................................................................................................... 8-6 8.7.2 Processing ............................................................................................................................... 8-6 8.7.3 Servicing ................................................................................................................................. 8-6 8.8 TLB Refill Exception ..................................................................................................................... 8-7 8.8.1 Cause ...................................................................................................................................... 8-7 8.8.2 Processing ............................................................................................................................... 8-7 8.8.3 Servicing ................................................................................................................................. 8-7 8.9 TLB Invalid Exception................................................................................................................... 8-8 8.9.1 Cause ...................................................................................................................................... 8-8 8.9.2 Processing ............................................................................................................................... 8-8 8.9.3 Servicing ................................................................................................................................. 8-8 8.10 TLB Modified Exception ............................................................................................................... 8-9 8.10.1 Cause ...................................................................................................................................... 8-9 8.10.2 Processing ............................................................................................................................... 8-9 8.10.3 Servicing ................................................................................................................................. 8-9 8.11 Bus Error Exception .................................................................................................................... 8-10 8.11.1 Cause .................................................................................................................................... 8-10 8.11.2 Processing ............................................................................................................................. 8-10 8.11.3 Servicing ............................................................................................................................... 8-10 8.12 Integer Overflow Exception ......................................................................................................... 8-12 8.12.1 Cause .................................................................................................................................... 8-12 8.12.2 Processing ............................................................................................................................. 8-12 8.12.3 Servicing ............................................................................................................................... 8-12 8.13 Trap Exception ............................................................................................................................ 8-13 8.13.1 Cause .................................................................................................................................... 8-13 8.13.2 Processing ............................................................................................................................. 8-13 8.13.3 Servicing ............................................................................................................................... 8-13 8.14 System Call Exception ................................................................................................................. 8-14 8.14.1 Cause .................................................................................................................................... 8-14 8.14.2 Processing ............................................................................................................................. 8-14 8.14.3 Servicing ............................................................................................................................... 8-14 8.15 Breakpoint Exception................................................................................................................... 8-15 8.15.1 Cause .................................................................................................................................... 8-15 8.15.2 Processing ............................................................................................................................. 8-15 8.15.3 Servicing ............................................................................................................................... 8-15 8.16 Reserved Instruction Exception.................................................................................................... 8-16 8.16.1 Cause .................................................................................................................................... 8-16 8.16.2 Processing ............................................................................................................................. 8-16 8.16.3 Servicing ............................................................................................................................... 8-16 8.17 Coprocessor Unusable Exception ................................................................................................. 8-17 8.17.1 Cause .................................................................................................................................... 8-17 8.17.2 Processing ............................................................................................................................. 8-17 8.17.3 Servicing ............................................................................................................................... 8-17 8.18 Floating-Point Exception ............................................................................................................. 8-18 8.18.1 Cause .................................................................................................................................... 8-18 8.18.2 Processing ............................................................................................................................. 8-18 8.18.3 Servicing ............................................................................................................................... 8-18 8.19 Interrupt Exception...................................................................................................................... 8-19 8.19.1 Cause .................................................................................................................................... 8-19 8.19.2 Processing ............................................................................................................................. 8-19 8.19.3 Servicing ............................................................................................................................... 8-19 8.20 Exception Handling and Servicing Flowcharts ............................................................................. 8-20 8.21 Floating-Point Exception of Floating-Point Unit (CP1) ................................................................ 8-25 8.21.1 Introduction .......................................................................................................................... 8-25 iii Table of Contents 8.21.2 8.21.3 8.21.4 8.21.5 8.21.6 8.21.7 Exception Types.................................................................................................................... 8-25 Exception Trap Processing .................................................................................................... 8-26 Flags ..................................................................................................................................... 8-26 FPU Exceptions .................................................................................................................... 8-27 Saving and Restoring State .................................................................................................... 8-30 Trap Handlers for IEEE Standard 754 Exceptions ................................................................. 8-30 9. Initialization Interface ....................................................................................................................... 9-1 9.1 Functional Overview ..................................................................................................................... 9-1 9.1.1 System Coordination............................................................................................................... 9-1 9.2 Reset Signal Description ................................................................................................................ 9-2 9.2.1 Power-On Reset....................................................................................................................... 9-2 9.2.2 Cold Reset............................................................................................................................... 9-3 9.2.3 Soft Reset ................................................................................................................................ 9-4 9.3 User-Selectable Mode Configurations ............................................................................................ 9-5 9.3.1 System Bus Interface Modes.................................................................................................... 9-5 9.3.2 Clock Divisor for the System Bus ............................................................................................ 9-5 9.3.3 System Endianness.................................................................................................................. 9-5 9.3.4 Enabling and Disabling the Timer Interrupt ............................................................................ 9-5 10. Clock Interface ................................................................................................................................ 10-1 10.1 Signal Terminology...................................................................................................................... 10-1 10.2 Basic System Clocks .................................................................................................................... 10-2 10.2.1 MasterClock.......................................................................................................................... 10-2 10.2.2 CPUCLK.............................................................................................................................. 10-2 10.2.3 GBUSCLK ........................................................................................................................... 10-2 10.2.4 CPUCLK-to-GBUSCLK Division......................................................................................... 10-3 10.2.5 Phase-Locked Loop (PLL) .................................................................................................... 10-3 10.3 Connecting Clocks to a Phase-Locked System.............................................................................. 10-4 11. TX4955 System Interface................................................................................................................. 11-1 11.1 Introduction................................................................................................................................. 11-1 11.2 Explanation of System Interface of R5000 Type Protocol Mode .................................................. 11-1 11.2.1 Interface Bus ......................................................................................................................... 11-2 11.2.2 Address Cycle and Data Cycle............................................................................................... 11-2 11.2.3 Issue Cycle ............................................................................................................................ 11-3 11.2.4 Handshake Signal.................................................................................................................. 11-4 11.2.5 System Interface Protocol of R5000 Type.............................................................................. 11-4 11.2.6 Processor Requests and External Requests............................................................................. 11-6 11.2.7 Handling of Requests .......................................................................................................... 11-10 11.2.8 Processor Request and External Request Protocol ............................................................... 11-12 11.2.9 Data Transfer ...................................................................................................................... 11-25 11.2.10 System Interface Cycle Time ............................................................................................... 11-26 11.2.11 System Interface Command and Data Identifiers ................................................................. 11-27 11.2.12 System Interface Addresses ................................................................................................. 11-32 11.2.13 Mode Register of System Interface (G2SConfig).................................................................. 11-32 11.2.14 Data Error Detection........................................................................................................... 11-33 11.3 System Interface of R4300 Type Protocol Mode ........................................................................ 11-34 11.3.1 System Interface Description of R4300 Type Protocol Mode ............................................... 11-34 11.3.2 System Events ..................................................................................................................... 11-37 11.3.3 System Event Sequences and the SysAD Bus Protocol......................................................... 11-37 11.3.4 System Interface Protocols .................................................................................................. 11-40 11.3.5 Timing Summary ................................................................................................................ 11-42 11.3.6 Arbitration .......................................................................................................................... 11-46 11.3.7 Issuing Commands.............................................................................................................. 11-47 11.3.8 Processor Write Request...................................................................................................... 11-47 11.3.9 Processor Read Request....................................................................................................... 11-49 11.3.10 External Write Request ....................................................................................................... 11-49 11.3.11 External Read Response ...................................................................................................... 11-51 11.3.12 Flow Control....................................................................................................................... 11-53 11.3.13 Data Rate Control............................................................................................................... 11-54 iv Table of Contents 11.3.14 11.3.15 11.3.16 11.3.17 11.3.18 11.3.19 11.3.20 11.3.21 Consecutive SysAD Bus Transactions.................................................................................. 11-55 Starvation and Deadlock Avoidance .................................................................................... 11-57 Discarding and Re-Executing Read Command .................................................................... 11-57 Multiple Drivers on the SysAD Bus ..................................................................................... 11-58 Signal Codes ....................................................................................................................... 11-59 Physical Addresses .............................................................................................................. 11-61 Mode Register of System Interface (G2SConfig).................................................................. 11-61 Read Time Out Counter (MODE43* = 0) ........................................................................... 11-62 12. TX4955 Processor Interrupts ........................................................................................................... 12-1 12.1 Nonmaskable Interrupt ................................................................................................................ 12-2 12.2 External Interrupts....................................................................................................................... 12-2 12.3 Interrupts by External Write Through SysAD[6:0] ....................................................................... 12-2 12.4 Software Interrupt........................................................................................................................ 12-2 12.5 Timer Interrupt............................................................................................................................ 12-3 12.6 Masking of the TX4955 Interrupts ............................................................................................... 12-3 12.7 Recognition of the Processor Interrupts ....................................................................................... 12-3 13. Power-Saving Modes ....................................................................................................................... 13-1 13.1 Halt Mode ................................................................................................................................... 13-1 13.2 Doze Mode.................................................................................................................................. 13-1 13.3 Status Shifts ................................................................................................................................. 13-2 14. JTAG Interface................................................................................................................................ 14-1 14.1 What Boundary Scanning Is ........................................................................................................ 14-1 14.2 Signal Summary .......................................................................................................................... 14-2 14.3 JTAG Controller and Registers .................................................................................................... 14-3 14.3.1 Instruction Register ............................................................................................................... 14-3 14.3.2 Bypass Register ..................................................................................................................... 14-4 14.3.3 Boundary-Scan Register(BSR) ............................................................................................... 14-5 14.3.4 Device Identification Register................................................................................................ 14-7 14.3.5 Test Access Port (TAP).......................................................................................................... 14-8 14.3.6 TAP Controller ..................................................................................................................... 14-8 14.3.7 Controller Reset .................................................................................................................... 14-8 14.3.8 TAP Controller ..................................................................................................................... 14-9 14.4 Instructions for JTAG ................................................................................................................ 14-13 14.4.1 The EXTEST Instruction .................................................................................................... 14-13 14.4.2 The SAMPLE/PRELOAD Instruction ............................................................................... 14-14 14.4.3 The BYPASS Instruction..................................................................................................... 14-15 14.4.4 The IDCODE Instruction ................................................................................................... 14-15 15. CPU Instruction Set Summary ........................................................................................................ 15-1 15.1 Introduction................................................................................................................................. 15-1 15.2 Instruction Format....................................................................................................................... 15-1 15.3 Instruction Set Overview.............................................................................................................. 15-2 15.3.1 Load and Store Instructions (Table 15.3.1) ............................................................................ 15-2 15.3.2 Computational Instructions (Table 15.3.2)............................................................................. 15-3 15.3.3 Jump and Branch Instructions (Table 15.3.3) ......................................................................... 15-4 15.3.4 Special Instructions (Table 15.3.4) ......................................................................................... 15-5 15.3.5 Exception Instructions (Table 15.3.5)..................................................................................... 15-5 15.3.6 Coprocessor Instructions (Table 15.3.6) ................................................................................. 15-6 15.3.7 CP0 Instructions (Table 15.3.7) ............................................................................................. 15-6 15.3.8 Multiply and Divide Instructions (Table 15.3.8)..................................................................... 15-7 15.3.9 Debug Instructions (Table 15.3.9).......................................................................................... 15-7 15.3.10 Other Instructions (Table 15.3.10) ......................................................................................... 15-7 15.4 Instruction Execution Cycles........................................................................................................ 15-7 15.5 Defining Access Types ................................................................................................................. 15-8 15.6 Bit Encoding of CPU Instruction OPcodes .................................................................................. 15-9 16. FPU Instruction Set Details ............................................................................................................. 16-1 16.1 Instruction Formats ..................................................................................................................... 16-1 16.2 Instruction Set Summary ............................................................................................................. 16-2 v Table of Contents 16.2.1 Floating-Point Loads, Stores, and Moves ............................................................................... 16-2 16.2.2 Floating-Point Computational Instructions............................................................................ 16-2 16.3 Load and Store Instructions ......................................................................................................... 16-3 16.4 Computational Instructions ......................................................................................................... 16-5 16.5 Bit Encoding of FPU Instruction OP codes.................................................................................. 16-8 17. Electrical Characteristics ................................................................................................................. 17-1 17.1 TMPR4955B Electrical Characteristics ........................................................................................ 17-1 17.1.1 Absolute Maximum Ratings .................................................................................................. 17-1 17.1.2 Recommended Operating Conditions .................................................................................... 17-1 17.1.3 DC Characteristics ................................................................................................................ 17-2 17.1.4 AC Characteristics ................................................................................................................ 17-3 17.1.5 Timing Diagrams .................................................................................................................. 17-3 17.2 TMPR4955C Electrical Characteristics ........................................................................................ 17-6 17.2.1 Absolute Maximum Ratings .................................................................................................. 17-6 17.2.2 Recommended Operating Conditions .................................................................................... 17-6 17.2.3 DC Characteristics ................................................................................................................ 17-7 17.2.4 AC Characteristics ................................................................................................................ 17-8 17.2.5 Timing Diagrams .................................................................................................................. 17-8 18. Package Dimension ......................................................................................................................... 18-1 18.1 TMPR4955BFG/TMPR4955CFG .............................................................................................. 18-1 Appendix A. PLL Passive Components....................................................................................................... A-1 Appendix B. Movement parameter setting of a processor .............................................................................B-1 Appendix C. Differences between TMPR4955BFG and TMPR4955CFG ................................................... C-1 vi Handling Precautions Handling Precautions 1. Precautions for Semiconductor Product Use Toshiba is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing Toshiba semiconductor products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such Toshiba semiconductor products could cause loss of human life, bodily injury or damage to property. In developing your designs, please check the most recent product specifications and ensure that the Toshiba semiconductor products are used within the operating ranges. Also, please keep in mind the precautions and conditions set forth in this Handbook. 1 Handling Precautions 2. Safety Precautions This section lists important precautions which users of semiconductor devices (and anyone else) should observe in order to avoid injury to human body and damage to property, and to ensure safe and correct use of devices. Please be sure that you understand the meanings of the labels and graphic symbols described below before you move on to the detailed descriptions of the precautions, and make every effort to observe the precautions stated. [Explanation of Labels] Label Meaning Indicates an imminently hazardous situation which will result in death or serious injury1 if you do not followinstructions. Indicates a potentially hazardous situation which could result in death or serious injury1 if you do not followinstructions. Indicates a potentially hazardous situation which if not avoided, may result in minor injury2, moderate injury2, or property damage3. 1. Serious injury includes blindness, wounds, burns (low and high temperature), electric shock, fractures, and poisoning, etc. with long-lasting effects or that require hospitalization and/or long-term hospital visits for treatment. 2. Injury includes wounds, burns, electric shock, etc. not requiring hospitalization and/or long-term hospital visits for treatment. 3. Damage includes extensive damage to machines and equipment. [Explanation of Graphic Symbols] Graphic Symbol Meaning Indicates prohibited (restricted) actions. Prohibited actions are explained in or near the symbols in pictures and sentences. Prohibited Indicates compulsory (mandatory) actions. Compulsory actions are explained in or near the symbols in pictures and sentences. Instructions 2 Handling Precautions Indicates cautions. Cautions are explained in or near the symbols in pictures and sentences. Caution Example of a caution symbol: Indicates laser beam caution. Caution 3 Handling Precautions 2.1 General Precautions Regarding Semiconductor Products Prohibited Prohibited Prohibited Prohibited Instructions Instructions Instructions The absolute maximum ratings of a semiconductor device are a set of ratings that must not be exceeded, even for a moment. Do not exceed any of these ratings. Exceeding the rating(s) may cause the device breakdown, damage or deterioration, and may result injury by explosion or combustion. Do not insert devices in the wrong orientation or incorrectly. Make sure that the positive and negative terminals of power supplies are connected properly. Otherwise, the current or power consumption may exceed the absolute maximum rating, and exceeding the rating(s) may cause the device breakdown, damage or deterioration, and may result injury by explosion or combustion. In addition, do not use any device that is applied the current with inserting in the wrong orientation or incorrectly even just one time. Do not touch the heat sink of the device while the device is on or immediately after the device has been turned off. Heat sinks become hot. Contact to the heat sink may result in a burn. Do not touch the lead tips of a device. Some devices have leads withsharp tips. Contact to sharp tips may result in a puncture wound. On the evaluation, inspection or test, be sure to connect the test equipment’s electrodes or probes to the pins of the device before turning the power on. When you have finished, discharge any electrical charge remaining in the device. Insufficient connection, wrong power-on timing or incomplete discharge may cause electric shock, resulting in injury. Check that there is no electrical leakage before grounding measuring equipment or a solder iron. Electrical leakage may cause the device you are testing or soldering to electrically break down or may cause electric shock. Always wear safety glasses when cutting the leads of a device with clippers or a similar tool. Failure to do so may result in eye damage from the small shavings that fly off the cut ends. 4 Handling Precautions 2.2 2.2.1 Precautions Specific to Product Group Optical Semiconductor Devices Prohibited Prohibited When a semiconductor laser is operating, do not look into the laser beam or look through the optical system. Doing so may damage your eyesight or, in the worst case, cause blindness. When inspecting the optical characteristics of the laser using laser protective glasses, be sure the glasses comply with JISC6802. Do notapply voltage or current into the LED device that exceeds the device’s absolute maximum rating. With resin-packaged LED devices in particular, excessive voltage or current may cause the package resin to explode, scattering resin fragments and may result injury. When evaluating and testing the dielectric strength voltage of a photocoupler, use equipment that can shut off the supply voltage if a leakage current exceeding 100µA is detected. Instructions Instructions 2.2.2 Failure to do so may result in the continuous flow of a large short-circuit current, causing the device to explode or combust, resulting in fire or injury. When designing a semiconductor laser, use the built-in or another light-receiving element to stabilize optical output so as to ensure that laser beams exceeding the laser’s rated optical output are not emitted. If this stabilization function does not work properly and the rated output is exceeded, not only the device may break down but also injury may result by the laser beam. Power Device Prohibited Instructions Do not touch a power device while it is on or after it has been turned off and all remaining electrical charge has not yet been discharged. Touching power element with electrical charge may cause electric shock, resulting in death or serious injury. When evaluating, inspecting or testing a device, be sure to connect all of the test equipment’s electrodes or probes before turning the power on. When you have finished, discharge any electrical charge remaining in the device. Connecting the electrodes or probes with the power on may cause electric shock, resulting in death or serious injury. 5 Handling Precautions Prohibited Instructions Instructions Instructions Instructions Instructions Instructions Instructions Do not use a device under conditions that exceed its absolute maximum ratings (such as current, voltage, safe operation range, temperature.). Using device with exceeded its absolute maximum ratings may cause the device to break down, causing a short-circuit current, which may in turn cause it to explode or combust, resulting in fire or injury. Use a unit which can detect short-circuit currents and shut off the power supply if a short-circuit occurs. If the power supply is not shut off, a large short-circuit current will flow continuously, causing the device to explode or combust, resulting in fire or injury. Design the case for enclosing your system taking into consideration the prevention of flying debris in the event the device explodes or combusts. Flying debris may cause injury. When conducting an evaluation, inspection or test, use protective safety tools such as device covers. The device may explode or combust due to excessive stress in the event of breakdown or arc discharge between the electrode and ground potential, resulting in fire or injury. Design your product so that it is used with all metal areas (other than electrodes and terminals) grounded. Even with products where the device’s electrodes and metal casings are insulated, electrostatic capacitance in the product may cause the electrostatic potential in the casing to rise. Insulation deterioration or breakdown may cause a high voltage to be applied to the casing, causing electric shock when touched, resulting in death or serious injury. When designing the heat radiation and safety features of a system incorporating Schottky barrier diodes and high-speed rectifiers, take into consideration the device’s forward and reverse losses. The reverse current in these devices is greater than that in ordinary rectifiers. If the operating environment is severe (such as high temperature, high voltage), the device’s reverse loss may increase, causing a short-circuit current and subsequently explosion or combustion, resulting in fire or injury. Be sure to design the product so that, except when the main circuits of the device are active, the main circuits will be inactive when electricity is conducted to control circuits. Malfunction of the device may cause a serious accident or injury. When conducting an evaluation, inspection or test, either wear protective gloves or wait until the device cools down prior to handling. Devices become hot when operated. Even after the power supply has been turned off, residual heat may cause a burn when the device is touched. 6 Handling Precautions 2.2.3 Application Specific Standard Products and General-Purpose Linear ICs Instructions Instructions Instructions Instructions Use an appropriate power supply fuse to ensure that a large current does not continuously flow in case of over current and/or IC failure. The IC will fully break down when used under conditions that exceed its absolute maximum ratings, when the wiring is routed improperly or when an abnormal pulse noise occurs from the wiring or load, causing a large current to continuously flow and the breakdown can lead smoke or ignition. To minimize the effects of the flow of a large current in case of breakdown, appropriate settings, such as fuse capacity, fusing time and insertion circuit location, are required. If your design includes an inductive load such as a motor coil, incorporate a protection circuit into the design to prevent device malfunction or breakdown caused by the current resulting from the inrush current at power ON or the negative current resulting from the back electromotive force at power OFF. For details on how to connect a protection circuit such as a current limiting resistor or back electromotive force adsorption diode, refer to individual IC datasheets or the IC databook. IC breakdown may cause injury, smoke or ignition. Use a stable power supply with ICs with built-in protection functions. If the power supply is unstable, the protection function may not operate, causing IC breakdown. IC breakdown may cause injury, smoke or ignition. Carefully select external components (such as inputs and negative feedback capacitors) and load components (such as speakers), for example, power amp and regulator. If there is a large amount of leakage current such as input or negative feedback condenser, the IC output DC voltage will increase. If this output voltage is connected to a speaker with low input withstand voltage, over current or IC failure can cause smoke or ignition. (The over current can cause smoke or ignition from the IC itself.) In particular, please pay attention when using a Bridge Tied Load (BTL) connection type IC that inputs output DC voltage to a speaker directly. 7 Handling Precautions 2.2.4 Memory Card Products Prohibited Prohibited Prohibited Prohibited Prohibited Prohibited Keep out of reach of small children. Accidental swallowing may cause suffocation or injury. Contact a doctor immediately if you suspect a child has swallowed the Product. Do not directly touch the interface pins, put them in contact with metal, strike them with hard objects, or cause them to short. Do not expose to static electricity. Do not bend, apply strong force to, drop, expose to strong impact or lay heavy objects on top of the Product. Do not put the Product in the back pocket, etc. of trousers. It may break when you sit down or exert strong force on it in other ways. Do not disassemble or modify the Product. This may cause electric shock, damage to the Product, or fire. Do not expose the Product to moisture. Do not use, store, or place in humid locations or expose to water. Do not expose the Product to excessive heat or cold. Do not use, store, or place in direct sunlight, inside a hot car, near fire or sources of heat or flame, such as a stove. Do not use, store, or place the Product near an air-conditioner outlet. Do not expose the Product to dust, strong magnetic fields, or corrosive chemicals or gas. Avoid sudden temperature changes which could cause condensation. Prohibited 8 Handling Precautions Prohibited (Applicable only to mini SD) While writing data to or reading data from the Product, do not turn off the power, remove the Product or the miniSD adapter from the device, or permit the Product or device to be shaken or impacted. Prohibited (Applicable only to mini SD) Do not insert, remove or change the Product while the miniSD adapter is still inserted into a device. This may cause product failure or the destruction or loss of data. Prohibited (Applicable only to mini SD) Do not insert into a device the miniSD adapter that does not contain the Product. This may cause improper function on the device. Prohibited (Applicable only to mini SD) Do not insert into the miniSD adapter a memory card other than the Product or other foreign object. This may cause product failure. Prohibited Prohibited Instructions Instructions Instructions While writing data to or reading data from the Product, do not turn off the power, remove the Product from the device, or permit the Product or device to be shaken or impacted. (Applicable only to USB flash memory) Performing the following operations with the Product connected to your PC may cause improper function on your PC. - Booting - Rebooting - Resuming from standby or suspended mode Please perform these operations after removing the Product from your computer. The Product comes pre-formatted. When formatting, all data stored in the Product will be lost, so make sure to back up the data on the Product. Please use functions relevant to the Product. (Applicable to SD, mini SD and compact flash) Formatting with other devices, for example PCs, may cause problems such as the inability to read, write, or delete data. (Applicable only to USB flash memory) Please take note of the following when formatting the Product using Windows XP or Windows 2000. · Log in as a user with administrator access rights. The Product cannot be formatted while logged in as a user with limited access rights. · Format the Product as FAT. It may not format properly as NTFS or FAT32. When removing the Product from the slot or the USB port of a PC, first follow the removal (stop) procedure for your operating system. 9 Handling Precautions Refer to your device’s manual to learn how to insert and remove the Product. Instructions Instructions Instructions Instructions Insert the Product firmly in the correct orientation. The Product will not operate correctly if it is inserted in an incorrect orientation or not inserted all the way. Always use the Product with the interface pins and connector in a clean state. When cleaning the Product, use a soft, dry cloth. (Applicable only to miniSD) Always use the miniSD adapter when using the Product with a standard SD memory card device. Directly inserting the Product into a standard SD memory card device may cause improper function on the device. 10 Handling Precautions 3. General Safety Precautions and Usage Considerations This section provides information that will help you gain a better understanding of semiconductor devices so as to ensure device safety, quality and reliability. 3.1 From Incoming to Shipping 3.1.1 Electrostatic Discharge (ESD) When handling individual devices, be sure that the environment is protected against static electricity. Operators should wear anti-static clothing. In addition, containers and other objects that come in direct contact with devices should be made of materials that do not produce static electricity that would cause damage. Please follow the precautions below. This is particularly important for those devices marked “Be careful of static.” 3.1.1.1 Work Environment Control (1) When humidity decreases, static electricity readily occurs due to friction. Taking into consideration the fact that moisture-proof-packed products absorb moisture after unpacking, the recommended humidity is 40 to 60%. (2) Be sure that all equipment such as jigs and tools installed in the work area are grounded. (3) Place a conductive mat over the floor of the work area or take other measure to ensure that the floor is protected against static electricity and is grounded to the earth. (Resistance between surface and ground: 1 x 109Ω or less) (4) Place a conductive mat over the surface of worktables to ensure that the tables are grounded. (Resistance between surface and ground: 7.5 x 105 to 1 x 109Ω) Do not construct worktable surfaces of metallic materials. Metallic materials are low in resistance, allowing rapid discharge when a charged device comes in contact with them directly. (5) Observe the following when using automated equipment: (a) When picking up a device with a vacuum, use conductive rubber in sections which come into contact with the device surface to protect against electrostatic charge. (b) Avoid friction on the device surface to the extent possible. If rubbing is unavoidable due to the device’s mechanical structure, minimize the friction plane or use material with a small friction coefficient and low electrical resistance. Also, prevent electrostatic charge by using an ionizer. (c) Use a material which dissipates static electricity in sections which come in contact with device leads or terminals. (d) Ensure that no statically charged bodies (such as work clothes or the human body) come in contact with the devices. (e) Use a tape carrier that employs a low-resistance material on sections that come in contact with 11 Handling Precautions electrical machinery. (f) Make sure that jigs and tools used in the manufacturing process do not touch the devices. (g) In processing associated with package electrostatic charge, use an ionizer to neutralize the ions in the ambient environment. (6) Make sure that CRT displays in the work area are protected against static charge by employing a filter, for example. Avoid turning displays on and off to the extent possible. Neglecting to do so can cause electrostatic induction in devices. (7) Periodically measure the charged potential of devices, systems and fixtures located in the work area to ensure that the area is free of any charge. (8) Ensure that the work chairs are protected by a conductive cover and grounded to the floor by conductive castors. (Resistance between seat surface and ground: 1 x 1010Ω or less) (9) Install anti-static mats on storage shelf surfaces and ground the mat surface. (Resistance between surface and ground: 7.5 x 105 to 1 x 109Ω) (10) For device transport and temporary storage, use containers (boxes, jigs or bags) that are made of a material which does not produce static electricity that could damage the device. (11) Make sure that cart surfaces which come in contact with product packaging are made of materials which conduct static electricity, and ground the cart surfaces to the floor surface using conductive castors. (12) In static electricity control areas, install anti-static dedicated ground wires. Use a transmission line circuit ground wire [Type D (previous Class C) or above], or a trunk line ground wire. In addition, separate and ground the various devices individually. 3.1.1.2 Work Environment Control (1) Operators must wear anti-static clothing and conductive shoes (or a toe or heal strap). (2) Operators must wear a wrist strap grounded to earth via a resistor. (Resistance between surface and earth when worn: 7.5 x 105 to 3.5 x 107Ω) (3) Soldering irons must be grounded from the iron tip to earth, and must be used at low voltages (6 to 24V). (4) If the tweezers you use are likely to touch the device terminals, use anti-static tweezers. Do not use metallic tweezers since they are low in resistance and may cause rapid discharge when a charged device comes in contact with them. When using a vacuum tweezers, attach a conductive chucking pat to the tip, and connect it to a dedicated anti-static ground. In addition, follow the manufacturer’s methods of use and maintenance. (5) Do not place devices or their containers near sources of strong electrical fields (such as above a CRT). (6) Place boards with mounted devices in anti-static board containers separated from one another, and do not stack them directly on top of one another. Stacking them directly on top of one another may cause frictional charge or discharge. 12 Handling Precautions (7) Ensure, to the extent possible, that any articles (such as clipboards) which are brought to a static electricity control area are constructed of anti-static materials. (8) When the human body is to come in direct contact with a device, wear anti-static finger covers or gloves. (9) The material of equipment safety covers located near devices should have a resistance rating of 1 x 109Ω or less. (10) If a wrist strap cannot be used and there is a possibility of imparting friction to devices, use an ionizer. (11) The transport film used in tape carrier products is manufactured from materials in which static electricity readily builds up. When using these products, use an ionizer to prevent the film from being charged. Also, to ensure than no static electricity will be applied to the copper foil area, take measures to prevent electrostatic discharge failure of peripheral equipment. 3.1.2 Vibration, Impact and Stress Handle devices and packaging with care. Dropping or applying impact to devices or packaging causes device damage. Ensure that devices and packaging are not subjected to mechanical vibration or impact to the extent possible. Hollow canister-type devices and ceramic sealed devices contain unsecured Vibration wires, making them more susceptible to vibration and impact than plastic sealed devices. When a location such as a soldered area, connecting area or top surface of a device is subjected to vibration, impact or stress in actual equipment, bonding fault or device destruction may result. Therefore, be sure to keep this in mind at the time of structural design. If a device is subject to especially strong vibration, impact or stress, the package or chip may crack. If stress is applied to a semiconductor chip through the package, changes in the resistance of the chip may result due to piezoelectric effects, resulting in fluctuation in element characteristics. Furthermore, if a stress that does not instantly result in damage is applied continually for a long period of time, product deformation may result, causing defects such as disconnection or element failure. Thus, at the time of structural design, carefully consider vibration, impact and stress. 3.2 3.2.1 Storage General Packaged Products (1) Avoid storage locations where devices may be exposed to moisture or direct sunlight. Humidity: (2) Follow the precautions printed on the packing label of the device for transportation and storage. (3) Keep the storage location temperature and humidity within a range of 5°C to 35°C and 45% to 75%, respectively. 13 Temperature: Handling Precautions (4) Do not store the products in locations with poisonous gases (especially corrosive gases) or in dusty conditions. (5) Store the products in locations with minimal temperature fluctuations. Rapid temperature changes during storage can cause condensation, resulting in lead oxidation or corrosion, which will deteriorate the solderability of the leads. (6) When restoring devices after removal from their packing, use anti-static containers. (7) Do not allow loads to be applied directly to devices while they are in storage. (8) If devices have been stored for more than two years under normal storage conditions, it is recommended that you check the leads for ease of soldering prior to use. 3.2.2 Moisture-Proof Packing Moisture-proof packing should be used while taking into careful consideration the handling methods specified for each packing type. If the specified procedures are not followed, the quality and reliability of the devices may be deteriorated. This section describes the general precautions for handling moisture-proof packing. Since the details may differ from device to device, refer to the individual standards or databooks during handling. 3.2.2.1 Moisture-Proof Packing General Precautions Follow the precautions printed on the packing label of the device for transportation and storage. For chip products, follow the individual specifications. (1) Do not toss or drop device packing. The aluminum laminated bag may be damaged, resulting in a loss in airtightness. (2) Keep the storage environment at 5°C to 30°C, and the relative humidity at 90% or less. Use devices within 12 months of the date marked on the package seal. (3) If the 12-month storage period has been exceeded, or if the 30% humidity indicator is pink when the package is opened, remove any moisture under the conditions described in the table below. The effective usage period without moisture removal after the packing has been opened and the product has been stored at 5°C to 30°C and a relative humidity of 60% is listed on the moisture-proof package. If the effective usage period has been exceeded, or if the packing has been stored in a high-humidity environment or an environment that produces condensation, remove any existing moisture. 14 Handling Precautions Packing Type Tray Moisture Removal Applicability/Procedure If the packing indicates a “Heatproof” or temperature label, bake at 125°C for 20 hours. (Some devices may require a different amount of time.) If the packing does not indicate a “Heatproof” or temperature label, transfer the devices to an anti-static container that bears a “Heatproof” or temperature label and then bake. The moisture-proof package itself is not heat resistance. Be sure to remove the devices from the package prior to baking. Magazine Transfer devices to antistatic containers bearing the “Heatproof” or temperature label, and then bake at 125°C for 20 hours. (Some devices may require a different amount of time.) The moisture-proof package itself is not heat resistance. Be sure to remove the devices from the package prior to baking. Tape Transfer devices to antistatic containers bearing the “Heatproof” or temperature label, and then bake at 125°C for 20 hours. (Some devices may require a different amount of time.) The moisture-proof package itself is not heat resistance. Be sure to remove the devices from the package prior to baking. (4) When removing the moisture from the devices, protect the devices from breakdown from static electricity. (5) Moisture indicators (for your reference) Moisture indicators detect the approximate ambient humidity level at a standard temperature of 25°C. Figure 3.1 shows a 3-point indicator. HUMIDITY INDICATOR 30 DANGER IF PINK 40 20 READ AT LAVENDER BETWEEN PINK & BLUE 3-point indicator Figure 3.1 Humidity Indicator (6) Do not allow loads to be applied directly to devices while they are in storage. 15 Handling Precautions 3.3 Design To achieve the reliability required by an electronic device or system, it is important not only to use the semiconductor device in accordance with specified absolute maximum ratings and operating ranges, but also to consider the environment in which the equipment will be used, including factors such as the ambient temperature, transient noise and current surges, as well as mounting conditions which affect semiconductor device reliability. This section describes general design precautions. Be sure to refer to the individual ratings of each product at the time of design. 3.3.1 Absolute Maximum Ratings The absolute maximum ratings of a semiconductor device are a set of ratings that must not be exceeded, even for a moment. Do not exceed any of these ratings. Exceeding the rating(s) may cause device breakdown, damage or deterioration, and may result injury by explosion or combustion. If the voltage or current on any pin exceeds the absolute maximum rating, the overvoltage or overcurrent causes the device’s internal circuitry to deteriorate. In extreme cases, heat generated in internal circuitry can fuse wiring or cause the semiconductor chip to break down. If the storage or operating temperature exceeds the absolute maximum rating, the device internal circuitry may deteriorate and the bonded areas may open or the package airtightness may deteriorate due to the differences between the thermal expansion coefficients of the materials from which the device is constructed. Although absolute maximum ratings differ from product to product, they essentially concern the voltage and current at each pin, the allowable power dissipation, the connecting area temperatures, and storage temperatures. Note that the term “maximum rating” which appears in semiconductor technical datasheets and the like refers to “absolute maximum rating.” 3.3.2 Operating Range The operating range is the range of conditions necessary for the device to operate as specified in individual technical datasheets and databooks. Care must be exercised in the design of the equipment. If a device is used under conditions that do not exceed absolute maximum ratings but exceed the operating range, the specifications related to device operation and electrical characteristics may not be met, resulting in a decrease in reliability. If greater reliability is required, derate the device’s operating ranges for voltage, current, power and temperature before use. 16 Handling Precautions 3.3.3 Derating The term “derating” refers to ensuring greater device reliability by setting operating ranges reduced from rated values and taking into consideration factors such as current surges and noise. While derating generally applies to electrical stresses such as voltage, current and power, and environmental stresses such as ambient temperature and humidity, it differs from application to application. Refer to the individual technical datasheets available for each product. Power devices in particular require heat sink consideration as well since the level of derating greatly affects reliability. For your reference, details are provided in the appendix. Be sure to read the appendix carefully. 3.3.4 Unused Pins If unused pins are left open, some devices exhibit input instability, resulting in faulty operation such as a sudden increase in current consumption. In addition, if unused output pins on a device are connected to the power supply, GND or other output pin, the IC may malfunction or break down. Since the treatment of unused input and output pins differs for each product and pin, please follow the directions in the individual technical datasheets and databooks. CMOS logic IC inputs, for example, have extremely high impedance. If an input pin is left open, it can readily pick up noise and become unstable. In this case, if the input reaches an intermediate level, both the P-channel and N-channel transistors will become conductive, allowing unnecessary power supply current to flow. It is therefore necessary to ensure that the unused input gates of a device are connected to the power supply pin or ground (GND) pin of the same device. For treatment of heat sink pins, refer to the individual technical datasheets and databooks. 3.3.5 Latch-up Semiconductor devices sometimes transition to an inherent condition referred to as “latch-up.” This condition mainly occurs in CMOS devices. This happens when a parasitic PN-PN junction (thyristor structure) built in the device itself is turned on, causing a large current to flow between the power supply voltage and GND, eventually causing the device to break down. Latch-up occurs when the voltage impressed on an input or output pin exceeds the rated value, causing a large current to flow in the internal element, or when the voltage impressed on the power supply voltage pin exceeds its rated value, forcing the internal element to breakdown. Once the element falls into the latch-up state, even though the excess voltage may have been applied only for an instant, the large current continues to flow between the power supply voltage and GND, potentially causing device explosion or combustion. To avoid this problem, observe the following: (1) Do not allow the voltage levels on the input and output pins to rise above the power supply voltage or decrease below GND. Consider the timing during power supply activation as well. (2) Do not allow any abnormal noises to be applied to the device. (3) Set the electrical potential of unused input pins to the power supply voltage or GND. (4) Do not create an output short. 17 Handling Precautions 3.3.6 Input/Output Protection Wired-AND configurations in which outputs are connected together directly cannot be used since the outputs short-circuit with the configurations. Outputs should, of course, never be connected to the power supply voltage or GND. In addition, products with tri-state outputs can undergo IC deterioration if a shorted output current continues for a long period of time. Design the circuit so that the tri-state outputs will not be enabled simultaneously. 3.3.7 Load Capacitance Certain devices exhibit an increase in delay times and a large charging and discharging current if a large load capacitance is connected, resulting in noise. In addition, since outputs are shorted for a long period of time, wiring can become fused. Use the load capacitance recommended for each product. 3.3.8 Thermal Design The failure rate of semiconductor devices largely increases as the operating temperatures increase. As shown in Figure 3.2, the thermal stress applied to device internal circuitry is the sum of the ambient temperature and the temperature rise caused by the power consumption of the device. For thermal design, therefore, refer to the precautions stated in individual technical datasheets and databooks. To achieve even higher reliability, take into consideration the following thermal design points: (1) Conduct studies to ensure that the ambient temperature (Ta) is maintained as low as possible, avoiding the effects of heat generation from the surrounding area. (2) If the device’s dynamic power consumption is relatively large, conduct studies regarding use of forced air-cooling, circuit board composed of low thermal resistance material, and heat sinks. Such measures can lower the thermal resistance of the package. (3) Derate the device’s absolute maximum ratings to minimize thermal stress from power consumption. θja = θjc + θca θja = (Tj − Ta)/P θjc = (Tj − Tc)/P θca = (Tc − Ta)/P where, θja: Thermal resistance between junction and ambient air (°C/W) Ta θca Tc θjc: Thermal resistance between junction and package surface, or internal thermal resistance (°C/W) θca: Thermal resistance between package surface and θjc Tj ambient air, or external thermal resistance (°C/W) Tj: Junction temperature or chip temperature (°C) Tc: Package surface temperature or case temperature (°C) Ta: Ambient temperature (°C) Figure 3.2 Thermal Resistance of Package P: Power consumption (W) 18 Handling Precautions 3.3.9 Interfacing When connecting devices with different input and output voltage levels, make sure that the input voltage (VIL/VIH) and output voltage (VOL/VOH) levels match. Otherwise, the devices may malfunction. In addition, when connecting devices with different power supply voltages, such as in a dual power supply system, device breakdown may result if the power-on and power-off sequences are incorrect. For device interface details, refer to the individual technical datasheets and databooks. In addition, if you have any questions about interfacing, contact your nearest Toshiba office or distributor. 3.3.10 Decoupling Spike currents generated during switching can cause power supply voltage and GND voltage levels to fluctuate, causing ringing in the output waveform or a delay in the response speed. (The power supply and GND wiring impedance is normally 50 to 100Ω.) For this reason, the impedance of the power supply lines with respect to high frequencies must be kept low. Specifically, this is ideally accomplished by routing thick and short power supply and GND lines and by inserting decoupling capacitors (of approximately 0.01 to 1µF) as high-frequency filters between the power supply and GND into each required location on the circuit board. For low-frequency filtering, it is appropriate to insert a 10 to 100µF capacitor in each circuit board. However, conversely if the capacitance is excessively large (such as 1000µF), latch-up may result. An appropriate capacitance value is therefore required. On the other hand, in the case of high-speed logic ICs, noise is caused by reflection, crosstalk or common power supply impedance. Reflections cause increased signal delay, ringing, overshoot and undershoot, thereby reducing the device’s noise margin. One effective wiring measure for preventing reflections is to reduce the wiring length by increasing the mounting density so as to lower the wiring inductance (L) and capacitance (C). This measure, however, also requires consideration with regard to crosstalk between wires. In actual pattern design, both of these factors must be considered. 3.3.11 External Noise When externally induced noise or surges are applied to a printed circuit board with long I/O signals or signal lines, malfunction may result, depending on the device. To protect against noise, protective measures against surges must be taken such as lowering the impedance of the Input/Output Signals signal line or inserting a noise-canceling circuit. For details of required protection, refer to individual technical datasheets and databooks. 19 Handling Precautions 3.3.12 Electromagnetic Interference Radio and TV reception problems have increased in recent years as a result of increased electromagnetic interference radiated from electrical and electronic equipment. To use radio waves effectively and to maintain the quality of radio communications, each country has defined limitations for the amount of electromagnetic interference which can be generated by designated devices. The types of electromagnetic interference include noise propagated through power supply and telephone lines, and noise from direct electromagnetic waves radiated from equipment. Different measurement methods and corrective actions are used for each type. Difficulties in countering electromagnetic interference derive from the fact that there is no means for calculating at the design stage the strength of the electromagnetic waves produced from each component in a piece of equipment. As a result, it is after the prototype equipment has been completed that measurements are taken using dedicated instruments to determine for the first time the strength of the electromagnetic interference. Yet it is possible during system design to incorporate measures for the prevention of electromagnetic interference which can facilitate corrective action after design completion. One effective method, for example, is to design the product with several shielding options, and then select the optimum shielding method based on the results of the measurements subsequently taken. 3.3.13 Peripheral Circuits In many cases semiconductor devices are used with peripheral circuits and components. The input and output signal voltages and currents in these circuits must be designed to match the specifications of the device, taking into consideration the factors below. (1) Input voltages and currents that are not appropriate with respect to the input pins may cause malfunction. Some devices contain pull-up or pull-down resistors, depending on specifications. Design your system taking into account the required voltage and current. (2) The output pins on a device have a predetermined external circuit drive capability. If a drive capability exceeding this value is required, either insert a compensating circuit or take that fact into account when selecting components for use in external circuits 3.3.14 Safety Standards Each country and region has established safety standards which must be observed. These safety standards sometimes include requirements for quality certification systems and insulation design standards. The safety standards of the respective countries and regions must be taken fully into account to ensure compliant device selection and design. 20 Handling Precautions 3.3.15 Other (1) When designing a system, incorporate fail-safe and other measures according to system application. In addition, debug the system under actual mounting conditions. (2) If a plastic package device is placed in a strong electric field, surface leakage may occur due to charge-up, resulting in malfunction. When using such a device in a strong electric field, take measures by, for example, protecting the package surface with a conductive shield. (3) With some memory devices and microcomputers, attention is required at power on or reset release. To ensure that your design is device appropriate, refer to the individual technical datasheets and databooks. (4) Design the casing so as to ensure that no conductive material (such as a metal pin) can drop from an external source onto a terminal of a mounted device, causing a short. 3.4 3.4.1 Inspection, Testing and Evaluation Grounding Check that there is no electrical leakage before grounding measuring equipment or a solder iron. Electrical leakage may cause the device you are testing or soldering to electrically break down or may cause electric shock. 3.4.2 Inspection Sequence [1] Do not insert devices in the wrong orientation or incorrectly. Make sure that the positive and negative terminals of power supplies are connected properly. Otherwise, the current or power consumption may exceed the absolute maximum rating, and exceeding the rating(s) may cause the device breakdown, damage or deterioration, and may result injury by explosion or combustion. In addition, do not use any device that is applied the current with inserting in the wrong orientation or incorrectly even just one time. [2] On the evaluation, inspection or test using AC power with a peak value of 42.4V or DC power exceeding 60V, be sure to connect the electrodes or probes of the testing equipment before activating the power. When you have finished, discharge any electrical charge remaining in the device. Insufficient connection, wrong power-on timing or incomplete discharge may cause electric shock, resulting in injury. (1) Apply voltage to the device after inserting it into the test jig. At this time, observe the power supply activation or shutdown standards, if existent. (2) After test completion, be sure that the voltage applied to the device is off before removing the device from the test jig. Removing the device with the power supply on can cause device deterioration or breakdown. 21 Handling Precautions (3) Make sure that no surge voltages from the measuring equipment are applied to the device. (4) The chips in tape carrier packages (TCPs) are LSI chips and therefore exposed. During inspection, be careful not to crack or scratch the chip. Electrical contact may also cause chip failure. Therefore make sure that nothing comes into electrical contact with the chip. 3.5 Mounting There are two types of device packages: lead insertion and surface mount. The items that affect reliability during circuit board mounting include contamination by flux and thermal stress during the soldering process. With surface-mount devices in particular, the most significant problem is thermal stress from solder reflow, when the entire package is subjected to heat. In addition, the mounting method differs according to factors such as chip size and frame design, even for the same package type. For details, refer to the individual technical datasheets and databooks for each device. When a location such as a soldered area, connecting area or top surface of a device is subjected to vibration, impact or in actual equipment, bonding fault or device destruction may result. Therefore, be sure to keep this in mind at the time of mounting. If a device is subject to especially strong vibration, impact or stress, the package or chip may crack. Thus, at the time of mounting, carefully consider vibration, impact and stress. 3.5.1 Lead Forming [1] Always wear safety glasses when cutting the leads of a device with clippers or a similar tool. Failure to do so may result in eye damage from the small shavings that fly off the cut ends. [2] Do not touch the lead tips of a device. Some devices have leads withsharp tips. Contact to sharp tips may result in a puncture wound. Semiconductor devices sometimes undergo a process in which the leads are cut and formed before the devices are installed on a printed circuit board. If abnormal stress is applied to the interior of a device during this process, mechanical breakdown or reliability deterioration may result. This is attributable mainly to the relative stress applied between the device itself and the lead, and can result in internal lead damage, adhesive property deterioration and sealant breakdown. Observe the following precautions during the lead-forming process. (This does not apply to surface-mount devices.) (1) Lead insertion hole intervals on the printed circuit board should be designed using the same dimension standard as that for the lead interval of the device. (2) If the lead insertion hole intervals on the printed circuit board do not match the lead interval of the device, do not forcibly insert the device. 22 Handling Precautions (3) For the minimum dimension between a device and printed circuit board, refer to the individual technical datasheets and databooks. When necessary, create space when forming the device’s leads. Do not use the spacers for raising devices above the surface of the printed circuit board during soldering. These spacers may continue to expand due to heat even after the solder has solidified, sometimes applying a great amount of stress to the device. (4) Observe the following when forming the leads of a device: (a) When bending a lead, secure the lead at the end of the bending section near the package to ensure that mechanical stress is not applied to the device. Also, do not repeatedly bend or stretch a lead at the same location. (b) Do not damage the lead during lead forming. (c) Following any other precautions specified in the individual technical datasheets or databooks. 3.5.2 Socket Mounting (1) When socket-mounting devices on a printed circuit board, use sockets that match the package. (2) Use sockets with contacts that have the appropriate contact pressure. If the contact pressure is insufficient, the contact may become poor when the device is repeatedly inserted and removed. If the contact pressure is too high, the device leads may bend or become damaged when they are inserted into or removed from the socket. (3) When soldering sockets to the printed circuit board, use sockets designed to prevent flux from penetrating the contacts and to allow flux to be completely cleaned off. (4) Ensure that the coating agent applied to the printed circuit board for moisture-proofing does not adhere to the socket contacts. (5) If the leads are severely bent when inserted into or removed from a socket and you want to repair the leads and continue using the device, repair the leads once only. Do not use devices whose leads have been corrected multiple times. (6) If external vibration will be applied to a printed circuit board with devices mounted on it, use sockets with strong contact pressure so as to prevent vibration between the devices and sockets. 3.5.3 Lead(Pb)-Free / Lead(Pb)-Free Finish* Soldering Temperature Profile Perform soldering following the methods and conditions described in the individual technical datasheets and databooks for the device used. The soldering method, temperature and time may be restricted, depending on the device. All soldering temperature profiles and conditions described in the mounting methods below are representative. The profiles and conditions vary from product to product. Therefore, mount the product after first confirming the information described in the individual technical datasheets and databooks with the customer. For details regarding lead(Pb) soldering, please contact your nearest Toshiba office or distributor. *Toshiba Semiconductor Company defines capitalized “Lead(Pb)-Free” products as those Containing no more than 0.1 percent lead(Pb) by weight in homogeneous materials. This does not mean that Toshiba Semiconductor products labeled "Lead(Pb)-Free" are entirely free of 23 Handling Precautions lead(Pb). In addition to Lead(Pb)-Free, Toshiba Semiconductor Company will offer products that have Lead(Pb)-Free terminals, which will be referred to as “Lead(Pb)-Free Finish.” The Lead(Pb)-Free Finish products may Contain greater than 0.1 percent lead(Pb) by weight in homogeneous materials in portions of the product other than the terminals (based on the exemption(s) in the RoHS Directive), for example, in internal solder used to connect the semiconductor silicon to the package. This does not mean that Toshiba Semiconductor products that are labeled "Lead(Pb)-Free Finish" have terminals that are entirely free of lead(Pb). Furthermore, the expressions “Lead(Pb)-Free” and “Lead(Pb)-Free Finish” will be changed in package labeling as the like below from April 2006. <<Examples of correspondence with the existing lead (Pb)-free markings>> [Lead (Pb)-free products]: Lead (Pb)-Free -> [[G]]/RoHS COMPATIBLE [Lead (Pb)-free finish products]: Lead(Pb)-Free Finish -> [[G]]/RoHS [[Pb]] 3.5.3.1 Using a Soldering Iron Complete soldering within 10 seconds for lead temperatures of up to 260°C, or within 3 seconds for lead temperatures of up to 350°C. 3.5.3.2 Using Infrared Reflow (1) It is recommended the top and bottom heating method with long or medium infrared rays. (See Figure 3.3.) Medium infrared ray heater (Reflow heater) Device flow Long infrared ray heater (preheater) Figure 3.3 Top and Bottom Heating Method with Long or Medium Infrared Rays (2) Complete the infrared ray reflow process with a maximum package surface temperature of 260°C, within 30 to 50 seconds when a package surface temperature is 230°C or higher. (3) Refer to Figure 3.4 for an example of a temperature profile. Package Surface Tempature (°C) 260 230 190 180 60 to 120 seconds 30 to 50 seconds Time (Seconds) Figure 3.4 Example of Temperature Profile 24 Handling Precautions This profile is based on the device’s maximum heat resistance guaranteed value. Set the preheat temperature/heating temperature to the optimum temperature corresponding to the solder paste type used by the customer within the above-described profile. 3.5.3.3 Using Hot Air Reflow (1) Complete hot air reflow with a maximum package surface temperature of 260°C, within 30 to 50 seconds when a package surface temperature is 230°C or higher. (2) For an example of a temperature profile, refer to Figure 3.4 in Section 3.5.3.2 (3) above. 3.5.3.4 Using Solder Flow/Dip (1) Apply preheating for 60 to 120 seconds at a temperature of 150°C. (2) For lead insertion-type packages, mount the device within 10 seconds of solder flow with a maximum temperature of 260°C at the stopper or at a location more than 1.5mm from the body. (3) For surface-mount packages, mount the device within 5 seconds at a temperature of 250°C or less in order to avoid thermal stress. (4) Figure 3.5 shows an example of the temperature profile of solder flow for a surface-mount package. Package Surface Temperature (°C) 250 160 140 60 to 120 seconds Within 5 seconds Time (Seconds) Figure 3.5 Example of Surface-Mount Package Temperature Profile This profile is based on the device’s maximum heat resistance guaranteed value. Set the preheat temperature/heating temperature to the optimum temperature corresponding to the solder paste type used by the customer within the above-described profile. 3.5.4 Flux Cleaning (1) When cleaning circuit boards to remove flux, make sure that no reactive ions such as sodium or chlorine remain. Some organic solvents react with water to generate hydrogen chloride and other corrosive gases which can result in device deterioration. (2) When washing devices with water, make sure that no reactive ions such as sodium or chlorine remain particularly. 25 Handling Precautions (3) When washing devices, do not rub markings with a brush or with your hand while the cleansing liquid is still on the device. Doing so can rub off the markings. (4) Dip cleaning, shower cleaning and steam cleaning processes are performed based on the chemical action of a solvent. When immersing devices in a solvent or steam bath, complete the cleaning for a period of one minute or less at a liquid temperature of 50°C or less, taking into consideration the effects on the devices. (5) Avoid use of ultrasonic cleaning with hermetically sealed ceramic packages such as a leadless chip carrier (LCC), pin grid array (PGA) or charge-coupled device (CCD). Using the ultrasonic cleaning may cause the internal wires to become disconnected due to resonance. Even if a device package allows ultrasonic cleaning, keep the duration of ultrasonic cleaning in a brief time. Long hours of ultrasonic cleaning may deteriorate the adhesion between the mold resin and frame material. The basic recommended conditions are as follows: Recommended Ultrasonic Cleaning Conditions Frequency: 27 to 29kHz Ultrasonic output: Cleaning time: 15W/L or less 30 seconds or less Suspend the printed circuit board in the solvent bath to ensure that the circuit board and device do not come in direct contact with the ultrasonic vibrator. 3.5.5 No Cleaning It is recommended that you clean analog devices and high-speed devices. If such devices are not cleaned, flux may cause minute leakage between leads or migration, depending on the flux grade. Be sure therefore to check cleanliness at the time of use. If you are considering no cleaning, be sure to use a flux that does not require cleaning. 3.5.6 Tape Carrier Packages (TCPs) Mounting (1) When tape carrier packages are mounted, measures must be taken to prevent electrostatic breakdown of the devices. (2) When separating devices from tape, or carrying out outer lead bonding (OLB) mounting, be sure to take work safety into consideration. (3) The base film, which is made of polyimide, is hard and thin. Be careful not to injury yourself or damage any objects during handling. (4) When punching tape, take countermeasures to prevent minute broken pieces from scattering. Scattered pieces may cause injury. (5) Appropriately treat the tape, reels and spacers left after separating the device as industrial waste. 26 Handling Precautions (6) With tape carrier package (TCPs) devices, the backside of the LSI chips is exposed. To ensure that the chip will not crack, mount the device so that mechanical shock is not applied to the LSI backside. In addition, electrical contact may also cause LSI failure. Mount the device so that there is no electrical contact with the backside of the LSI chip. If you are mounting the backside of the LSI chip to improve device characteristics, please contact your nearest Toshiba office or distributor in advance. 3.5.7 Chips Mounting Devices delivered in chip form readily deteriorate or become damaged due to external factors in comparison with plastic-packaged products. Attention is therefore required during handling. (1) Mount devices in a properly maintained environment so that the chip will not be exposed to contaminated ambient air or other substances. (2) When handling chips, be careful not to expose the chips to static electricity. In particular, measures must be taken to prevent electrostatic breakdown during chip mounting. For this purpose, it is recommended that you mount all peripheral devices before you mount the chips. (3) Use chip mounting circuit boards (such as PCBs) that do not have any chemical residue on them (such as the chemicals used during PCB etching). (4) When mounting chips, use the method of assembly that is most suitable for achieving the appropriate electrical, thermal and mechanical characteristics of the semiconductor product used. * 3.5.8 For chip details, refer to the relevant specification sheet. Circuit Board Coating When using devices that require high reliability or devices used under extreme environments (where moisture, corrosive gas or dust is present), circuit boards are sometimes coated with a moisture-proof coating. When using a coating resin, choose the coating resin which results in minimal stress to the device. 3.5.9 Heat Sinks (1) When installing a heat sink to a device, use the specified accessories. In addition, be careful not to apply excessive force to the device during installation. (2) When installing a device to a heat sink by fixing it in two or more locations, do not tighten one location to the specified torque while the rest are left not tightened. Rather, lightly tighten all locations evenly first and tighten all locations to the specified torque by rotation. (3) Drill screw holes in the heat since as specified, and smooth the surface of the device installation area by removing burrs and protrusions or indentations. (4) Thinly applying silicone grease between the heat sink makes device better to improve heat conductivity compared with no grease. If you choose to apply the silicone grease, use a non-volatile type. Volatile type silicone grease can cause 27 Handling Precautions cracks over time, resulting in the deterioration of the heat radiation effect. (5) With plastic-packaged devices, the base oil of some silicone grease compounds penetrates the package interior, significantly reducing the lifetime of the device. We ask therefore that you use the recommended silicon grease YG6260 from GE Toshiba Silicone. If you choose to use another product, select one that is equivalent to the Toshiba Silicone product. (6) During device operation, heat sinks become very hot. Be careful not to touch them. A burn may result. 3.5.10 Tightening Torque (1) Tighten screws to a tightening torque that is within the specified values described in the individual technical datasheets and databooks for the device used. (2) Be careful not to allow a pneumatic screwdriver to come in contact with devices. Device damage may result. 3.5.11 Repeated Device Mounting and Usage Do not remount or reuse devices that have histories such as that described below. These devices may cause significant problems with regard to device characteristics and reliability. (1) Devices that have been removed from the board after soldering. (2) Devices that have been inserted in the wrong orientation or with reverse polarity and charged. (3) Devices that have undergone lead forming more than once. 3.6 3.6.1 Operating Environment Temperature Semiconductor devices are generally more sensitive to temperature than other electromechanical parts. The various electrical characteristics of a semiconductor device are restricted by the operating temperature. It is therefore necessary to understand the temperature characteristics of a device and incorporate derating into the device design in advance. When a device is used at a temperature outside the specified operating range, electrical characteristics will not be realized and device deterioration will occur more rapidly. 3.6.2 Humidity Plastic package devices are sometimes not completely sealed. When these devices are used for an extended period of time under high humidity, moisture can seep into the device and cause semiconductor chip deterioration or failure. Furthermore, when devices are mounted on a regular printed circuit board, the impedance between wiring can decrease under high humidity. In systems with a high signal-source impedance, circuit board leakage or leakage between device leads can cause malfunction. In such a case, moisture-proof treatment to the device surface should be considered. On the other hand, operation under low humidity can damage a device due to the occurrence of electrostatic discharge. Unless moisture-proof treatments have been specifically taken, use devices within the humidity range of 40 to 60%. 28 Handling Precautions 3.6.3 Corrosive Gases Devices react to corrosive gases may cause deteriorating device characteristics. For example, consideration must be given to lead corrosion and leakage between leads caused by the chemical reaction that occurs when a device is placed near a rubber product. The reason is that the rubber product will not only produce condensation but also generate sulfur-bearing corrosive gases under high-humidity conditions. 3.6.4 Radioactive and Cosmic Rays Standard devices are not designed with protection against radioactive and cosmic rays. Devices must therefore be shielded if the device will be used in environments that may result in exposure to radioactive or cosmic rays above the levels that exist in the natural environment. 3.6.5 Strong Electrical and Magnetic Fields Devices exposed to magnetic fields can undergo a polarization phenomenon in the plastic material or within the IC chip, which gives rise to abnormal conditions such as impedance changes or leak current increases. Malfunctions have been reported in LSIs mounted near television deflection yokes. In such cases, the device installation location must be changed or the device must be shielded against the electrical or magnetic field. Shielding against magnetism is especially required in an alternating magnetic field due to the electromotive forces generated. 3.6.6 Interference from Light (such as Ultraviolet Rays, Sunlight, Fluorescent Lamps, Incandescent Lamps) Light striking a semiconductor device generates electromotive force due to photoelectric effects, sometimes causing malfunction. Devices in which the chip is visible through the package are especially affected by such light. When designing the circuits, make sure that the devices are protected against light interference. Not just optical semiconductor devices, but all types of devices are affected by light. 3.6.7 Dust and Oil Similar to corrosive gases, dust and oil cause chemical reactions in semiconductor products, sometimes adversely affecting product characteristics. Be sure to use semiconductor products in an environment that will not result in dust or oil adhesion. Solvent and oil contained in heat release sheets similarly may result in semiconductor product quality deterioration, characteristic deterioration or disconnection. Be sure to use such products with care. 29 Handling Precautions 3.6.8 Smoke and Ignition Semiconductor devices and modularized devices are not noncombustible; they can emit smoke or ignite when excessive current or failure occurs. When this happens, poisonous gases may be produced. Be sure to develop a safe design that protects the device from excessive current so as to ensure excessive current does not flow within the device during operation or at the time of failure. To prevent the propagation of fire caused by a smoking or ignited Toshiba product and to ensure that Toshiba products do not emit smoke or ignite due to surrounding conditions, do not use Toshiba products in close proximity to combustible thing, heat-generating thing, igniting materials or flammable materials. 3.7 Disposal Each country and region has laws and regulations for the proper disposal of devices and packing materials. Be sure to follow these laws and regulations at the time of disposal. 30 Handling Precautions 4. Precautions and Usage Considerations Specific to Each Product Group This section describes the matters specific to each product group which need to be taken into consideration. The precautions described in this section take precedence over those described in Section 3, “General Safety Precautions and Usage Considerations.” 4.1 4.1.1 Microcomputers Design (1) Use of Crystal Oscillators Other than Those Recommended For components such as crystal oscillators that are used in the oscillation circuit of microcomputer products, use the components with usage conditions described in the individual technical datasheets and databooks. If you plan on using components with usage conditions other than those recommended, contact the our engineering department stated in the individual technical datasheet or databook, or consult with the oscillator manufacturer. (2) Undefined Functions Microcomputer products have commands that are not individually defined for each product (i.e., undefined commands). These products also similarly have undefined functions (for instance, bits to which functions are not assigned in the register). Refer to the product’s individual technical datasheets and databooks and do not use the undefined commands and undefined functions. 31 Handling Precautions 32 TMPR4955B/TMPR4955C Rev. 1.1 Chapter 1 Introduction 1. Introduction 1.1 Overview The TMPR4955B and the TMPR4955C (to be called “TX4955” hereinafter) is a standard microcontroller of 64-bit RISC Microprocessor TX49 family. The TMPR4955B uses the TX49/H3 Processor Core, and the TMPR4955C uses the TX49/H4 Processor Core as the CPUs. The TX49/H3 and the TX49/H4 Processor Cores are 64-bit RISC CPU cores Toshiba developed based on the R4000 architecture of MIPS Technologies, Inc (“MIPS”). TX4955 supports 32-bit SysAD bus interface which have multiplexed address and data between the processor and an external agent 1.2 Notation Used in this Manual 1.2.1 Numerical Notation • Hexadecimal numbers in this manual are expressed as follows:0x2A (example shown for decimal number 42) KB (kilobyte) 210 = 1,024 bytes MB (megabyte) 220 = 1,024 × 1,024 = 1,048,576 bytes GB (gigabyte) 230 = 1,024 × 1,024 × 1,024 = 1,073,741,824 bytes 1.2.2 Data Notation • Byte: Eight bits • Half word: Two contiguous bytes (16 bits) • Word: Four contiguous bytes (32 bits) “W” may be used for a word data. • Double word: Eight contiguous bytes (64 bits) “D” may be used for a double word data. 1.2.3 1.2.4 Signal Notation • Active-low signals are indicated by adding an asterisk(*) at the end of the signal name (Example: RESET*) • When a signal is driven to the active voltage level, the signal is said to be “asserted.” When the signal is driven to an inactive voltage level, it is said to be “deasserted.” Register Notation • The following nomenclature is used for access attributes. R: Read only. Cannot be written. W: Write only. The bit value is undefined if read. R/W: Read/Write R4000/R4300/R5000 are a trademark of MIPS Technologies, Inc. 1-1 Chapter 1 Introduction 1-2 Chapter 2 Features 2. Features • TX49/H3 Processor Core and TX49/H4 Processor Core TX49/H3 Processor Core and TX49/H4 Processor Core are 64-bit RISC CPU cores Toshiba developed based on the architecture of MIPS for interactive consumer applications including Printer, Network and set-top terminals. • Internal bus width is 64-bit, External bus width is 32-bit. Core and Cache are connected with 64-bit internal bus. External bus is 32-bit SysAD-bus I/F with multiplexed address and data. This interface is compatible with the R4300, and R5000 system interfaces. • Power management External Supply Voltage (I/O) Product Name Internal Supply Voltage TMPR4955B 1.5 V 3.3 V TMPR4955C 1.25 V 3.3 V or 2.5 V The TX4955 supports Power management mode (Halt, Doze) • Maximum operating frequency The SysAD-bus I/F and Processor’s maximum operating frequency is set by External pin (DivMode[2:0]). • Div Mode[2:0] EC-bit Clock Ratio 000 001 010 011 100 101 110 111 010 111 000 001 100 101 110 011 1:4 1:2.5 1:2 1:3 1:3.5 1:4.5 1:5 1:6 Package 160-pin QFP • Part Number TMPR4955BFG-200: Maximum internal operating frequency = 200 MHz TMPR4955BFG-300: Maximum internal operating frequency = 300 MHz TMPR4955CFG-400: Maximum internal operating frequency = 400 MHz (Ask your nearest Toshiba sales representative for the latest part number.) 2-1 Supplementation TMPR4955C only TMPR4955C only Chapter 2 Features 2.1 Block Diagram TX4955 MasterClock TX49/H3 Core / TX49/H4 Core CG (PLL) Integer Unit GPR Interrupt / Reset Synchronize DSU (EJTAG) Pipeline Control Data Path EJTAG Interface 32-bit SysAD Bus JTAG (BSR) Sys AD Interface MAC 32 KB 4 -Way set Instruction Cache System Control Coprocessor (CP0) CP0 Registers FP Registers MMU / TLB Data Path Exception Unit Cache Controller 32 KB 4 -Way set Data Cache Figure 2.1.1 TX4955 Block Diagram 2-2 Floating - Point Coprocessor (CP1) Pipeline Control Write Buffer Chapter 2 Features 2.2 Pin Description 2.2.1 TMPR4955B/TMPR4955C Pin Out (160-pin QFP) Table 2.2.1 shows the relation between System Interface operation modes and pin settings. TX4955 has two types of system interface. One is for R5000 type protocol , other is for R4300 type protocol. Table 2.2.1 Relationship between System Interface Operation Mode and Pin Setting Pin Setting System Interface Operation Mode MODE43*=0 R4300 type protocol MODE43*=1 R5000 type protocol See the Chapter 11 about System Interface in detail. Table 2.2.2 shows the TMPR4955B pin assignment and Table 2.2.3 shows TMPR4955C pin assignment. In the following tables, signal names surrounded by () mean the signal name in the case of R4300 type protocol selected, and “*” means the signal is the low-active 2-3 Chapter 2 Features Table 2.2.2 TMPR4955B Pin Assginment Pin No. Signal Name Pin No. Signal Name Pin No. Signal Name Pin No. Signal Name 1 Vss 41 Vss 81 VccInt 121 SysAD28 2 BufSel1 42 TRST* 82 NMI* 122 SysAD29 3 JTDO 43 RdRdy* / (GND) 83 ExtRqst* / (EReq*) 123 VccInt 4 JTDI 44 WrRdy* / (EOK*) 84 Reset* 124 Vss 5 JTCK 45 ValidIn* / (EValid*) 85 ColdReset* 125 SysAD30 6 JTMS 46 ValidOut* / (PValid*) 86 VccIO 126 VccIO 7 VccIO 47 Release* / (PMaster*) 87 Endian 127 Vss 8 Vss 48 VccIO 88 VccIO 128 SysAD31 9 SysAD4 49 PLLReset* 89 Vss 129 SysADC2 / (GND) 10 SysAD5 50 VccInt 90 SysAD16 130 VccInt 11 VccInt 51 TintDis 91 VccInt 131 Vss 12 Vss 52 Vss 92 Vss 132 SysADC3 / (GND) 13 SysAD6 53 SysCmd0 93 SysAD17 133 VccIO 14 VccIO 54 SysCmd1 94 SysAD18 134 Vss 15 Vss 55 SysCmd2 95 VccIO 135 SysADC0 / (GND) 16 SysAD7 56 SysCmd3 96 Vss 136 VccInt 17 SysAD8 57 SysCmd4 97 SysAD19 137 Vss 18 VccInt 58 SysCmd5 / (GND) 98 VccInt 138 SysADC1 / (GND) 19 Vss 59 VccIO 99 Vss 139 SysAD0 20 SysAD9 60 Vss 100 SysAD20 140 VccIO 21 VccIO 61 SysCmd6 / (GND) 101 SysAD21 141 Vss 22 Vss 62 SysCmd7 / (GND) 102 VccIO 142 SysAD1 23 SysAD10 63 SysCmd8 / (GND) 103 Vss 143 SysAD2 24 SysAD11 64 SysCmdP / (GND) 104 SysAD22 144 VccInt 25 VccInt 65 VccInt 105 VccInt 145 Vss 26 Vss 66 Vss 106 Vss 146 SysAD3 27 SysAD12 67 VccIO 107 SysAD23 147 PCST8 28 VccIO 68 HALT/DOZE 108 SysAD24 148 PCST7 29 Vss 69 Int0* 109 VccIO 149 PCST6 30 SysAD13 70 Int1* 110 Vss 150 PCST5 31 SysAD14 71 Int2* 111 SysAD25 151 PCST4 32 VccInt 72 Int3* 112 VccInt 152 VccIO 33 Vss 73 Int4* 113 Vss 153 Vss 34 SysAD15 74 Int5* 114 SysAD26 154 VccIO 35 BufSel0 75 VccIO 115 SysAD27 155 VssPLL 36 PCST3 76 Vss 116 VccIO 156 DivMode2 37 PCST2 77 TPC3 117 MODE43* 157 VccPLL 38 PCST1 78 TPC2 118 DivMode1 158 Vss 39 PCST0 79 TPC1 119 DivMode0 159 MasterClock 40 VccIO 80 DCLK 120 Vss 160 VccIO 2-4 Chapter 2 Features Table 2.2.3 TMPR4955C Pin Assginment Pin No. Signal Name Pin No. Signal Name Pin No. Signal Name Pin No. Signal Name 1 Vss 41 Vss 81 VccInt 121 2 BufSel 42 TRST* 82 NMI* 122 SysAD28 SysAD29 3 JTDO 43 RdRdy* / (GND) 83 ExtRqst* / (EReq*) 123 VccInt 4 JTDI 44 WrRdy* / (EOK*) 84 Reset* 124 Vss 5 JTCK 45 ValidIn* / (EValid*) 85 ColdReset* 125 SysAD30 6 JTMS 46 ValidOut* / (PValid*) 86 VccIO 126 VccIO 7 VccIO 47 Release* / (PMaster*) 87 Endian 127 Vss 8 Vss 48 VccIO 88 VccIO 128 SysAD31 9 SysAD4 49 PLLReset* 89 Vss 129 SysADC2 / (GND) 10 SysAD5 50 VccInt 90 SysAD16 130 VccInt 11 VccInt 51 TintDis 91 VccInt 131 Vss 12 Vss 52 Vss 92 Vss 132 SysADC3 / (GND) 13 SysAD6 53 SysCmd0 93 SysAD17 133 VccIO 14 VccIO 54 SysCmd1 94 SysAD18 134 Vss 15 Vss 55 SysCmd2 95 VccIO 135 SysADC0 / (GND) 16 SysAD7 56 SysCmd3 96 Vss 136 VccInt 17 SysAD8 57 SysCmd4 97 SysAD19 137 Vss 18 VccInt 58 SysCmd5 / (GND) 98 VccInt 138 SysADC1 / (GND) 19 Vss 59 VccIO 99 Vss 139 SysAD0 20 SysAD9 60 Vss 100 SysAD20 140 VccIO 21 VccIO 61 SysCmd6 / (GND) 101 SysAD21 141 Vss 22 Vss 62 SysCmd7 / (GND) 102 VccIO 142 SysAD1 23 SysAD10 63 SysCmd8 / (GND) 103 Vss 143 SysAD2 24 SysAD11 64 SysCmdP / (GND) 104 SysAD22 144 VccInt 25 VccInt 65 VccInt 105 VccInt 145 Vss 26 Vss 66 Vss 106 Vss 146 SysAD3 27 SysAD12 67 VccIO 107 SysAD23 147 PCST8 28 VccIO 68 HALT/DOZE 108 SysAD24 148 PCST7 29 Vss 69 Int0* 109 VccIO 149 PCST6 30 SysAD13 70 Int1* 110 Vss 150 PCST5 31 SysAD14 71 Int2* 111 SysAD25 151 PCST4 32 VccInt 72 Int3* 112 VccInt 152 VccIO 33 Vss 73 Int4* 113 Vss 153 Vss 34 SysAD15 74 Int5* 114 SysAD26 154 VccIO 35 VccIO 75 VccIO 115 SysAD27 155 VssPLL 36 PCST3 76 Vss 116 VccIO 156 DivMode2 37 PCST2 77 TPC3 117 MODE43* 157 VccPLL 38 PCST1 78 TPC2 118 DivMode1 158 Vss 39 PCST0 79 TPC1 119 DivMode0 159 MasterClock 40 VccIO 80 DCLK 120 Vss 160 VccIO 2-5 Chapter 2 Features 2.2.2 TX4955 Pin Description Table 2.2.4 System Interface (when R5000 type protocol mode (MODE43* = 1)) Signal Name I/O Function SysAD[31:0] I/O System address/data bus A 32-bit address and data bus for communication between the processor and an external agent. SysCmd[8:0] I/O System command/data identifier bus A 9-bit bus for command and data identifier transmission between the processor and an external agent. SysADC[3:0] I/O System command/data check bus A 4-bit bus containing parity check bits for the SysAD bus during data cycle. SysCmdP I/O Reserved for system command/data identifier bus parity This signal is unused for TX4955. 0 is driven for output. Please put a pull-down or pull-up resistor for input on the board. ValidIn* I Valid input The external agent asserts Validln* when it is driving a valid address or data on the SysAD bus and valid command or data identifier on the SysCmd bus. ValidOut* O Valid output The processor asserts ValidOut* when it is driving a valid address or data on the SysAD bus and a valid command or data identifier on the SysCmd bus. ExtRqst* I External request An external agent asserts ExtRqst* to request use of the System interface. Release* O Release interface The processor asserts this signal when the system interface is released to the slave state. WrRdy* I Write Ready This signal should be asserted when an external agent accepts a processor write request. RdRdy* I Read Ready (with pull-down resistor). This signal should be asserted when an external agent accepts a processor read request. 2-6 Chapter 2 Features Table 2.2.5 System Interface (when R4300 type protocol mode (MODE43* = 0)) Signal Name I/O Function SysAD[31:0] I/O System address/data bus A 32-bit address and data bus for communication between the processor and an external agent. SysCmd[8:5] I/O These pins are driven to 0 at both address output and data input cycles, and then can be left open on the board. SysCmd[4:0] I/O System command/data identifier bus A 5-bit bus for command and data identifier transmission between the processor and an external agent. SysADC[3:0] I/O These pins are driven to 0 at both address output and data input cycles, and then can be left open on the board. SysCmdP I/O This pin is driven to 0 at both address output and data input cycles, and then can be left open on the board Evalid* I External agent valid input This signal should be asserted when an external agent is driving a valid address or valid data on the SysAD bus, and a valid command or data identifier on the SysCmd bus. Pvalid* O Processor valid output The processor asserts this signal when the processor is driving a valid address or valid data on the SysAD bus, and a valid command or data identifier on the SysCmd bus. EReq* I External request This signal should be asserted when an external agent is requesting System interface bus ownership. PMaster* O Processor Master The processor asserts this signal when the processor is a bus master. EOK* I External agent Ready This signal should be asserted when an external agent accepts a processor request. RdRdy* I This signal has a pull-down resistor in the internal of the processor, and then this signal can be left open on the board. 2-7 Chapter 2 Features Table 2.2.6 Clock/Control Interface Signal Name I/O Function MasterClock I Master clock Master clock input that establishes the processor operating frequency. DivMode[2:0] I Set the operational frequency of the System interface Set the Clock ratio between MasterClock and internal clock (CPUCLK). * EC-bit indicates the bit filed of Config Register in CP0. DivMode[2:0] EC-bit Clock Ratio (MasterClock:CPUCLK) 000 010 1:4 001 111 1:2.5 010 000 1:2 011 001 1:3 100 100 1:3.5 TMPR4955C only 101 101 1:4.5 110 110 1:5 111 011 1:6 TMPR4955C only The DivMode[2] signal of the TMPR4955B has a pull-down resistor in the internal of the processor See chapter 10 described about Clock interface in detail. TintDis I Timer-Interrupt disable input 0: enable Timer-Interrupt 1: disable Timer-Interrupt HALTDOZE O HALT/DOZE mode output This signal output the status of HALT or DOZE mode. This signal indicates that the TX4956 is in the HALT or DOZE mode when this signal is “H”. Endian I Endianess input Indicates the initial setting of the endian during a reset. 0: Little Endian 1: Big Endian Table 2.2.7 Interrupt Interface Signal Name I/O Function Int[5:0]* I Interrupt (with pull-up resistor). 6 general-purpose processor interrupt inputs, which are sampled at rising edges of the MasterClock. NMI* I When TintDis is deasserted (TintDis = 0), Int5* is not available. Nonmaskable interrupt (with pull-up resistor). Nonmaskable interrupt input, which is sampled at rising edges of the MasterClock. 2-8 Chapter 2 Features Table 2.2.8 EJTAG Interface Signal Name I/O Function JTDI I JTAG data input/Debug interrupt input Run-time mode: Input serial data to JTAG data/instruction registers. (with pull-up resistor). JTCK I JTAG clock input Clock input for JTAG. The JTDI and JTMS data are latched on rising edges of this clock (with pull-up resistor). JTDO/TPC[0] O JTAG data output/Trace PC output Data is serially shifted out from this pin. Outputs a non-sequential program counter value synchronously with DCLK. JTMS I JTAG command Controls mainly the status transition of the TAP controller state machine. When the serial input data is a JTAG command, apply a high signal (= 1) to this pin (with pull-up resistor). DCLK O Debug clock (1/3 CPU clock) Clock output for a real-time debug system. Timings of the serial monitor bus and PC trace interface signals all are defined by this debug clock DCLK. PCST[8:0] O PC trace status Outputs PC trace status information and serial monitor bus mode. TPC[3:1] O Trace PC output (with pull-up resistor for TPC[1] and with pull-down resistors for TPC[3:2]) TRST* I DCLK clock frequency is 1/3 that of CPUCLK. Outputs a non-sequential program counter value synchronously with DCLK. Test reset input Reset input for a real-time debug system. When TRST* is asserted (= 0), the debug support unit (DSU) is initialized. TRST* should be asserted when DSU is not used (with pull-down resistor). 2-9 Chapter 2 Features Table 2.2.9 Initialization Interface Signal Name I/O Function Reset* I Reset (with pull-up resistor). This signal should be asserted for soft reset. See section 9.2.3 SoftReset in detail. ColdReset* I Cold reset This signal should be assert at power-on and for a cold reset. GBUSCLK starts operating synchronously with this signal. See section 9.2.2 ColdReset in detail. PLLReset* I PLL reset input This signal should be asserted for initialization of the on-chip PLL, for example, when the system power is turned on. MODE43* I SysAD bus protocol selection The high or low level of this input signal at power-on or cold reset selects the SysAD bus protocol. 0: R4300 type protocol 1: R5000 type protocol BufSel[1:0] :TMPR4955B I Output Buffer Select Select the output buffer type of data bus and control signals. TMPR4955B BufSel[1:0] Buffer output rate 00 50 % ( 4-mA buffer type) 01 Reserved 10 150 % (12-mA buffer type) 11 100 % ( 8-mA buffer type) TMPR4955C BufSel Buffer output rate 0 100 % (16-mA buffer type) 1 50 % ( 8-mA buffer type) Please not change the value after power-on. See section 9.2.1 Power-On Reset in detail. BufSel :TMPR4955C 2-10 Chapter 2 Features Table 2.2.10 Power Supply Signal Name I/O Function VccPLL − Vcc for the PLL This is a static Vcc for the internal Phase Locked Loop. TMPR4955B: Apply a 1.5 V power supply. TMPR4955C: Apply a 1.25 V power supply VssPLL − Vss for the PLL This is a static Vss for the internal Phase Locked Loop. VccIO − VccIO This is a 3.3 V or 2.5 V power supply pin. VccInt − VccInt This is a power supply pin. TMPR4955B: Apply a 1.5 V power supply. TMPR4955C: Apply a 1.25 V power supply. Vss − Vss This is the ground pin. 2-11 Chapter 2 Features 2-12 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3. 3.1 TX49/H3, TX49/H4 Core’s Registers CPU Registers The TX4955 with TX49/H3 or TX49/H4 Core has the 64-bit CPU registers. • 32 general-purpose registers • 64-bit program counter • HI/LO register for storing the result of multiply and divide operations Figure 3.1.1 shows the configuration of these registers. General Purpose Registers (GPR) 63 0 Multiply/Divide Registers 63 0 r0 = 0 HI r1 63 0 r2 LO . . Program counter r29 63 r30 0 PC r31 = Link Address Figure 3.1.1 CPU Registers The r0 and r31 registers of GPR have special functions as follows. • Register r0 always contains the value 0. It can be a target register of an instruction whose operation result is not needed. Or, it can be a source register of an instruction that requires a value of 0. • Register r31 is the link register for the Jump and Link instruction. The address of the instruction after the delay slot is placed in r31. The TX4955 has the following some special registers that are used or modified implicitly by certain instructions. • HI - Holds the high-order bits of the result of integer multiply operation or the remainder of integer divide operation. • LO - Holds the low-order bits of the result of integer multiply operation or the quotient of integer divide operation. These two registers are used to store that result of an integer multiplication or division. In multiplication, the 64 high-order bits of a 128-bit result are stored in the HI, and the 64 low-order bits are stored in the LO. In division, the resulting quotient is stored in the LO, and the remainder is stored in the HI. • PC - Program Counter The register contains the address of the currently executed instruction. 3-1 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2 CP0 Registers The TX4955 with TX49/H3 or TX49/H4 Core has the 32-bit or 64-bit System control coprocessor(CP0) registers. These registers are used for memory system or exception handling. Table 3.2.1 lists the CP0 registers built into the TX49/H3 or TX49/H4 Core. Table 3.2.1 CP0 Registers Register Name Reg. No. Register Name Reg. No. Index Reg#0 Config Reg#16 Random Reg#1 LLAddr Reg#17 EntryLo0 Reg#2 (Reserved) (Note 1) Reg#18 EntryLo1 Reg#3 (Reserved) (Note 1) Reg#19 Context Reg#4 XContext Reg#20 PageMask Reg#5 (Reserved) (Note 1) Reg#21 Wired Reg#6 (Reserved) (Note 1) Reg#22 (Reserved) (Note 1) Reg#7 Debug (Note 2) Reg#23 BadVAddr Reg#8 DEPC (Note 2) Reg#24 Count Reg#9 (Reserved) (Note 1) Reg#25 EntryHi Reg#10 (Reserved) (Note 1) Reg#26 Compare Reg#11 (Reserved) (Note 1) Reg#27 Status Reg#12 TagLo Reg#28 Cause Reg#13 TagHi Reg#29 EPC Reg#14 ErrorEPC Reg#30 PRId Reg#15 DESAVE (Note 2) Reg#31 Note 1: These registers are used to test the System Control Coprocessor (CP0) and should not be accessed by the user. Note 2: These registers are exclusively used by external in-circuit emulators (ICE). 3-2 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.1 Index Register (Reg#0) The Index register is a 32-bit read/write register containing six bits to index an entry in the TLB. The P bit of the register shows the success/failure of a TLB Probe (TLBP) instruction. The Index register also specifies the TLB entry affected by TLB Read (TLBR) or TLB Write Index (TLBWI) instructions. Figure 3.2.1 shows the format of the Index register and Table 3.2.2 describes the Index register fields. 31 30 6 5 P 0 0 Index Figure 3.2.1 Index Register Format Table 3.2.2 Index Register Field Descriptions Bit(s) Field Name Description 31 P 30:6 0 Reserved 0x0 Read 5:0 Index Index to the TLB entry affected by the TLB Read (TLBR) and TLB Write Index (TLBWI) instructions. Undefined Read/Write Probe failure. Set to 1 when the previous TLB Probe (TLBP) instruction was unsuccessful. 3-3 Cold Reset Read/Write Undefined Read/Write Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.2 Random Register (Reg#1) The Random register is a read only register containing six bits to index an entry in the TLB. This register decrements as each instruction executes. The values are as follows. • A lower bound is set by the number of TLB entries reserved for exclusive use by the operating system (the contents of the Wired register). • An upper bound is set by the total number of TLB entries (47 maximum). The Random register specifies the TLB entry affected by TLB Write Random (TLBWR) instruction. However the register doesn’t need to be read for this purpose, it is readable to verify proper operation of the processor. To simplify testing, the Random register is set to the value of the upper bound upon system reset. This register is also set to the upper bound when the Wired register is written. Figure 3.2.2 shows the format of the Random register and Table 3.2.3 describes the Random register fields. 31 6 5 0 0 Random Figure 3.2.2 Random Register Format Table 3.2.3 Random Register Field Descriptions Bit(s) Field Name Cold Reset Read/Write 31:6 0 Reserved Description 0x0 Read 5:0 Random TLB random index for TLBWR instruction. Upper bound (47) Read 3-4 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.3 EntryLo0 Register (Reg#2) and EntryLo1 Register (Reg#3) The EntryLo register consists of two registers have identical formats: • EntryLo0 is used for even virtual pages • EntryLo1 is used for odd virtual pages The EntryLo0 and EntryLo1 register are read/write register. These registers hold the physical page frame number (PFN) of the TLB entry for even and odd pages, respectively, when performing TLB read and write operations. Figure 3.2.3 shows the format of the EntryLo0/EntryLo1 register and Table 3.2.4 describes the EntryLo0/EntryLo1 register fields. 63 32 31 0 30 29 WCE 6 5 PFN C 3 2 1 0 D V G Figure 3.2.3 EntryLo0/EntryLo1 Register Format Table 3.2.4 EntryLo0/EntryLo1 Register Field Descriptions Bit(s) Field Name Description Cold Reset Read/Write 63:32 0 Reserved 0x0 Read 31:30 WCE Usable for Windows CE 0x0 Read/Write 29:6 PFN Page frame number. This frame number is the upper bit filed of physical address. Undefined Read/Write 5:3 C Specifies the TLB page coherency attribute. 0: Cacheable, noncoherent, write-through, no-Write Allocate 1: Cacheable, noncoherent, write-through, Write Allocate 2: Uncached 3: Cacheable, noncoherent, write-back, Write Allocate 4-7: Reserved 0x0 Read/Write 2 D Dirty If this bit is set, the page is marked as dirty and, therefore, writable. This bit is actually a write-protect bit that software can use to prevent alteration of data. 0 Read/Write 1 V Valid If this bit is set, it indicates that the TLB entry is valid; otherwise, a TLBL or TLBS miss occurs. 0 Read/Write 0 G Global If this bit is set in both EntryLo0 and EntryLo1, then the processor ignores the ASID during TLB lookup. 0 Read/Write 3-5 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.4 Context Register (Reg#4) The Context register is a read/write register containing the pointer to an entry in the page table entry (PTE) array. This array is an operating system data structure that stores virtual to physical address translations. When there is a TLB miss, the CPU loads the TLB with the missing translation from the PTE array. Normally, the operating system uses the Context register to address the current page map which resides in the kernel mapped segment, kseg3. However the contents of this register duplicates some information of the BadVAddr register, it is arranged in a form that is more useful for TLB exception handler by a software. Figure 3.2.4 shows the formats of the Context register and Table 3.2.5 describes the Context register fields. 31 23 22 4 PTEBase 3 BadVPN2 0 0 (32-bit mode) 63 23 22 PTEBase 4 3 BadVPN2 0 0 (64-bit mode) Figure 3.2.4 Context Register Formats Table 3.2.5 Context Register Field Descriptions 32-bit mode Cold Reset Read/Write 31:23 Bit(s) Field Name PTEBase Page table entry base pointer This field is for use by the operating system. It is normally written with a value that allows the operating system to use the Context register as a pointer into the current PTE array in memory. Description Undefined Read/Write 22:4 BadVPN2 Bad virtual address bits 31-13 This field is written by hardware on a miss. It contains the virtual page number (VPN) of the most recent virtual address that did not have a valid translation. Undefined Read 3:0 0 Reserved 0x0 Read Cold Reset Read/Write 64-bit mode Bit(s) Field Name Description 63:23 PTEBase Page table entry base pointer Undefined Read/Write 22:4 BadVPN2 Bad virtual address bits 31-13 Undefined Read 3:0 0 Reserved 0x0 Read The 19-bit BadVPN2 field contains bits 31-13 of the virtual address that caused the TLB miss; bits 12 is excluded because a single TLB entry maps-an even-odd page pair. For a 4-Kbyte page size, this format can directly address the pair-table of 8-byte PTEs. For other page size and PTE sizes, shifting and masking this value produces the appropriate address. 3-6 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.5 PageMask Register (Reg#5) The PageMask register is a read/write register used for reading from/writing to the TLB. This register holds a comparison mask that sets the variable page size for each TLB entry. TLB read and write operations use this register as either a source or a destination. When virtual addresses are presented for translation into physical address, the corresponding bits in the TLB identify which virtual address bits among bits 24-13 are used in the comparison. When the Mask field is not one of the values shown in Table 3.2.6, the operation of the TLB is undefined. Figure 3.2.5 shows the format of the PageMask register and Table 3.2.6 describes the PageMask register fields. 31 25 24 0 13 12 0 MASK 0 Figure 3.2.5 PageMask Register Format Table 3.2.6 PageMask Register Field Descriptions Bit(s) Field Name Cold Reset Read/Write 31:25 0 Reserved Description 0x0 Read 24:13 MASK Page comparison mask 000000000000: page size = 4 Kbytes 000000000011: page size = 16 Kbytes 000000001111: page size = 64 Kbytes 000000111111: page size = 256 Kbytes 000011111111: page size = 1 Mbytes 001111111111: page size = 4 Mbytes 111111111111: page size = 16 Mbytes 0x0 Read/Write 12:0 0 Reserved 0x0 Read 3-7 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.6 Wired Register (Reg#6) The Wired register is a read/write register specifies the boundary between the wired and random entries of the TLB as follows. Wired entries are non-replaceable entries, which can not be overwritten by a TLB write random operation. Random entries can be overwritten. TLB 47 Range of Random entries Wired Register Range of Wired entries 0 The Wired register is set to 0 upon system reset. Writing this register also sets the Random register to the value of its upper bound. Figure 3.2.6 shows the format of the Wired register and Table 3.2.7 describes the Wired register fields. 31 6 5 0 0 Wired Figure 3.2.6 Wired Register Table 3.2.7 Wired Register Filed Descriptions Bit(s) Field Name Cold Reset Read/Write 31:6 0 Reserved (Must be written as zeroes, and returns zeroes when read.) Description 0x0 Read 5:0 Wired TLB Wired boundary. 0x0 Read/Write 3-8 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.7 BadVAddr Register (Reg#8) The Bad Virtual Address (BadVAddr) register is a read only register that displays the most recent virtual address that cause one of the following exceptions; Address Error, TLB Invalid, TLB Modified and TLB Refill exceptions. The processor does not write to this register when the EXL bit in the Status register is set to a 1. Figure 3.2.7 shows the formats of the BadVAddr register and Table 3.2.8 describes the BadVAddr register fields. 31 0 Bad Virtual Address (32-bit mode) 63 0 Bad Virtual Address (64-bit mode) Figure 3.2.7 BadVAddr Register Formats Table 3.2.8 BadVAddr Register Field Descriptions 32-bit mode Bit(s) Field Name 31:0 BadVAddr Description Bad Virtual address Cold Reset Read/Write Undefined Read 64-bit mode Bit(s) Field Name 63:0 BadVAddr Description Bad Virtual address 3-9 Cold Reset Read/Write Undefined Read Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.8 Count Register (Reg#9) The Count register is a read/write register. This register acts as a timer, incrementing at a constant rate (1/2 rate of CPUCLK) whether or not an instruction is executed, retired, or any forward progress is made through the pipeline. When all count bits of the Counter register become up to 1, then they are flushed to 0 and continue to count up from 0. This register can be also written for diagnostic purpose or system initialization. Figure 3.2.8 shows the format of the Count register and Table 3.2.9 describes the Count register field. 31 0 Count Figure 3.2.8 Count Register Format Table 3.2.9 Count Register Field Description Bit(s) Field Name 31:0 Count Description 32-bit timer, incrementing at half the maximum instruction issue rate (CPUCLK). 3-10 Cold Reset Read/Write 0x0 Read/Write Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.9 EntryHi Register (Reg#10) The EntryHi is a read/write register, and holds the high-order bits of a TLB entry for TLB read and write operations. This register is accessed by the TLB Probe (TLBP), TLB Write Ransom (TLBWR), TLB Write Indexed (TLBWI), and TLB Read Indexed (TLBR) instructions. When either a TLB refill, TLB invalid, or TLB modified exception occurs, this register is loaded with the virtual page number (VPN2) and the ASID of the virtual address that did not have a matching TLB entry. Figure 3.2.9 shows the formats of the EntryHi register and Table 3.2.10 describes the EntryHi register fields. 31 13 12 VPN2 8 7 0 0 ASID (32-bit mode) 63 62 61 R 40 39 FILL 13 12 VPN2 8 7 0 0 ASID (64-bit mode) Figure 3.2.9 EntryHi Register Formats Table 3.2.10 EntryHi Register Field Descriptions 32-bit mode Bit(s) Field Name 31:13 VPN2 12:8 0 7:0 ASID Description Cold Reset Read/Write Virtual page number divided by two Undefined Read/Write Reserved 0x0 Read Address space ID field An 8-bit field that lets multiple processes share the TLB; each process has a distinct mapping of otherwise identical virtual page numbers. Undefined Read/Write 64-bit mode Bit(s) Field Name 63:62 R Description 61:40 Fill Reserved. 0 on read. Ignored on write. Undefined Read 39:13 VPN2 Virtual page number divided by two Undefined Read/Write Region. Used to match vAddr63 and vAddr62. 00: user 01: supervisor 11: kernel Cold Reset Read/Write Undefined Read/Write 12:8 0 Reserved 0x0 Read 7:0 ASID Address space ID field. Undefined Read/Write 3-11 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.10 Compare Register (Reg#11) The Compare register acts as a timer. When value of the Count register equals the value of the Compare register, interrupt bit IP[7] in the Cause register is set. This causes an interrupt exception as soon as the interrupt is enabled. Writing a value to this register, as a side effect, clears the timer interrupt. For diagnostic purpose, this register is a read/write register. However, in normal operation this register is write only. Figure 3.2.10 shows the format of the Compare register and Table 3.2.11 describes the Compare register field. 31 0 Compare Figure 3.2.10 Compare Register Format Table 3.2.11 Compare Register Field Description Bit(s) Field Name 31:0 Compare Description Acts as a timer; it maintains a stable value that does not change on its own. 3-12 Cold Reset Read/Write 0x0 Read/Write Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.11 Status Register (Reg#12) The Status register is a read/write register that contains the operating mode, interrupt enabling, and diagnostic states of the processor. The more important Status register fields are as followings: • The Interrupt Mask (IM) field of 8 bits controls the enabling of eight interrupt conditions. Interrupt must be enabled before they can be asserted, and the corresponding bits are set in both the IM field of this register and the Interrupt Pending field of the Cause register. • The Coprocessor Usability (CU) field of 4 bits controls the usability of four possible coprocessors. Regardless of the CU0 bit setting, CP0 is always usable in Kernel mode. • The Diagnostic Status (DS) field of 9 bits is used for self-testing, and checks the cache and virtual memory system. • The Reverse Endian (RE) bit reverses the endianness. The processor can be configured as either little/big-endian at reset; reverse-endian selection is used in Kernel and Supervisor modes, and in the User mode when the RE bit is 0. Setting the RE bit to 1 inverts the User mode endianness. Figure 3.2.11 shows the format of the Status register and Table 3.2.12 describes the Status register field. 31 28 CU 27 26 25 0 FR RE 24 16 15 DS 8 IM 7 6 5 KX SX UX 24 23 22 21 20 19 18 17 16 0 BEV 0 SR 0 CH 0 0 4 3 KSU 2 1 ERL EXL 0 IE Figure 3.2.11 Status Register Format Table 3.2.12 Status Register Field Descriptions Bit(s) Field Name 31:28 CU (3, 2, 1, 0) Description Controls the usability of each of the four coprocessor unit numbers. CP0 is always usable when in Kernel mode, regardless of the setting of the CU0 bit. Cold Reset Read/Write 0000 Read/Write 0: unusable 1: usable 27 0 Reserved 0 Read 26 FR Number of floating-point registers(FPR) 0: 64-bit wide 16 FPRs 1: 32-bit wide 32 FPRs See Section 3.3.1, “Floating-Point General Registers (FGRs)” in detail. 0 Read/Write 25 RE Reverse-Endian bit, valid in User mode. 0 Read/Write 24:23 0 Reserved 0x0 Read 22 BEV Controls the location of TLB refill and general exception vectors. 1 Read/Write 0: normal 1: bootstrap 3-13 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Bit(s) Field Name 21 0 Cold Reset Read/Write Reserved Description 0 Read 20 SR 1: Indicates a soft reset or NMI has occurred. 0 Read/Write 19 0 Reserved 0 Read 18 CH “Hit” or “miss” indication for last CACHE Hit Invalidate, Hit Write Back Invalidate, Hit Write Back for a primary cache. 0: miss 1: hit 0 Read/Write 17:16 0 Reserved 0x0 Read 15:8 IM Interrupt Mask Controls the enabling of each of the external, internal and software interrupts. An interrupt is taken if interrupts are enabled, and the corresponding bits are set in both the IM field of the Status register and the IP field of the Cause register. 0x0 Read/Write 0 Read/Write 0 Read/Write 0: disabled 1: enabled 7 KX Enables 64-bit addressing in Kernel mode. The extended-addressing TLB refill exception is used for TLB misses on kernel addresses. 0: 32-bit 1: 64-bit 6 SX Enables 64-bit addressing and operations in Supervisor mode. The extended-addressing TLB refill exception is used for TLB misses on supervisor addresses. 0: 32-bit 1: 64-bit 5 UX Enables 64-bit addressing and operations in User mode. The extended-addressing TLB refill exception is used for TLB misses on user addresses. 0: 32-bit 1: 64-bit 0 Read/Write 4:3 KSU Mode 10: user 01: supervisor 00: kernel 11: reserved 0x0 Read/Write 2 ERL Error Level 0: normal 1: error 1 Read/Write 1 EXL Exception Level 0: normal 1: exception 0 Read/Write 0 IE Interrupt Enable 0: disable 1: enable 0 Read/Write 3-14 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Status Register Modes and Access States Fields of the Status register set the modes and access states described in the section that follow. • Interrupt Enable: Interrupts are enabled when all of the following conditions are met: – IE = 1 – EXL = 0 – ERL = 0 If these conditions are met, the settings of the IM bits enable the interrupt. • Operation Modes: The following CPU Status register bit settings are required for User, Kernel and Supervisor modes (see Section 4.2, “Operation Modes,” for more information about operating modes). – The processor is in User mode when KSU = 102, EXL = 0, and ERL = 0. – The processor is in Supervisor mode when KSU = 012, EXL = 0 and ERL = 0. – The processor is in Kernel mode when KSU = 002, EXL= 1, or ERL =1. • 32- and 64-bit Modes: The following CPU Status register settings select 32- or 64-bit operation for User, Kernel, and Supervisor operating modes. Enabling 64-bit operation permits the execution of 64-bit opcodes and translation of 64-bit addresses. 64-bit operation for User, Kernel and Supervisor modes can be set independently. – 64-bit addressing for Kernel mode is enabled when KX = 1. 64-bit operations are always valid in Kernel mode. – 64-bit addressing and operations are enabled for Supervisor mode when SX = 1. – 64-bit addressing and operations are enabled for User mode when UX = 1. • Kernel Address Space Accesses: Access to the kernel address space is allowed when the processor is in Kernel mode. • Supervisor Address Space Accesses: Access to the supervisor address space is allowed when the processor is in Kernel or Supervisor mode, as described above in the section above titled “Operating Modes.” • User Address Space Accesses: Access to the user address is allowed in any of the three operating modes. Status Register Reset The contents of the Status register are undefined at reset, except for the following bits in the Diagnostic Status field: • ERL and BEV = 1 The SR bit distinguishes between the Reset exception and the Soft Reset exception (caused by Nonmaskable Interrupt [NMI]). 3-15 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.12 Cause Register (Reg#13) The Cause register holds the cause of the most recent exception. This register is read-only, except for the IP[1:0] bits. Figure 3.2.12 shows the format of the Cause register and Table 3.2.13 describes the Cause register field. 31 30 BD 0 29 28 27 16 15 CE 0 8 7 IP 6 0 2 1 ExcCode 0 0 Figure 3.2.12 Cause Register Format Table 3.2.13 Cause Register Field Descriptions Bit(s) Field Name 31 BD Description Indicates whether or not the last exception was taken while executing in a branch delay slot. Cold Reset Read/Write 0 Read 0: normal 1: delay slot 30 0 Reserved 0 Read 29:28 CE Indicates the coprocessor unit number referenced when a coprocessor unusable exception is taken. 0x0 Read 00: coprocessor 0 01: coprocessor 1 10: coprocessor 2 11: coprocessor 3 27:16 0 Reserved 0x0 Read 15:10 IP[7:2] Indicates whether an interrupt is pending. 0: not pending 1: pending INT[5:0] Read 9:8 IP[1:0] Software interrupts. 0: reset 1: set 0x0 Read/Write 7 0 Reserved 0 Read 6:2 ExcCode Exception Code field. 0: Int: Interrupt. 1: Mod: TLB modification exception. 2: TLBL: TLB exception (load or instruction fetch) 3: TLBS: TLB exception (Store) 4: AdEL: Address error exception (load or instruction fetch) 5: AdES: Address error exception (store) 6: IBE: Bus error exception (instruction fetch) 7: DBE: Bus error exception (data reference: load) 8: Sys: System call exception 9: Bp: Breakpoint exception 10: RI: Reserved instruction exception 11: CpU: Coprocessor Unusable exception 12: Ov: Arithmetic Overflow exception 13: Tr: Trap exception 14: Reserved 15: FPE: Floating-Point exception 16-31: Reserved 0x0 Read 1:0 0 Reserved 0x0 Read 3-16 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.13 EPC Register (Reg#14) The Exception Program Counter (EPC) register is a read/write register. This register contents the address at which processing resumes after an exception has been serviced. For synchronous exceptions, this register contains either: • the virtual address of the instruction that was the direct cause of the exception. • the virtual address of the immediately preceding branch or jump instruction (when the instruction is in a branch delay slot, and the Branch Delay bit in the Cause register is set). The processor does not write to the EPC register when EXL bit in the Status register is set to 1. Figure 3.2.13 shows the formats of the EPC register and Table 3.2.14 describes the EPC register field. 31 0 EPC (32-bit mode) 63 0 EPC (64-bit mode) Figure 3.2.13 EPC Register Formats Table 3.2.14 EPC Register Field Description 32-bit mode Bit(s) Field Name 31:0 EPC Description Exception program counter Cold Reset Read/Write Undefined Read/Write Cold Reset Read/Write Undefined Read/Write 64-bit mode Bit(s) Field Name 63:0 EPC Description Exception program counter 3-17 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.14 PRId Register (Reg#15) The Processor Revision Identifier (PRId) register is a read-only register. This register contents information identifying the implementation and revision level of the CPU and CP0. Figure 3.2.14 shows the format of the PRId register and Table 3.2.15 describes the PRId register field. 31 16 15 0 8 7 Imp 0 Rev Figure 3.2.14 PRId Register Format Table 3.2.15 PRId Register Field Descriptions Bit(s) 31:16 Field Name 0 Cold Reset Read/Write Reserved Description 0x0 Read 15:8 Imp Implementation number (0x2d means “TX49 family”.) 0x2d Read 7:0 Rev Revision number +. + Read + Value is shown in product sheet 3-18 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.15 Config Register (Reg#16) The Config register is a read-only register; except for HALT, ICE#, DCE# and K0 fields. This register specifies various configuration options selected on the processor. EC, BE, IC, DC, IB and DB fields are set by the hardware during reset and are included in this register as read-only status bits for the software to access. Figure 3.2.15 shows the format of the Config register and Table 3.2.16 describes the Config register field. 31 0 30 28 27 EC 24 23 0 19 0 18 17 16 15 14 13 12 HALT ICE# DCE# BE 1 0 11 9 8 IC 6 DC 5 4 3 IB DB 0 2 0 K0 Figure 3.2.15 Config Register Format Table 3.2.16 Config Register Field Descriptions Bit(s) Field Name Description Cold Reset Read/Write 31 0 Reserved 0 Read 30:28 EC GBUS clock rate This bit indicates the divided rate of CPUCLK and GBUSCLK. 0: processor clock frequency divided by 2 1: processor clock frequency divided by 3 2: processor clock frequency divided by 4 3: processor clock frequency divided by 6 4: processor clock frequency divided by 3.5 5: processor clock frequency divided by 4.5 6: processor clock frequency divided by 5 7: processor clock frequency divided by 2.5 Number 3 and 4 are not supported and reserved in TMPR4955B. pin Read 27:19 0 Reserved 0x0 Read 18 HALT Wait mode 0: Halt 1: Doze Indicates the power-down behavior of the processor when WAIT instruction is executed. The processor stalls the pipeline both in halt and doze mode. Cache snoops are possible during Doze mode but not possible during Halt mode. Halt mode reduces power consumption to a greater extent than Doze mode. 0 Read/Write 17 ICE# Instruction Cache Enable 0: Instruction cache enable 1: Instruction cache disable 0 Read/Write 16 DCE# Data Cache Enable 0: Data cache enable 1: Data cache disable 0 Read/Write 15 BE Big Endian 0: Little Endian 1: Big Endian pin Read 14:13 1 Reserved 11 Read 12 0 Reserved 0 Read 3-19 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Cold Reset Read/Write 11:9 Bit(s) Field Name IC Instruction cache size. In the processor, this is set to 32 KB (011). Description 011 Read 8:6 DC Data cache size. In the processor, this is set to 32 KB (011). 011 Read 5 IB Primary I-Cache line Size 1:32 bytes (8 words) 1 Read 4 DB Primary D-cache line Size 1:32 bytes (8 words) 1 Read 3 0 Reserved 0 Read 2:0 K0 kseg0 coherency algorithm 0: Cacheable, non-coherent, write-through, no-Write Allocate 1: Cacheable, non-coherent, write-through, Write Allocate 2: Un-cached 3: Cacheable, non-coherent, write-back, Write Allocate 4-7: Reserved 0x0 Read/Write 3-20 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.16 LLAddr Register (Reg#17) The Load Linked Address (LLAddr) register is a read/write register, and contains the physical address read by the most recent Load Linked (LL/LLD) instruction. This register is for diagnostic purposes only, and serves no function during normal operation. Figure 3.2.16 shows the format of the LLAddr register and Table 3.2.17 describes the LLAddr register field. 31 0 pAddr[35:4] Figure 3.2.16 LLAddr Register Format Table 3.2.17 LLAddr Register Field Description Bit(s) Field Name 31:0 pAddr Description Physical address bits 35-4 3-21 Cold Reset Read/Write 0x0 Read/Write Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.17 XContext Register (Reg#20) The XContext register is a read/write register, and contains a pointer to an entry in the page table entry (PTE) array, an operating system data structure that stores virtual to physical address translations. When there is a TLB miss, the operating system software loads the TLB with the missing translation from the PTE array. However the contents of this register duplicates some information of the BadVAddr register, it is arranged in a form that is more useful for TLB exception handler by a software. This register is for use with the XTLB refill handler, which loads TLB entries for references to a 64-bit address space, and is included solely for operating system use. The operating system sets the PTE base field in the register, as needed. Normally, the operating system uses this register to address the current page map which resides in the Kernel mapped segment, kseg3. The BadVPN2 field of 27 bits has bits 39-13 of the virtual address that caused the TLB miss; bit 12 is excluded because a single TLB entry maps to an even-odd page pair. For a 4 KByte page size, this format may be used directly to access the pair-table of 8 Byte PTEs. For other page sizes and PTE sizes, shifting and masking this value produces the appropriate address. Figure 3.2.17 shows the format of the XContext register and Table 3.2.18 describes the XContext register field. 63 33 32 31 30 PTEBase R 4 3 0 BadVPN2 0 Figure 3.2.17 XContext Register Format Table 3.2.18 XContext Register Field Description Cold Reset Read/Write 63:33 Bit(s) Field Name PTEBase Page table entry base pointer This field is normally written with a value that allows the operation system to use the Context register as a pointer into the current PTE array in memory. Description Undefined Read/Write 32:31 R The Region field contains bits 63-62 of the virtual address. 00: user 01: supervisor 11: kernel Undefined Read/Write 30:4 BadVPN2 Bad virtual page number divided by two. This field is written by hardware on a miss. It contains the VPN of the most recent invalidly translated virtual address. Undefined Read 3:0 0 Reserved 0x0 Read 3-22 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.18 Debug Register (Reg#23) The Debug register is a read-only; except for TLF, BsF, SSt and JtagRst fields. This register holds the information for debug handler. 6 5 4 JtagRst 0 DINT DIB 3 2 1 0 DSS 7 DBp 8 DDBL 9 DDBS 10 SSt 11 0 12 BsF 13 TLF 14 OES 15 TRS 29 0 30 DM DBD 31 NIS Figure 3.2.18 shows the format of the Debug register and Table 3.2.19 describes the Debug register field. Figure 3.2.18 Debug Register Format Table 3.2.19 Debug Register Field Descriptions Bit(s) Field Name Cold Reset Read/Write 31 DBD Debug Branch Delay When a debug exception occurs while an instruction in the branch delay slot is executing, this bit is set to 1. Description 0 Read 30 DM Debug Mode It indicates that a debug exception has taken place. This bit is set when a debug exception is taken, and is cleared upon return from the exception (DERET). While this bit is set all interrupts, including NMI, TLB exception , BUS error exception, and debug exception are masked and cache line locking function is disabled. 0 Read 0: Debug handler not running 1: Debug handler running 29:15 0 Reserved 0x0 Read 14 NIS Non-maskable Interrupt Status When this bit is set indicating that a non-maskable interrupt has occurred at the same time as a debug exception. In this case the Status, Cause, EPC, and BadVAddr registers assumes the usual status after occurrence of a non-maskable interrupt, but the address in DEPC is not the non-maskable exception vector address (0xbfc0 0000). Instead, 0xbfc0 0000 is put in DEPC by the debug handler software after which processing returns directly from the debug exception to the non-maskable interrupt handler. 0 Read 13 TRS TLB Miss Status When this bit is set indicating the Debug Exception and TLB/XTLB refill exception has occurred at the same time. In this case the Status, Cause, EPC, and BadVAddr registers assumes the usual status after occurrence of TLB/XTLB refill. The address in the DEPC is not the other exception vector address. Instead, 0xbfc0 0200 (if BEV = 1) in case of TLB refill exception and 0xbfc0 0280 (if BEV = 1) in case of XTLB refill exception or 0x8000 0000 (if BEV = 0) in case of TLB refill exception and 0x8000 0080 (if BEV = 0) in case of XTLB refill exception is put in DEPC by the debug exception handler software, after which processing returns directly from the debug exception to the other exception handler. 0 Read 3-23 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Bit(s) Field Name Cold Reset Read/Write 12 OES Other Exception Status When this bit is set, indicates exception other than reset, NMI, or TLB/XTLB refill has occurred at the same time as a debug exception. In this case the Status, Cause, EPC, and BadVAddr registers assume the usual status after occurrence of such an exception, but the addressing the DEPC is not the other exception Vector address. Instead, 0xbfc0 0380 (if BEV = 1) or 0x8000 0180 (if BEV = 0) is put in DEPC by the debug exception handler software, after which processing returns directly from the other exception handler. Description 0 Read 11 TLF TLB Exception Flag This bit is set to 1 when TLB related exception occurs for immediately preceding load or store instruction while a debug exception handler is running (DM = 1). TLB exception will set this bit to 1 regardless of writing zero. It is cleared by writing 0 and writing 1 is ignored. 0 Read/Write 10 BsF Bus Error Exception Flag This bit is set to 1 when a bus error exception occurs for a load or store instruction while a debug exception handler is running (DM = 1). Bus error exception will set this bit to 1 regardless of writing zero. It is cleared by writing 0 and writing 1 is ignored. 0 Read/Write 9 0 Reserved 0 Read 8 SSt Single Step Set to 1 indicates the single step debug function is enable (1) or disabled (0). The function is disable when the DM bit is set to 1 while the debug exception is running. 0 Read/Write 7 JtagRst JTAG Reset When this bit is set to 1 the processor reset the JTAG unit. 0 Read/Write 6 0 Reserved 0 Read 5 DINT Debug Interrupt Break Exception Status Set to 1 when debug interrupts occurs. 0 Read 4 DIB Debug Instruction Break Exception Status Set to 1 on instruction address break. 0 Read 3 DDBS Debug Data Break Store Exception Status Set to 1 on data address break at store operation. 0 Read 2 DDBL Debug Data Break Load Exception Status Set to 1 on data address break at load operation. 0 Read 1 DBp Debug Breakpoint Exception Status This bit is set when executing SDBBP instruction. 0 Read 0 DSS Debug Single Step Exception Status Set to 1 indicate Single Step Exception. 0 Read 3-24 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.19 DEPC Register (Reg#24) The DEPC register holds the address where processing resumes after the debug exception routine has finished. The address that has been loaded in the DEPC register is the virtual address of the instruction that caused the debug exception. If the instruction is in the branch delay slot, the virtual address of the immediately preceding branch or jump instruction is placed in this register. Execution of the DERET instruction causes a jump to the address in the DEPC. If the DEPC is both written from software (by MTC0) and by hardware (debug exception) then the DEPC is loaded by the value generated by the hardware. Figure 3.2.19 shows the formats of the DEPC register and Table 3.2.20 describes the DEPC register field. 31 0 DEPC (32-bit mode) 63 0 DEPC (64-bit mode) Figure 3.2.19 DEPC Register Formats Table 3.2.20 DEPC Register Field Description 32-bit mode Bit(s) Field Name 31:0 DEPC Description Debug exception program counter. Cold Reset Read/Write Undefined Read/Write Cold Reset Read/Write Undefined Read/Write 64-bit mode Bit(s) Field Name 63:0 DEPC Description Debug exception program counter. 3-25 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.20 TagLo Register (Reg#28) and TagHi Register (Reg#29) The TagLo and TagHi registers are a read/write registers. These registers hold the primary cache tag for cache lock function or cache diagnostics. These registers are written by the CACHE/MTC0 instruction. Figure 3.2.20 shows the formats of the TagLo and TagHi registers and Table 3.2.21 describes the TagLo and TagHi registers field. 31 8 7 PTagLo 6 5 PState 3 RWNT 2 1 Lock F0 0 0 (TagLo) 31 30 F1 PTagLo1 29 0 0 (TagHi) Figure 3.2.20 TagLo and TagHi Register Formats Table 3.2.21 TagLo and TagHi Register Field Descriptions TagLo Bit(s) Field Name 31:8 PTagLo 7:6 PState Description Cold Reset Read/Write Bits 35-12 of the physical address 0x0 Read/Write Specifies the primary cache state 0: Invalid 1: Reserved 2: Reserved 3: Valid 0x0 Read/Write Read/Write 5:3 RWNT Read/Write bits required for Windows NT 0x0 2 Lock Lock bit (0: not locked, 1: locked) 0 Read/Write 1 F0 FIFO Replace bit 0 (indicates the set to be replaced) 0 Read/Write 0 0 Reserved 0 Read TagHi Bit(s) Field Name Cold Reset Read/Write 31 F1 FIFO Replace bit 1 (indicates the set to be replaced) Description 0 Read/Write 30 PTagLo1 Bit 11 of the physical address 0 Read/Write 29:0 0 Reserved 0x0 Read F1 and F0 are concatenated and indicate the set to be replaced. F1 ⏐ F0 0 0 : way0 0 1 : way1 1 0 : way2 1 1 : way3 3-26 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.21 ErrorEPC Register (Reg#30) The ErrorEPC is a read/write register, and is similar to the EPC register. This register is used to store the program counter (PC) on ColdReset, SoftReset and NMI exceptions. This register contains the virtual address at which instruction processing can resume after servicing an error. This address can be: • The virtual address of the instruction that caused the exception • The virtual address of the immediately preceding branch or jump instruction, when this address is in a branch delay slot. There is no branch delay slot indication for this register. Figure 3.2.21 shows the formats of the ErrorEPC register and Table 3.2.22 describes the ErrorEPC register field. 31 0 ErrorEPC (32-bit mode) 63 0 ErrorEPC (64-bit mode) Figure 3.2.21 ErrorEPC Register Formats Table 3.2.22 ErrorEPC Register Field Descriptions 32-bit mode Bit(s) Field Name 31:0 ErrorEPC Description Error Exception Program Counter. Cold Reset Read/Write Undefined Read/Write 64-bit mode Bit(s) Field Name 63:0 ErrorEPC Description Error Exception Program Counter. 3-27 Cold Reset Read/Write Undefined Read/Write Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.2.22 DESAVE Register (Reg#31) This register is used by the debug exception handler to save one of the GPRs, that is then used to save the rest of the context to a pre-determined memory area, e.g. in the processor probe. This register allows the safe debugging of exception handlers and other types of code where the existence of a valid stack for context saving cannot be assumed. Figure 3.2.22 shows the formats of the DESAVE register and Table 3.2.23 describes the DESAVE register field. Note: This register can use for ICE system only. 63 0 DESAVE Figure 3.2.22 DESAVE Register Format Table 3.2.23 DESAVE register Field Description 32-/64-bit mode Bit(s) Field Name 63:0 DESAVE Description Save one of the GPRs 3-28 Cold Reset Read/Write Undefined Read/Write Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.3 Floating-Point Unit, CP1 The floating-point operations fully conform to the requirements of ANSI/IEEE Standard 754-1985, IEEE Standard for Binary Floating-Point Arithmetic 3.3.1 Floating-Point General Registers (FGRs) CP1 has a set of Floating-Point General Purpose registers (FGRs) that can be accessed in the following ways: • As 32 general purpose registers (32 FGRs), each of which is 32-bits wide when the FR bit in the CPU Status register equals 0; or as 32 general purpose registers (32 FGRs), each of which is 64-bits wide when FR equals 1. The CPU accesses these registers through move, load, and store instructions. • As 16 floating-point registers (see the next section for a description of FPRs), each of which is 64-bits wide, when the FR bit in the CPU Status register equals 0. The FPRs hold values in either single- or double-precision floating-point format. Each FPR corresponds to adjacently numbered FGRs as shown in Figure 3.3.1. • As 32 floating-point registers (see the next section for a description of FPRs), each of which is 64-bits wide, when the FR bit in the CPU Status register equals 1. The FPRs hold values in either single- or double-precision floating-point format. Each FPR corresponds to an FGR as shown in Figure 3.3.1. Floating-point Registers (FPR) (FR = 0) Floating-Point General Purpose Registers 31 FPR0 FPR2 (least) (FGR) Floating-point Registers (FPR) (FR = 1) 0 63 FGR0 FPR0 FPR15 (FGR) FGR1 FPR1 FGR1 (least) FGR2 FPR2 FGR2 (most) FGR3 FPR3 FGR3 • • • (least) FGR28 FPR28 (most) FGR29 FPR29 FGR29 (least) FGR30 FPR30 FGR30 (most) FGR31 FPR31 FGR31 31 0 FGR0 (most) • • • FPR14 Floating-Point General Purpose Registers Control/Status Register (FCR31) 0 FGR28 Floating-point Control Registers (FCR) Implementation/Revision Register 31 (FCR0) 0 Figure 3.3.1 FP Registers 3-29 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.3.2 Floating-Point Control Registers The MIPS RISC architecture defines 32 floating-point control registers (FCRs); the TX49 processor implements two of these registers: FCR0 and FCR31. These FCRs are described below: • The Implementation/Revision register (FCR0) holds revision information. • The Control/Status register (FCR31) controls and monitors exceptions, holds the result of compare operations, and establishes rounding modes. • FCR1 to FCR30 are reserved. Table 3.3.1 lists the assignments of the FCRs. Table 3.3.1 Floating-Point Control Register Assignments FCR Number Use FCR0 Coprocessor implementation and revision register FCR1-FCR30 Reserved FCR31 Rounding mode, cause, trap enables, and flags Implementation and Revision Register (FCR0) The read-only Implementation and Revision register (FCR0) specifies the implementation and revision number of CP1. This information can determine the coprocessor revision and performance level, and can also be used by diagnostic software. Figure 3.3.2 shows the layout of the register; Table 3.3.2 describes the Implementation and Revision register (FCR0) fields. Implementation/Revision Register (FCR0) 31 16 15 8 7 0 0 Imp Rev 16 8 8 Figure 3.3.2 Implementation/Revision Register Table 3.3.2 FCR0 Fields Field Name Description Imp Implementation number Rev Revision number in the form of y. x 0 Reserved. Returns zeroes when read. The revision number is a value of the form y. x, where: • y is a major revision number held in bits 7:4. • x is a minor revision number held in bits 3:0. 3-30 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Control/Status Register (FCR31) The Control/Status register (FCR31) contains control and status information that can be accessed by instructions in either Kernel or User mode. FCR31 also controls the arithmetic rounding mode and enables User mode traps, as well as identifying any exceptions that may have occurred in the most recently executed floating-point instruction, along with any exceptions that may have occurred without being trapped. Figure 3.3.3 shows the format of the Control/Status register, and Table 3.3.3 describes the Control/Status register fields. Figure 3.3.4 shows the Control/Status register Cause, Flag, and Enable fields. Control/Status Register (FCR31) 31 25 24 23 22 0 18 17 FS C 7 1 1 12 11 76 21 0 Enables VZOUI Flags VZOUI RM 5 6 5 5 2 Figure 3.3.3 FP Control/Status Register Bit Assignments Table 3.3.3 Control/Status Register Fields Field Name Description FS When set, denormalized results can be flushed instead of causing an unimplemented operation exception. C Condition bit. Stores the result of compare instruction. See description of Control/Status register Condition bit. Cause Cause bits. These bits identify the exceptions raised by the most recently executed floating-point instruction. See Figure 3.3.4 and the description of Control/Status register Cause, Flag, and Enable bits. Enables Enable bits. When set, these bits trap any floating-point exceptions to indicate that they have been passed to the CPU. See Figure 3.3.4 and the description of Control/Status register Cause, Flag, and Enable bits. Flags Flag bits. These bits indicate that an exception was raised. See Figure 3.3.4 and the description of Control/Status register Cause, Flag, and Enable bits. RM Rounding mode bits. See Table 3.3.5 and the description of Control/Status register Rounding Mode Control bits. Bit# 0 Cause EVZOUI 17 16 15 14 13 12 E V Z O U I Bit# 11 10 9 8 7 V Z O U I Bit# 6 5 4 3 2 V Z O U I Cause Bits Enable Bits Flag Bits Inexact Operation Underflow Overflow Division by Zero Invalid Operation Unimplemented Operation Figure 3.3.4 Control/Status Register Cause, Flag, and Enable Fields 3-31 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Control/Status Register FS Bit The FS bit enables the flushing of denormalized values. When the FS bit is set and the Underflow and Inexact Enable bits are not set, denormalized results are flushed instead of causing an Unimplemented Operation exception. Results are flushed either to 0 or the minimum normalized value, depending upon the rounding mode (see Table 3.3.4 below), and the Underflow and Inexact Flag and Cause bits are set. Table 3.3.4 Flush Values of Denormalized Results Denormalized Result Flushed Result Rounding Mode RN RZ Positive +0 +0 Negative -0 -0 RP +2 Emin -0 RM +0 -2Emin Control/Status Register Condition Bit When a floating-point Compare operation takes place, the result is stored at bit 23, the Condition bit. The C bit is set to 1 if the condition is true; the bit is cleared to 0 if the condition is false. Bit 23 is affected only by compare and CTC1 instructions. The BC1T and BC1F instructions test the C bit to decide whether or not to cause a branch. Control/Status Register Cause, Flag, and Enable Fields Figure 3.3.4 illustrates the Cause, Flag, and Enable fields of the Control/Status register. The Cause and Flag fields are updated by all conversion, computational (except MOV. fmt), CTC1, reserved, and unimplemented instructions. All other instructions have no affect on these fields. Cause Bits Bits 17-12 in the Control/Status register contain Cause bits, as shown in Figure 3.3.4, which reflect the results of the most recently executed floating-point instruction. The Cause bits are a logical extension of the CP0 Cause register; they identify the exceptions raised by the last floating-point operation. If the corresponding Enable bit is set at the time of the exception a floating-point exception and interrupt is raised. If more than one exception occurs on a single instruction, each appropriate bit is set. The Cause bits are updated by most floating-point operations. The Unimplemented Operation (E) bit is set to 1 if software emulation is required, otherwise it remains 0. The other bits are set to 0 or 1 to indicate the occurrence or non-occurrence (respectively) of an IEEE 754 exception. Within the set of floating-point instructions that update the Cause bits, the Cause field indicates the exceptions raised by the most-recently-executed instruction. When a floating-point exception is taken, no results are stored, and the only state affected is the Cause bit. Therefore, software emulation routines can use the original values to emulate the exception-causing floating-point operation. 3-32 Chapter 3 TX49/H3, TX49/H4 Core’s Registers Enable Bits A floating-point exception is generated any time a Cause bit and the corresponding Enable bit are set. A floating-point operation that sets an enabled Cause bit forces an immediate floating-point exception, as does setting both Cause and Enable bits with CTC1. Software can also emulate above. There is no enable for Unimplemented Operation (E). An Unimplemented exception always generates a floating-point exception. Before returning from a floating-point exception, software must first clear the enabled Cause bits with a CTC1 instruction to prevent a repeat of the interrupt. Thus, User mode programs can never observe enabled Cause bits set; if this information is required in a User mode handler, it must be passed somewhere other than the Status register. For a floating-point operation that sets only unenabled Cause bits, no floating-point exception occurs and the default result defined by IEEE 754 is stored. In this case, the exceptions that were caused by the immediately previous floating-point operation can be determined by reading the Cause field. Flag Bits The Flag bits are cumulative and indicate the exceptions that were raised by the operations that were executed since the bits were explicitly reset. Flag bits are set to 1 if an IEEE 754 exception is raised, otherwise they remain unchanged. The Flag bits are never cleared as a side effect of floating-point operations; however, they can be set or cleared by writing a new value into the Status register, using a CTC1 instruction. Control/Status Register Rounding Mode Control Bits Bits 1 and 0 in the Control/Status register constitute the Rounding Mode (RM) field. As shown in Table 3.3.5, these bits specify the rounding mode that CP1 uses for all floating-point operations. Table 3.3.5 Rounding Mode Bit Decoding Rounding ModeRM [1:0] Mnemonic Description 0 RN Round result to nearest representable value; round to value with least-significant bit 0 when the two nearest representable values are equally near. 1 RZ Round toward 0: round to value closest to and not greater in magnitude than the infinitely precise result. 2 RP Round toward +∞: round to value closest to and not less than the infinitely precise result. 3 RM Round toward −∞: round to value closest to and not greater than the infinitely precise result. 3-33 Chapter 3 TX49/H3, TX49/H4 Core’s Registers 3.3.3 Accessing the FP Control and Implementation/Revision Registers The Control/Status and the Implementation/Revision registers are read by a Move Control From Coprocessor 1 (CFC1) instruction. The bits in the Control/Status register can be set or cleared by writing to the register using a Move Control To Coprocessor 1 (CTC1) instruction. The Implementation/Revision register is a read-only register. There are no pipeline hazards (between any instructions) associated with floating-point control registers. 3-34 Chapter 4 Memory Management System 4. Memory Management System The processor provides a full-featured memory management unit (MMU) which uses an on-chip translation look aside buffer (TLB) to translate virtual addresses into physical addresses. 4.1 Address Space Overview The physical address space is either 4 Gbytes or 64 Gbytes depending on whether the processor is operating in 32- or 64-bit bus width mode. In 32-bit bus width mode, address space is 4 Gbytes using a 32-bit address. In 64-bit bus width mode, address space is 64 Gbytes using a 36-bit address. The virtual address is either 32 or 64 bits wide depending on whether the processor is operating in 32- or 64-bit bus width mode. In 32-bit bus width mode, addresses are 32 bits wide and the maximum user process size is 2 Gbytes (231). In 64-bit bus width mode, addresses are 64 bits wide and the maximum user process is 1 Tbytes (240). The virtual address is extended with an Address Space Identifier (ASID) to reduce the frequency of TLB flushing when switching context. The size of the ASID field is 8 bits. The ASID is contained in the CP0 EntryHi register. 4.1.1 Virtual Address Space The processor virtual address can be either 32 or 64 bits wide, depending on whether the processor is operating in 32-bit or 64-bit bus width mode. • In 32-bit bus width mode, addresses are 32 bits wide. The maximum user process size is 2 Gbytes (231). • In 64-bit bus width mode, addresses are 64 bits wide. The maximum user process size is 1 Tbytes (240). Figure 4.1.1 shows the translation of a virtual address into a physical address. Virtual address 1. Virtual address (VA) represented by the virtual page number (VPN) is compared with tag in the TLB. G G ASID VPN ASID Offset VPN TLB Entry 2. If there is a match, the page frame number (PFN) representing the upper bits of the physical address (PA) is output from the TLB. PFN TLB 3. The Offset, which does not pass through the TLB, is then concatenated to the PFN. PFN Offset Physical address Figure 4.1.1 Overview of a Virtual-to-Physical Address Translation As shown in Figure 4.1.2 and Figure 4.1.3, the virtual address is extended with an 8-bit address space identifier (ASID), which reduces the frequency of TLB flushing when switching contexts. This 8-bit ASID is in the CP0 EntryHi register, described later in this chapter. The Global bit (G) is in the EntryLo0 and EntryLo1 registers, described later in this chapter. 4-1 Chapter 4 Memory Management System 4.1.2 Physical Address Space The physical address space can be either 4 G or 64 Gbytes, depending on whether the processor is operating in 32-bit or 64-bit bus width mode. 4.1.3 • In 32-bit bus width mode, address space is 4 Gbytes using a 32-bit address. • In 64-bit bus width, mode, addresses space is 64 Gbytes using a 36-bit address. Virtual-to-Physical Address Translation Converting a virtual address to a physical address begins by comparing the virtual address from the processor with the virtual addresses in the TLB; there is a match when the virtual page number (VPN) of the address is the same as the VPN field of the entry, and either: • the Global (G) bit of the TLB entry is set, or • the ASID field of the virtual address is the same as the ASID field of the TLB entry. This match is referred to as a TLB hit. If there is no match, a TLB Miss exception is taken by the processor and software is allowed to refill the TLB from a page table of virtual/physical addresses in memory. If there is a virtual address match in the TLB, the physical address is output from the TLB and concatenated with the Offset, which represents an address within the page frame space. The Offset does not pass through the TLB. Virtual-to-physical translation is described in greater detail throughout the remainder of this chapter; Figure 4.4.1 is a flow diagram of the process shown at the end of this chapter. The next two sections describe the 32-bit and 64-bit address translations. 4-2 Chapter 4 Memory Management System 4.1.4 32-bit Mode Address Translation Figure 4.1.2 shows the virtual-to-physical-address translation of a 32-bit mode address. This figure illustrates two of the possible page sizes: a 4-Kbyte page (12 bits) and a 16-Mbyte page (24 bits). • The top portion of Figure 4.1.2 shows a virtual address with a 12-bit, or 4-Kbyte, page size, labeled Offset. The remaining 20 bits of the address represent the VPN, and Index the 1M-entry page table. • The bottom portion of Figure 4.1.2 shows a virtual address with a 24-bit, or 16-Mbyte, page size, labeled Offset. The remaining 8 bits of the address represent the VPN, and index the 256-entry page table. Virtual Address with 1M (220) 4-Kbyte pages 39 32 31 20 bits = 1 M pages 29 28 12 11 0 ASID VPN Offset 8 20 12 Virtual-to-physical translation in TLB TLB 32-bit Physical Address Bits 31, 30 and 29 of the virtual address select user, supervisor, or kernel address spaces. 0 31 PFN Offset Virtual-to-physical translation in TLB TLB 39 32 31 ASID 8 Offset passed unchanged to physical memory 29 28 Offset passed unchanged to physical memory 24 23 VPN 0 Offset 8 8 bits = 256 pages 24 Virtual Address with 256 (28) 16-Mbyte pages Figure 4.1.2 32-bit Mode Virtual Address Translation 4-3 Chapter 4 Memory Management System 4.1.5 64-Bit Mode Address Translation Figure 4.1.3 shows the virtual-to-physical-address translation of a 64-bit mode address. This figure illustrates two of the possible page sizes: a 4-Kbyte page (12 bits) and a 16-Mbyte page (24 bits). • The top portion of Figure 4.1.3 shows a virtual address with a 12-bit, or 4-Kbyte, page size, labelled Offset. The remaining 28 bits of the address represent the VPN, and index the 256M-entry page table. • The bottom portion of Figure 4.1.3 shows a virtual address with a 24-bit, or 16-Mbyte, page size, labelled Offset. The remaining 16 bits of the address represent the VPN, and index the 64K-entry page table. Virtual Address with 256 M (228) 4-Kbyte pages 71 64 63 62 61 ASID 40 39 28 bits = 256M pages 12 11 0 or -1 VPN Offset 24 28 12 8 Virtual-to-physical translation in TLB Bits 62 and 63 of the virtual address select user, supervisor, 35 or kernel address spaces. TLB 36-bit Physical Address Offset Virtual-to-physical translation in TLB Offset passed unchanged to physical memory TLB 64 63 62 61 40 39 ASID 0 or -1 8 24 Offset passed unchanged to physical memory 0 PFN 71 0 24 23 VPN 0 Offset 16 24 16 bits = 64 K pages Virtual Address with 64 K (216) 16-Mbyte pages Figure 4.1.3 64-bit Mode Virtual Address Translation 4-4 Chapter 4 Memory Management System 4.2 Operating Modes The processor has the three operating modes, User mode, Supervisor mode and Kernel mode, for 32- and 64-bit operation. The KSU, EXL and ERL bit in the Status register select User, Supervisor or Kernel mode. The UX, SX and KX bit in the Status register select 32- or 64-bit addressing in user, supervisor and kernel mode respectively. 4.2.1 KSU EXL ERL UX SX KX 10 0 0 0 – – 32-bit addressing in user mode Mode 10 0 0 1 – – 64-bit addressing in user mode 01 0 0 – 0 – 32-bit addressing in supervisor mode 01 0 0 – 1 – 64-bit addressing in supervisor mode 00 – – – – 0 32-bit addressing in kernel mode – 1 – – – 0 32-bit addressing in kernel mode – – 1 – – 0 32-bit addressing in kernel mode 00 – – – – 1 64-bit addressing in kernel mode – 1 – – – 1 64-bit addressing in kernel mode – – 1 – – 1 64-bit addressing in kernel mode User Mode Operations In User mode, a single, uniform virtual address space-labelled User segment-is available; its size is: • 2 Gbytes (231 bytes) in 32-bit mode (useg) • 1 Tbytes (240 bytes) in 64-bit mode (xuseg) Figure 4.2.1 shows User mode virtual address space. 32-bit (Note) 64-bit 0x FFFF FFFF 0x FFFF FFFF FFFF FFFF Address Error Address Error 0x 8000 0000 0x 0000 0100 0000 0000 2 GB Mapped Cacheable 0x 0000 0000 1 TB Mapped Cacheable useg xuseg 0x 0000 0000 0000 0000 Figure 4.2.1 User Mode Virtual Address Space Note: In 32-bit mode, bit 31 is sign-extended through bits 63-32. Failure results in an address error exception. The User segment starts at address 0 and the current active user process resides in either useg (in 32-bit mode) or xuseg (in 64-bit mode). The TLB identically maps all references to useg/xuseg from all modes, and controls cache accessibility. The processor operates in User mode when the Status register contains the following bit-values: • KSU bits = 102 • EXL = 0 • ERL = 0 4-5 Chapter 4 Memory Management System In conjunction with these bits, the UX bit in the Status register selects between 32- or 64-bit User mode addressing as follows: • when UX = 0, 32-bit useg space is selected and TLB misses are handled by the 32-bit TLB refill exception handler • when UX = 1, 64-bit xuseg space is selected and TLB misses are handled by the 64-bit TLB refill exception handler Table 4.2.1 lists the characteristics of the two user mode segments, useg and xuseg. Table 4.2.1 32-bit and 64-bit User Mode Segments Status Register Bit Values Address Bit Values Segment Name Address Range Segment Size KSU EXL ERL UX 32-bit A[31]=0 102 0 0 0 useg 0x0000 0000 through 0x7FFF FFFF 2 Gbytes (231 bytes) 64-bit A[63:40]=0 102 0 0 1 xuseg 0x0000 0000 0000 0000 through 0x0000 00FF FFFF FFFF 1 Tbytes (240 bytes) 32-bit User Mode (useg) In User mode, when UX = 0 in the Status register, User mode addressing is compatible with the 32-bit addressing model shown in Figure 4.2.1, and a 2-Gbyte user address space is available, labelled useg. All valid User mode virtual addresses have their most-significant bit cleared to 0; any attempt to reference an address with the most-significant bit set while in User mode causes an Address Error exception. The system maps all references to useg through the TLB, and bit settings within the TLB entry for the page determine the cacheability of a reference. 64-bit User Mode (xuseg) In User mode, when UX = 1 in the Status register, User mode addressing is extended to the 64-bit model shown in Figure 4.2.1. In 64-bit User mode, the processor provides a single, uniform address space of 240 bytes, labelled xuseg. All valid User mode virtual addresses have bits 63-40 equal to 0; an attempt to reference an address with bits 63-40 not equal to 0 causes an Address Error exception. The system maps all reference to xuseg through the TLB, and bit settings within the TLB entry for the page determine the cacheability of a reference. 4-6 Chapter 4 Memory Management System 4.2.2 Supervisor Mode Operations Supervisor mode is designed for layered operating systems in which a true kernel runs in Kernel mode, and the rest of the operating system runs in Supervisor mode. The processor operates in Supervisor mode when the Status register contains the following bit-values: • KSU = 012 • EXL = 0 • ERL = 0 In conjunction with these bits, the SX bit in the Status register selects between 32- or 64-bit Supervisor mode addressing: • when SX = 0, 32-bit supervisor space is selected and TLB misses are handled by the 32-bit TLB refill exception handler • when SX = 1, 64-bit supervisor space is selected and TLB misses are handled by the 64-bit XTLB refill exception handler The system maps all references through the TLB, and bit settings within the TLB entry for the page determine the cacheability of a reference. Figure 4.2.2 shows Supervisor mode address mapping. Table 4.2.2 lists the characteristics of the supervisor mode segments; descriptions of the address spaces follow. 32-bit (Note) 0x FFFF FFFF 0x E000 0000 0x A000 0000 0x 8000 0000 Address error 2 GB Mapped Cacheable 0x 0000 0000 0x FFFF FFFF FFFF FFFF Address error 512 MB Mapped Cacheable Address error 0x C000 0000 64-bit 0x FFFF FFFF E000 0000 Address error 0x 4000 0100 0000 0000 512 MB Mapped Cacheable Address error 0x 4000 0000 0000 0000 1 TB Mapped Cacheable sseg 0x FFFF FFFF C000 0000 csseg xsseg Address error 0x 0000 0100 0000 0000 suseg 0x 0000 0000 0000 0000 1 TB Mapped Cacheable xsuseg Figure 4.2.2 Supervisor Mode Address Space Note: In 32-bit mode, bit 31 is sign-extended through bits 63-32. Failure results in an address error exception. 4-7 Chapter 4 Memory Management System Table 4.2.2 32-bit and 64-bit Supervisor Mode Segments Status Register Bit Values Address Bit Values Segment Name Address Range Segment Size KSU EXL ERL SX 32-bit A[31] = 0 012 0 0 0 suseg 0x0000 0000 through 0x7FFF FFFF 2 Gbytes (231 bytes) 32-bit A[31:29] = 1102 012 0 0 0 ssseg 0xC000 0000 through 0xDFFF FFFF 512 Mbytes (229 bytes) 64-bit A[63:62] = 002 012 0 0 1 xsuseg 0x0000 0000 0000 0000 through 0x0000 00FF FFFF FFFF 1 Tbytes (240 bytes) 64-bit A[63:62] = 012 012 0 0 1 xsseg 0x4000 0000 0000 0000 through 0x4000 00FF FFFF FFFF 1 Tbytes (240 bytes) 64-bit A[63:62] = 112 012 0 0 1 csseg 0xFFFF FFFF C000 0000 through 0xFFFF FFFF DFFF FFFF 512 Mbytes (229 bytes) 32-bit Supervisor Mode, User Space (suseg) In Supervisor mode, when SX = 0 in the Status register and the most-significant bit of the 32-bit virtual address is set to 0, the suseg virtual address space is selected; it covers the full 231 bytes (2 Gbytes) of the current user address space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. This mapped space starts at virtual address 0x0000 0000 and runs through 0x7FFF FFFF. 32-bit Supervisor Mode, Supervisor Space (sseg) In Supervisor mode, when SX = 0 in the Status register and the three most-significant bits of the 32-bit virtual address are 1102, the sseg virtual address space is selected; it covers 229 bytes (512 Mbytes) of the current supervisor address space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. This mapped space begins at virtual address 0xC000 0000 and runs through 0xDFFF FFFF. 64-bit Supervisor Mode, User Space (xsuseg) In Supervisor mode, when SX = 1 in the Status register and bits 63-62 of the virtual address are set to 002, the xsuseg virtual address space is selected; it covers the full 240 bytes (1 Tbytes) of the current user address space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. This mapped space starts at virtual address 0x0000 0000 0000 0000 and runs through 0x0000 00FF FFFF FFFF. 64-bit Supervisor Mode, Current Supervisor Space (xsseg) In Supervisor mode, when SX = 1 in the Status register and bits 63-62 of the virtual address are set to 012, the xsseg current supervisor virtual address space is selected. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. This mapped space begins at virtual address 0x4000 0000 0000 0000 and runs through 0x4000 00FF FFFF FFFF. 4-8 Chapter 4 Memory Management System 64-bit Supervisor Mode, Separate Supervisor Space (csseg) In Supervisor mode, when SX = 1 in the Status register and bits 63-62 of the virtual address are set to 112, the csseg separate supervisor virtual address space is selected. Addressing of the csseg is compatible with addressing sseg in 32-bit mode. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. This mapped space begins at virtual address 0xFFFF FFFF C000 0000 and runs through 0xFFFF FFFF DFFF FFFF. 4.2.3 Kernel Mode Operations The processor operates in Kernel mode when the Status register contains one or more of the following values: • KSU = 002 • EXL = 1 • ERL = 1 In conjunction with these bits, the KX bit in the Status register selects between 32- or 64-bit Kernel mode addressing: • when KX = 0, 32-bit kernel space is selected and all TLB misses are handled by the 32-bit TLB refill exception handler • when KX = 1, 64-bit kernel space is selected and all TLB misses are handled by the 64-bit XTLB refill exception handler The processor enters Kernel mode whenever an exception is detected and it remains in Kernel mode until an Exception Return (ERET) instruction is executed and results in ERL and/or EXL = 0. The ERET instruction restores the processor to the mode existing prior to the exception. Kernel mode virtual address space is divided into regions differentiated by the high-order bits of the virtual address, as shown in Figure 4.2.3. Table 4.2.3 lists the characteristics of the 32-bit kernel mode segments, and Table 4.2.4 lists the characteristics of the 64-bit kernel mode segments. 4-9 Chapter 4 Memory Management System 32-bit 0x FFFF FFFF (Note 1) 64-bit 0x FFFF FFFF FFFF FFFF kseg3 (Note 2) 0x FFFF FFFF E000 0000 0x E000 0000 512 MB Mapped Cacheable 0x FFFF FFFF C000 0000 ksseg 0x C000 0000 512 MB Mapped Cacheable kseg1 0x A000 0000 512 MB Unmapped Uncached 0x 8000 0000 512 MB Unmapped Cacheable 512 MB Mapped Cacheable 512 MB Mapped Cacheable 512 MB Unmapped Uncached 512 MB Unmapped Cacheable 0x FFFF FFFF A000 0000 0x FFFF FFFF 8000 0000 Address error Mapped Cacheable 0x C000 00FF 8000 0000 kseg0 0x C000 0000 0000 0000 Unmapped (For details see Figure 4.2.4) ckseg3 (Note 2) cksseg ckseg1 ckseg0 xkseg xkphys 0x 8000 0000 0000 0000 2 GB Mapped Cacheable 0x 0000 0000 0x 4000 0100 0000 0000 Address error 0x 4000 0000 0000 0000 1 TB Mapped Cacheable 0x 0000 0100 0000 0000 Address error 0x 0000 0000 0000 0000 1 TB Mapped Cacheable kuseg xksseg xkuseg Figure 4.2.3 Kernel Mode Address Space Note 1: In 32-bit mode, bit 31 is sign-extended through bits 63-32. Failure results in an address error exception. Note 2: 0xff00_0000 through 0xff3f_ffff in 32-bit mode and 0xffff_ffff_ff00_0000 through 0xffff_ffff_ff3f_ffff in 64-bit mode are reserved (unmapped, uncached) for use by registers in the Debug Support Unit and the processor’s peripherals. 4-10 Chapter 4 Memory Management System 0xBFFF FFFF FFFF FFFF 4 × 64 GB Unmapped Reserved 0xA000 0000 0000 0000 0x9FFF FFFF FFFF FFFF 64 GB Unmapped Cacheable noncoherent WB 0x9800 0000 0000 0000 0x97FF FFFF FFFF FFFF 64 GB Unmapped Uncached 0x9000 0000 0000 0000 0x8FFF FFFF FFFF FFFF 64 GB Unmapped Cacheable noncoherent WT-WA 0x8800 0000 0000 0000 0x87FF FFFF FFFF FFFF 64 GB Unmapped Cacheable noncoherent WT-no-WA 0x8000 0000 0000 0000 Figure 4.2.4 xkphys Address Space 4-11 Chapter 4 Memory Management System Table 4.2.3 32-bit Kernel Mode Segments Address Bit Values Status Register Is One Of These Values KSU EXL ERL Segment Name Address Range Segment Size KX A[31] = 0 0 Kuseg 0x0000 0000 through 0x7FFF FFFF 2 Gbytes (231 bytes) A[31:29] = 1002 0 Kseg0 0x8000 0000 through 0x9FFF FFFF 512 Mbytes (229 bytes) 0 Kseg1 0xA000 0000 through 0xBFFF FFFF 512 Mbytes (229 bytes) 0 Ksseg 0xC000 0000 through 0xDFFF FFFF 512 Mbytes (229 bytes) Kseg3 0xE000 0000 through 0xFFFF FFFF 512 Mbytes-4 Mbytes (229 bytes) Reserved (Note) 0xFF00 0000 through 0xFF3F FFFF 4 Mbytes A[31:29] = 1012 A[31:29] = 1102 A[31:29] = 1112 KSU = 002 or EXL = 1 or ERL = 1 0 Note : 0xff00_0000 through 0xff3f_ffff in 32-bit mode is reserved (unmapped, uncached) for use by registers in the Debug Support Unit and the processor’s peripherals. 32-bit Kernel Mode, User Space (kuseg) In Kernel mode, when KX = 0 in the Status register, and the most-significant bit of the virtual address, A31, is cleared, the 32-bit kuseg virtual address space is selected; it covers the full 231 bytes (2 Gbytes) of the current user address space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. When ERL = 1 in the Status register, the user address region becomes a 231 bytes unmapped (that is, mapped directly to physical addresses) uncached address space. 32-bit Kernel Mode, Kernel Space 0 (kseg0) In Kernel mode, when KX = 0 in the Status register and the most-significant three bits of the virtual address are 1002, 32-bit kseg0 virtual address space is selected; it is the 229 bytes (512 Mbytes) kernel physical space. References to kseg0 are not mapped through the TLB; the physical address selected is defined by subtracting 0x8000 0000 from the virtual address. The K0 field of the Config register, described in this chapter, controls cacheability and coherency. 32-bit Kernel Mode, Kernel Space 1 (kseg1) In Kernel mode, when KX = 0 in the Status register and the most-significant three bits of the 32-bit virtual address are 1012, 32-bit kseg1 virtual address space is selected; it is the 229 bytes (512 Mbytes) kernel physical space. References to kseg1 are not mapped through the TLB; the physical address selected is defined by subtracting 0xA000 0000 from the virtual address. Caches are disabled for accesses to these addresses, and physical memory (or memory-mapped I/O device registers) are accessed directly. 32-bit Kernel Mode, Supervisor Space (ksseg) In Kernel mode, when KX = 0 in the Status register and the most-significant three bits of the 32-bit virtual address are 1102, the ksseg virtual address space is selected; it is the current 229 bytes (512 Mbytes) supervisor virtual space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. 4-12 Chapter 4 Memory Management System 32-bit Kernel Mode, Kernel Space 3 (kseg3) In Kernel mode, when KX = 0 in the Status register and the most-significant three bits of the 32-bit vital address are 1112, the kseg3 virtual address space is selected; it is the current 229 bytes (512 Mbytes-4 Mbytes) kernel virtual space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. Table 4.2.4 64-bit Kernel Mode Segments Address Bit Values Status Register Is One Of These Values KSU EXL ERL KX Segment Name Address Range Segment Size A[63:62] = 002 1 xkuseg 0x0000 0000 0000 0000 through 0x0000 00FF FFFF FFFF 1 Tbytes (240 bytes) A[63:62] = 012 1 xksseg 0x4000 0000 0000 0000 through 0x4000 00FF FFFF FFFF 1 Tbytes (240 bytes) A[63:62] = 102 1 xkphys 0x8000 0000 0000 0000 through 0xBFFF FFFF FFFF FFFF 8 × 232 bytes A[63:62] = 112 1 xkseg 0xC000 0000 0000 0000 through 0xC000 00FF 7FFF FFFF 2 –2 bytes 1 ckseg0 0xFFFF FFFF 8000 0000 through 0xFFFF FFFF 9FFF FFFF 512 Mbytes (229 bytes) 1 ckseg1 0xFFFF FFFF A000 0000 through 0xFFFF FFFF BFFF FFFF 512 Mbytes (229 bytes) 1 cksseg 0xFFFF FFFF C000 0000 through 0xFFFF FFFF DFFF FFFF 512 Mbytes (229 bytes) ckseg3 0xFFFF FFFF E000 0000 through 0xFFFF FFFF FFFF FFFF 512 Mbytes -4 Mbytes Reserved (Note) 0xFFFF FFFF FF00 0000 through 0xFFFF FFFF FF3F FFFF 4 Mbytes A[63:62] = 112 A[61:31] = -1 A[63:62] = 112 A[61:31] = -1 A[63:62] = 112 A[61:31] = -1 A[63:62] = 112 A[61:31] = -1 KSU = 002 or EXL = 1 or ERL = 1 1 40 31 Note : 0xffff_ffff_ff00_0000 through 0xffff_ffff_ff3f_ffff in 64-bit mode is reserved (unmapped, uncached) for use by registers in the Debug Support Unit and the processor’s peripherals. 64-bit Kernel Mode, User Space (xkuseg) In Kernel mode, when KX = 1 in the Status register and bits 63-62 of the 64-bit virtual address are 002, the xkuseg virtual address space is selected; it covers the current user address space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. When ERL = 1 in the Status register, the user address region becomes a 231 bytes unmapped (that is, mapped directly to physical addresses) uncached address space. 64-bit Kernel Mode, Current Supervisor Space (xksseg) In Kernel mode, when KX = 1 in the Status register and bits 63-62 of the 64-bit virtual address are 012, the xksseg virtual address space is selected; it is the current supervisor virtual space. The virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address. 4-13 Chapter 4 Memory Management System 64-bit Kernel Mode, Physical Spaces (xkphys) In Kernel mode, when KX = 1 in the Status register and bits 63-62 of the 64-bit virtual address are 102, one of the two unmapped xkphys address spaces are selected, either cached or uncached. Accesses with address bits 58-36 not equal to 0 cause an address error. References to this space are not mapped; the physical address selected is taken from bits 35-0 of the virtual address. Bits 61-59 of the virtual address specify the cacheability and coherency attributes, as shown in Table 4.2.5. Table 4.2.5 Cacheability and Coherency Attributes Value[61:59] Cacheability and Coherency Attributes Starting Address 0 Cacheable, non-coherent, write-through, no write allocate 0x8000 0000 0000 0000 1 Cacheable, non-coherent, write-through, no write allocate 0x8800 0000 0000 0000 2 Uncached 0x9000 0000 0000 0000 3 Cacheable, non-coherent 0x9800 0000 0000 0000 Reserved 0xA000 0000 0000 0000 4-7 64-bit Kernel Mode, Kernel Space (xkseg) In Kernel mode, when KX = 1 in the Status register and bits 63-62 of the 64-bit virtual address are 112, the address space selected is one of the following: • kernel virtual space, xkseg, the current kernel virtual space; the virtual address is extended with the contents of the 8-bit ASID field to form a unique virtual address • one of the four 32-bit kernel compatibility spaces, as described in the next section. 64-bit Kernel Mode, Compatibility Spaces (ckseg0, ckseg1, cksseg, ckseg3) In Kernel mode, when KX = 1 in the Status register, bits 63-62 of the 64-bit virtual address are 112, and bits 61-31 of the virtual address equal-1, the lower two bytes of address, as shown in Figure 4.2.3, select one of the following 512 Mbytes compatibility spaces. • ckseg0 This 64-bit virtual address space is an unmapped region, compatible with the 32-bit address model kseg0. The K0 field of the Config register, described in this chapter, controls cacheability and coherency. • ckseg1 This 64-bit virtual address space is an unmapped and uncached region, compatible with the 32-bit address model kseg1. • Cksseg This 64-bit virtual address space is the current supervisor virtual space, compatible with the 32-bit address model ksseg. • ckseg3 This 64-bit virtual address space is kernel virtual space, compatible with the 32-bit address model kseg3. 4-14 Chapter 4 Memory Management System 4.3 Translation Lookaside Buffer 4.3.1 Joint TLB The processor has a fully associative TLB which maps 48 pairs (odd/even entry) of virtual pages to their corresponding physical addresses. 4.3.2 TLB Entry format 32-bit addressing 127 121 120 109 108 0 96 MASK 0 95 77 76 VPN2 63 75 G 72 71 64 0 ASID 62 61 38 37 0 PFN 31 30 29 6 5 0 PFN 64-bit addressing 255 G V 0 136 135 0 94 93 63 0 D 192 141 140 139 VPN2 0 128 ASID 70 69 PFN 30 29 0 0 0 168 167 0 127 V 1 205 204 MASK 191 190 189 D 3 2 C 217 216 0 R 35 34 33 32 C 67 66 65 64 C 6 5 PFN D V 3 2 1 0 D V 0 C 0 MASK: Page comparison mask. This field sets the variable page size for each TLB entry. VPN2: Virtual page number divided by two (maps to two pages) ASID: Address space ID field. R: Region. (00: user, 01: supervisor, 11: kernel) used to match Vaddr[63:62]. PFN: Page frame number; upper bits of the physical address. C: Specifies the cache algorithm to be used (see the “C” field of the EntryLo0, 1). D: Dirty. If this bit is set, the page is marked as dirty and therefore, writable. This bit is actually a write-protect bit that software can use to prevent alteration of data. V: Valid. If this bit is set, it indicates that the TLB entry is valid. If a cache hit occurs through a TLB entry when this bit is cleared, a TLB invalid exception occurs. G: Global. If this bit is set in both Lo0 and Lo1, then ignore the ASID during TLB lookup. 0: Reserved. Returns zeroes when read. 4-15 Chapter 4 Memory Management System 4.3.3 Instruction-TLB The processor has a 2-entry instruction TLB (ITLB). Each ITLB entry is a subset of any single JTLB entry. The ITLB is completely invisible to software. 4.3.4 Data-TLB The processor has a 4-entry data TLB (DTLB). Each DTLB entry is a subset of any single JTLB entry. The DTLB is completely invisible to software. 4.4 Virtual-to-Physical Address Translation Process During virtual-to-physical address translation, the CPU compares the 8-bit ASID (if the Global bit, G, is not set) of the virtual address to the ASID of the TLB entry to see if there is a match. One of the following comparisons are also made: • In 32-bit mode, the 7 to 19 bits (depending upon the page size) of the virtual address are compared to the contents of the TLB VPN2 (virtual page number divided by two). • In 64-bit mode, the 15 to 27 bits (depending upon the page size) of the virtual address are compared to the contents of the TLB VPN2 (virtual page number divided by two). If a TLB entry matches, the physical address and access control bits (C, D, and V) are retrieved from the matching TLB entry. While the V bit of the entry must be set for a valid translation to take place, it is not involved in the determination of a matching TLB entry. Figure 4.4.1 illustrates the TLB address translation process. 4-16 Chapter 4 Memory Management System Virtual Address (Input) For valid address space, see the section describing Operating Modes No Address Error Exception VPN and ASID Legal Yes Address? User Mode? Sup Yes Mode? No Legal No Address? Address Error Exception Yes No Address Error No Yes Legal Address? Yes Mapped Address? Yes VPN Match? No Global Yes No No G = 1? ASID Match? No Yes Yes V = 1? No 32-bit address? No Yes Yes Dirty Yes Write? No No TLB Mod D = 1? Yes TLB Invalid Uncached? Yes No Exception TLB Refill Exception Access Main Memory Access Cache Physical Address (Output) Figure 4.4.1 TLB Address Translation 4-17 XTLB Refill Chapter 4 Memory Management System TLB Misses If there is no TLB entry that matches the virtual address, a TLB refill exception occurs. (TLB refill exceptions are described in Chapter 8.) If the access control bits (D and V) indicate that the access is not valid, a TLB modification or TLB invalid exception occurs. If the C bits equal 0102, the physical address that is retrieved accesses main memory, bypassing the cache. TLB Instructions Table 4.4.1 lists the instructions that the CPU provides for working with the TLB. See Appendix A for a detailed description of these instructions. Table 4.4.1 TLB Instructions Op Code Description of Instruction TLBP Translation Lookaside Buffer Probe TLBR Translation Lookaside Buffer Read TLBWI Translation Lookaside Buffer Write Index TLBWR Translation Lookaside Buffer Write Random 4-18 Chapter 5 Cache Organization 5. Cache Organization This chapter describes in detail the cache memory: its place in the processor memory organization, and individual organization of the caches. This chapter uses the following terminology: • The data cache may also be referred to as the D-cache. • The instruction cache may also be referred to as the I-cache. These terms are used interchangeably throughout this book. 5.1 Memory Organization Figure 5.1.1 shows the processor system memory hierarchy. In the logical memory hierarchy, both primary and secondary caches lie between the CPU and main memory. They are designed to make the speedup of memory accesses transparent to the user. Each functional block in Figure 5.1.1 has the capacity to hold more data than the block above it. For instance, physical main memory has a larger capacity than the caches. At the same time, each functional block takes longer to access than any block above it. For instance, it takes longer to access data in main memory than in the CPU on-chip registers. TX49 CPU CPU Core I-cache D-cache Core Caches Cache Faster Access Time Main Memory Disk, CD-ROM, Tape, etc. Increasing Data Capacity Memory Peripherals Figure 5.1.1 Logical Hierarchy of Memory The processor has two on-chip caches: one holds instructions (the instruction cache), the other holds data (the data cache). The instruction and data caches can be read in one CPUCLK cycle. Data writes are pipelined and can complete at a rate of one per CPUCLK cycle. In the first stage of the cycle, the store address is translated and the tag is checked; in the second stage, the data is written into the data RAM. 5-1 Chapter 5 Cache Organization 5.2 Cache Organization This section describes the organization of the on-chip data and instruction caches. Figure 5.2.1 provides a block diagram of the processor cache and memory model. TX4955 Main Memory Cache Controller I-cache Caches D-cache I-cache: Instruction cache D-cache: Data cache Figure 5.2.1 Processor Cache Support 5.2.1 Cache Sizes The processor instruction cache is 32 Kbytes; the data cache is 32 Kbytes. 5.2.2 Cache Line Lengths A cache line is the smallest unit of information that can be fetched from main memory for the cache, and that is represented by a single tag.(Note) The line size for the instruction cache is 8 words (32 bytes) and the line size for the data cache is 8 words (32 bytes). Note: Cache tags are described in the following sections. 5.2.3 Organization of the Instruction Cache (I-Cache) Each line of I-cache data (although it is actually an instruction, it is referred to as data to distinguish it from its tag) has an associated 24-bit tag. The processor I-cache has the following characteristics: • Cache size: 32 KB • Four-way set associative • FIFO replacement • Indexed with a virtual address • Checked with a physical tag • Block (line) size: 8 words (32 bytes) • Burst refill size: 8 words (32 bytes) • Lockable on a per-line basis (way1 to way3) • All Valid bits, Lock and FIFO bits are cleared by a Reset exception 5-2 Chapter 5 Cache Organization 5.2.4 Instruction Cache Address Field Figure 5.2.2 shows the instruction cache address field. 35 12 11 5 4 3 2 0 Physical Tag (24 bits ) Cache Tag Index (8 bits) Byte (3 bits) Word (2 bits) Figure 5.2.2 Instruction Cache Address Field 5.2.5 Instruction Cache Configuration Each line in the 4 ways of the instruction cache share F1, F0 replacement bits. Figure 5.2.3 shows the format of replacement bits. These bits are shared by way0, way1, way2 and way3 for 32 KB cache, and indicate next set to which replacement will be directed; when lock bit is set to 1, indicate this set is not locked. Each line of instruction cache data has an associated 26-bit tag that contains a 24-bit physical address, a single Lock bit and a single Valid bit, except for the line in way0, which has an 25-bit tag that excludes a Lock bit. Figure 5.2.4 shows the formats of tag and data pair. 1 0 F1 F0 F0: FIFO replace bit 0 F1: FIFO replace bit 1 Figure 5.2.3 Format of Replacement Bits 24 V 23 0 63 P Tag 0 63 0 Data 63 Data 0 63 Data 0 Data Format for way0 25 24 L V 23 P Tag 0 63 0 63 0 Data 63 Data 0 Data Format for way1, 2 and 3 L: Lock bit (1: enable, 0: disable) V: Valid bit (1: valid, 0: invalid) PTag: Physical tag (bits 35-12 of the physical address) Data: Instruction cache data Figure 5.2.4 Format of Tag and Data Pair for I-cache 5-3 63 0 Data Chapter 5 Cache Organization 5.2.6 Organization of the Data Cache (D-Cache) Each line of D-cache data has an associated 24-bit tag. The processor D-cache has the following characteristics: 5.2.7 • Cache size: 32 KB • Four-way set associative • FIFO replacement • Indexed with a virtual address • Checked with a physical tag • Block (line) size: 8 words (32 bytes) • Burst size: 8 words (32 bytes) • Store buffer • Lockable on a per-line basis (way1 to way3) • Write-back or write-through on a per-page basis • All Write-back, CS, FIFO and Lock bits are cleared by a Reset exception Data Cache Address Field Figure 5.2.5 shows the data cache address field. 35 12 11 5 4 3 2 0 Physical Tag (24 bits ) Cache Tag Index (8 bits) Word (2 bits) Byte (3 bits) Figure 5.2.5 Data Cache Address Field 5.2.8 Data Cache Configuration Each line in the 4 ways of the data cache share F1, F0 replacement bits. Figure 5.2.6 shows the format of replacement bits. These bits are shared by way0, way1, way2 and way3 for 32 KB cache, and indicate next set to which replacement will be directed; when Lock bit is set to 1, indicate this set is not locked. Each line of data cache data has an associated 28-bit tag that contains a 24-bit physical address, a single Lock bit, a single Write-back bit and a 2-bit cache state, except for the line in way0, which has an 27-bit tag that excludes a Lock bit. Figure 5.2.7 shows the formats of tag and data pair. 1 0 F1 F0 F0: FIFO replace bit 0 F1: FIFO replace bit 1 Figure 5.2.6 Format of Replacement Bits 5-4 Chapter 5 Cache Organization 26 25 24 W 23 CS 0 63 PTag 0 63 DATA 0 63 DATA 0 63 DATA 0 DATA Format for way0 27 L 26 25 24 23 W CS 0 PTag 63 0 63 DATA 0 DATA 63 0 DATA 63 0 DATA Format for way1, 2 and 3 L: Lock bit (1: enable, 0: disable) W: Write-back bit (set if cache line has written) CS: Primary cache state (0: Invalid, 1: Reserved, 2: Reserved, 3: Valid) PTag: Physical tag (bits 35-12 of the physical address) Data: Data cache data Figure 5.2.7 Format of Tag and Data Pair for D-cache In the processor, the W (write-back) bit, not the cache state, indicates when the primary cache contents modified data that must be written back to memory. The states Invalid and Dirty Exclusive are used to describe the cache line. That is, there is no hardware support for cache coherency. 5.3 Lock Function The lock function can be used to locate critical instruction/data in one instruction/data cache set and they are not replaced when the Lock bit is set. 5.3.1 Lock Bit Setting and Clearing Setting the Lock bit in each line cache enable the instruction/data cache lock function. When the lock function is enabled, the instruction/data in the valid line is locked and never be replaced. The set to be locked is pointed by FIFO bit. Refilled instruction/data during the lock function is enabled is locked. When a store miss occurs for the write-through data cache without write allocate, the store data is not written to the cache and will therefore not be locked. The lock function is disabled by clearing the Lock bit in each line. In order to clear or set the Lock bit in the cache, CACHE instructions (Index store I-cache /D-cache Tag) can be used, and in order to load the instruction/data to cache from memory, another CACHE instructions (Fill I-cache/D-cache) can be used (refer to CACHE instruction). Clear the Lock bit as follows when data written to a locked line should be stored in main memory. 1) Read the locked data from cache memory 2) Clear the Lock bit 3) Store the data that was read 5-5 Chapter 5 Cache Organization 5.3.2 Operation during Lock After the Lock bit is set for a line, the line can be replaced only when it’s line state is invalid. The locked valid line can never be replaced. FIFO bit should point only to the set of locked invalid line or unlocked line. A write access to a locked valid line takes place only to the cache not to the memory at Write-back mode. Both of the cache and the memory are replaced at Write-through mode. 5.3.3 Example of Data Cache Locking During the load operation to the locked line of the cache, any interrupt should be disabled in order to avoid to lock the wrong data. To lock data cache lines, the following sequence of codes could be used. ....................... /* Disable the interrupt */ mtc0 t0, TagLo /* Load data into TagLo reg */ cache 2 (D), offset (base) /* Invalidate and lock line in desired set using Index_Store_Tag cache instruction */ cache 7 (D), offset (base) /* Fill the cache line from desired memory location */ ....................... 5.3.4 /* Enable the interrupt */ Example of Instruction Cache Locking To lock instruction cache lines, the following sequence of codes could be used: ....................... /* Disable the interrupt */ mtc0 t0, TagLo /* Load data into TagLo reg */ cache 2 (I), offset (base) /* Invalidate and lock line in desired set using Index_Store_Tag cache instruction */ cache 5 (I), offset (base) /* Fill the cache line from desired memory location */ ....................... /* Enable the interrupt */ 5-6 Chapter 5 Cache Organization 5.4 The Primary Cache Accessing Figure 5.4.1 shows the virtual address (VA) index to the primary cache. Instruction cache size is 32 KB and Data cache size is 32 KB. The virtual address bits be used to index into the primary cache decided by the cache size. Data Tags Tag line Data line Instruction Cache: VA[12:5] Data Cache: VA[12:5] VA[12:5] VA[12:5] W Stage Tag 64 Figure 5.4.1 Primary Cache Data and Tag Organization 5.5 Cache States The section describes about the state of a cache line. The cache lines in the processor are in one of states described in Table 5.5.1. The I-Cache line is in one of the following states: • invalid • valid The D-Cache line is in one of the following states: • invalid • valid Table 5.5.1 Cache States Cache Line State Description Invalid A cache line that does not contain valid information must be marked invalid, and cannot be used. A cache line in any other state than invalid is assumed to contain valid information. Valid A cache line contains valid information. The cache line may or not be consistent with memory and is owned by the processor (see “Cache Line Ownership” in this chapter). 5-7 Chapter 5 Cache Organization 5.6 Cache Line Ownership The processor becomes the owner of a cache line after it writes to that cache line (that is, by entering the dirty exclusive), and is responsible for providing the contents of that line on a read request. There can only be one owner for each cache line. 5.7 Cache Multi-Hit Operation The processor is not guaranteed the operation for the multi-hit of primary cache. Thus, in case of locking the specified program/data in the primary cache, the program/data must be used after locked in the cache by Fill instruction. 5.8 FIFO Replacement Algorithm The instruction and data caches in the processor use the FIFO replacement algorithm. • Usually, cache elements are replaced in this order: Way0, Way1, Way2, Way3. • The FIFO[1:0] replacement bits do not point to a locked, valid cache line. • Data is first written to a cache line marked invalid, if any. • The FIFO replacement bits change every time memory data is written to the cache or a CACHE instruction is executed. Figure 5.8.1 shows several examples of how the FIFO replacement bits change. Way0 Way1 Way2 Way3 A) Invalid Invalid Invalid Invalid Way0 Way1 Way2 Way3 C) Invalid Invalid valid Invalid Way0 Way1 Way2 Way3 Invalid valid Lock valid Lock valid Lock E) Way0 Way1 Way2 Way3 B) Invalid Invalid Lock Invalid Invalid Way0 Way1 Way2 Way3 D) Invalid valid Lock Invalid valid Way0 Way1 Way2 Way3 valid valid valid Lock valid F) Figure 5.8.1 Examples of Cache State Transitions by the FIFO Replacement Algorithm 5-8 Chapter 5 Cache Organization 5.9 Cache Testing 5.9.1 Cache Disabling The ICE# and DCE# bits in the Config register enable and disable the instruction and data caches respectively. When the cache is disabled, any attempt to access the cache causes a cache miss; therefore, a cache refill does not occur. (A burst bus cycle does not occur, either, as is the case with an access to an uncached memory space.) With the cache disabled, the Valid (V) and Cache State (CS) bits for each entry remain unchanged. Note: When the instruction cache is disabled – All instruction fetches cause an instruction cache miss. External memory accesses will occur as a single-read operation. – Instruction cache operations by the CACHE instruction are valid. Note: When the data cache is disabled – All memory accesses by the load and store instructions cause a data cache miss. At this time, no cache refill occurs. External memory accesses will occur as a single-read or single-write operation. – Data cache operations by the CACHE instruction are valid. Note: How to disable the instruction cache reliably – To disable the instruction cache, stop instruction streaming by following the MTC0 instruction with a jump instruction, as shown below: Example: MTC0 Rn, Config (Set ICE# bit.) J L1 (Jump to L1 and stop streaming.) NOP (Jump delay slot) L1: CACHE IndexInvalidate, offset (base) 5.9.2 Cache Flushing Both the instruction and data caches are flushed by a ColdReset or WarmReset exception. i.e., all the Valid and CS bits are cleared to zeroes. The instruction cache is also flushed by the Index Invalidate and Hit Invalidate operations with a CACHE instruction. The data cache is flushed by the Hit Invalidate operation with a CACHE instruction. Data is written back to the main memory when an Index Writeback Invalidate or Hit Writeback Invalidate operation is performed, when a Hit Writeback operation is performed, and when a cache line is replaced. When the write-back policy is employed, it is required to consciously maintain cache coherency when flushing the cache. 5-9 Chapter 5 Cache Organization 5.10 Cache Operations As described earlier, caches provide fast temporary data storage, and they make the speedup of memory accesses transparent to the user. In general, the processor accesses cache-resident instructions or data through the following procedure: 1. The processor, through the on-chip cache controller, attempts to access the next instruction or data in the appropriate cache. 2. The cache controller checks to see if this instruction or data is present in the cache. 3. • If the instruction/data is present, the processor retrieves it. This is called a cache hit. • If the instruction/data is not present in the cache, the cache controller must retrieve it from memory. This is called a cache miss. The processor retrieves the instruction/data from the cache and operation continues. It is possible for the same data to be in two places simultaneously: main memory and cache. This data is kept consistent through the use of a write-back methodology; that is, modified data is not written back to memory until the cache line is to be replaced. Instruction and data cache line replacement operations are listed in described as the following sections. Table 5.10.1 Cache Instruction Name Caches Operation Index Invalidate Instruction Sets the cache state of cache block to invalid. Index Write Back Invalidate Data Examines cache state, if Valid Dirty, then that block is written back to main memory. Then the cache block is set to invalid. Index Load Tag Instruction & Data Read the tag for the cache block at the specified index and place it into TagLo. Index Store Tag Instruction & Data Write the tag for the cache block at the specified index from the TagLo and TagHi register. Create Dirty Exclusive Data If the cache does not contain the specified address, and the block is Valid Dirty the block will be written back to main memory. Then the tag will be set to the specified physical address and will be marked valid. Hit Invalidate Instruction & Data If the cache block contains the specified address, cache block will be marked invalid. Hit Write Back Invalidate Data If the cache block contains the specified address, and it is Valid Dirty, the data will be written back to main memory. Then, the cache block is marked invalid. Fill Instruction Fill the Instruction cache block from main memory. Fill Data Fill the Data cache block from memory. Hit Write Back Data If the cache block contains the specified address, and it is marked Valid Dirty, the block will be written back to main memory, and marked Valid Clean. 5-10 Chapter 5 Cache Organization 5.10.1 Cache Write Policy The processor manages its data cache by using a write-back and a write-through policy. A write-back stores write data into the cache, instead of writing it directly to memory. Some time later this data is independently written into memory. In the processor implementation, a modified cache line is not written back to memory until the cache line is to be replaced either in the course of satisfying a cache miss, or during the execution of a write-back CACHE instruction. When the processor writes a cache line back to memory, it does not ordinarily retain a copy of the cache line, and the state of the cache line is changed to invalid. A write-through is written simultaneously to cache and memory. Selection of a write policy is done by the K0 bit in the Config register (Reg#16) for the kseg0 segment. For the other segments, selection of a write policy is done by the C bits in each TLB entry. 5.10.2 Data Cache Line Replacement Since the data cache uses a write-back and a write-through methodology, a cache line load is issued to main memory on a load or store miss, as described below. After the data from memory is written to the data cache, the pipeline resumes execution. The processor does not support “Critical Data Word First”. Always it transfer the data of first address. The data cache miss penalties, in number of CPUCLK cycles, are given in Table 5.10.2. Table 5.10.2 Data Cache Miss Penalty Cycle Count Number of CPUCLK Cycles Action 1 Stall the DC stage. 1 Transfer address to the write buffer and wait for the pipeline start signal 1-2 Transfer address to the internal SysAD bus on the GBUSCLK. 2 Transfer to the external SysAD bus. M Time needed to access memory, measured in CPUCLK cycles. 4 Transfer the cache line form memory to the SysAD bus. 2 Transfer the cache line from the external bus to the internal bus. 0 Restart the DC stage. 5-11 Chapter 5 Cache Organization 5.10.3 Instruction Cache Line Replacement For an instruction cache miss, refill is done using sequential ordering, starting from the first word of the retrieved cache line. During an instruction cache miss, a memory read is issued. The requested line is returned from memory and written to the instruction cache. At this time the pipeline resumes execution, and the instruction cache is reaccessed. The replacement sequence for an instruction cache miss is: 1. Move the instruction physical address to the processor pads. 2. Wait for a CPUCLK cycle, aligned with a GBUSCLK boundary, to occur. 3. Read the line from memory and write it out to the instruction cache array. 4. Restart the processor pipe. The instruction cache miss penalties, in number of CPUCLK, is given in Table 5.10.3. Table 5.10.3 Instruction Cache Miss Penalty Cycle Count Number of CPUCLK 1 1 Action Stall the RF stage. Transfer address to the write buffer and wait for the pipeline start signal. 1-2 Transfer to the external SysAD bus. 2 Transfer to the external SysAD bus. M Time needed to access memory, measured in CPUCLK cycles. 8 Transfer the cache line from memory to the SysAD bus. 2 Transfer the cache line from the external bus to the internal bus. 0 Restart the RF stage. 5.11 Manipulation of the Caches by an External Agent The processor does not provide any mechanisms for an external agent to examine and manipulate the state and contents of the caches. 5-12 Chapter 6 Write Buffer 6. Write Buffer The processor contains a write buffer to improve the performance of writes to the external memory. Every write to external memory uses this on-chip write buffer. The write buffer holds up to four 64-bit address and data pairs. For a cache miss write-back, the entire buffer is used for the write-back data and allows the processor to proceed in parallel with the memory update. For uncached and write-through stores, the write buffer uncouples the CPU from the write to memory. If the write buffer is full, additional stores will stall until there is room for them in the write buffer. The processor core might issue a read request while the write buffer is performing a write operation. Multiple read/write operations are serviced in the following order: • If there is only a write request, the data in the write buffer is written to an external device. • If there is only a read request, a read operation is performed to bring in data from an external device. • If a read request and a write request occur simultaneously, the read request is serviced first, except for the following cases: – when the processor issues a read request to the target address of one of the write buffer entries – when the processor issues an uncacheable read reference while the write buffer has uncacheable write data The BC0T and BC0F instructions can be used to determine whether any data is present in the write buffer: • If there is data in the write buffer, the coprocessor condition signal is false (0). • If there is no data in the write buffer, the coprocessor condition signal is true (1). Following is the assembly language code to freeze the processor until the write buffer becomes empty. SW NOP NOP Loop: BC0F Loop NOP The following sequence of instructions also causes the processor to perform the same action. Appended to a store instruction, the SYNC instruction ensures that the store instruction initiated prior to this instruction is completed before any instruction after this instruction is allowed to start. SW SYNC 6-1 Chapter 6 Write Buffer 6-2 Chapter 7 Debug Support Unit 7. 7.1 7.2 Debug Support Unit Features 1. TX4955 can provide various kinds of execution controls and access to registers of the processor core through EJTAG interface implemented by the debug support unit inside the processor core. 2. Supports DMA access through EJTAG interface to internal processor bus to access system memory. 3. Debug functions • Instruction Address Break • Data Bus break • Processor Bus Break • Hardware Debug Interrupt • Reset, NMI, Interrupt Mask EJTAG Interface This interface consists of external signals for a Run Time Mode. The Run Time Mode provides functions such as processor Run, STOP, Single Step, and access to internal registers and system memory. About TX4955 EJTAG interface signals, see Table 2.2.7 “EJTAG Interface” on Chapter 2. 7-1 Chapter 7 Debug Support Unit 7.3 Debug Unit 7.3.1 7.3.2 7.4 Extended Instructions • SDBBP • DERET • CTC0 • CFC0 Extended Debug Registers in CP0 • Debug Register • DEPC Register • DESAVE Register Register Map Table 7.4.1 Register Map 7.5 Address Mnemonic 0xf ff30 0000 DCR Description Debug Control Register 0xf ff30 0008 IBS Instruction Break Status 0xf ff30 0010 DBS Data Break Status 0xf ff30 0018 PBS Processor Break Status 0xf ff30 0100 IBA0 Instruction Break Address 0 0xf ff30 0108 IBC0 Instruction Break Control 0 0xf ff30 0110 IBM0 Instruction Break Address Mask 0 0xf ff30 0300 DBA0 Data Break Address 0 0xf ff30 0308 DBC0 Data Break Control 0 0xf ff30 0310 DBM0 Data Break Address Mask 0 0xf ff30 0318 DB0 0xf ff30 0600 PBA0 Processor Bus Break Address 0 Data Break Value 0 0xf ff30 0608 PBD0 Processor Bus Break Data 0 0xf ff30 0610 PBM0 Processor Bus Break Mask 0 0xf ff30 0618 PBC0 Processor Bus Break Control 0 Processor Bus Break Function This function is to monitor the interface to core and provide debug interruption or trace trigger for a given physical address and data. 7.6 Debug Exception Three kinds of debug exception are supported. • Debug Single Step (DSS bit) • Debug Breakpoint Exception (SDBBP Instruction) • JTAG Break Exception (Jtagbrk bit in JTAG_Control_Register) 7-2 Chapter 8 CPU Exception 8. 8.1 CPU Exception Introduction This chapter describes the explanation of CPU exception processing. The chapter concludes with a description of each exception’s cause, together with the manner in which the CPU processes and services these exceptions. 8.2 Exception Vector Locations Exception vector addresses are stored in an area of kseg0 or kseg1 except for Debug exception vector. The vector address of the ColdReset, SoftReset and NMI exception is always in a non-cacheable area of kseg1. Vector addresses of the other exceptions depend on the BEV bit of Status register. When BEV is 0, these exceptions are vectored to a cacheable area of kseg0. When BEV is 1, all vector addresses are in a non-cacheable area of kseg1. Table 8.2.1 shows the list of the exception vector locations. Table 8.2.1 Exception Vector Locations Vector Address (virtual address) Exception (BEV = 0) (BEV = 1) ColdReset, SoftReset, NMI 0xffff_ffff_bfc0_0000 0xffff_ffff_bfc0_0000 TLB refill, EXL = 0 0xffff_ffff_8000_0000 0xffff_ffff_bfc0_0200 XTLB refill, EXL = 0 (X = 64-bit TLB) 0xffff_ffff_8000_0080 0xffff_ffff_bfc0_0280 Others (common exception) 0xffff_ffff_8000_0180 0xffff_ffff_bfc0_0380 Vector Address (physical address) Exception (BEV = 0) (BEV = 1) ColdReset, SoftReset, NMI 0x0_1fc0_0000 0x0_1fc0_0000 TLB refill, EXL = 0 0x0_0000_0000 0x0_1fc0_0200 XTLB refill, EXL = 0 (X = 64-bit TLB) 0x0_0000_0080 0x0_1fc0_0280 Others (common exception) 0x0_0000_0180 0x0_1fc0_0380 The cache error exception is not occurred because the TX4955 does not have the parity bit into the primary cache. Debug exception needs the care, it has the special address. Table 8.2.2 shows the list of the debug exception vector locations. Table 8.2.2 Debug Exception Vector Locations Exception Debug Exception Debug Debug Exception Vector Address (virtual address) (ProbEnb = 0) 0xffff_ffff_bfc0_0400 (ProbEnb = 1) 0xffff_ffff_ff20_0200 Debug Exception Vector Address (physical address) (ProbEnb = 0) 0x0_1fc0_0400 8-1 (ProbEnb = 1) 0xf_ff20_0200 Chapter 8 CPU Exception 8.3 Priority of Exception More than one exception may be raised for the same instruction, in which case only the exception with the highest priority is reported. The TX4955 Processor Core instruction exception priority is shown in Table 8.3.1. Table 8.3.1 Priority of Exception Priority Exception Mnemonic ColdReset High SoftReset NMI Address error Inst. Fetch AdEL TLB refill Inst. Fetch TLBL TLB invalid Inst. Fetch TLBL Bus error Inst. Fetch Low IBE Ov, Tr, Sys, Bp, RI, CpU, FPE Integer overflow, Trap, System Call, Breakpoint, Reserved Instruction, Coprocessor Unusable, or Floating-Point Exception Address error Data access AdEL/AdES TLB refill Data access TLBL/TLBS TLB invalid Data access TLBL/TLBS TLB modified Data write Mod Bus error Data access DBE Interrupt Int General exceptions (i.e., exceptions other than debug exceptions) are prioritized as follows: 1. If more than one exception condition occurs for a single instruction or a single cycle, only the exception with the highest priority is reported, as shown in Table 8.3.1 (from highest to lowest priority). 2. If two instructions cause exception conditions in the M and E stages of the pipeline simultaneously, the instruction in the M stage causes the processor to take an exception. 3. When 64-bit instructions are executed in 32-bit mode, the Reserved Instruction (RI) exception can occur simultaneous with other exception, as shown below. In that case, the RI exception is given precedence. • RI and CpU • RI and Ov • RI and AdEL/S (data) • RI and TLBL/S (data) General and debug exceptions are prioritized as follows: 1. If a general exception condition and a debug exception condition occur for a single instruction, the debug exception is serviced first, and then the general exception is serviced. 2. If two instructions cause exception conditions in the M and E stages of the pipeline simultaneously, only the instruction in the M stage generates an exception. 8-2 Chapter 8 CPU Exception 8.4 ColdReset Exception 8.4.1 Cause This ColdReset exception occurs when the ColdReset* signal is asserted and then deasserted. This exception is not maskable. 8.4.2 Processing A special interrupt vector that resides in an unmapped and uncached area is used. It is therefore not necessary for hardware to initialize TLB and cache memory in order to process this exception. The vector location of this exception is: • In 32-bit mode, 0xbfc0 0000 (virtual address), 0x1fc0_0000 (physical address) • In 64-bit mode, 0xffff ffff bfc0 0000 (virtual address), 0x1fc0_0000 (physical address) The most register’s contents are cleared when this exception occurs. The values of these bits are listed into the table of Chapter 3. Valid bits, Lock bits and FIFO replacement bits in the instruction cache are all cleared to 0. W bits, CS bits, Lock bits and FIFO replacement bits in the data cache are all cleared to 0. If a ColdReset exception occurs during bus cycle, the current bus cycle is aborted and an exception is taken. 8.4.3 Servicing The ColdReset exception is serviced by; • initializing all registers, coprocessor registers, caches and the memory system • performing diagnostic tests • bootstrapping the operating system 8-3 Chapter 8 CPU Exception 8.5 SoftReset Exception 8.5.1 Cause This SoftReset exception occurs when the Reset* signal is asserted and then deasserted. This exception is not maskable. 8.5.2 Processing A special interrupt vector that resides in an unmapped and uncached area is used. It is therefore not necessary for hardware to initialize TLB and cache memory in order to process this exception. The vector location of this exception is: • In 32-bit mode, 0xbfc0 0000 (virtual address), 0x0_1fc0_0000 (physical address) • In 64-bit mode, 0xffff ffff bfc0 0000 (virtual address), 0x0_1fc0_0000 (physical address) All register contents are retained except for the following. • ErrorEPC register, which contains the restart PC If the exception-causing instruction is in a branch delay slot, the ErrorEPC register points at the preceding branch instruction. • ERL, SR and BEV bits of Status register, which are set to 1 Because SoftReset exception can abort cache and bus operations, cache and memory state is undefined when this exception occurs. 8.5.3 Servicing The SoftReset exception is serviced by saving the current processor state for diagnostic purposes, and reinitializing for the ColdReset exception. 8-4 Chapter 8 CPU Exception 8.6 NMI (Non-maskable Interrupt) Exception 8.6.1 Cause The NMI (Non-maskable Interrupt) exception occurs at the falling edge of the NMI* signal. This interrupt is not maskable, and occurs regardless of the EXL, ERL and IE bits of the Status register. 8.6.2 Processing The same special interrupt vector as for ColdReset/SoftReset exception (virtual address: 0xbfc0_0000/ 0xffff_ffff_bfc0_0000). This vector is located within unmapped and uncached area so that the cache and TLB need not be initialized to process this exception. When this exception occurs, the SR bit of Status register is set. Because NMI exception can occur in the midst of another exception, it is not normally possible to continue program execution after servicing NMI exception. Unlike the ColdReset/SoftReset exception, but like other exceptions, this exception occurs at an instruction boundary. The state of the primary cache and memory system are preserved by this exception. All register contents are retained except for the following. 8.6.3 • ErrorEPC register, which contains the restart PC If the exception-causing instruction is in a branch delay slot, the ErrorEPC register points at the preceding branch instruction. • ERL, SR and BEV bits of the Status register, which is set to 1. Servicing The NMI exception is serviced by saving the current processor state for diagnostic purposes, and reinitializing the system for the ColdReset exception. 8-5 Chapter 8 CPU Exception 8.7 Address Error Exception 8.7.1 Cause The Address Error exception occurs when an attempt is made to execute one of the following. • load or store a doubleword that is not aligned on a doubleword boundary • load, fetch or store a word that is not aligned on a word boundary • load or store a halfword that is not aligned on a halfword boundary • reference Kernel mode address while in User or Supervisor mode • reference Supervisor mode address while in User mode This exception is not maskable. 8.7.2 Processing The common exception vector (virtual address: 0x8000_0180/0xffff_ffff_8000_0180) is used. ExcCode AdEL or AdES in Cause register is set depending on whether the memory access attempt was a load or store. When this exception is raised, the misalign virtual address causing the exception, or the protected virtual address that was illegally referenced, is placed in BadVAddr register. The contents of the VPN field of Context and EntryHi registers are undefined, as are the contents of EntryLo register. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.7.3 Servicing The process executing at the time is handed a segmentation violation signal. This error is usually fatal to the process incurring the exception. 8-6 Chapter 8 CPU Exception 8.8 TLB Refill Exception 8.8.1 Cause The TLB refill exception occurs when there is no TLB entry to match a reference to a mapped address. This exception is not maskable. 8.8.2 Processing There are two special exception vectors for this exception; one for references to 32-bit virtual address, and one for references to 64-bit virtual address. The KX, SX and UX bits of Status register determine whether the User, Supervisor or Kernel address referenced are 32-bit mode or 64-bit mode. When EXL bit of Status register is set to 0, all references use these vectors. When this exception occurs, TLBL or TLBS code is set in the ExcCode field of Cause register. This code indicates whether the instruction, as shown by EPC register and BD bit of Cause register, caused the miss by an instruction reference, load operation, or store operation. When this exception occurs: • BadVAddr, Context, XContext and EntryHi registers hold the virtual address failed address translation • EntryHi register contains ASID from which the translation fault occurred, too • A valid address in which to place the replacement TLB entry is contained into Random register • The contents of EntryLo register are undefined If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.8.3 Servicing To service this exception, the contents of the Context or XContext register are used as a virtual address to fetch memory locations containing the physical page frame and access control bits for a pair of TLB entries. The two entries are placed into the EntryLo0/EntryLo1 register; the EntryHi and EntryLo registers are written into the TLB. It is possible that the virtual address used to obtain the physical address and access control information is on a page that is not resident in the TLB. This condition is processed by allowing a TLB refill exception in the TLB refill handler. This exception goes to the common exception vector because the EXL bit of the Status register is set. 8-7 Chapter 8 CPU Exception 8.9 TLB Invalid Exception 8.9.1 Cause The TLB Invalid exception occurs when a virtual address reference matches a TLB entry that is marked invalid (TLB valid bit cleared). This exception is not maskable. 8.9.2 Processing The common exception vector is used for this exception. When this exception occurs, TLBL or TLBS code is set in the ExcCode field of Cause register. This code indicates whether the instruction, as shown by EPC register and BD bit of Cause register, caused the miss by an instruction reference, load operation, or store operation. When this exception occurs: • BadVAddr, Context, XContext and EntryHi registers hold the virtual address failed address translation • EntryHi register contains ASID from which the translation fault occurred, too • A valid address in which to place the replacement TLB entry is contained into Random register • The contents of EntryLo register are undefined If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.9.3 Servicing A TLB entry is typically marked invalid when one of the following is true: • a virtual address does not exist • the virtual address exists, but is not in main memory (a page fault) • a trap is desired on any reference to the page (for example, to maintain a reference bit or during debug) After servicing the cause of a TLB Invalid exception, the TLB entry is located with TLB Probe (TLBP) instruction, and replaced by an entry with that entry’s Valid bit set. 8-8 Chapter 8 CPU Exception 8.10 TLB Modified Exception 8.10.1 Cause The TLB Modified exception occurs when a store operation virtual address reference to memory matches a TLB entry that is marked valid but is not dirty and therefore is not writable. This exception is not maskable. 8.10.2 Processing The common exception vector is used for this exception, and Mod code in Cause register is set. When this exception occurs: • BadVAddr, Context, XContext and EntryHi registers hold the virtual address failed address translation • EntryHi register contains ASID from which the translation fault occurred, too • The contents of EntryLo register are undefined If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.10.3 Servicing The kernel uses the failed virtual address or virtual page number to identify the corresponding access control information. The page identified may or may not permit write accesses; if writes are not permitted, a write protection violation occurs. If write accessed are permitted, the page frame is marked dirty/writable by the kernel in its own data structures. The TLB Probe (TLBP) instruction places the index of the TLB entry that must be altered into the Index register. The EntryLo register is loaded with a word containing the physical page frame and access control bits (with the D bit set), and the EntryHi and EntryLo registers are written into the TLB. 8-9 Chapter 8 CPU Exception 8.11 Bus Error Exception 8.11.1 Cause This Bus Error exception occurs when any of the following errors is detected during. memory read responsing on SysAD bus by “instruction fetch cycle” or “data read cycle” 1. Error data is reported by the SysCmd 2. Parity errors are detected 3. Time-out error is detected Table 8.11.1 shows the condition of Bus Error Exception. Table 8.11.1 Condition of Bus Error Exception Operation Mode Error Data Parity Error R5000 type protocol SysCmd[5] =1 (When this error data bit is set to 1 on the SysAD bus) SysCmd[4] =1 and any parity bit of SysADC[7:0] is set to 1 N.A R4300 type protocol SysCmd[1] =1 (When this error data bit is set to 1 on the SysAD bus) N.A G2SConfig register[3] (ToutEnable) = 1 and G2SConfig register[19:4] (ToutVal) = 0 8.11.2 Time-out Error Processing The common interrupt vector is used for a Bus Error exception. The IBE or DBE code in the ExcCode field of the Cause register is set, signifying whether the instruction (as indicated by the EPC register and BD bit in the Cause register) caused the exception by an instruction reference, load operation, or store operation. The EPC register contains the address of the instruction that caused the exception, unless it is in a branch delay slot, in which case the EPC register contains the address of the preceding branch instruction and the BD bit of the Cause register is set to 1. 8.11.3 Servicing The physical address at which the fault occurred can be computed from information available in the CP0 registers. • If the IBE code in the Cause register is set (indicating an instruction fetch reference), the virtual address is contained in the EPC register (or 4+ the contents of the EPC register if the BD bit of the Cause register is set). • If the DBE code is set (indicating a load or store reference), the instruction that caused the exception is located at the virtual address contained in the EPC register (or 4+ the contents of the EPC register if the BD bit of the Cause register is set). 8-10 Chapter 8 CPU Exception The virtual address of the load and store reference can then be obtained by interpreting the instruction. The physical address can be obtained by using the TLB Probe (TLBP) instruction and reading the EntryLo register to compute the physical page number. The process executing at the time of this exception is handed a bus error signal, which is usually fatal. Note: The bus error treats only the read bus cycle because the TX4955 supports the write buffer. Because the TX4955 supports the non-blocking load and the streaming, please stop the program counter by SYNC instruction or the depending registers instruction, for using EPC register to return from this exception. 8-11 Chapter 8 CPU Exception 8.12 Integer Overflow Exception 8.12.1 Cause The Integer Overflow exception occurs when ADD, ADDI, SUB, DADD, DADDI or DSUB instruction results in a 2’s complement overflow. This exception is not maskable. 8.12.2 Processing The common exception vector is used for this exception, and the Ov code in Cause register is set. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.12.3 Servicing The process executing at the time of the exception is handed a floating-point exception signal or integer overflow signal. This error is usually fatal to the current process. 8-12 Chapter 8 CPU Exception 8.13 Trap Exception 8.13.1 Cause The Trap exception occurs when TGE, TGEU, TLT, TLTU, TEQ, TNE, TGEI, TGEIU, TLTI, TLTIU, TEQI or TNEI instruction results in a TRUE condition. This exception is not maskable. 8.13.2 Processing The common exception vector is used for this exception, and the Tr code in Cause register is set. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.13.3 Servicing The process executing at the time of a Trap exception is handed a floating-point exception signal or integer overflow signal. This error is usually fatal. 8-13 Chapter 8 CPU Exception 8.14 System Call Exception 8.14.1 Cause The System Call exception occurs during an attempt to execute the SYSCALL instruction. This exception is not maskable. 8.14.2 Processing The common exception vector is used for this exception, and the Sys code in Cause register is set. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the SYSCALL instruction. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register, and BD bit of Cause register is set to 1. 8.14.3 Servicing When this exception occurs, control is transferred to the applicable system routine. To resume execution, the EPC register must be altered so that the SYSCALL instruction does not re-execute; this is accomplished by adding a value of 4 to the EPC register (EPC register + 4) before returning. If a SYSCALL instruction is in a branch delay slot, a more complicated algorithm, beyond the scope of this description, may be required. 8-14 Chapter 8 CPU Exception 8.15 Breakpoint Exception 8.15.1 Cause The Breakpoint exception occurs when an attempt is made to execute the BREAK instruction. This exception is not maskable. 8.15.2 Processing The common exception vector is used for this exception, and the Bp code in Cause register is set. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the BREAK instruction. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register, and BD bit of Cause register is set to 1. 8.15.3 Servicing When the Breakpoint exception occurs, control is transferred to the applicable system routine. Additional distinctions can be mode by analyzing the unused bits of the BREAK instruction (bits 25-6), and loading the contents of the instruction whose address the EPC register contains. A value of 4 must be added to the contents of the EPC register (EPC register + 4) to locate the instruction if it resides in a branch delay slot. To resume execution, the EPC register must be altered so that the BREAK instruction does not re-execute; this is accomplished by adding a value of 4 to the EPC register (EPC register + 4) before returning. If a BREAK instruction is in a branch delay slot, interpretation of the branch instruction is required to resume execution. 8-15 Chapter 8 CPU Exception 8.16 Reserved Instruction Exception 8.16.1 Cause The Reserved Instruction exception occurs when one of the following condition occurs: • an attempt is made to execute an instruction with an undefined major opcode (bits 31-26) • an attempt is made to execute a SPECIAL instruction with an undefined minor opcode (bits 5-0) • an attempt is made to execute a REGIMM instruction with an undefined minor opcode (bits 20-16) • an attempt is made to execute 64-bit operations in 32-bit mode when in User or Supervisor modes • an attempt is made to execute a COPz rs instruction with an undefined minor opcode (bits 25-21) • an attempt is made to execute a COPz rt instruction with an undefined minor opcode (bits 20-16) 64-bit operations are always valid in Kernel mode regardless of the value of the KX bit in Status register. This exception is not maskable. 8.16.2 Processing The common exception vector is used for this exception, and the RI code in Cause register is set. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and the BD bit of Cause register is set to 1. 8.16.3 Servicing No instruction in the MIPS ISA are currently interpreted. The process executing at the time of this exception is handed an illegal instruction/reserved operand fault signal. This error is usually fatal. 8-16 Chapter 8 CPU Exception 8.17 Coprocessor Unusable Exception 8.17.1 Cause The Coprocessor Unusable exception occurs when an attempt is made to execute a coprocessor instruction for either. 8.17.2 • attempting to execute a coprocessor CPz instruction when its corresponding CUz bit in Status register. • in User or Supervisor mode attempting to execute a CP0 instruction when CU0 bit is cleared to 0. (In Kernel mode, an exception is not raised when a CP0 instruction is issued , regardless of the CU0 bit setting) • an attempt is made to execute a FPU instruction in TX49 without FPU Processing The common exception vector is used for this exception, and the CpU code in Cause register is set. The coprocessor number referred to at the time of the exception is stored in Cause register CE (Coprocessor Error) field. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and BD bit of Cause register is set to 1. 8.17.3 Servicing The coprocessor unit to which an attempted reference was mode is identified by the Coprocessor Usage Error field (CE) of Cause register, which results in one of the following situations: • If the process is entitled access to the coprocessor, the coprocessor is marked usable and the corresponding user state is restored to the coprocessor. • If the process is entitled access to the coprocessor, but the coprocessor does not exist or has failed, interpretation of the coprocessor instruction is possible. • If the BD bit is set in the Cause register, the branch instruction must be interpreted; then the coprocessor instruction can be emulated and execution resumed with the EPC register advanced past the coprocessor instruction. • If the process is not entitled access to the coprocessor, the process executing at the time is handed an illegal instruction/privileged instruction fault signal. This error is usually fatal. 8-17 Chapter 8 CPU Exception 8.18 Floating-Point Exception 8.18.1 Cause The Floating-Point exception is used by the floating-point coprocessor. This exception is not maskable. 8.18.2 Processing The common exception vector is used for this exception, and the FPE code in Cause register is set. The contents of the Floating-Point Control/Status register indicate the cause of this exception. If EXL bit of Status register is only set to 0, the following operation is executed. EPC register points to the address of the instruction causing the exception. If, however, the affected instruction was in the branch delay slot (for execution during a branch), the immediately preceding branch instruction address is retained in EPC register and the BD bit of Cause register is set to 1. 8.18.3 Servicing This exception is cleared by clearing the appropriate bit in the Floating-Point Control/Status register. For an unimplemented instruction exception, the kernel should emulate the instruction; for other exceptions, the kernel should pass the exception to the user program that caused the exception. 8-18 Chapter 8 CPU Exception 8.19 Interrupt Exception 8.19.1 Cause The Interrupt exception is raised by any of eight interrupts (two software and six hardware). A hardware interrupt is raised when Int[5:0]* signal goes active. A software interrupt is raised by setting the IP[1]/IP[0] bit in Cause register. The significance of these interrupts is dependent upon the specific system implementation. Each of the eight interrupts can be masked individually by clearing its corresponding bit in the IM(Interrupt Mask) field of Status register, and all interrupts can be masked at once by clearing IE bit of Status register to 0. 8.19.2 Processing The common exception vector is used as following: • In 32-bit mode, 0x8000 0180 (BEV = 0) 0xbfc0 0380 (BEV = 1) • In 64-bit mode, 0xffff ffff 8000 0180 (BEV = 0) 0xffff ffff bfc0 0380 (BEV = 1 When the processor is in the doze or halt operation mode, it is returned to the normal operation mode by an interrupt. 8.19.3 Servicing If the interrupt is caused by one of the two software-generated exceptions (SW1 or SW0), the interrupt condition is cleared by setting the corresponding Cause register bit to 0. If the interrupt is hardware-generated, the interrupt condition is cleared by correcting the condition causing the interrupt pin to be asserted. If the timer interrupt is caused, the interrupt condition is cleared by changing the value of the Compare register or setting the corresponding Cause register bit (IP[7]) to 0. Interrupts are not acceptable when the settings of the Status register are EXL = 1 and ERL = 1. Note: Due to the write buffer, a store to an external device will not necessary occur until after other instructions in the pipeline finish. Thus, the user must ensure that the store will occur before the return from exception instruction (ERET) is executed otherwise the interrupt may be serviced again even though there should be no interrupt pending. 8-19 Chapter 8 CPU Exception 8.20 Exception Handling and Servicing Flowcharts The remainder of this chapter contains flowcharts for the following three sets of. exceptions and guidelines for their handlers: 1. 2. 3. general exceptions and their exception handler • Figure 8.20.1 shows general exception handler (HW) • Figure 8.20.2 shows general exception servicing guidelines (SW) TLB/XTLB miss exception and their exception handler • Figure 8.20.3 shows TLB/XTLB miss exception handler (HW) • Figure 8.20.4 shows TLB/XTLB exception servicing guidelines (SW) ColdReset, SoftReset and NMI exceptions, and a guideline to their handler. • Figure 8.20.5 shows ColdReset, SoftReset & NMI Exception Handling (HW) and Servicing Guidelines (SW) Generally speaking, the exceptions are handled by hardware (HW); the exceptions are then serviced by software (SW). Comments Set FP Control Status Resister EnHi ← VPN2, ASID X/Context ← VPN2 Set Cause Register (ExcCode, CE) Set BadVA Check if exception within another exception EXL (SR1) FP Control/Status Register is only set if the respective exception occurs. EnHi, X/Context are set only for *TLB- Invalid, Modified, & Refill exceptions BadVA is set only for TLB-invalid, Modified, and Refill exceptions Note: not set if it is a Bus Error =1 =0 Yes Instr. in Br. Dly. Slot? Cause 31 (BD) ← 0 EPC ← PC Cause 31 (BD) ← 1 EPC ← (PC - 4) EXL ← 1 = 0 (normal) No BEV PC ← 0xFFFF FFFF 8000 0000 + 180 (unmapped, cached) Processor forced to Kernel Mode & interrupt disabled = 1 (bootstrap) PC ← 0xFFFF FFFF BFC0 0200 + 180 (unmapped, uncached) To General Exception Servicing Guidelines Figure 8.20.1 General Exception Handler (HW) 8-20 Chapter 8 CPU Exception Comments Save the Context No Set Status register (KSU←00, EXL←0, IE = 1) Interrupt enabled Exception cause is interrupt? * Treat in unmapped area * Save the Context (Status, Cause, X/Context, EPC, etc.) to stack area * Avoid all other exceptions except to NMI, Soft Reset and Cold Reset until saving the Context * Check ExcCode field of Cause register Yes Check of interrupt cause * Check the interrupt cause from IP field of Cause register and IM field of Status register Service routine of each interrupts * Negate the current interrupt cause in the service routine Interrupt disabled * Set 1 to EXL field of Status register, and disable interrupt on kernel mode Restore Context * Restore the saved registers Service routine of each exception * Close the exception handler by ERET instruction ERET Figure 8.20.2 General Exception Servicing Guidelines (SW) 8-21 Chapter 8 CPU Exception Yes Instr. in Br. Dly. Slot? No EnHi ← VPN2, ASID X/Context ← VPN2 Set Cause Reg. ExcCode, CE and Set BadVA EXL (SR bit 1) EnHi ← VPN2, ASID X/Context ← VPN2 Set Cause Reg. ExcCode, CE and Set BadVA =1 EXL (SR bit 1) =1 Check if exception within another exception =0 =0 EPC ← (PC-4) Cause bit 31 (BD) ← 1 Yes EPC ← PC Cause bit 31 (BD) ← 0 XTLB Exception? Vector Offset = 0x080 No Vector Offset = 0x000 Points to Refill Exception Points to General Exception EXL ← 1 = 0 (normal) Vector Offset = 0x180 BEV (SR bit 22) PC ← 0xFFFF FFFF 8000 0000 + Vec. Off. (unmapped, cached) Processor forced to Kernel Mode & interrupt disabled = 1 (bootstrap) PC ← 0xFFFF FFFF BF00 0200 + Vec. Off. (unmapped, uncached) To TLB/XTLB Exception Servicing Guidelines Figure 8.20.3 TLB/XTLB Miss Exception Handler (HW) 8-22 Chapter 8 CPU Exception Comments * Unmapped vector TLBMod, TLBInv, TLB Refill exceptions not possible MFC0 CONTEXT * EXL = 1 so Interrupt exceptions disabled * OS/System to avoid all other exceptions * Only Cold Reset, Soft Reset, NMI exceptions possible. * Load the mapping of the virtual address in Context Reg. Move it to ENLO and Write into the TLB Service Code * There could be a TLB miss again during the mapping of the data or instruction address. The processor will jump to the general exception vector since the EXL is 1. (Option to complete the first level refill in the general exception handler or ERET to the original instruction and take the exception again) * ERET is not allowed in the branch delay slot of another Jump Instruction ERET * Processor does not execute the instruction which is in the ERET’s branch delay slot * PC ← EPC; EXL = 0 * LLbit ← 0 Figure 8.20.4 TLB/XTLB Miss Exception Servicing Guidelines (SW) 8-23 Chapter 8 CPU Exception Soft Reset & NMI Exception Cold Reset Exception Random ← TLBENTRIES-1 Wired ← 0 Status: ColdReset, SoftReset & NMI Exception Handling (HW) Status: BEV ← 1 TS ← 0 (*) SR ← 1 ERL ← 1 BEV ← 1 TS ← 0 (*) SR ← 0 ERL ← 1 Instr. in Br. Dly. Slot? Yes No ErrorEPC ← PC ErrorEPC ← PC - 4 ColdReset, SoftReset & NMI Servicing Guidelines (SW) PC ← 0xFFFF FFFF BFC0 0000 (Optional) Yes NMI? No NMI Service Code Note: There is no indication from the proessor to differentiate between NMI & SoftReset; there must be a system level indication. Status bit 20 (SR) =0 =1 ERET SoftReset Service Code ColdReset Service Code (*) Reserved for TX4955 Figure 8.20.5 ColdReset, SoftReset & NMI Exception Handling (HW) and Servicing Guidelines (SW) 8-24 Chapter 8 CPU Exception 8.21 Floating-Point Exception of Floating-Point Unit (CP1) 8.21.1 Introduction This chapter describes floating-point exceptions, including FPU exception type, exception trap processing, exception flags, saving and restoring state when handling an exception, and trap handlers for IEEE Standard 754 exceptions. 8.21.2 Exception Types The FP Control/Status register described in Chapter 3 contains an Enable bit for each exception type; exception Enable bits determine whether an exception will cause the FPU to initiate a trap or set a status flag. • If a trap is taken, the FPU remains in the state found at the beginning of the operation and a software exception handling routine executes. • If no trap is taken, an appropriate value is written into the FPU destination register and execution continues. The FPU supports the five IEEE Standard 754 exceptions: • Inexact (I) • Underflow (U) • Overflow (O) • Division by Zero (Z) • Invalid Operation (V) Cause bits, Enables, and Flag bits (status flags) are used. The FPU adds a sixth exception type, Unimplemented Operation (E). This exception indicates the use of a software implementation. The Unimplemented Operation exception has no Enable or Flag bit; whenever this exception occurs, an unimplemented exception trap is taken. Figure 8.21.1 shows the Control/Status register bits that support exceptions. Bit # 17 16 15 14 13 12 E V Z O U I Bit # | 11 | 10 | 9 | 8 | 7 V Z O U I | 6 | 5 | 4 | 3 | 2 V Z O U I | Invalid | Division by Zero | Overflow | Underflow | Inexact Bit # | Unimplemented Figure 8.21.1 Control/Status Register (Exception/Flag/Trap/Enable Bits) 8-25 Cause Bits Enable Bits Flag Bits Chapter 8 CPU Exception 8.21.3 Exception Trap Processing When a floating-point exception trap is taken, the Cause register indicates the floating-point coprocessor is the cause of the exception trap. The Floating-Point Exception (FPE) code is used, and the Cause bits of the floating-point Control/Status register indicate the reason for the floating-point exception. These bits are, in effect, an extension of the system coprocessor Cause register. 8.21.4 Flags A Flag bit is provided for each IEEE exception. This Flag bit is set to a 1 on the assertion of its corresponding exception, with no corresponding exception trap signaled. When no exception trap is signaled, floating-point coprocessor takes a default action, providing a substitute value for the exception-causing result of the floating-point operation. The particular default action taken depends upon the type of exception. Table 8.21.1 lists the default action taken by the FPU for each of the IEEE exceptions. Table 8.21.1 Default FPU Exception Actions Field Description Rounding Mode Default Action I Inexact exception ANY Supply a rounded result. U Underflow exception ANY Supply a rounded result. O Overflow exception RN Modify overflow values to ∞ with the sign of the intermediate result. RZ Modify overflow values to the format’s largest finite number with the sign of the intermediate result. RP Modify negative overflows to the format’s most negative finite number; modify positive overflows to + ∞ RM Modify positive overflows to the format’s largest finite number; modify negative overflows to – ∞ Z Division by zero ANY Supply a properly signed ∞ V Invalid operation ANY Supply a quiet Not a Number (NaN). The FPU detects the eight exception causes internally. When the FPU encounters one of these unusual situations, it causes either an IEEE exception or an Unimplemented Operation exception (E). Table 8.21.2 lists the exception-causing situations and contrasts the behavior of the FPU with the requirements of the IEEE Standard 754. 8-26 Chapter 8 CPU Exception Table 8.21.2 FPU Exception-Causing Conditions FPA Internal Result IEEE Standard 754 Inexact result Trap Enable Trap Disable Notes I I I O, I (Note 1) O, I O, I Division by zero Z Z Z Zero is (exponent = Emin – 1, mantissa = 0) Overflow on convert V E E Source out of integer range Signaling NaN source V V V Quiet NaN result generated from quiet NaN source Invalid operation V V V 0/0, etc. Exponent underflow U E E Normalized exponent < Emin None E E Denormalized is (exponent = Emin – 1 and mantissa < > 0) Exponent overflow (Note 2) Denormalized or QNaN Loss of accuracy Normalized exponent > Emax Note 1: The IEEE Standard 754 specifies an inexact exception on overflow only if the overflow trap is disabled. Note 2: If the conversion is to integer, it occurs the E-exception on Signaling NaN source. 8.21.5 FPU Exceptions The following sections describe the conditions that cause the FPU to generate each of its exceptions, and details the FPU response to each exception-causing condition. Inexact Exception (I) The FPU generates the Inexact exception if one of the following occurs: • the rounded result of an operation is not exact, or • the rounded result of an operation overflows, or • the rounded result of an operation underflows and both the Underflow and Inexact Enable bits are not set and the FS bit is set. Trap Enabled Results: If Inexact exception traps are enabled, the result register is not modified and the source registers are preserved. Trap Disabled Results: The rounded or overflowed result is delivered to the destination register if no other software trap occurs. Invalid Operation Exception (V) The Invalid Operation exception is signaled if one or both of the operands are invalid for an implemented operation. When the exception occurs without a trap, the MIPS ISA defines the result as a quiet Not a Number (qNaN). The invalid operations are: • Addition or subtraction: magnitude subtraction of infinities, such as: (+∞) + (–∞) or (–∞) – (–∞) • Multiplication: 0 times ∞, with any signs • Division: 0/0, or ∞/∞, with any signs • Comparison of predicates involving ‘<’ or ‘>’ without ‘?’, when the operands are unordered • Any arithmetic operation, when one or both operands is a signaling NaN. A move (MOV) operation is not considered to be an arithmetic operation, but absolute value (ABS) and negate (NEG) are. • Comparison or a Convert From Floating-point Operation on a signaling NaN. • Square root: x , where x is less than zero. 8-27 Chapter 8 CPU Exception Software can simulate the Invalid Operation exception for other operations that are invalid for the given source operands. Examples of these operations include IEEE Standard 754-specified functions implemented in software, such as Remainder: x REM y, where y is 0 or x is infinite; conversion of a floating-point number to a decimal format whose value causes an overflow, is infinity, or is NaN; and transcendental functions, such as In(–5) or cos–1(3). Refer to Appendix B for examples or for routines to handle these cases. Trap Enabled Results: The result register is not modified, and the source registers are preserved. Trap Disabled Results: A quiet NaN is delivered to the destination register if no other software trap occurs. Divide-by-Zero Exception (Z) The Division-by-Zero exception is signaled on an implemented divide operation if the divisor is zero and the dividend is a finite nonzero number. Software can simulate this exception for other operations that produce a signed infinity, such as In (0), sec (π/2), csc (0), or 0–1. Trap Enabled Results: The result register is not modified, and the source registers are preserved. Trap Disabled Results: The result, when no trap occurs, is a correctly signed infinity. Overflow Exception (O) The Overflow exception is signaled when the magnitude of the rounded floating-point result, with an unbounded exponent range, is larger than the largest finite number of the destination format. (This exception also signals an Inexact exception.) Trap Enabled Results: The result register is not modified, and the source registers are preserved. Trap Disabled Results: The result, when no trap occurs, is determined by the rounding mode and the sign of the intermediate result. Underflow Exception (U) Two related events contribute to the Underflow exception: • creation of a tiny nonzero result between ±2Emin which can cause some later exception because it is so tiny • extraordinary loss of accuracy during the approximation of such tiny numbers by denormalized numbers. IEEE Standard 754 allows a variety of ways to detect these events, but requires they be detected the same way for all operations. Tininess can be detected by one of the following methods: • after rounding (when a nonzero result, computed as though the exponent range were unbounded, would lie strictly between ±2Emin) • before rounding (when a nonzero result, computed as though the exponent range and the precision were unbounded, would lie strictly between ±2Emin). The MIPS architecture requires that tininess be detected after rounding. Loss of accuracy can be detected by one of the following methods: • denormalization loss (when the delivered result differs from what would have been computed if the exponent range were unbounded) • inexact result (when the delivered result differs from what would have been computed if the exponent range and precision were both unbounded). 8-28 Chapter 8 CPU Exception The MIPS architecture requires that loss of accuracy be detected as an inexact result. Trap Enabled Results: If Underflow or Inexact traps are enabled, or if the FS bit is not set, then an Unimplemented exception (E) is generated, and the result register is not modified. Trap Disabled Results: If Underflow and Inexact traps are not enabled and the FS bit is set, the result is determined by the rounding mode and the sign of the intermediate result. Unimplemented Instruction Exception (E) Any attempt to execute an instruction with an operation code or format code that has been reserved for future definition sets the Unimplemented bit in the Cause field in the FPU Control/Status register and traps. The operand and destination registers remain undisturbed and the instruction is emulated in software. Any of the IEEE Standard 754 exceptions can arise from the emulated operation, and these exceptions in turn are simulated. The Unimplemented Instruction exception can also be signaled when unusual operands or result conditions are detected that the implemented hardware cannot handle properly. These include: • Denormalized operand, except for Compare instruction • Quiet Not a Number operand, except for Compare instruction • Denormalized result or Underflow, when either Underflow or Inexact Enable bits are set or the FS bit is not set. • Reserved opcodes • Unimplemented formats • Operations which are invalid for their format (for instance, CVT.S.S) Note: Denormalized and NaN operands are only trapped if the instruction is a convert or computational operation. Moves do not trap if their operands are either denormalized or NaNs. The use of this exception for such conditions is optional; most of these conditions are newly developed and are not expected to be widely used in early implementations. Loopholes are provided in the architecture so that these conditions can be implemented with assistance provided by software, maintaining full compatibility with the IEEE Standard 754. Trap Enabled Results: The result register is not modified, and the source registers are preserved. Trap Disabled Results: This trap cannot be disabled. 8-29 Chapter 8 CPU Exception 8.21.6 Saving and Restoring State Sixteen doubleword† coprocessor load or store operations save or restore the coprocessor floating-point register state in memory. The remainder of control and status information can be saved or restored through CFC1/CTC1 instructions, and saving and restoring the processor registers. Normally, the Control/Status register is saved first and restored last. When state is restored, state information in the Control/Status register indicates the exceptions that are pending. Writing a zero value to the Cause field of Control/Status register clears all pending exceptions, permitting normal processing to restart after the floating-point register state is restored. 8.21.7 Trap Handlers for IEEE Standard 754 Exceptions The IEEE Standard 754 strongly recommends that users be allowed to specify a trap handler for any of the five standard exceptions that can compute; the trap handler can either compute or specify a substitute result to be placed in the destination register of the operation. By retrieving an instruction using the processor Exception Program Counter (EPC) register, the trap handler determines: • exceptions occurring during the operation • the operation being performed • the destination format On Overflow or Underflow exceptions (except for conversions), and on Inexact exceptions, the trap handler gains access to the correctly rounded result by examining source registers and simulating the operation in software. On Overflow or Underflow exceptions encountered on floating-point conversions, and on Invalid Operation and Divide-by-Zero exceptions, the trap handler gains access to the operand values by examining the source registers of the instruction. The IEEE Standard 754 recommends that, if enabled, the overflow and underflow traps take precedence over a separate inexact trap. This prioritization is accomplished in software; hardware sets the bits for both the Inexact exception and the Overflow or Underflow exception. † 32 doublewords if the FR bit is set to 1. 8-30 Chapter 9 Initialization Interface 9. Initialization Interface This chapter describes the TX4955 Initialization interface, and the processor modes. This includes the reset signal description and types, and initialization sequence, with signals and timing dependencies, and the user-selectable TX4955 processor modes. Low-active signals are indicated by a trailing asterisk, such as ColdReset*, the power-on/cold reset signal. 9.1 Functional Overview The TX4955 processor has the following three types of resets; they use the PLLReset*, ColdReset* and Reset* input signals. • PLLReset* signal is asserted to initialize the Clock Generator. (CG) • ColdReset* signal is asserted after the power supply is stable and then restarts all clocks. A cold reset completely reinitializes the internal state machine of the processor without saving any state information. • Reset* signal is asserted to generate SoftReset exception. Clock ratio is not changed (DivMode is not reloaded). The internal state except certain registers is not saved. After reset, the processor is bus master and drives the SysAD bus. For reset vector address, use 0xbfc0 0000. In the TX4955 processor core, the reset vector is located in uncached and unmapped address space. Therefore, the cache and TLB need not be initialized at reset processing. 9.1.1 System Coordination Care must be taken to coordinate system reset with other system elements. In general, bus errors immediately before, during, or after a reset may result in unpredicted behavior. Also, a small amount of processor state is guaranteed as stable after a reset of the TX4955 processor, so extreme care must be taken to correctly initialize the processor through software. 9-1 Chapter 9 Initialization Interface 9.2 Reset Signal Description This section describes the three reset signals, PLLReset*, ColdReset* and Reset*. 9.2.1 • PLLReset*: • ColdReset*: The ColdReset* signal must be asserted to reset the processor. Internal clock begins to cycle and is synchronized with the deasserted edge of ColdReset* signal. ColdReset* signal can be asserted and deasserted asynchronously with the rising edge of MasterClock. • Reset*: Assertion of PLLReset* signal initializes the on-chip PLL. PLLReset* signal should be asserted, for example, when the system power is turned on. The Reset* signal must be asserted to generate SoftReset exception. Keep Reset* signal to be deasserted when a soft reset is not used. Power-On Reset Power-on reset is a reset that occurs when the system power is turned on. This reset initializes the PLL inside the on-chip Clock Generator. After MasterClock became stable and the PLL stabilization time has elapsed, PLLReset* must be deasserted and then ColdReset* must be deasserted. Figure 9.2.1 illustrates the power-on reset timing. VCC IO VCC Int Wavy lines indicate one or more identical cycles, not shown due to space constraints. MasterClock (MClk) GBUSCLK (Internal Clock) PLLReset* MasterClock & PLL Stabilization Time ≥ 10 ms ≥ 1 ms ColdReset* Reset* Note: PLLReset* need not be synchronized to MasterClock. PLLReset* is sampled by the on-chip logic. Figure 9.2.1 Power-On Reset Timing 9-2 Chapter 9 Initialization Interface 9.2.2 Cold Reset A cold reset is used to completely reset the processor, including the processor clock. Processor states should be saved as follows. After the processor power has stabilized, ColdReset* must be kept asserted for a minimum of 64,000, MasterClock cycles to ensure that the processor clock locks with respect to the MasterClock input. ColdReset* may be asserted and deasserted asynchronously from the rising edge of MasterClock. While ColdReset* is asserted, the processor assumes bus ownership and drives the SysAD bus, as follows: In R5000 Mode In R4300 Mode SysAD: 32’hxxxxxxxx (unknown output) 32’hxxxxxxxx (unknown output) SysCmd: 9’b111010000 (output) 9’b111010000 (output) ValidOut*: 1’b1 (output) 1’b1 (output) Release*: 1’b1 (output) 1’b1 (output) After ColdReset* is deasserted, the processor branches to the Reset Exception vector and begins executing the ColdReset Exception handler. Information about the CPU register bits during a cold reset is provided in the Chapter 3, “TX49 Core’s Registers.” When ColdReset* is asserted during a SysAD transfer, all external agents must be reset to avoid bus contention on the SysAD bus. Figure 9.2.2 illustrates the cold reset timing. VCC Wavy lines indicate one or more identical cycles, not shown due to space constraints. MasterClock (MClk) ≥ 64,000MClk cycles ColdReset* TDH TDS ≥ 16MClk cycles Reset* Figure 9.2.2 Cold Reset 9-3 Chapter 9 Initialization Interface 9.2.3 Soft Reset A soft reset is used to reset the processor without affecting the clocks; in other words, a soft reset is a logic reset. Asserting the Reset* signal resets the processor without disrupting the clocks and allows the processor to retain as much of its state as possible for debugging. (For information on saving the processor states, see the section on SoftReset exception in CPU Exception Processing.) Because asserting the Reset* signal results in an immediate soft reset, multicycle instructions such as cache misses or floating-point instructions may be aborted and some data lost as a result. A soft reset is started by assertion of the Reset* signal. Reset* signal must be asserted for a minimum of 16 cycles, and must be asserted and deasserted synchronously with MasterClock. In general, data in the processor is preserved for debugging purposes. While Reset* signal is asserted, the processor assumes bus ownership and drives the SysAD bus, as follows: In R5000 Mode In R4300 Mode SysAD: 32'hxxxxxxxx (unknown output) 32'hxxxxxxxx (unknown output) SysCmd: 9'b111010000 (output) 9'b111010000 (output) ValidOut*: 1'b1 (output) 1'b1 (output) Release*: 1'b1 (output) 1'b1 (output) After Reset* signal is deasserted, the processor branches to the Reset Exception vector and begins executing the SoftReset Exception handler. Information about the CPU register bits by a soft reset is provided in the Section 8.5, “SoftReset Exception.” When Reset* signal is asserted during a SysAD transfer, all external agents must be reset to avoid bus contention on the SysAD bus. Figure 9.2.3 illustrates the soft reset timing. VCC Wavy lines indicate one or more identical cycles, not shown due to space constraints. MasterClock (MClk) TDH TDS ColdReset* ≥ 16MClk cycles Reset* Figure 9.2.3 Soft Reset 9-4 Chapter 9 Initialization Interface 9.3 User-Selectable Mode Configurations The TX4955 supports several user-selectable modes, which are designated during initialization. 9.3.1 System Bus Interface Modes The TX4955 provides two system bus (SysAD) interface modes: R4300 mode and R5000 mode. The MODE43* signal selects which interface mode is used. 0: R4300 mode 1: R5000 mode 9.3.2 Clock Divisor for the System Bus The DivMode[1:0] signals specify the frequency relationship between the system bus (SysAD bus) interface and the CPU core. The TX4955 supports divide ratios as follows: <TMPR4955B> 1:2, 1:2.5, 1:3, 1:4, 1:4.5 and 1:5 <TMPR4955C> 1:2, 1:2.5, 1:3, 1:3.5, 1:4, 1:4.5, 1:5 and 1:6 9.3.3 System Endianness The value of the Endian signal when ColdReset* is released (High) controls the system endianness: 0 for little-endian and 1 for big-endian. The BE bit in the Config register is read-only. Setting the RE bit in the Status register reverses the User-mode endianness. 9.3.4 Enabling and Disabling the Timer Interrupt The Timer interrupt, an internal interrupt of the TX49/H3 core and the TX49/H4 core, can be enabled and disabled through the TintDis* signal: 0: Enabled 1: Disabled 9-5 Chapter 9 Initialization Interface 9-6 Chapter 10 Clock Interface 10. Clock Interface This chapter describes the clock signals (“clocks”) used in the TX4955 processor. The subject matter includes basic system clocks, system timing parameters, operating the TX4955 processor in reduced power (RP) mode, connecting clocks to a phase-locked system, and connecting clocks to a system without phase locking. 10.1 Signal Terminology The following terminology is used in this chapter (and book) when describing signals: • Rising edge indicates a low-to-high transition. • Falling edge indicates a high-to-low transition. • Clock-to-Q delay is the amount of time it takes for a signal to move from the input of a device (clock) to the output of the device (Q). Figure 10.1.1 and Figure 10.1.2 illustrate these terms. single clock cycle 1 high-to-low transition 2 3 4 low-to-high transition Figure 10.1.1 Signal Transitions data in Q data in clock in clock in clock-to-Q data out Clock-to-Q delay Figure 10.1.2 Clock-to-Q Delay 10-1 data out Chapter 10 Clock Interface 10.2 Basic System Clocks The various clock signals used in the TX4955 processor are described below, starting with MasterClock, upon which the processor bases all internal and external clocking. The clocks on the TX4955 processor are controlled by an on-processor Phase-locked Loop (PLL) circuit. This circuit keeps the TX4955 processor’s internal clock edges aligned with the clock edges of the MasterClock signal, which itself acts as the master system clock. Inside the TX4955 processor, the MasterClock signal can be multiplied by a factor set by the DivMode[2:0] inputs to the processor. All internal clocks are then derived from this clock. The TX4955 processor has two primary internal clocks, the pipeline (also referred to as processor) clock, CPUCLK, and the system interface clock, GBUSCLK. GBUSCLK has the same frequency and phase as MasterClock. 10.2.1 MasterClock The Processor bases all internal and external clocking on the single MasterClock input signal. MasterClock specifications are shown in Figure 10.2.1. tMCH tMCP 0.8VCC IO tMCL tMCH 1.5 V 0.2VCC IO tMCR tMCF Figure 10.2.1 MasterClock 10.2.2 CPUCLK The pipeline (or processor) clock, CPUCLK, can be 1:2, 1:2.5, 1:3, 1:3.5, 1:4, 1:4.5, 1:5, 1:6 times the MasterClock frequency. This multiplication factor is determined by DivMode[2:0] pins, which are static signal inputs to TX4955. All internal registers and latches use CPUCLK. 10.2.3 GBUSCLK The system interface clock, GBUSCLK, is the same as the MasterClock frequency. GBUSCLK is always derived from CPUCLK. The TX4955 processor drives its outputs on this clock edge. The first rising edge of GBUSCLK, after ColdReset* is deasserted, is aligned with the first rising edge of MasterClock. 10-2 Chapter 10 Clock Interface 10.2.4 CPUCLK-to-GBUSCLK Division Figure 10.2.2 shows the clocks for a CPUCLK-to-GBUSCLK division by 2. Cycle 1 2 4 3 MasterClock CPUCLK GBUSCLK D SysAD Driven D D D tDO D SysADIn D D D tDS tDH Figure 10.2.2 Processor Clock, CPUCLK-to-GBUSCLK Divisor of 2 10.2.5 Phase-Locked Loop (PLL) The TX4955 clocks are controlled by a Phase-locked Loop circuit (PLL). 10-3 Chapter 10 Clock Interface 10.3 Connecting Clocks to a Phase-Locked System When the processor is used in a phase-locked system, the external agent must phase lock its operation to a common MasterClock. In such a system, the delivery of data and data sampling have common characteristics, even if the components have different delay values. For example, transmission time (the amount of time a signal takes to move from one component to another along a trace on the board) between any two components A and B of a phase-locked system can be calculated from the following equation: Transmission Time = (GBUSCLK period) − (tDO for A) − (tDS for B) − (Clock Jitter for A Max) − (Clock Jitter for B Max) Figure 10.3.1 shows a block-level diagram of a phase-locked system using the TX4955 processor. MasterClock External Agent TX4955 MasterClock MasterClock SysCmd SysCmd SysAD SysAD Figure 10.3.1 The TX4955 Processor Phase-Locked System 10-4 Chapter 11 TX4955 System Interface 11. TX4955 System Interface 11.1 Introduction The TX4955 supports 32-bit bus width. It is available R4300 type protocol mode and R5000 type protocol mode. A selection of above-mentioned protocol modes depend on the status of signals of MODE43* after ColdReset* is deasserted. The following terms are used in this section. • External agent: Logic device that is directly connected to the processor via the system interface so a processor can issue (instructions). • System event: Event issued inside a processor which, when generated, means that access to external system resources is required. • Sequence: Strict order of requests that the processor generates in order to provide service for system events. • Protocol: Shift of signals for each cycle generated on the system interface so processor requests or external requests can be asserted. • Syntax: Strict definition of the bit pattern on the encoded bus (command bus, etc.). 11.2 Explanation of System Interface of R5000 Type Protocol Mode A selection of above-mentioned R5000 type protocol mode increases by followings. R5000 type protocol mode: MODE43* = 1 The TX4955 processor supports 32-bit address/data interfaces. This processor makes it possible to construct a processor system by processors, main memory and external agent (ASIC and companion devices). System interfaces consist of the following components: • 32-bit address/data bus, SysAD • 4-bit SysAD check bus, SysADC • 9-bit command bus, SysCmd • 1-bit SysCmd check parity, SysCmdP • 6 handshake signals – RdRdy*, WrRdy* – ExtRqst*, Release* – ValidIn*, ValidOut* The TX4955 processor accesses external resources using the system interface in order to correct cache misses, uncached operation, and other problems. 11-1 Chapter 11 TX4955 System Interface 11.2.1 Interface Bus Figure 11.2.1 illustrates the 32-bit address/data bus SysAD[31:0], which is the main communication bus of the system interface, and the 9-bit command bus SysCmd[8:0]. SysAD and SysCmd are bi-directional busses. In other words, these two busses are used for the processor to issue processor requests and for the external agent to issue external requests. TX4955 External agent SysAD[31:0] SysCmd[8:0] Figure 11.2.1 System Interface Bus Requests sent via the system interface consist of the following: 11.2.2 • Address • System interface command that strictly specifies the type of request • Series of data elements for when the request is a particular write or read process. Address Cycle and Data Cycle Cycles during which valid addresses exist on the SysAD bus are referred to as address cycles. Also, cycles during which valid data exist on the SysAD bus are referred to as data cycles. Validity is determined depending on the ValidIn signals and ValidOut signals. The SysCmd bus is used to identify the contents of the SysAD bus for all cycles at which it is to be valid. The most significant bit of the SysCmd bus is used to indicate whether the current cycle is an address cycle or a data cycle. • In the case of an address cycle [SysCmd[8] = 0], the remaining bits SysCmd[7:0] of the SysCmd bus contain the system interface commands. • In the case of a data cycle [SysCmd[8] = 1], the remaining bits SysCmd[7:0] of the SysCmd bus contain the data identifier. 11-2 Chapter 11 TX4955 System Interface 11.2.3 Issue Cycle Two types of processor issue cycles exist with the TX4955. • Processor read request issue cycles. • Processor write request issue cycles. The TX4955 judges the issue cycle of the processor read request by sampling the RdRdy* signal. It also judges the issue cycle of the processor write request by sampling the WrRdy* signal from the external agent. As illustrated in Figure 11.2.2, RdRdy* must be asserted two cycles before the processor read request address cycle in order to define the address cycle as an issue cycle. Cycle 1 2 3 Issue Cycle 5 4 6 MasterClock SysAD Bus Address RdRdy* ValidOut* Figure 11.2.2 RdRdy* Signal Status in case of Read Request As illustrated in Figure 11.2.3, WrRdy* is asserted two cycles before the initial address cycle of the processor write request, and the address cycle must be defined as the issue cycle. Issue Cycle Cycle 1 2 3 4 5 6 MasterClock SysAD Bus Address Data WrRdy* ValidOut* Figure 11.2.3 WrRdy* Signal Status in case of Write Request The TX4955 repeats the request address cycle until the conditions of the valid issue cycle are met. If the processor request is a data transmission, then data transmission starts at the point when the issue cycle is complete. There is only one issue cycle no matter what the processor request is. The TX4955 accepts external requests even while trying to issue processor requests. If the external agent asserts ExtRqst*, the processor responds to the external agent by releasing the system interface and going into the slave state. Rules relating to the issue cycle of processor requests are strictly applied in determining the processor run operation as well. The TX4955 performs one of the following: 11-3 Chapter 11 TX4955 System Interface • Complete issuing of processor requests before external requests are received. • Release the system interface and go into the slave mode without completing issuance of the processor requests. In the latter of the above situations, the TX4955 issues processor requests after external requests are complete. Rules relating to issuing are also provided to processor requests. 11.2.4 Handshake Signal The processor uses the eight control signals explained below to manage the flow of requests. 11.2.5 • RdRdy* and WrRdy* are used by the external agent to indicate that it is ready to accept a new read or write transaction. • ExtRqst* and Release* are used to transfer SysAD bus and SysCmd bus control. ExtRqst* is used by the external agent to indicate the necessity of controlling the interface. Release* is asserted by the processor when transferring the system interface access privileges. • The TX4955 processor uses ValidOut* and the external agent ValidIn* signals to indicate the valid command/data on the SysCmd/SysAD bus. System Interface Protocol of R5000 Type Figure 11.2.4 illustrates the system interface that operates between registers. In other words, processor output is directly transferred from the output register and changes with the MasterClock rising edge. Processor input is directly transferred to the input register and the input register latches these input signals at the rising edge of the MasterClock. In this way, it becomes possible for the system interface to operate at the fastest clock frequency. TX4955 Output data Input data MasterClock Figure 11.2.4 Operation of the System Interface Between Registers 11-4 Chapter 11 TX4955 System Interface 11.2.5.1 Master state and slave state The system interface is placed in the master state when the TX4955 processor is driving the SysAD bus and SysCmd bus. In contrast, the system interface is in the slave state when the external agent is driving the SysAD bus and SysCmd bus. The processor asserts the ValidOut* signal if the SysAD bus and SysCmd bus become valid when the system interface is in the master state. The external agent asserts the ValidIn* signal if the SysAD bus and SysCmd bus become valid when the system interface is in the slave state. 11.2.5.2 Shifting from the master state to the slave state The system interface remains in the master state unless it enters one of the following states: • The external agent issues a request, and the external agent is granted permission to use the system interface (external arbitration). • The processor issues a read request and shifts into the slave mode by itself. 11.2.5.3 External arbitration The external agent cannot issue external requests via the system interface unless the system interface goes into the slave state. Shifts from the master state to the slave state are arbitrated by the processor using the system interface handshake signals ExtRqst* and Release*. This shift is performed as follows below. 1) The external agent sends notification that it would like to issue an external request by asserting the ExtRqst* signal. 2) The processor releases the system interface and changes its state from the master state to the slave state by asserting the Release* signal for 1 cycle. 3) The system interface returns to the master state when issuing of the external request is complete. 11.2.5.4 Shifting to the slave state on its own Shifting to the slave state on its own means that the shift from the master state to the slave state is started by the processor when the processor read request is still on hold. The Release* signal is automatically asserted after the read transaction. Self-invoked shifting to the slave state occurs in one cycle after the issue cycle of the read request. After shifting to the slave state on its own, the processor returns to the master state at the end of the next external request. This is made possible by a read response or other type of external request. The SysAD bus and SysCmd bus drives must start after the external agent confirms that the processor autonomously shifted to the slave state. While the system interface is in the slave state, the external agent can start making external requests without requesting access to the system interface (without asserting the ExtRqst* signal). The system interface returns to the master state when the external request ends. If a processor read request is on hold after a read request is issued, the processor automatically changes the system interface into the slave state even if the external agent has not requested the permission necessary for issuing of the external request to use the system interface. By shifting to the slave state in this manner, the external agent becomes able to return read response data. 11-5 Chapter 11 TX4955 System Interface 11.2.6 Processor Requests and External Requests Requests are broadly categorized as processor requests and external requests. This section will describe these two categories. When a system event is generated, either a single request or a series of requests (referred to as processor requests) are issued via the system interface so the processor can access an external resource and invoke the service for the event. In order for this operation to be performed properly, the processor system interface must be connected to a system agent that meets the two following conditions: 1) It is in compliance to the system interface protocol. 2) It can regulate access to system resources. An external agent that requests access to the processor cache or the status registers generates an external request. This access request is transferred via the system interface. Figure 11.2.5 illustrates the system event and request cycles. TX4955 External agent Processor Request • Read • Write Processor Request • Read • Write • Null System Events • Load miss • Store miss • Store bit • Uncached load/store • Cache operation Figure 11.2.5 Requests and System Event 11.2.6.1 Rules relating to processor requests The following rules apply to processor requests. Cycle 1 • After a processor read request is issued, the processor cannot issue the next read request until after it receives a read response. • When in the R4000 compatible mode, after a write request is issued, at least 4 cycles must pass from when the write request issue cycle is complete until the processor can issue the next request. This is because two dummy system cycles are inserted as illustrated in Figure 11.2.6 by consecutive write requests of single data cycles. 2 3 4 5 6 7 Cycle 1 2 3 4 Addr Data Dummy Dummy Addr 8 9 10 Data Dummy Dummy MasterClock SysAD Bus Write #1 Write #2 WrRdy* ValidOut* Figure 11.2.6 Timing of Consecutive Write Cycles 11-6 Chapter 11 TX4955 System Interface 11.2.6.2 Processor requests The term “processor request” refers to either a single request or a series of requests issued via the system interface in order to access external resources. As illustrated in Figure 11.2.7, there are two types of processor request: read and write. TX4955 External agent Processor Request • Read • Write Figure 11.2.7 Processor Requests Read requests are requests that read data from main memory or other memory resources in block, word, and byte units. Write requests are requests that write data to main memory or other system resources in block, , word, and byte units. Processor requests are managed by the TX4955 processor in the same manner as the R4000 non-secondary cache mode. The processor issues requests strictly according to a sequential method. In other words, the processor cannot issue the next request while a previous request is on hold. For example, after issuing a read request, the processor waits for a read response before issuing the next request. The processor only issues write requests when there are no read requests on hold. When using processor input signals RdRdy* and WrRdy*, the external agent can control the processor request flow. RdRdy* is the signal that controls the processor read flow, and WrRdy* controls the processor write request flow. Figure 11.2.8 illustrates the sequence of the processor request cycle. External agent TX4955 1. Processor issues read/write requests. 2. External system controls acceptance of requests by asserting either RdRdy* or WrRdy*. Figure 11.2.8 Processor Requests 11.2.6.3 Processor read requests When the processor issues a read request, the external agent must access the specified resource and return the requested data. The external agent returns response data for processor read requests so they can be executed separately from the requests. In other words, the external agent can start an external request before returning response data for the processor read request. A processor read request is completed when the final word of the response data is received from the external agent. Depending on the data identifier combined with the response data, an error in the response data may be pointed out. The processor would then treat this error as a bus error. 11-7 Chapter 11 TX4955 System Interface If data have not been returned to the issued processor read request, the applicable request is said to be “on hold.” This state continues until the requested read data are returned. The external agent must be able to accept processor read requests at any time if both of the following two conditions are met. • There is no processor read request that is on hold. • The RdRdy* signal is asserted for 1 cycle 2 cycles before the issue cycle. 11.2.6.4 Processor write requests When the processor issues a write request, the specified resources are accessed, then the data are written to those resources. Processor write requests are completed when the final data word is transferred to the external agent. The external agent must be able to accept processor write requests at any time if either of the two following conditions are met. • There is no processor read request that is on hold. • The WrRdy* signal is asserted for 1 cycle 2 cycles before the issue cycle. 11.2.6.5 External requests As illustrated in Figure 11.2.9, there are three types of external request: read, write, and null. TX4955 External agent External request • Read • Write • Null Figure 11.2.9 External Requests Read requests are used to call 1-word data from processor internal resources. Write requests are used to write 1-word data to the processor internal resources. Null requests are requests that do not require processor operation. As illustrated in Figure 11.2.10, the processor uses arbitration signals ExtRqst* and Release* to control the flow of external requests. The external agent cannot issue external requests unless access privileges to the system interface are obtained. In order to do so, the external agent asserts the ExtRqst* signal, then waits until the processor asserts the Release* signal for 1 cycle. 11-8 Chapter 11 TX4955 System Interface External agent TX4955 1. External system requests bus access privileges by asserting the ExtRqst* signal 2. Processor grants access privileges by asserting the Release* signal 3. External system issues external request 4. Processor obtains bus access privileges again Figure 11.2.10 External Requests After the external request is issued, the system interface access privileges always return to the processor. The processor will not accept another external request until the current one is complete. If there is no processor request that is on hold, the processor decides based on the interior state whether to accept an external request or to issue a new processor request. The processor can issue a new processor request even if the external agent requested access to the system interface. The external agent sends notification that it would like to start an external request by asserting the ExtRqst* signal. After that, the external agent waits for the processor to assert the Release* signal and send notification that preparations have been made to accept this request. The processor sends notification based on the next judgement criterion to be listed that preparations have been made to accept an external request. • The processor ends processor requests that are in progress. • The processor can accept an external request while waiting for the RdRdy* signal to be asserted so a processor read request can be issued. However, this request must be transferred to the processor at least 1 cycle before the RdRdy* signal is asserted. • The processor can accept an external request while waiting for the WrRdy* signal to be asserted so a processor write request can be issued. However, this request must be transferred to the processor at least 1 cycle before the WrRdy* signal is asserted. • If waiting for a response to a read request after the processor shifted itself to the slave state, the external agent can issue an external request before sending read response data. 11.2.6.6 External read requests In contrast to processor read requests, data are directly returned as a response to the request for external read requests. No other requests can be issued until the processor returns the requested data. External read requests are complete when the processor returns the requested data word. Depending on the data identifier combined with the response data, an error in the response data may be pointed out. The processor would process the error as a bus error. Note: The TX4955 does not have any resources that can read external read requests. The processor returns to the external read request undefined data and data identifiers in which SysCmd[5] of the errant data bit is set. 11-9 Chapter 11 TX4955 System Interface 11.2.6.7 External write requests External write requests can only use the Interrupt register. When the external agent issues a write request, the Interrupt register is accessed, then the data are written to this register. External write requests are completed when the data is written to the processor. 11.2.6.8 Read responses As illustrated in Figure 11.2.11, read responses return data to processor read requests. Read responses are external requests, strictly speaking, but there is only one difference with other external requests: read responses do not request permission to use the system interface. Therefore, read responses are handled separately from other external requests and are simply referred to as read responses. External agent TX4955 1. Read request 2. Read response Figure 11.2.11 Read Response 11.2.7 Handling of Requests This section will describe in detail sequences, protocol, and syntax for both processor and external requests. • Load miss • Store miss • Store hit • Cache operation • Load Linked/Store Conditional 11.2.7.1 Load miss If a processor load miss occurs in the primary cache, the processor cannot proceed to the next process if the cache line that contains the loaded data elements is not received from the external agent. If the current cache line set in which the write back bit (W bit) is set is replaced by a new cache line, the current cache line must be written back. The processor checks the coherency properties in the TLB entries for pages including the requested cache lines. If the coherency properties are non-coherent, then a non-coherent read request is issued. Table 11.2.1 indicates the measures that can be taken when a load miss occurs in the primary cache. 11-10 Chapter 11 TX4955 System Interface Table 11.2.1 Load Miss to the Primary Cache Page Properties State of the replaced data cache line Dirty (W = 0)/Invalid Dirty (W = 1) NCR NCR/W Non-coherent NCR: Processor non-coherent, block read request NCR/W: Processor non-coherent, block write requests continue after the block read request 11.2.7.2 Store miss When a store miss occurs in the primary cache, the processor cannot proceed to the next process if it does not receive from the external agent a cache line that includes a store target address. The processor checks the coherency properties in the TLB entries for pages including the requested cache line, then confirms whether to invalidate write transactions to that cache line or not. After that, the processor executes one of the following requests: • If the coherency properties are non-coherent write back or non-coherent write through (write allocate), then a non-coherent block read request is issued. • If the coherency properties are non-coherent write through (non-write allocate), then a non-block write request is issued. Table 11.2.2 indicates the measures taken when there is a store miss to the primary cache. Table 11.2.2 Store Miss to Primary Cache State of the replaced data cache line Page Properties Dirty (W = 0)/Invalid Dirty (W = 1) Non-coherent write back or non-coherent write through (write allocate) NCR NCR/W Non-coherent write through (non-write allocate) NCW NA NCR: Processor non-coherent, block read request NCR/W: Processor non-coherent, block write requests continue after the block read request NCW: Processor non-coherent write request 11.2.7.3 Store hits Operation in the system interface is determined by whether a line is write back or write through. When in the primary cache mode, all lines set to write back are set to the dirty exclusion state (W = 1). In other words, burst transactions do not occur even if a store hit occurs. Lines set to write through generate processor write requests for store data. 11.2.7.4 Uncached load or store When performing uncached load operations, the processor issues non-coherent read requests for double words, partial double words, words, or partial words. Also, when performing uncached store operations, the processor issues write requests for double words, partial double words, words, or partial words. The TX4955 judges that there is valid parity and data in the entire 32-bit SysAD bus even for data requests of less than a word. Even if there was a partial word request for example, all parity must be correctly returned for all 32 bits. If not, then parity check must be disabled. 11-11 Chapter 11 TX4955 System Interface All write transactions by the TX4955 are buffered in the 4-stage write buffer of the system interface. If there are entries in the write buffer when a block request is required, the write buffer is flushed before a read request is generated (for cache misses or read transactions to uncached areas). Data cache misses or uncached data load transactions flush the write buffer. Note: The TX4955 processes a parity error of the system interface as a bus error exception. 11.2.7.5 Cache instruction operation Various operations are made available to the Cache instruction in order to maintain the primary cache status and contents. When Cache instruction operations are in progress, write requests or invalidate requests can be issued from the processor. 11.2.8 Processor Request and External Request Protocol This section explains the bus arbitration protocol for both processor requests and external requests on a cycle-by-cycle basis. Table 11.2.3 below describes the abbreviations used in the following timing diagram of the bus. Table 11.2.3 System Interface Request Range Abbreviation Meaning Total Unsd Unused SysAD bus Addr Physical address SysCmd bus Data<n> Data number n of the data block Cmd Undefined system interface command Read Processor or external read request command Write Processor or external write request command SINull External null request command that releases the system interface NData Non-coherent data identifier for datum other than the final datum NEOD Non-coherent data identifier for the final datum 11.2.8.1 Processor request protocol Processor request protocol is as follows. • Read • Write • Null 11.2.8.2 Processor read request protocol The processor read request protocol is as described in the following sequence. The next step numbers correspond to the numbers in Figure 11.2.12. 1. RdRdy* is asserted to Low by the external agent. This means that the external agent is ready to accept read requests. 2. When the system interface is in the master state, the read command is transmitted to the SysCmd bus, then the processor read request is issued by transmitting the read address to the SysAD bus. 11-12 Chapter 11 TX4955 System Interface 3. At the same time, the processor asserts the ValidOut* signal for one cycle. This means that valid data are being transmitted to the SysCmd bus and SysAD bus. 4. The processor goes into the slave state by itself either at the issue cycle of a read request or after the Release* signal is asserted for one cycle and the issue cycle of the read request is complete. Note: The external agent must not assert the ExtRqst* signal as a means of returning a read response. It must however wait to shift to the slave state on its own. If an external request other than a read response is issued, ExtRqst* can be asserted either before the read response or in the process of the read response. 5. The SysCmd bus and SysAD bus are released from the processor one cycle after the Release* signal is asserted. 6. The SysCmd bus and SysAD bus are driven by the external agent within two cycles after the Release* signal is asserted. When shifting to the slave state (from Cycle 5 in Figure 11.2.12), the external agent can return the requested data as a read response. Notification of an error in the returned data is sent if either the data requested by a read response were returned or if the requested data could not be fetched. In this case, the processor handles the result as a bus error exception. Figure 11.2.12 illustrates a situation in which the slave state is autonomously shifted to after a processor read request is issued. Note: The timing of the SysADC bus and SysCmdP bus are the same as the timing of the SysAD bus and SysCmd bus timing, respectively. Master Cycle 1 2 Slave 3 4 5 6 7 8 MasterClock Addr SysAD Bus 5 SysCmd Bus 2 6 Read 3 ValidOut* Validln* RdRdy* 1 WrRdy* Release* 4 Figure 11.2.12 Processor Read Request Protocol 11-13 9 10 11 12 Chapter 11 TX4955 System Interface If the Release* signal is asserted, this means that either there is autonomous shifting to the slave state or there is a response to the ExtRqst* signal assertion. In this case, the processor can accept either a read response or an external request other than a read response. If an external request other than a read response is issued, the processor asserts Release* for 1 cycle, then autonomously shifts to the slave state again after the external request process. 11.2.8.3 Processor write request protocols Either of the two following protocols is used in issuing processor write requests. • The word write request protocol (see Note below) is used for double word, partial double word, word or partial word writing. Note: Words are called to differentiate from the block request protocol. It is actually possible to transfer data in double word, partial double word, word, or partial word units. The block write request protocol is used for block write transactions. • The system interface is used in the master state to issue processor word write requests. Figure 11.2.13 illustrates processor non-coherent single word write request cycles. 1. In order to issue a processor single word write request, a write command is sent to the SysCmd bus, and a write address is sent to the SysAD bus. 2. The processor asserts the ValidOut* signal 3. The processor sends the data identifier to the SysCmd bus and transmits data to the SysAD bus. 4. The data identifier for this data cycle must receive an indication that this is the final data cycle. ValidOut* is deasserted at the end of the cycle. Note: The timing of the SysADC bus and SysCmdP bus are the same as the timing of the SysAD bus and SysCmd bus timing, respectively. Master Cycle 1 2 3 4 5 SysAD Bus Addr Data 0 SysCmd Bus Write NEOD 6 7 8 9 10 MasterClock 3 1 ValidOut* 2 4 Validln* RdRdy* WrRdy* Release* Figure 11.2.13 Processor Non-coherent Single Word Write Request Protocol 11-14 11 12 Chapter 11 TX4955 System Interface 11.2.8.4 Processor single write requests There are three processor single write requests as follow below. With later G2SConfig register, these modes are selected. 1. R4000 compatible write 2. Reissue write 3. Pipeline write Table 11.2.4 Data Transfer Rate, Data Pattern and Setting at single write requests Maximum Data Transfer Rate 1 word/3 MasterClock cycle Reserved Data Pattern Setting Bits 2-1 Wxx Write mode 00 R4000 compatible Reserved 01 Reserved 1 word/1 MasterClock cycles W 10 Pipeline write 1 word/1 MasterClock cycles W 11 Reissue write Note: The setting bits 2-1 is bits 2-1 of the G2Sconfig register (0xF FF10 0000). Bits 2-1 is set to “00” when initialized. 1. R4000 compatible write When in the R4000 compatible write mode, 4 cycles are required for single write operation. After the address is asserted for 1 cycle, it is followed by 2 cycles of dummy data. Figure 11.2.14 illustrates its basic operation. In the case of the TX4955, the WrRdy* signal must be asserted for 1 cycle 2 cycles before the write operation is issued. When in the R4000 compatible signal write mode, the external agent receives the write data then immediately asserts WrRdy*, making it possible to stop write operation that continues after 4 cycles. The 2 cycles of dummy data that follow these write data give the external agent time to stop the next write operation. 11-15 Chapter 11 TX4955 System Interface Cycle 1 2 3 4 SysAD Bus Addr SysCmd Bus Write 5 6 7 8 9 10 11 Data 0 Addr Data 1 Addr NEOD Write NEOD Write 12 MasterClock ValidOut* Validln* RdRdy* WrRdy* Release* Figure 11.2.14 R4000 Compatible Write 2. Reissue write When in the reissue write mode, the WrRdy* signal is asserted for 1 cycle 2 cycles before the address cycle, and the write operation is reissued when the WrRdy* signal is asserted during the address cycle. Figure 11.2.15 illustrates the reissue write protocol. • By asserting (Low) the WrRdy* signal in the first and third cycles, Addr0/Data0 issues a write operation in the third or fourth cycle. • By deasserting (High) the WrRdy* signal in the fifth cycle, Addr1/Data1 does not issue a write operation in the fifth and sixth cycles. • By asserting (Low) the WrRdy* signal again in the eighth and tenth cycles, Addr1/Data issues a write operation in the tenth and eleventh cycles. No Issue Issue Cycle 1 2 No Issue No Issue 8 No Issue Issue 9 10 3 4 5 6 7 11 SysAD Bus Addr0 Data0 Addr1 Data1 Addr1 Data 1 SysCmd Bus Write NEOD Write NEOD Write NEOD MasterClock WrRdy* Figure 11.2.15 Reissue Write Protocol 11-16 12 Chapter 11 TX4955 System Interface 3. Pipeline write Similar to when in the R4000 compatible write mode, the pipeline write protocol issues a write operation if the WrRdy* signal is asserted for 1 cycle 2 cycles before the write operation is issued. However, the 2 cycles of dummy data after the write operation are deleted. The external agent must be able to accept one write operation or more after WrRdy* is deasserted. Figure 11.2.16 illustrates this protocol. • Third, fourth cycle Addr0/Data0 is issued by asserting (Low) the WrRdy* signal in the first cycle. • Fifth, sixth cycle Addr1/Data1 is issued by asserting (Low) the WrRdy* signal in the third cycle. • Addr2 is not issued in the seventh cycle when the WrRdy* signal is deasserted (High) in the fifth cycle. Addr2/Data2 is issued in the tenth, eleventh cycle by asserting the WrRdy* signal again in the eighth cycle. Cycle 1 2 No Issue Issue Issue No Issue 8 No Issue 9 Issue 3 4 5 6 7 10 11 SysAD Bus Addr0 Data0 Addr1 Data1 Addr2 Data 1 SysCmd Bus Write NEOD Write NEOD Write NEOD MasterClock WrRdy* Figure 11.2.16 Pipeline Write Protocol 11-17 12 Chapter 11 TX4955 System Interface 11.2.8.5 Processor block write request The master state system interface is used to issue processor block write requests. Figure 11.2.17 illustrates a processor non-coherent block request made for 8-word data with the “D” data pattern. 1. Processor sends a write command to the SysCmd bus, then sends a write address to the SysAD bus. 2. Processor asserts the ValidOut* signal. 3. Processor sends data identifier to the SysCmd bus and sends data to the SysAD bus. 4. Processor asserts the ValidOut* signal only for the number of cycles required to transfer the data block. 5. Final data cycle directive must be included in data identifiers for the final data cycle. Note: There is transmission protocol of Processor block write request three kinds same as Processor single write requests. With later G2SConfig register, these modes are selected. Master Cycle 1 2 3 4 5 6 7 8 9 10 11 Addr Data0 Data1 Data2 Data3 Data4 Data5 Data6 Data7 Write NData NData NData NData NData NData NData NEOD 12 MasterClock SysAD Bus SysCmd Bus 1 ValidOut* 2 3 5 4 Validln* RdRdy* WrRdy* Release* Figure 11.2.17 Processor non-coherent block request protocol 11.2.8.6 External request protocol External requests can only be issued when the system interface is in the slave state. The external agent asserts the ExtRqst* signal, and requests use of the system interface. The processor asserts the Release* signal, releases the system interface, waits for it to enter the slave state, then the external agent issues an external request. If the system interface is already in the slave mode, namely, if the processor has put the system interface in the slave state on its own, then the external agent can immediately issue an external request. In the case of the external agent, the system interface must be returned to the master state after issuing an external request. When the external agent issues a single external request, ExtRqst* must be deasserted 2 cycles after the cycle at which Release* is asserted. Also, when issuing a series of external requests, the ExtRqst* signal must be asserted before the last request cycle. 11-18 Chapter 11 TX4955 System Interface The processor continues processing external requests while ExtRqst* is asserted. However, until the processor completes a request that is currently being processed, it will not be able to release the system interface and put it into the slave state in preparation for the next external request. Also, until ExtRqst* is asserted, a series of external requests cannot be interrupted by a processor request. 11.2.8.7 External arbitration protocol As previously mentioned, the ExtRqst* signal and Release* signal are used in system interface arbitration. Figure 11.2.18 illustrates the timing of the arbitration protocol when the slave state changes to the master state. The arbitration cycle sequence is as follows. 1. The external agent asserts ExtRqst* when it becomes necessary to issue external requests. 2. The processor asserts Release* for 1 cycle when it becomes possible to process an external request. 3. The processor sets the SysAD bus and SysCmd bus to tri-state. 4. The external agent must start transmission to the SysAD bus and SysCmd bus 2 cycles after Release* is asserted. 5. The external agent deasserts ExtRqst* 2 cycles after Release* is asserted. This does not apply however to situations where an attempt is made to issue another external request. 6. The external agent sets the SysAD bus and SysCmd bus to tri-state when processing of the external request is complete. The processor becomes able to issue processor requests 1 cycle after the external agent sets the busses to tri-state. Note: The timing of the SysADC bus and SysCmdP bus are the same as the timing of the SysAD bus and SysCmd bus timing, respectively. Master Cycle 1 2 Slave 3 4 5 6 7 Addr Data0 Cmd NEOD Master 8 9 MasterClock 3 SysAD Bus 6 4 SysCmd Bus ValidIn* WxtRqst* Release* 1 5 2 Figure 11.2.18 Arbitration Protocol Relating to External Requests 11-19 10 11 12 Chapter 11 TX4955 System Interface 11.2.8.8 External read request protocol External read requests are requests that read 1 word of data from processor-internal resources such as registers. External read requests cannot be partitioned. Namely, it is not possible to generate other requests between an external read request and the corresponding read response. Figure 11.2.19 illustrates the timing of external read requests, which consist of the following steps. 1. The external agent requests use of the system interface by asserting ExtRqst*. 2. The processor asserts Release* for 1 cycle, then releases the system interface by deasserting Release* and puts the interface into the slave state. 3. After Release* is deasserted, the SysAD bus and SysCmd bus are set to tri-state for 1 cycle. 4. The external agent sends a read request command to the SysCmd bus, sends a read request address to the SysAD bus, and asserts ValidIn* for 1 cycle. 5. After sending the above address and command, the external agent sets the SysCmd and SysAD busses to tri-state, makes it possible for the processor to drive them, and then releases them both. The processor that accessed the data to be read returns the data to the external agent. Therefore, the processor sends the data identifier to the SysCmd bus, sends the response data to the SysAD bus, then asserts ValidOut* for 1 cycle. This data identifier indicates that data are the response data of the final data cycle. 6. The system interface is in the master state. The processor continues to drive the SysCmd bus and SysAD bus even after the read response is returned. Note: The timing of the SysADC bus and SysCmdP bus are the same as the timing of the SysAD bus and SysCmd bus timing, respectively. External read requests can read data from only a single word in the processor. If data elements other than a word are requested, the processor response is not defined. Master Cycle 1 2 Slave 3 4 5 6 7 Master 8 9 10 11 12 MasterClock SysAD Bus Addr Data0 6 Read Data0 6 3 SysCmd Bus ValidOut* 4 5 ValidIn* ExtRqst* 1 2 Release* Figure 11.2.19 External Read Request when System Interface is in the Master State Note: The processor contains no resources that can read by way of external read requests. The processor returns data identifiers with SysCmd[5] of the error data bits set along with undefined data when it receives an external read request. 11-20 Chapter 11 TX4955 System Interface 11.2.8.9 External null request protocol The processor only supports one external null request. The system interface release external null request returns the system interface from the slave state to the master state. This request does not affect any other processors. The only processing the external null request does is to have the processor return the system interface to the master state. Figure 11.2.20 illustrates the timing of the external null request, which consists of the following steps. 1. The external agent drives the system interface, sends the external null request command to the SysCmd bus, then asserts the ValidIn* signal for 1 cycle. 2. The SysAD bus is not available during the external null request address cycle (there are no valid data in the bus). 3. The null request ends when the address cycle is issued. In the case of a system interface release null request, the external agent releases the SysCmd bus and SysAD bus so the system interface can return to the master state. Master Slave Cycle 1 2 3 4 5 6 7 8 9 10 11 MasterClock SysAD Bus 2 Unsd SysCmd Bus SINull 3 ValidOut* 1 Validln* Extqst* Release* Figure 11.2.20 System Interface Release External Null Request 11-21 12 Chapter 11 TX4955 System Interface 11.2.8.10 External write request protocol The same protocol as the processor single word write protocol is used for external write requests, except when the ValidIn* signal is asserted instead of the ValidOut* signal. Figure 11.2.21 illustrates the timing of the external write request, which consists of the following steps. 1. The external agent requests use of the system interface by asserting ExtRqst*. 2. The processor asserts Release*, then the system interface is released from the processor and goes into the slave state. 3. The external agent sends a write command to the SysCmd bus, and sends a write address to the SysAD bus while asserting ValidIn*. 4. The external agent sends data identifiers to the SysCmd bus, and sends data to the SysAD bus while asserting ValidIn*. 5. Data identifiers for this data cycle must contain an indication of a coherent or non-coherent final data cycle. 6. After a data cycle is issued, the write request is complete, the external agent sets the SysCmd and SysAD busses to tri-state, then the system interface returns to the master state. Note: The timing of the SysADC bus and SysCmdP bus are the same as the timing of the SysAD bus and SysCmd bus timing, respectively. External write requests can write only 1 word of data to the processor. Operation of processors that have specified data elements other than a single word of data by an external write request is not defined. Slave Master Cycle 1 2 3 4 5 6 7 Addr Data0 Master 8 9 10 11 MasterClock SysAD Bus 6 SysCmd Bus Write NEOD 4 ValidOut* 5 3 Validln* ExtRqst* Release* 1 2 Figure 11.2.21 External Write Request when System Interface Starts in the Master State 11-22 12 Chapter 11 TX4955 System Interface 11.2.8.11 Read response protocol The external agent must use the read response protocol to return data to the processor if a processor read request has been received. The sequence of the read response protocol is as follows. 1. The external agent waits for the processor to automatically execute a shift into the slave state. 2. The external agent uses either a single data cycle or a series of data cycles to return data. 3. After issuing the final data cycle, the read response ends, then the external agent sets the SysCmd and SysAD busses to tri-state. 4. The system interface returns to the master state. Note: After issuing a read response, the processor automatically shifts to the slave state. 5. Data identifiers of a data cycle must indicate that the data are response data. 6. Final data cycle identifiers must contain an indication that a cycle is the final data cycle. In the case of read responses to non-coherent block read requests, it is not necessary for the response data to check the initial cache state. The cache state is automatically set to exclusively dirty. Data identifiers of data cycles can send notification of transfer data errors in those cycles. The external agent must return data blocks with the correct size even when there is an error in the data. Whether there is a single error or multiple errors in the read response data cycles, the processor processes them as bus errors. Read responses must always be returned to the processor when a processor read request is being held. Processor operation is not defined if a read response was returned in a state where there were no processor read requests on hold. Figure 11.2.22 illustrates a processor word read request and the subsequent word read response. Also, Figure 11.2.23 illustrates the read response to a processor block read request when the system interface is in the slave state. 11-23 Chapter 11 TX4955 System Interface Master Cycle 1 2 Slave 3 4 5 6 7 8 Master 9 10 11 12 MasterClock Addr SysAD Bus Data0 3 Addr SysCmd Bus 4 NEOD ValidOut* 2 6 ValidIn* ExtRqst* 1 Release* Figure 11.2.22 Processor Word Read Request and Subsequent Word Read Response Slave Master Cycle 1 2 3 4 5 Master 6 7 13 14 15 MasterClock SysAD Bus Addr Data0 Data1 Data7 SysCmd Bus Addr NData NData NEOD 3 ValidOut* 2 5 4 6 ValidIn* ExtRqst* Release* Figure 11.2.23 Block Read Response when System Interface is in the Slave State 11-24 16 Chapter 11 TX4955 System Interface 11.2.9 Data Transfer The maximum data transfer rate of the system interface is 1 word per cycle. The external agent can select the data transfer rate to the processor. For example, it is possible to transfer data and assert the ValidIn* signal just once for every n cycles instead of at all cycles. The external agent can transfer data to the processor at the selected transfer rate. The processor interprets cycles as being valid when the ValidIn* signal is asserted and the SysCmd bus includes the data identifier. After a cycle has been interpreted as valid, the processor continues to accept data until a data word with an indication that it is the final data word appears. 11.2.9.1 Data transfer pattern The term “data pattern” in the case of block write operations, refers to a string of text that indicates the “data” cycles repeated so that the appropriate data transfer speed can be obtained and the “unused” cycles. Wxx data patterns indicate a repetition data transfer rate where there is one word in three cycles followed by two unused cycles. The data transfer rate is set by G2SConfig register(0xF FF10 0000). Table 11.2.5 indicates the data transfer rate, data pattern, and setting. Table 11.2.5 Data Transfer Rate, Data Pattern and Setting at Block Write Requests Maximum Data Transfer Rate Data Pattern Setting Bit0 1 word/3 MasterClock cycle Wxx 0 1 word/1 MasterClock cycle W 1 (32-bit width) Note: The setting Bit0 is bit0 of the G2SConfig register (0xF FF10 0000). Bit0 is set to 0 when initialized. 11.2.9.2 Independent transfer on SysAD bus A majority of applications connect the processor and external agent interior (both directions), and register format transceivers together in a point-to-point manner via the SysAD bus. The only two SysAD bus drives available for such applications are the processor and the external agent. Depending on the application, it may be necessary to make additional connections on the SysAD bus for drivers and receivers to transfer data using the SysAD bus without involving the processor. Such transfers are referred to as independent transfers. In order to perform independent transfers, the external agent must use arbitration handshake signals and external null requests to properly tune SysAD bus control. Independent transfer is performed on the SysAD bus according to the following steps. 1. The external agent requests access to the SysAD bus in order to issue an external request. 2. The processor releases the system interface and puts it in the slave state. 3. The external agent can independently transfer data using the SysAD bus. However, the ValidIn* signal must not be asserted during that transfer. 4. When transfer is complete, the external agent must issue a system interface release null request and return the system interface to the master state. 11-25 Chapter 11 TX4955 System Interface 11.2.10 System Interface Cycle Time In the case of a processor, there is a response time for each kind of processor transaction and for each external request. A minimum and maximum cycle count has been prescribed for each response time. Since processor requests themselves are restrained by system interface request protocols, checking the protocols makes it possible to determine the cycle count required for requests. The interval for the next interface operation is variable within the range of the minimum and maximum cycle counts. • Stand-by time from when an external request is received and the processor releases the system interface, until when the interface enters the slave state (release latency). • Response time to external request that requires a response (external response latency). 11.2.10.1 Release latency Broadly defined, release latency is the number of cycles for which it is possible to wait from when the processor receives an external request until when the system interface is released and shifts to the slave state. If there are no processor requests currently in progress, the processor must delay release of the system interface for a few cycles since it is internal operation. Therefore, if release latency is strictly defined, it becomes the cycle count from when the ExtRqst* signal is asserted until when the Release* signal is asserted. There are three types of release latency. • Category 1: If external request signal is asserted 2 cycles before the final cycle of the processor request • Category 2: If external request signal is not asserted during processor request or processor request is the final cycle even if external request signal is asserted • Category 3: If processor automatically shifts to the slave state Table 11.2.6 indicates the minimum and maximum release latency inherent to categories 1, 2, and 3. However, note that these cycle counts may be changed at any time. Table 11.2.6 Release Latency for External Requests Category Minimum Cycle Count 1 3 5 2 1 24 3 0 0 11-26 Maximum Cycle Count Chapter 11 TX4955 System Interface 11.2.11 System Interface Command and Data Identifiers System interface commands specify the type of system interface and its properties. This specification is performed in the request address cycle. The system interface data identifiers specify the properties of the data transferred during the system interface data cycle. In the case of external requests, the reserved bits and fields of the system interface commands and data identifiers should be set to 1. In the case of processor requests, these bits and fields are undefined. 11.2.11.1 Syntax of commands and data identifiers System interface commands and data identifiers consist of 9 bits. These commands are sent by the SysCmd bus from the processor to the external agent or from the external agent to the processor during either the address cycle or the data cycle. Bit 8 (MSB) of the SysCmd bus specifies whether the SysCmd contents at that time are a command or a data identifier (namely, whether the current cycle is an address cycle or a data cycle). If the contents are a system interface command, then SysCmd[8] must be set to 0. If the contents are a system interface data identifier, then SysCmd[8] must be set to 1. 11.2.11.2 Syntax of system interface commands Following is an explanation of the SysCmd bus structure in the case of a system interface command. Figure 11.2.24 illustrates the structure common to all system interface commands. 8 0 7 5 4 0 Request type Request specific Figure 11.2.24 Syntax Bit Structure of System Interface Command SysCmd[8] must always be set to 0 in the case of system interface commands. SysCmd[7:5] specifies the type of system interface request (read, write, null). Table 11.2.7 indicates the SysCmd[7:5] specification method. Table 11.2.7 SysCmd[7:5] Specification Method for System Interface Commands SysCmd[7:5] Command 0 Read request 1 Reserved 2 Write request 3 4-7 Null request Reserved SysCmd[4:0] varies depending on the type of request. Each specification type is indicated below. 11-27 Chapter 11 TX4955 System Interface 11.2.11.3 Read requests Figure 11.2.25 illustrates the SysCmd format in the case of read requests. 8 7 5 0 4 0 000 Read request specific Figure 11.2.25 Bit Definition of SysCmd Bus for Read Requests Table 11.2.8, Table 11.2.9, and Table 11.2.10 indicate the methods for specifying SysCmd[4:0] for read requests. Table 11.2.8 Specification Method of SysCmd[4:3] for Read Requests SysCmd[4:3] 0-1 Read Properties Reserved 2 Non-coherent block read 3 Word or partial word read Table 11.2.9 Specification Method of SysCmd[2:0] for Block Read Requests SysCmd[2] Reserved SysCmd[1:0] Read Block Size 0 1 2-3 Reserved 8 words Reserved Table 11.2.10 Data Size Expressed by SysCmd[2:0] for Word or Partial Word Read Requests SysCmd[2:0] Read Data Size 0 1 byte valid (byte) 1 2 bytes valid (half-word) 2 3 bytes valid (tri-byte) 3 4 bytes valid (word) 4 Reserved 5 Reserved 6 Reserved 7 Reserved 11-28 Chapter 11 TX4955 System Interface 11.2.11.4 Write requests Figure 11.2.26 illustrates the SysCmd format for write requests. Table 11.2.11 indicates the methods of specifying write properties using SysCmd[4:3]. Table 11.2.12 indicates the methods of specifying replacements properties using SysCmd[2:0] for block write requests. Table 11.2.13 indicates the methods of specifying the data size using SysCmd[2:0] for write requests. 8 7 5 0 4 0 010 Write request specific Figure 11.2.26 SysCmd Bus Bit Specification for Write Requests Table 11.2.11 Methods of Specifying SysCmd[4:3] for Write Requests SysCmd[4:3] Write Properties 0-1 Reserved 2 Block write 3 Word or partial word write Table 11.2.12 Specification Method of SysCmd[2:0] for Block Write Requests SysCmd[2] Reserved SysCmd[1:0] 0 1 2-3 Write Block Size Reserved 8 words Reserved Table 11.2.13 Methods for Specifying SysCmd[2:0] for Word or Partial Word Write Requests SysCmd[2:0] Write Data Size 0 1 byte valid (byte) 1 2 bytes valid (half-word) 2 3 bytes valid (tri-byte) 3 4 bytes valid (word) 4 Reserved 5 Reserved 6 Reserved 7 Reserved 11-29 Chapter 11 TX4955 System Interface 11.2.11.5 Null requests Figure 11.2.27 illustrates the SysCmd format in the case of null requests. 8 7 5 0 4 0 011 Null request specific Figure 11.2.27 Bit Definition of the SysCmd Bus for Null Requests Null request commands are always used for system interface release external null requests. Table 11.2.4 indicates methods of specifying SysCmd[4:3] for system interface release external null requests. SysCmd[2:0] is reserved for null requests. Table 11.2.14 Method of Specifying SysCmd[4:3] for External Null Requests SysCmd[4:3] 0 Null Properties Release system interface 1-3 Reserved 11.2.11.6 Syntax of system interface data identifiers This section defines methods of specifying the SysCmd bus for system interface identifiers. The bit structure illustrated in Figure 11.2.28 is common to all system interface data identifiers. 8 1 7 6 5 4 Final Data Response Data Error Data Data Check 3 0 Reserved Figure 11.2.28 Syntax Bit Structure of System Interface Data Identifiers SysCmd[8] must always be set to 1 for system interface data identifiers. System interface data identifiers are in the non-coherent data format. 11.2.11.7 Non-coherent data Non-coherent data are data such as the following. • Data that are the subject of a processor block write request or a processor word/partial word write request. • Data that are returned to a processor non-coherent block read request or a processor word/partial word read request as a response. • Data that are the subject of an external write request. • Data that are returned to an external read request as a response. 11-30 Chapter 11 TX4955 System Interface 11.2.11.8 Bit definition of data identifiers In the case of processor or external coherent data identifiers and processor or external non-coherent data identifiers, SysCmd[7] indicates that they are the final data element, and SysCmd[6] indicates whether they are response data. Response data are the data that are returned to a read request as a response. SysCmd[5] indicates whether there is an error in a data element. Uncorrectable errors are included in the error data. When such an error is returned to the processor, a bus error is generated. If a primary parity error is detected in the data items to be transferred, the processor deasserts the good data bits and sends data. SysCmd[4] indicates to the processor whether the data bits and check bits of a data element should be searched. SysCmd[3] is reserved in the case of external data identifiers. SysCmd[4:3] is reserved in the case of non-coherent processor data identifiers. SysCmd[2:0] is reserved in the case of non-coherent data identifiers. Table 11.2.15 indicates methods of specifying SysCmd[7:3] for processor data identifiers. Table 11.2.16 indicates methods of specifying SysCmd[7:3] for external data identifiers. Table 11.2.15 Methods of Specifying SysCmd[7:3] for Processor Data Identifiers SysCmd[7] Final Data Element Indication 0 Final data element 1 Is not final data element SysCmd[6] Response Data Indication 0 Response data 1 Is not response data SysCmd[5] Good Data Indication 0 No errors 1 Is error data SysCmd[4:3] Reserved Table 11.2.16 Method of Specifying SysCmd[7:3] for External Data Identifiers SysCmd[7] Final Data Element Indication 0 Final data element 1 Is not final data element SysCmd[6] Response Data Indication 0 Response data 1 Is not response data SysCmd[5] Good Data Indication 0 No errors 1 Is error data SysCmd[4] Enable Data Check 0 Check data bits and check bits 1 Do not check data bits and check bits SysCmd[3] Reserved 11-31 Chapter 11 TX4955 System Interface 11.2.12 System Interface Addresses 11.2.12.1 Addressing rules Addresses that are to be used in word or partial word transactions are arranged to match the size of the data element. The following rules are used by this system. • Target addresses of the block request are aligned to the word boundaries. In other words, the lower 2 bits of the address become 0. • Word requests set the lower 2 bits of the address to 0. • Half-word requests set the least significant bit of the address to 0. • Byte requests and 3-byte requests use the byte address. 11.2.13 Mode Register of System Interface (G2SConfig) The Mode Register of System Interface (G2SConfig) is a read/write register. This register is used to specify a protocol type of a processor write request etc. This register is only Word-Access. Table 11.2.17 G2SConfig Address Field Name Description 0xF_FF10_0000 G2SConfig Mode Register of System Interface 31 20 19 Reserved Bit(s) Field Name 4 3 Reserved 2 Reserved 1 Write mode Description Cold Reset 0 Read/Write 31:20 Reserved Read as undefined. Must be written as 0xfff. Undefined 19:4 Reserved Read as undefined. Must be written as 0xffff. 0xffff Read/Write 3 Reserved Read as undefined. Must be written as 0. 0 Read/Write Processor single write protocols set 00: R4000 compatible write 01: Reserved 10: Pipeline write 11: Reissue write 00 Read/Write Data transfer rate set for the block write 0 : WWWWWWWW 1: WxxWxxWxxWxxWxxWxxWxxWxx 0 Read/Write 2:1 0 Note: Write mode Data rate Read When initialized Single write: AWxx (R4000 compatible) Block write: AWWWWWWWW Figure 11.2.29 G2SConfig Register Formats(When R5000 protocol (MODE43*=1)) 11-32 Bit Data rate Chapter 11 TX4955 System Interface 11.2.14 Data Error Detection The TX4955 internal system interface uses the following two methods to detect data errors: • Indication of good data by data identifier SysCmd[5] • Determination by a check bit 11.2.14.1 Indication of good data by data identifier SysCmd[5] This bit indicates whether data is good or not for all data. Therefore, in a block refill transfer, for example, no matter in what number of data SysCmd[5] may have been set, a bus error exception is always generated. 11.2.14.2 Determination by a check bit When an error is detected by check bit determination, a bus error exception occurs. Because this determination also is made for all data, no matter in what number of data in a block refill transfer an error may have occurred, a bus error exception is always generated. 11.2.14.3 Timing at which a bus error exception occurs Indication of good data (SysCmd[5]): Two cycles after read response data Check bit error detection: Three cycles after read response data 11.2.14.4 Precautions • There is no means of identifying whether a bus error exception has been generated by indication of good data or by check bit determination. Nor do the TX49/H3 core and the TX49/H4 core have a cache parity bit, but when a bus error exception occurs during a block refill transfer, the cache line is referenced INVALID. • Regardless of whether a bus error exception has been generated by indication of good data or by check bit determination during a block refill transfer, a designated block size of data needs to be transferred. 11-33 Chapter 11 TX4955 System Interface 11.3 System Interface of R4300 Type Protocol Mode In TX4955, it is built in system interface function corresponding to R4300 type protocol. A selection of above-mentioned R5000 type protocol mode or R4300 type protocol mode increases by external pin (MODE43*). The R4300 type protocol mode setting is as follows: MODE43* = 0 Note: 11.3.1 In R4300 type protocol mode of TX4955, there is not PReq output signal. Therefore PReq input signal of an external agent should be always fixed in “Low”. And also there is not a function to show that protocol errors were detected. Otherwise, TX4955 has a built-in counter, and when there is no reply detected to read request in a certain time, bus error exception occurs. System Interface Description of R4300 Type Protocol Mode The TX4955 processor has a 32-bit address/data interface. The System interface consists of: • 32-bit address and data bus, SysAD • 5-bit command bus, SysCmd • five handshake signals: – EValid*, PValid* – EReq* – PMaster*, EOK* Table 11.3.1 System Interface Signals (When R4300 type protocol mode (MODE43* = 0,) Signal Name I/O Function SysAD[31:0] I/O System address/data bus A 32-bit address and data bus for communication between the processor and an external agent. SysCmd[8:5] I/O Reserved These pins are always driven to 0, then, can be left open on the board SysCmd[4:0] I/O System command/data identifier bus A 5-bit bus for command and data identifier transmission between the processor and an external agent. SysADC[3:0] I/O Reserved These pins are always driven to 0, then, can be left open on the board SysCmdP I/O Reserved This pin is always driven to 0, then, can be left open on the board Evalid* I External agent valid input During the cycle it is asserted, EValid* indicates an external agent is driving a valid address or valid data on the SysAD bus, and a valid command or data identifier on the SysCmd bus. Pvalid* O Processor valid output During the cycle it is asserted, PValid*, indicates the processor is driving a Valid address or Valid data on the SysAD bus, and a valid command or data indentifier on the SysCmd bus. EReq* I External request Indicates an external agent is requesting System interface bus ownership. PMaster* O Processor Master This signal indicates that the processor is a bus master. 11-34 Chapter 11 TX4955 System Interface I/O Function EOK* Signal Name I External agent Ready An external agent asserts EOK* when an external agent can now accept a processor request. RdRdy* I Reserved There is a pull-down resistor in the circuit. Then you can left it open or set it to 0. 11-35 Chapter 11 TX4955 System Interface Table 11.3.2 Pin Layout (When R4300 type protocol mode(MODE43* = 0) Pin No. Signal Name Pin No. Signal Name Pin No. Signal Name Pin No. Signal Name 1 Vss 41 Vss 81 VccInt 121 SysAD28 2 BufSel1 42 TRST* 82 NMI* 122 SysAD29 3 JTDO 43 (GND) 83 EReq* 123 VccInt 4 JTDI 44 EOK* 84 Reset* 124 Vss 5 JTCK 45 EValid* 85 ColdReset* 125 SysAD30 6 JTMS 46 PValid* 86 VccIO 126 VccIO 7 VccIO 47 PMaster* 87 Endian 127 Vss 8 Vss 48 VccIO 88 VccIO 128 SysAD31 9 SysAD4 49 PLLReset* 89 Vss 129 (GND) 10 SysAD5 50 VccInt 90 SysAD16 130 VccInt 11 VccInt 51 TintDis 91 VccInt 131 Vss 12 Vss 52 Vss 92 Vss 132 (GND) 13 SysAD6 53 SysCmd0 93 SysAD17 133 VccIO 14 VccIO 54 SysCmd1 94 SysAD18 134 Vss 15 Vss 55 SysCmd2 95 VccIO 135 (GND) 16 SysAD7 56 SysCmd3 96 Vss 136 VccInt 17 SysAD8 57 SysCmd4 97 SysAD19 137 Vss 18 VccInt 58 (GND) 98 VccInt 138 (GND) 19 Vss 59 VccIO 99 Vss 139 SysAD0 20 SysAD9 60 Vss 100 SysAD20 140 VccIO 21 VccIO 61 (GND) 101 SysAD21 141 Vss 22 Vss 62 (GND) 102 VccIO 142 SysAD1 23 SysAD10 63 (GND) 103 Vss 143 SysAD2 24 SysAD11 64 (GND) 104 SysAD22 144 VccInt 25 VccInt 65 VccInt 105 VccInt 145 Vss 26 Vss 66 Vss 106 Vss 146 SysAD3 27 SysAD12 67 VccIO 107 SysAD23 147 PCST8 28 VccIO 68 HALTDOZE 108 SysAD24 148 PCST7 29 Vss 69 Int0* 109 VccIO 149 PCST6 30 SysAD13 70 Int1* 110 Vss 150 PCST5 31 SysAD14 71 Int2* 111 SysAD25 151 PCST4 32 VccInt 72 Int3* 112 VccInt 152 VccIO 33 Vss 73 Int4* 113 Vss 153 Vss 34 SysAD15 74 Int5* 114 SysAD26 154 VccIO 35 BufSel0 75 VccIO 115 SysAD27 155 VssPLL 36 PCST3 76 Vss 116 VccIO 156 DivMode2 37 PCST2 77 TPC3 117 MODE43* 157 VccPLL 38 PCST1 78 TPC2 118 DivMode1 158 Vss 39 PCST0 79 TPC1 119 DivMode0 159 MasterClock 40 VccIO 80 DCLK 120 Vss 160 VccIO Note: Active-low signals have a trailing asterisk (*). 11-36 Chapter 11 TX4955 System Interface 11.3.2 System Events System events include: • Fetch miss in the instruction cache • Load miss in the data cache • Store miss in the data cache • an uncached load or store • actions resulting from the execution of cache instructions When a system event occurs, the processor issues a request or a series of requests through the system interface to access some external resource to service that event. The system interface must be connected to an external agent that coordinates access to system resources. Processor requests include both read and write requests: • a read request supplies an address to an external agent • a write request supplies an address and a word or block of data to be written to an external agent Processor read requests that have been issued, but for which data has not yet been returned, are said to be pending. The processor will not issue another request while a read is already pending. A processor read request is said to be complete after the last transfer of response data has been received from an external agent. A processor write request is said to be complete after the last word of data has been transmitted. External requests include both read responses and write requests: • a read response supplies a block or single transfer of data from an external agent in response to a read request • a write request supplies an address and a word of data to be written to a processor resource When an external agent receives a read request, it accesses the specified resource and returns the requested data through a read response, which may be returned any time after the read request and at any data rate. By default, the processor is the master of the system interface. An external agent becomes master of the system interface either through arbitration, or by default after a processor read request. The external agent returns mastership to the processor after the external request completes or after the processor read request has been serviced. 11.3.3 System Event Sequences and the SysAD Bus Protocol The following sections describe the sequence and timing of processor and external requests in detail. Note: The following sections describe the SysAD bus protocol; the TX4955 processor always meets the conditions of this protocol. The TX4955 processor is capable of receiving sequences of transactions on the bus at full protocol speed and of receiving data on every cycle. At a minimum speed, the design of external agents must meet the requirements of this protocol. 11.3.3.1 Fetch Miss When the processor misses in the instruction cache on a fetch, it obtains a cache line of instructions from an external agent. The processor issues a read request for the cache line and waits for an external agent to provide the data in response to this read request. 11-37 Chapter 11 TX4955 System Interface 11.3.3.2 Load Miss When the processor misses in the data cache on a load, it obtains a cache line of data from an external agent. The processor issues a read request for the cache line and waits for an external agent to provide the data in response to this read request. If the cache data which the incoming line will replace contains valid dirty data, this data is written to memory. The read request completes before the write of the dirty cast-out data because TX4955 has the write buffer. 11.3.3.3 Store Miss When the processor misses in the data cache on a store, it issues a read request to bring a cache line of data into the cache, where it is then updated with the store data. If the cache data which the incoming line will replace contains valid dirty data, the data is written to memory. The read request completes before the write of the dirty cast-out data because TX4955 has the write buffer. To guarantee that cached data written by a store is consistent with main memory, the corresponding cache line must be explicitly flushed from the cache using a cache operation. 11.3.3.4 Uncached Load or Store When the processor performs an uncached load, it issues a read request and waits for a single transfer of read response data from an external agent. When the processor performs an uncached store, it issues a write request and provides a single transfer of data to the external agent. The processor does not consolidate data on uncached writes. For example, writes of two contiguous halfwords takes two write cycles, they are never grouped into a single word write. 11.3.3.5 Cache Instructions The TX4955 processor provides a number of cache instructions for use in maintaining the state and contents of the caches. Cache operations supported in the TX4955 processor are described in Chapter 5. 11.3.3.6 Byte Ordering (Endian) The System interface byte order is set by the Endian of external pin. The byte order is big-endian when Endian is high, and little-endian when Endian is low. The RE (reverse-endian) bit in the Status register can be set by software to reverse the byte order available in User mode. 11.3.3.7 Physical Addresses Physical addresses are driven on SysAD[31:0] during address cycles. 11-38 Chapter 11 TX4955 System Interface 11.3.3.8 Interface Buses Figure 11.3.1 shows the primary communication paths for the System interface: a 32-bit address and data bus, SysAD[31:0], and a 5-bit command bus, SysCmd[4:0]. These SysAD and the SysCmd buses are bidirectional; that is, they are driven by the processor to issue a processor request, and by the external agent to issue an external request. A request through the System interface consists of: • an address • a System interface command • a series of data elements if the request is for a write or read response. TX4955 External Agent SysAD[31:0] SysCmd[4:0] Figure 11.3.1 System Interface Buses 11.3.3.9 Address and Data Cycles The SysCmd bus identifies the contents of the SysAD bus during any cycle in which it is valid. Cycles in which the SysAD bus contains a valid address are called address cycles. Cycles in which the SysAD bus contains valid data are called data cycles. The most significant bit of the SysCmd bus is always used to indicate whether the current cycle is an address cycle or a data cycle. When the TX4955 processor is driving the SysAD and SysCmd buses, the System interface is in master state. When the external agent is driving the SysAD and SysCmd buses, the System interface is in slave state. • When the processor is master, it asserts the PValid* signal when the SysAD and SysCmd buses are valid. • When the processor is slave, an external agent asserts the EValid* signal when the SysAD and SysCmd buses are valid. The SysCmd bus identifies the contents of the SysAD bus during valid cycles. • During address cycles (SysCmd[4] = 0), the remainder of the SysCmd bus, SysCmd[3:0], contains a System interface command, described in Section 11.3.18 in detail. • During data cycles (SysCmd[4] = 1), the remainder of the SysCmd bus, SysCmd[3:0], contains a data identifier, described in Section 11.3.18 in detail. 11-39 Chapter 11 TX4955 System Interface 11.3.4 System Interface Protocols Figure 11.3.2 illustrates the system interface that operates between registers. In other words, processor output is directly transferred from the output register and changes with at the rising edge of the MasterClock. Processor input is directly transferred to the input register and the input register latches these input signals at the rising edge of the MasterClock. In this way, it becomes possible for the system interface to operate at the fastest clock frequency. TX4955 Output data Input data MasterClock Figure 11.3.2 System Interface Register-to-Register Operation 11.3.4.1 Master and Slave States When the TX4955 processor is driving the SysAD and SysCmd buses, the System interface is in master state. When the external agent is driving the SysAD and SysCmd buses, the System interface is in slave state. In master state, the processor asserts the signal PValid* whenever the SysAD and SysCmd buses are valid. In slave state, the external agent asserts the signal EValid* whenever the SysAD and SysCmd buses are valid. 11.3.4.2 Moving from Master to Slave State The processor is the default master of the system interface. An external agent becomes master of the system interface through arbitration, or by default after a processor read request. The external agent returns mastership to the processor after an external request completes. The System interface remains in master state unless one of the following occurs: • The external agent issues a request, and the external agent is granted permission to use the system interface (external arbitration). • The processor issues a read request and shifts into the slave mode by itself. 11-40 Chapter 11 TX4955 System Interface 11.3.4.3 External Arbitration The System interface must be in slave state for the external agent to issue an external request through the System interface. The transition from master state to slave state is arbitrated by the processor using the System interface handshake signals EReq* and PMaster*. This transition is described by the following procedure: 1. An external agent signals that it wishes to issue an external request by asserting EReq*. 2. When the processor is ready to accept an external request, it releases the System interface from master to slave state by negating PMaster* signal for 1 cycle. 3. The System interface returns to master state as soon as the issue of the external request is complete. 11.3.4.4 Uncompelled Change to Slave State An uncompelled change to slave state is the transition of the System interface from master state to slave state, initiated by the processor itself when a processor read request is pending. PMaster* is negated automatically after a read request. An uncompelled change to slave state occurs either during or some number of cycles after the issue cycle of a read request. The uncompelled release latency depends on the state of the cache. After an uncompelled change to slave state, the processor returns to master state at the end of the next external request. This can be a read response, or some other type of external request. An external agent must note that the processor has performed an uncompelled change to slave state and begin driving the SysAD bus along with the SysCmd bus. As long as the System interface is in slave state, the external agent can begin an external request without arbitrating for the System interface; that is, without asserting EReq*. After the external request, the System interface returns to master state. 11.3.4.5 Signal Timing The System interface protocol describes the cycle-by-cycle signal transitions that occur on the pins of the system interface to realize requests between the processor and an external agent. Figure 11.3.3 shows the timing relationships between System interface signal edges. 11-41 Chapter 11 TX4955 System Interface MasterClock tDO tDH tDS SysAD SysCmd Valid output Valid Input tDO tDO PValid* PMaster* tDS tDH EValid*, EReq*, EOK*, Int*, NMI* Valid Input Note: These waveforms only describe edge-to-edge timing relationships. Figure 11.3.3 System Interface Edge Timing Relationships The Timing Summary section below describes the minimum and maximum timing values of each signal. The sections that follow describe the timing requirements for various bus cycles. 11.3.5 Timing Summary In the following timing diagrams, gray-scale signals indicate values that are either Unknown or Don’t Cares, within the specification limits. They may be any value as long they do not violate any bus value or timing specification. The timing diagrams illustrate cycles using the following signals: • PMaster* • EValid* • PValid* • EOK* • EReq* PMaster* (O) Indicates the processor is the master of the system interface bus. A Cycle B C MasterClock SysAD SysCmd Proc Data ExtAgent Data Proc Cmd ExtAgent Cmd PMaster* Figure 11.3.4 Sample Cycle with PMaster* Asserted, Then Deasserted A) Processor drives SysAD and SysCmd buses (processor is master). B) PMaster* is deasserted. SysAD and SysCmd buses are set to a tri-state (no bus master). C) External agent drives SysAD and SysCmd buses (external agent is master). 11-42 Chapter 11 TX4955 System Interface A Cycle B C MasterClock SysAD ExtAgent Data Proc Data SysCmd ExtAgent Cmd Proc Cmd PMaster* Figure 11.3.5 Sample Cycle with PMaster* Asserted A) External agent drives SysAD and SysCmd buses (external agent is master). B) SysAD and SysCmd buses are set to a tri-state (no bus master). C) PMaster* is asserted. Processor drives SysAD and SysCmd buses (processor is master). EValid* (I), PValid* (O) During a cycle in which either signal is asserted, the signal indicates a new valid address or valid data is on the SysAD bus, and a new valid command or data identifier is on the SysCmd bus. EValid* indicates an external agent is driving new SysAD and SysCmd values. PValid* indicates the processor is driving new SysAD and SysCmd values. A Cycle MasterClock SysAD Data SysCmd Cmd EValid or PValid Figure 11.3.6 Sample Cycle with PValid* and EValid* A) New SysAD and SysCmd values. Each cycle either of these signals remains asserted indicates there is a new SysAD and SysCmd value. Cycle A B Data Data Cmd Cmd MasterClock SysAD SysCmd EValid* or PValid* Figure 11.3.7 Sample Cycles with Multiple PValid* and EValid* A) New SysAD and SysCmd value. B) Another new SysAd and SysCmd value. 11-43 Chapter 11 TX4955 System Interface EOK* (I) Indicates an external agent accepts a processor request. A) EOK* is active. B) The processor asserts PValid* and drives a read or write command. EOK* is asserted and the external agent accepts the processor command. Once the external agent has accepted a processor write command, the agent must be able to accept the entire data size at the programmed data rate immediately following this command. The external agent may provide read response data to the processor at any rate. Deasserting EOK* may kill a processor read/write request in progress. If this occurs, the external agent must ignore command and data from the processor in the following cycle. A Cycle B C MasterClcok SysAD Proc Address SysCmd Pro Cmd (Rd/Wr) EOK* PValid* Figure 11.3.8 Sample Cycle with EOK* Asserted Cycle A B C D MasterClcok SysAD Proc Address Proc Data SysCmd Pro Cmd (Wr) Data Cmd EOK* PValid* Figure 11.3.9 Sample Cycle with EOK* Asserted, Then Deasserted A) EOK* is active. B) Processor asserts PValid* and drives a read or write command. EOK* is deasserted (external agent has killed the processor’s command). C) The external agent must ignore any SysAD and SysCmd data from the processor. 11-44 Chapter 11 TX4955 System Interface EReq* (I) Indicates an external agent is requesting bus ownership of the System interface. To gain mastership of the bus, an external agent must arbitrate with the processor as follows: A) External agent asserts EReq* B) Wait for PMaster* to be deasserted (1 to N cycles). C) External agent drives SysAD and SysCmd buses. The external agent is guaranteed to maintain mastership of the bus as long as EReq* is asserted. If at any time EReq* is deasserted, the external agent must go back to step A and re-arbitrate for the bus. A Cycle B C MasterClock SysAD ExtAgent Data SysCmd ExtAgent Cmd EReq* PMaster* Figure 11.3.10 Sample Cycle with EReq* Asserted From the time that EReq* is asserted, the external agent is guaranteed to gain mastership of the bus after at most one processor request. However, if EOK* is being deasserted, the external agent will gain mastership of the bus without having to accept any processor requests. The external agent relinquishes bus mastership by deasserting EReq* as shown below: Cycle A B C MasterClock SysAD ExtAgent Data Proc Data SysCmd ExtAgent Cmd Data Cmd EReq* PMaster* Figure 11.3.11 Sample Cycle with Deassertion of EReq* A) External agent deasserts EReq*. B) Bus is set to a tristate. C) Processor regains mastership of bus. 11-45 Chapter 11 TX4955 System Interface 11.3.6 Arbitration The processor is the default master of the bus. It relinquishes ownership of the bus either when an external agent requests and is granted the system interface, or until the processor issues a read request. The transition from processor master to processor slave state is arbitrated by the processor, using the System interface handshake signals EReq* and PMaster*. When a processor read request is pending, the processor transitions to slave state by deasserting PMaster*, allowing an external agent to return the read response data. The processor remains in slave state until the external agent issues an End Of Data read response, whereupon the processor reassumes mastership, signaled by the assertion of PMaster*. Note that an external agent is able to retain mastership of the bus after an End Of Data read response if the external agent arbitrates for mastership using EReq*. When the processor is master, an external agent acquires control of the system interface by asserting EReq*, and waiting for the processor to deassert PMaster*. The processor is ready to enter slave state when it deasserts PMaster*. The external agent must go through a three-step arbitration process (see the EReq* cycle in the Timing Summary) before driving the bus. Once the external agent has become master through EReq* arbitration, it can remain master as long as it continues to assert EReq*. The System interface returns to master state (with the processor driving the bus) two cycles after EReq* is deasserted. Figure 11.3.12 illustrates an arbitration for external requests. Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClcok External agent data SysAD SysCmd External agent command EReq* PMaster* Figure 11.3.12 External Request Arbitration When an external agent is master, it may always respond to a read with data. If the external agent has become master by EReq*, it may issue transactions at will; that is, the processor must always accept any command or data on the bus at any time. There is no means for the processor to hold off the external agent once the external agent is master. If the processor is in slave state and needs the bus, it waits until the external agent EReq* deasserted. Thereafter, when the processor sees EReq* deasserted, it resumes bus ownership, asserts the PMaster*, and issues its own command. The processor becomes master and drives the bus two cycles after EReq* is deasserted. The relation between processor request for bus mastership and the release of the bus mastership by the external agent is illustrated in Figure 11.3.13. 11-46 Chapter 11 TX4955 System Interface 1 Cycle 2 3 4 5 6 7 8 9 10 11 12 MasterClcok SysAD External agent data Processor address/data SysCmd External agent command Processor command PMaster* EReq* EOK* Figure 11.3.13 Processor Request For Bus Arbitration And External Agent Release Upon assertion of Reset* or ColdReset*, the processor becomes bus master and the external agent must become slave. This protocol guarantees that either the processor or an external agent is always bus master. The master should never tristate the bus, except when giving up ownership of the bus under the rules of the protocol. 11.3.7 Issuing Commands When the processor is master of the bus and wishes to issue a command, it cannot successfully issue the command until the external agent signals that it is ready to accept it. This readiness is indicated by assertion of the EOK* signal. Being master, the processor may place the command on the bus and continually reissue it while waiting for EOK* to be asserted; however, the command is not considered issued until EOK* has been asserted for two consecutive cycle (see the Timing Summary for EOK* earlier in this chapter). If the EOK* signal is asserted in one cycle and then deasserted in the next, during which time a command is issued, that command is considered killed and must be retried. When a command is killed in this way, the processor begins to execute the read/write command. This action must be ignored by the external agent. If a write command is killed, the data cycle following this killed transaction must be ignored. If a read is killed, the processor releases the bus one cycle after and (assuming no EReq*) regains mastership two cycles later. This allows the processor to retry the transaction. 11.3.8 Processor Write Request A processor write request is issued by the following: • driving a write command on the SysCmd bus • driving a write address on the SysAD bus • asserting PValid* for one cycle • driving the appropriate number of data identifiers on the SysCmd bus • driving data on the SysAD bus • asserting PValid* 11-47 Chapter 11 TX4955 System Interface For 1-to 4-byte writes, a single data cycle is used. 5-, 6- and 7-byte writes are broken up into two address/data transactions; one 4 bytes in size, the next handling the remaining 1, 2, or 3 bytes. More than 8 bytes (e.g. 8, 16, 32), 4 bytes are sent on each data cycle until the appropriate number of bytes has been transferred. The final data cycle is tagged as end of data (EOD) on the command bus. To be fully compliant with all implementations of this protocol, an external agent should be able to receive write data over any number of cycles with any number of idle cycles between any two data cycles. However, for the TX4955 processor implementation, data begins to arrive on the cycle immediately following the write issue cycle, and continues to arrive at a programmed data rate thereafter. The processor drives data at the rate specified by the data rate configuration signals (see the section describing Data Rate Control, later in this chapter). Writes may be cancelled and retried with the EOK* signal (see the section earlier, Issuing Commands). Figure 11.3.14 illustrates the bus transactions for a 4-word data cache block store. 1 Cycle 2 3 4 5 6 7 8 9 10 11 12 MasterClock SysAD Addr Data 0 Data 1 Data 2 Data 3 SysCmd Write Data Data Data EOD PValid* PMaster* EOK* Figure 11.3.14 Processor Block Write Request With D Data Rate Figure 11.3.15 illustrates a write request which is cancelled by the deassertion of EOK* during the address cycle of the second write, and which is retried when EOK* is asserted again. Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClock SysAD SysCmd Addr 0 Data 0 Addr 1 Data 1 Addr 1 Data 1 Write EOD Write EOD Write EOD PValid* PMaster* EOK* Figure 11.3.15 Processor Single Write Request Followed By A Cancelled And Retried Write Request 11-48 Chapter 11 TX4955 System Interface 11.3.9 Processor Read Request A processor read request is issued by the following: • driving a read command on the SysCmd bus • driving a read address on the SysAD bus • asserting PValid* Only one processor read request may be pending at a time. The processor must wait for an external read response before starting a subsequent read. The processor moves to slave state after the issue cycle of the read request, by deasserting the PMaster* signal. An external agent may then return the requested data through a read response. The external agent, which is now bus master, may issue any number of writes before sending the read response data. An example of a processor read request and an uncompelled change to slave state occurring as the read request is issued is illustrated in Figure 11.3.16. Master 1 Cycle 2 Slave 3 4 5 6 7 8 9 10 11 12 MasterClock Addr SysAD SysCmd Read Pvalid* PMaster* EOK* Figure 11.3.16 Processor Read Request The TX4955 support the Read Time Out Function. This function is to detect a time out error when response data are not returned within a certain time. See chapter 11.3.20 Mode Register of System Interface (G2SConfig). 11.3.10 External Write Request External write requests are similar to a processor single write except that the signal EValid* is asserted instead of the signal PValid*. An external write request consists of the following: • an external agent driving a write command on the SysCmd bus and a write address on the SysAD bus • asserting EValid* for one cycle • driving a data identifier on the SysCmd bus and data on the SysAD bus • asserting EValid* for one cycle. The data identifier associated with the data cycle must contain a last data cycle indication. Note that the external agent must gain and maintain bus mastership during these transactions (see EReq* in the Timing Summary, earlier in this chapter). An external write request example with the processor initially in master state is illustrated in Figure 11.3.17. 11-49 Chapter 11 TX4955 System Interface 1 Cycle 2 3 4 5 6 7 Addr Data 8 9 10 11 12 MasterClcok SysAD Write EOD SysCmd PValid* PMaster* EValid* EReq* Figure 11.3.17 External Write Request An example of a read response for a processor single word read request that is interrupted by an external agent write request is illustrated in Figure 11.3.21. External writes can not occur in the middle of a data response block; they can, however, occur before the first data response of the data block or after the last EOD response, but it can not occur between them. Note: The only writable resources are processor interrupts. An external write to any address is treated as a write to the processor interrupts. 11-50 Chapter 11 TX4955 System Interface 11.3.11 External Read Response An external agent returns data to the processor in response to a processor read request by waiting for the processor to move to slave state. The external agent then returns the data through either a single data cycle or a series of data cycles sufficient to transmit the requested data. After the last data cycle is issued, the read response is complete and the processor becomes master (assuming EReq* was not asserted). If, at the end of the read response cycles, EReq* has been asserted, the processor remains in slave state until the external agent relinquishes the bus. When the processor is in slave state and needs access to the SysAD bus, it waits until EReq* is deasserted. The data identifier associated with a data cycle may indicate that the data transmitted during that cycle is erroneous; however, an external agent must return a block of data of the correct size regardless of this erroneous data cycle indication. If a read response includes one or more erroneous data cycles, the processor takes a bus error. Read response data must only be delivered to the processor when a processor read request is pending. The state of the processor is undefined if a read response is presented to it when no processor read is pending. An example of a processor single read request followed by a read response is illustrated in Figure 11.3.18. Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClock SysAD Addr Data SysCmd Read EOD PValid PMaster EOK EValid Figure 11.3.18 Single Read Request Followed By Read Response A read response example for a processor block read with the system interface already in slave state is illustrated in Figure 11.3.19. Cycle 1 2 3 4 10 11 12 13 14 15 MasterClcok SysAD SysCmd Data 0 Data 1 Data Data Data 7 EOD PValid* PMaster* EValid* Figure 11.3.19 Block Read Response, System Interface Already In Slave State 11-51 16 Chapter 11 TX4955 System Interface A read response example for a processor single read request followed by an external agent write request is illustrated in Figure 11.3.20. Cycle 1 2 3 4 5 6 7 8 Data 9 10 11 12 MasterClock SysAD Addr Data Addr SysCmd Read EOD Write EOD PValid* PMaster* EOK* EValid* EReq* Figure 11.3.20 Single Read Request Followed By External Write Request (External Agent Keeps Bus) An example of a read response for a processor single word read request that is interrupted by an external agent write request is illustrated in Figure 11.3.21. Cycle 5 is the data for the external write request in cycle 4. Cycle 7 is the read response data. Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClcok SysAD Addr Addr Data Data SysCmd Read Write EOD EOD PValid* PMaster* EOK* EValid* Figure 11.3.21 External Write Followed By External Read Response, System Interface In Slave State 11-52 Chapter 11 TX4955 System Interface 11.3.12 Flow Control EOK* may be used by an external agent to control the flow of processor read and write requests; while EOK* is deasserted the processor will repeat the current address cycle until an external agent signals it is ready, by asserting EOK*. There is a one cycle delay from the assertion of EOK* to the state in which the Read/Write command becomes valid. EOK* must be asserted for two consecutive cycles for the command issue completion. Examples of EOK* use are given in Figure 11.3.22 and Figure 11.3.23. Cycle 1 2 3 4 5 6 7 8 9 10 11 12 10 11 12 MasterClcok SysAD Addr SysCmd Read PValid* PMaster* EOK* Figure 11.3.22 Delayed Processor Read Request Cycle 1 2 3 4 5 6 7 8 9 MasterClcok SysAD Addr0 Data Addr1 Data SysCmd Write EOD Write EOD PValid* PMaster* EOK* Figure 11.3.23 Two Processor Write Requests, Second Write Delayed 11-53 Chapter 11 TX4955 System Interface 11.3.13 Data Rate Control The System interface supports a maximum data rate of one word per cycle, and an external agent may deliver data to the processor at this maximum data rate. The rate at which data is delivered to the processor can be controlled by the external agent by driving data and asserting EValid* only when it wants data to be available. The processor interprets cycles as valid data cycles when EValid* is asserted and the SysCmd bus contains a data identifier. The processor continues to accept data until the end of data (EOD) indicator is received. The rate at which the processor transmits data to an external agent is programmed in the WBRATE field in G2S Config register. Data patterns are specified using the letters W and x (W indicates a word size data cycle and x indicates an unused, or idle, cycle). A data pattern is specified as a sequence of data and unused cycles that will be repeated to provide the appropriate number of data cycles for a given transfer. For example, a data pattern of WWxx indicates a data rate of two words every four cycles. The TX4955 supports two data rates, W and Wxx. During a cycle indicated by an x, the processor continues to hold the same data as the previous cycle. A processor block write request for two words with Wxx pattern is illustrated in Figure 11.3.24; this transaction results from a store doubleword instruction. Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClock SysAD Addr Data 0 Data 0 Data 0 Data 1 Data 1 Data 1 Data 2 Data 2 Data 2 SysCmd Write Data Data Data PValid* PMaster* EOK* Figure 11.3.24 Processor Block Write Request With Wxx Data Rate 11-54 Chapter 11 TX4955 System Interface 11.3.14 Consecutive SysAD Bus Transactions The following figures (Figure 11.3.25 to Figure 11.3.28) illustrate the minimum cycles required between consecutive bus transactions. Cycle 1 2 3 4 5 6 7 8 9 10 11 MasterClock SysAD Addr0 Data Addr1 Data 0 Data 1 Data 2 Data 3 SysCmd Read EOD Write Data Data Data EOD PValid* PMaster* EOK* EValid* Figure 11.3.25 Processor Single Word Read Followed By Block Write Request Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClock SysAD Addr0 Data Addr1 Data Addr2 Data SysCmd Write EOD Write EOD Write EOD PValid* PMaster* EOK* Figure 11.3.26 Consecutive Processor Single Word Write Requests With D Data Rate Cycle 1 2 3 4 5 6 7 8 9 10 Data Data 11 12 MasterClock SysAD Addr0 Data SysCmd Write EOD Data Data Addr1 Data Write EOD PValid* PMaster* EOK* Figure 11.3.27 Consecutive Processor Single Word Write Requests With Wxx Data Rate 11-55 Chapter 11 TX4955 System Interface Cycle 1 2 3 4 5 6 7 8 9 10 11 MasterClock SysAD Addr0 Data Addr1 Data Addr Data SysCmd Write Write EOD EOD Write EOD PValid* PMaster* EOK* EValid* EReq* Figure 11.3.28 Consecutive Processor Write Requests Followed By External Write Request Block Read Maximum Rate Maximum block reads can occur with the following data rate: AxW...WxAxW...W (1 cycle between W and A) where A is the address, W is a word data (four words, or WWWW, in the data cache miss, and 8 words, or WWWWWWWW, in an instruction cache miss), and x is an idle cycle. (When 1 bit of the Mode Register of System Interface (G2SConfig[1]) is set to 1, then 8 words or WWWWWWWW burst read can occur in an data cache miss.) Back-to-Back Instruction Cache Misses With a CPUCLK to MasterClock ratio of 2:1, back-to-back instruction cache misses can be refilled with the following data rate: AxWWWWWWWWxxxxxxAxWWWWWWWW (6 cycles between W and A) That is, the address is followed by an idle cycle, the instruction is executed, six idle cycles occur, followed by the next address. This pattern is valid for the case in which two sequential instructions miss in the instruction cache, each instruction residing on a different cache line. Running completely in uncached space (every instruction is uncached and a cache miss) results in a similar data pattern: AxWxxxxxxAxW (6 cycles between W and A) Back-to-Back Uncached Loads With a CPUCLK to MasterClock ratio of 2:1, back-to-back uncached doubleword data loads have the following data rate: AxWWxxxxxxAxWW (6 cycles between W and A) That is, the address is followed by an idle cycle, a doubleword data (two words data), six idle cycles, and the next address. With a CPUCLK to MasterClock ratio of 2:1, back-to-back uncached word data loads have the following data rate: AxWxxxxxxAxW (6 cycles between W and A) That is, the address is followed by an idle cycle, a word data, six idle cycles, and the next address. 11-56 Chapter 11 TX4955 System Interface 11.3.15 Starvation and Deadlock Avoidance Careful use of the EReq* signal allows a system to avoid starvation and deadlock situations. Whenever an external agent needs the bus, it can request the bus by asserting EReq*. The external agent is guaranteed to gain mastership of the bus after accepting at most one read/write request from the processor. If the external agent also deasserts EOK*, it is guaranteed to gain mastership of the bus without accepting any read/write request from the processor. The external agent can allow the processor to gain bus mastership, perform one read/write request and then relinquish mastership by the following sequence of actions: 1. deassert EReq* 2. assert EReq* 3. arbitrate for the bus while asserting EOK* The minimum deassertion of EReq* can be one cycle in length. Shows an external agent relinquishing the bus to allow a single read/write request from the processor. The external agent must be ready to accept this request by keeping EOK* asserted, otherwise the read/write request is held off or killed and the processor relinquishes bus mastership without extending a request. This could lead to starvation of the processor. Cycle 1 2 3 4 5 6 7 8 9 10 11 MasterClock SysAD Addr SysCmd Write Data 0 Data 1 Data EOD PMaster* EReq* EOK* PValid* Figure 11.3.29 External Agent Gives Up Bus for One Processor Request 11.3.16 Discarding and Re-Executing Read Command Figure 11.3.30 illustrates how a processor single read request is discarded and reexecuted. The following sequence describes the protocol. • Because the EOK* signal is low in cycle 5, the processor tries to issue an address (cycle 6). • If the EOK* signal is high at this point, the processor discards this read request and enters the slave status in the next cycle. • Because the EReq* signal is inactive, the processor returns to the master status again and reissues a read request. Because the EOK* signal is low in both the cycles 7 and 8, the issuance cycle of the read request is determined. • The external agent outputs data at the requested address. 11-57 Chapter 11 TX4955 System Interface Cycle 1 2 3 4 5 6 7 8 9 10 11 12 MasterClock SysAD[31:0] Addr SysCmd[4:0] Read Hi-Z Hi-Z Addr Data Hi-Z Hi-Z Data EOD Hi-Z Hi-Z PMaster* EReq* EOK* PValid* EValid* Figure 11.3.30 Discarding and Re-executing Processor Single Read Request 11.3.17 Multiple Drivers on the SysAD Bus In most applications, the SysAD bus is a point-to-point connection between the processor and a bidirectional, registered transceiver located in an external agent. In this application, the SysAD bus has two possible drivers: the processor and the external agent. However, an application may add additional drivers and receivers to the SysAD bus, allowing transmissions over the SysAD bus that bypass the processor. To accomplish this, the external agent(s) must coordinate its use of the SysAD bus by using arbitration handshake signals such as EReq* and PMaster*. To implement an independent transmission on the SysAD bus that does not involve the processor, the system executes the following sequence of actions: 1. The external agent(s) requests the SysAD bus by asserting EReq*. 2. The processor releases the System interface to slave state. 3. The external agent(s) allows independent transmission over the SysAD bus, making certain the EValid* input to the processor is not asserted while the transmission occurs. 4. When the transmission is complete, the external agent(s) deasserts EReq* to return the system interface to master state. To implement multiple drivers, separate Valid lines are required for non-processor chips to communicate. 11-58 Chapter 11 TX4955 System Interface 11.3.18 Signal Codes System interface commands and data identifiers are encoded in five bits on the SysCmd bus and transmitted between the processor and external agent during address and data cycles. • When SysCmd[4] is a 0, the current cycle is an address cycle and SysCmd[3:0] contains a command. • When SysCmd[4] is a 1, the current cycle is a data cycle and SysCmd[3:0] identifies data. For commands and data identifiers associated with external requests, all bits and fields have a value or a suggested value. For System interface commands and data identifiers associated with processor requests, reserved bits and reserved fields in the command or data identifier are undefined, except where noted. For all System interface commands, the SysCmd bus specifies the system interface request type. The encoding of SysCmd[4] for system interface commands is Table 11.3.3. Table 11.3.3 Encoding of System Interface Commands in SysCmd[4] SysCmd[4] Command 0 Address Cycle 1 Data Cycle For address requests, the remainder of the SysCmd bus specifies the attributes of the address request, as follows: • SysCmd[3] encodes the address request type. • SysCmd[2:0] indicates the size of the address requests. The encoding of SysCmd[3:2] for address requests is shown in Table 11.3.4. Table 11.3.4 Encoding of SysCmd[3] and SysCmd[2] for Address Cycle SysCmd[3] Command SysCmd[2] Request Size 0 Read Request 0 Single data 1 Write Request 1 Block data Note: TX4955 support only External Single data write request. The encoding of SysCmd[1:0] for block or single address requests is shown in Table 11.3.5 and Table 11.3.6, respectively. Table 11.3.5 Encoding of SysCmd[1:0] for Block Address Requests SysCmd[1:0] Block Size 0 Reserved 1 Four words (only Data cache) 2 Eight words 3 Reserved 11-59 Chapter 11 TX4955 System Interface Table 11.3.6 Encoding of SysCmd[1:0] for Single Address Requests SysCmd[1:0] Data size 0 One byte valid (byte) 1 Two bytes valid (halfword). 2 Three bytes valid (tribyte). 3 Four bytes valid (single word) The encoding of SysCmd[3:0] for processor data identifiers is described in Table 11.3.7. The encoding of SysCmd[3:0] for external data identifiers is illustrated in Table 11.3.8. Table 11.3.7 Encoding of SysCmd[3:0] for Processor Data Identifiers SysCmd[3] Last Data Element Indication 0 Last data element 1 Not the last data element SysCmd[2] SysCmd[1] Reserved Reserved for: Good Data Indication Processor drives 0 (Data is error free) SysCmd[0] Reserved for: Data Checking Enable Processor drives 1 (Disable data checking) Table 11.3.8 Encoding of SysCmd[3:0] for External Data Identifiers SysCmd[3] Last Data Element Indication 0 Last data element s1 Not the last data element SysCmd[2] Response Data Indication 0 Data is response data 1 Data is not response data SysCmd[1] Good Data Indication 0 Data is error free 1 Data is erroneous SysCmd[0] Reserved for: Data Checking Enable Processor ignores this field (Suggested drive of 1, disable data checking) Note: External read requests for processor resources are not supported in the TX4955 processor. 11-60 Chapter 11 TX4955 System Interface 11.3.19 Physical Addresses Physical addresses are driven on all 32 bits (bits 31 through 0) of the SysAD bus during address cycles. Addresses associated with single read and write requests are aligned for the size of the data element; specifically, for single word requests, the low order two bits of the address are zero, for halfword requests, the low order bit of the address is zero. For byte and tribyte requests, the address provided is a byte address. External agents returning read response data must support subblock ordering. Addresses associated with block read requests are aligned to the word of the desired data. The order in which data is returned in response to a processor block read request is: • the word containing the addressed data word is returned first • the remaining word(s) in the block are returned next, sequentially Block writes are always block aligned. 11.3.20 Mode Register of System Interface (G2SConfig) The Mode Register of System Interface (G2SConfig) is a read/write register. This register is used to specify system interface functions and modes of R4300 type protocol. This register is only WORD-Access. Table 11.3.9 G2SConfig Address Field Name Description 0xF_FF10_0000 G2SConfig Mode Register of System Interface 31 20 19 4 Reserved TOutVal 3 2 1 0 TOutEnable Reserved=0 BURST8 WBRATE Figure 11.3.31 G2SConfig Register Format Table 11.3.10 G2SConfig Register Formats (MODE43* = 0) Bit(s) Field Name 31:20 ⎯ 19:4 TOutVal 3 TOutEnable Description Reserved Set Data of Read Time Out Counter When the Read Time Out Counter function is used, the value should be more than {24+(wait cycles of main memory) × 2}. When the Read Time Out Counter function is not used, 0xffff must be set Enable bit of Read Time Out Counter 0: Disable (Please set 0xffff in TOutVal) 1: Enable Cold Reset Read/Write Undefined Read 0xffff Read/Write 0 Read/Write 2 ⎯ 1 BURST8 Data Formats at 8-word burst write 0: Double burst mode(4 words burst write × 2) 1: Single burst mode(8 words burst write × 1) 0 Read/Write 0 WBRATE Set bit of Data Out Formats 0: Every cycle Data Out(WWWW) 1: 4-word Data Out per 12 cycles(WxxWxxWxxWxx) 0 Read/Write Reserved Undefined 11-61 Chapter 11 TX4955 System Interface 11.3.21 Read Time Out Counter (MODE43* = 0) This counter is used to detect time-out when data is not returned during read. The counter normally is set by loading the G2SConfig register’s TOutVal as its initial value. When one of the conditions below is met, the counter counts down one every bus cycle and upon reaching the terminal count of 0, generates a time-out signal and asserts a bus error signal for one cycle before entering an idle state. If none of the following conditions is met, the value of TOutVal is reloaded into the counter. • TOutEnable = 1 • Waiting for data 11-62 Chapter 12 TX4955 Processor Interrupts 12. TX4955 Processor Interrupts Five types of interrupt are available on the TX4955. These are: 1. one non-maskable interrupt, NMI 2. six external interrupts 3. seven interrupts by external write through SysAD[6:0] 4. two software interrupts 5. one timer interrupt Figure 12.1.1 shows TX4955 interrupt control circuit. Software Interrupts Nonmaskable Interrupt (Buffer) NMI* Int0* Int1* Int2* Int3* Int4* Int5* External Interrupts NMI 15 SysAD 0 1 2 3 4 5 Interrupts by external write through SysAD[6:0] 6 IP7 H: INT5* /SysAD[5] L: Timer Interrupt Interrupt Register 0 1 2 3 4 8 IP6 IP5 IP4 IP3 IP2 IP1 IP0 Cause Register[15:8] H L 5 6 8 16 Status Register[15:8] 17 15 18 IM7 1 8 IM6 IM5 IM4 IM3 IM2 IM1 IM0 19 20 TX4955 Interrupt 1 8 21 22 Timer Interrupt AND-OR function Tint Dis Note: Status Register[0] IE Status Register[1] EXL Status Register[2] ERL AND function Interrupt register can be accessed by external write requeset through system interface. Please see Chapter 11, “TX4955 System interface” in detail. Figure 12.1.1 TX4955 Interrupt Control Circuit 12-1 Chapter 12 TX4955 Processor Interrupts 12.1 Nonmaskable Interrupt The non-maskable interrupt is signaled by asserting the NMI* pin (low), forcing the processor to branch to the Reset Exception vector. This pin is latched into an internal register by the rising edge of MasterClock, as shown in Figure 12.1.1. An NMI can also be set by an external write through the SysAD bus. On the data cycle, SysAD[22] pin acts as the write enable for SysAD[6] pin, which is the value to be written as the interrupt. NMI only takes effect when the processor pipeline is running. Thus NMI can be used to recover the processor from a software hang (for example, in an infinite loop) but cannot be used to recover the processor from a hardware hang (for example, no read response from an external agent). NMI cannot cause drive contention on the SysAD bus and no reset of external agents is required. This interrupt cannot be masked. The NMI* pin is latched by the rising edge of MasterClock. Figure 12.1.1 shows the internal derivation of the NMI signal. The NMI* pin is latched into an internal register by the rising edge of MasterClock. Bit 6 of the Interrupt register (means the interrupt by SysAD[6]) pin is then ORed with the inverted value of NMI* to form the non-maskable interrupt. 12.2 External Interrupts External interrupts are set by asserting the external interrupt pins Int[5:0]*. When external interrupts occur, bits 15-10 of the Cause register (IP7-IP2) is set to 1, corresponding to Int[5:0]* pins respectively shown as Figure 12.1.1. The external interrupt by Int5* pin and Timer Interrupt are selectable by TintDis pin. When TintDis is asserted (High), then the external interrupt by Int5* is selected. And when TintDis is deasserted (Low), then Timer Interrupt is selected. 12.3 Interrupts by External Write Through SysAD[6:0] These interrupts are signaled by driving the SysAD[6:0] pins to Low during the data cycle. And the SysAD[22:16] pins act as the write enables for the SysAD[6:0] respectively. External write to the CPU writes to the Interrupt register located in the system interfcace. During a data cycle, SysAD[22:16] pins acts as the write enables for the seven individual Interrupt register bits and SysAD[6:0] pins are the values to be written into these bits. This allows any subset of the Interrupt register to be set or cleared with a single write request. Bits 4-0 of the Interrupt register are bit-wise ORed with the current value of the interrupt pins Int[4:0]* and the result is directly set to bits 14-10 of the Cause register (IP6-IP2). Bit 5 of the Interrupt register (means SysAD[5] pin) is ORed with the current value of the external interrupt pin Int[5]*. When TintDis is asserted (High), this ORed signal is selected. And when TintDis is deasserted (Low), then the Timer Interrupt is selected. The result is set to bit 15 of the Cause register (IP7). The interrupt by SysAD[6] pin is ORed with the inverted value of NMI* pin to form the non-maskable interrupt. 12.4 Software Interrupt Software interrupts use bits 1 and 0 of the interrupt pending, IP, field in the Cause register. These may be written by software, but there is no hardware mechanism to set or clear these bits. 12-2 Chapter 12 TX4955 Processor Interrupts 12.5 Timer Interrupt When the Timer Interrupt occurs, the bit 15 of Cause register is set to 1, which is bit 7 of the interrupt pending, IP, filed in the Cause register. Bit5 of the Interrupt register (means SysAD[5] pin) is ORed with the current value of the external interrupt pin Int[5]*. When TintDis is asserted (High), this ORed signal is selected. And when TintDis is deasserted (Low), then the Timer Interrupt is selected. The result is set to bit 15 of the Cause Register (IP7). 12.6 Masking of the TX4955 Interrupts Figure 12.1.1 also shows the masking of the processor interrupt signals. Bits 15-8 of the Cause register (IP7-IP0) are AND-ORed with Bits 15-8 of the Status register (IM7-IM0) to mask individual interrupts. Bit 0 of the Status register (IE) is a global Interrupt Enable. It is ANDed with the output of the AND-OR logic to produce the processor interrupt signal. Bit 1 and 2 of the Status register (EXL and ERL) also enable these interrupts. 12.7 Recognition of the Processor Interrupts The results of the processor interrupts directly readable as bits 15-8 of the Cause register. If any interrupts are occurred, the processor software needs to read the Cause register to recognize what type of interrupts is occurred. 12-3 Chapter 12 TX4955 Processor Interrupts 12-4 Chapter 13 Power-Saving Modes 13. Power-Saving Modes The TX4955 has these power-saving modes: • Halt mode • Doze mode The TX4955 enters neither Halt nor Doze mode by just programming the Config register. The WAIT instruction puts the TX4955 in Halt or Doze mode. 13.1 Halt Mode The Halt mode reduces power consumption by halting the TX4955 almost altogether. In Halt mode, the internal clocks of the TX49/H4 core within the TX4955 are partially stopped. If the HALT bit in the Config register is cleared, executing the WAIT instruction in Normal Operation mode causes the TX4955 to enter Halt mode. When the TX4955 enters Halt mode, the HALTDOZE signal is asserted. Even when an external agent has ownership of the SysAD bus, executing the WAIT instruction puts the TX4955 in Halt mode, but the HALTDOZE signal is asserted after the current bus cycle is completed. If the on-chip write buffer has any store information, the WAIT instruction puts the TX4955 in Halt mode after it is emptied. Assertion of Int[5:0]* signal, NMI* signal, ColdReset* signal or Reset* signal brings the TX4955 out of Halt mode. The TX4955 recognizes the Int[5:0]* signal inputs, irrespective of the settings of the IntMask bits in the Status register. On a return from Halt mode by NMI* signal, ColdReset* signal, Reset* signal or not masked Int[5:0]* signals, the TX4955 takes a corresponding exception. At this time, the EPC register points to the address of the instruction following the WAIT instruction. When the TX4955 is taken out of Halt mode as the result of a masked Int[5:0]* signal, processing resumes from the instruction following the one that was being executed when the TX4955 went into Halt mode. 13.2 Doze Mode The Doze mode is also a software-controlled feature that reduces power consumption of the TX4955. In Doze mode, the CPU pipeline status is retained and the internal clocks of the TX4955 are not stopped. If the HALT bit in the Config register is set, executing the WAIT instruction causes the TX4955 to enter Doze mode. When the TX4955 enters Doze mode, the HALTDOZE signal is asserted. Even when an external agent has ownership of the SysAD bus, executing the WAIT instruction puts the TX4955 in Doze mode, but the HALTDOZE signal is asserted after the current bus cycle is completed. If the on-chip write buffer has any store information, the WAIT instruction puts the TX4955 in Doze mode after it is emptied. Assertion of Int[5:0]* signal, NMI* signal, ColdReset* signal or Reset* signal brings the TX4955 out of Doze mode. The TX4955 recognizes the Int[5:0]* signal inputs, irrespective of the settings of the IntMask bits in the Status register. On a return from Doze mode by NMI* signal, ColdReset* signal, Reset* signal or not masked Int[3:0]* signal, the TX4955 takes a corresponding exception. At this time, the EPC register points to the address of the instruction following the WAIT instruction. When the TX4955 is taken out of Doze mode as the result of a masked Int[5:0]* signal, processing resumes from the instruction following the one that was being executed when the TX4955 went into Doze mode. 13-1 Chapter 13 Power-Saving Modes 13.3 Status Shifts Figure 13.3.1 shows the status shifts in the operation mode of the TX4955. Power-On-Reset HALT bit = 0 & WAIT inst. HALT bit = 1 & WAIT inst Norma Operation Mode Halt Mode any of Int[5:0]* is set to 0 or NMI* = 0 or ColdReset* = 0 or Reset* = 0 Doze Mode any of Int[5:0]* is set to 0 or NMI* = 0 or ColdReset* = 0 or Reset* = 0 Figure 13.3.1 Status Shift Among Normal Operation Mode and Low Power Consumption Modes When operation status shifts from the normal operation mode to the halt mode, it is returned to the normal operation mode by an interrupt or a reset. Similarly, when it shifts from the normal operation mode to the doze mode, it is returned to the normal operation mode by an interrupt or a reset. After a reset, the TX4955 is initialized to the normal operation mode. 13-2 Chapter 14 JTAG Interface 14. JTAG Interface The TX4955 processor provides a boundary-scan interface that is compatible with Joint Test Action Group (JTAG) specifications, using the industry-standard JTAG protocol (IEEE Standard 1149.1/D6). This chapter describes that interface, including descriptions of boundary scanning, the pins and signals used by the interface, and the Test Access Port (TAP). Note: When performing a JTAG operation, be sure to run the MasterClock before and after a reset operation to properly release the processor reset. 14.1 What Boundary Scanning Is With the evolution of ever-denser integrated circuits (ICs), surface-mounted devices, double-sided component mounting on printed-circuit boards (PCBs), and buried vias, in-circuit tests that depend upon making physical contact with internal board and chip connections have become more and more difficult to use. The greater complexity of ICs has also meant that tests to fully exercise these chips have become much larger and more difficult to write. One solution to this difficulty has been the development of boundary-scan circuits. A boundary-scan circuit is a series of shift register cells placed between each pin and the internal circuitry of the IC to which the pin is connected, as shown in Figure 14.1.1. Normally, these boundary-scan cells are bypassed; when the IC enters test mode, however, the scan cells can be directed by the test program to pass data along the shift register path and perform various diagnostic tests. To accomplish this, the tests use the four signals described in the next section: JTDI, JTDO, JTMS, JTCK, and TRST*. Integrated Circuit IC package pin Boundary-scan cells Figure 14.1.1 JTAG Boundary-scan Cells 14-1 Chapter 14 JTAG Interface 14.2 Signal Summary The JTAG interface signals are listed below and shown in Figure 14.2.1. • JTDI JTAG serial data in • JTDO JTAG serial data out • JTMS JTAG test mode select • JTCK JTAG serial clock input • TRST* JTAG test reset input 31 0 Device Identification register 7 0 Instruction register JTDI pin 0 JTDO pin TAP Controller Bypass register JTMS pin 86(TMPR4955B) 235(TMPR4955C) 0 JTCK pin Boundary-scan register TRST* pin Figure 14.2.1 JTAG Interface Signals and Registers The JTAG boundary-scan mechanism (referred to in this chapter as JTAG mechanism) allows testing of the connections between the processor, the printed circuit board to which it is attached, and the other components on the circuit board. The JTAG mechanism does not provide any capability for testing the processor itself. 14-2 Chapter 14 JTAG Interface 14.3 JTAG Controller and Registers The processor contains the following JTAG controller and registers: • Instruction register • Boundary-scan register • Bypass register • Device ID Code register • Test Access Port (TAP) controller The basic operation of JTAG is for the TAP controller state machine to monitor the JTMS input signal. When it occurs, the TAP controller determines the test functionality to be implemented. This includes either loading the JTAG instruction register (IR), or beginning a serial data scan through a data register (DR), listed in Table 14.3.1. As the data is scanned in, the state of the JTMS pin signals each new data word, and indicates the end of the data stream. The data register to be selected is determined by the contents of the Instruction register. 14.3.1 Instruction Register The JTAG Instruction register includes eight shift register-based cells; this register is used to select the test to be performed and/or the test data register to be accessed. As listed in Table 14.3.1, this encoding selects either the Boundary-scan register or the Bypass register or Device Identification register. Table 14.3.1 JTAG Instruction Register Bit Encoding Instruction Code (MSB → LSB) Instruction Selected Data Register 00000000(0x00) EXTEST Boundary-scan register 00000001(0x01) SAMPLE/PRELOAD Boundary-scan register 00000010(0x02) Reserved Reserved 00000011(0x03) IDCODE Device Identification register 00000100 to 01111111 Reserved Reserved 10000000 to 11111110 Debug Support Unit Please refer DSU section 11111111(0xFF) BYPASS Bypass register Figure 14.3.1 shows the format of the Instruction register. 7 6 5 4 3 2 1 MSB 0 LSB Figure 14.3.1 Instruction Register The instruction code is shifted out to the Instruction register from the LSB. MSB LSB JTDI JTDO Figure 14.3.2 Instruction Register Shift Direction 14-3 Chapter 14 JTAG Interface 14.3.2 Bypass Register The Bypass register is 1 bit wide. When the TAP controller is in the Shift-DR (Bypass) state, the data on the JTDI pin is shifted into the Bypass register, and the Bypass register output shifts to the JTDO output pin. In essence, the Bypass register is a short-circuit which allows bypassing of board-level devices, in the serial boundary-scan chain, which are not required for a specific test. The logical location of the Bypass register in the boundary-scan chain is shown in Figure 14.3.3. Use of the Bypass register speeds up access to boundary-scan registers in those ICs that remain active in the board-level test datapath. JTDI Board input JTDO JTDO Board output Bypass register JTDI JTDO JTDI JTDI JTDO JTDI JTDO Boundary-scan register pad cell IC package Board Figure 14.3.3 Bypass Register Operation 14-4 Chapter 14 JTAG Interface 14.3.3 Boundary-Scan Register(BSR) Table 14.3.2 and Table 14.3.3 show the boundary scan order of the processor signals. Table 14.3.2 TMPR4955B JTAG Boundary-Scan Ordering [JTDI] 1: SysEN1 2: SysEN2 3: SysEN3 4: SysEN4 5: BufSel[1] 6: SysAD[4] 7: SysAD[5] 8: SysAD[6] 9: SysAD[7] 10: SysAD[8] 11: SysAD[9] 12: SysAD[10] 13: SysAD[11] 14: SysAD[12] 15: SysAD[13] 16: SysAD[14] 17: SysAD[15] 18: BufSel[0] 19: PCST[3] 20: PCST[2] 21: PCST[1] 22: PCST[0] 23: RdRdy* 24: WrRdy* 25: ValidIn* 26: ValidOut* 27: Release* 28: PLLReset* 29: TintDis 30: SysCmd[0] 31: SysCmd[1] 32: SysCmd[2] 33: SysCmd[3] 34: SysCmd[4] 35: SysCmd[5] 36: SysCmd[6] 37: SysCmd[7] 38: SysCmd[8] 39: SysCmdP 40: HALTDOZE 41: Int[0]* 42: Int[1]* 43: Int[2]* 44: Int[3]* 45: Int[4]* 46: Int[5]* 47: TPC[3] 48: TPC[2] 49: TPC[1] 50: DCLK 51: NMI* 52: ExtRqst* 53: Reset* 54: ColdReset* 55: Endian 56: SysAD[16] 57: SysAD[17] 58: SysAD[18] 59: SysAD[19] 60: SysAD[20] 61: SysAD[21] 62: SysAD[22] 63: SysAD[23] 64: SysAD[24] 65: SysAD[25] 66: SysAD[26] 67: SysAD[27] 68: MODE43* 69: DivMode[1] 70: DivMode[0] 71: SysAD[28] 72: SysAD[29] 73: SysAD[30] 74: SysAD[31] 75: SysADC[2] 76: SysADC[3] 77: SysADC[0] 78: SysADC[1] 79: SysAD[0] 80: SysAD[1] 81: SysAD[2] 82: SysAD[3] 83: PCST[8] 84: PCST[7] 85: PCST[6] 86: PCST[5] 87: PCST[4] [JTDO] Note: MasterClock and DivMode[2] do not support scan registers. ColdReset*, Reset* , BufSel[0] and BufSel[1] signals are handled as internal signals. 14-5 Chapter 14 JTAG Interface Table 14.3.3 TMPR4955C JTAG Boundary-Scan Ordering [JTDI] 1: BufSel 2: internal pad 3: internal pad 4: internal pad 5: internal pad 6: internal pad 7: internal pad 8: internal pad 9: internal pad 10: internal pad 11: SysAD[4] in 12: SysAD[4] out 13: SysAD[5] in 14: SysAD[5] out 15: SysEN1 16: SysAD[6] in 17: SysAD[6] out 18: SysAD[7] in 19: SysAD[7] out 20: SysAD[8] in 21: SysAD[8] out 22: SysAD[9] in 23: SysAD[9] out 24: SysEN2 25: SysAD[10] in 26: SysAD[10] out 27: SysAD[11] in 28: SysAD[11] out 29: SysAD[12] in 30: SysAD[12] out 31: SysAD[13] in 32: SysAD[13] out 33: SysEN3 34: SysAD[14] in 35: SysAD[14] out 36: internal pad 37: internal pad 38: SysAD[15] in 39: SysAD[15] out 40: internal pad 41: internal pad 42: internal pad 43: internal pad 44: internal pad 45: PCST[3] 46: PCST[2] in 47: PCST[2] out 48: internal pad 49: internal pad 50: SysEN4 51: PCST[1] in 52: PCST[1] out 53: PCST[0] in 54: PCST[0] out 55: internal pad 56: internal pad 57: internal pad 58: internal pad 59: internal pad 60: internal pad 61: internal pad 62: RdRdy* 63: WrRdy* 64: internal pad 65: internal pad 66: internal pad 67: ValidIn* 68: ValidOut* 69: internal pad 70: internal pad 71: Release* 72: internal pad 73: PLLReset* 74: TintDis 75: SysCmd[0] in 76: SysCmd[0] out 77: SysEN5 78: SysCmd[1] in 79: SysCmd[1] out 80: SysCmd[2] in 81: SysCmd[2] out 82: SysCmd[3] in 83: SysCmd[3] out 84: SysEN6 85: SysCmd[4] in 86: SysCmd[4] out 87: SysCmd[5] in 88: SysCmd[5] out 89: SysEN7 90: SysCmd[6] in 91: SysCmd[6] out 92: SysCmd[7] in 93: SysCmd[7] out 94: SysEN8 95: SysCmd[8] in 96: SysCmd[8] out 97: SysCmdP in 98: SysCmdP out 99: HALTDOZE 100: Int[0]* 101: Int[1]* 102: Int[2]* 103: Int[3]* 104: Int[4]* 105: Int[5]* 106: internal pad 107: internal pad 108: internal pad 109: internal pad 110: internal pad 111: TPC[3] in 112: TPC[3] out 113: internal pad 114: internal pad 115: SysEN9 116: TPC[2] in 117: TPC[2] out 118: TPC[1] in 119: TPC[1] out 120: DCLK 121: NMI* 122: internal pad 123: internal pad 124: ExtRqst* 125: internal pad 126: internal pad 127: internal pad 128: Reset* 129: internal pad 130: internal pad 131: ColdReset* 132: internal pad 133: internal pad 134: internal pad 135: internal pad 136: internal pad 137: Endian 138: internal pad 139: internal pad 140: SysAD[16] in 141: SysAD[16] out 142: SysAD[17] in 143: SysAD[17] out 144: SysEN10 145: SysAD[18] in 146: SysAD[18] out 147: SysAD[19] in 148: SysAD[19] out 149: SysAD[20] in 150: SysAD[20] out 151: SysAD[21] in 152: SysAD[21] out 153: SysEN11 154: SysAD[22] in 155: SysAD[22] out 156: SysAD[23] in 157: SysAD[23] out 158: SysAD[24] in 159: SysAD[24] out 160: SysAD[25] in 161: SysAD[25] out 162: internal pad 163: internal pad 164: SysEN12 165: SysAD[26] in 166: SysAD[26] out 167: internal pad 168: internal pad 169: internal pad 170: SysAD[27] in 171: SysAD[27] out 172: internal pad 173: internal pad 174: MODE43* 175: internal pad 176: internal pad 177: DivMode[1] 178: internal pad 179: internal pad 180: internal pad 181: DivMode[0] 182: internal pad 183: internal pad 184: SysAD[28] in 185: SysAD[28] out 186: SysEN13 187: SysAD[29] in 188: SysAD[29] out 189: internal pad 190: internal pad 191: internal pad 192: internal pad 193: internal pad 194: internal pad 195: internal pad 196: SysAD[30] in 197: SysAD[30] out 198: SysEN14 199: internal pad 200: internal pad 201: internal pad 202: internal pad 203: internal pad 204: internal pad 205: internal pad 206: SysAD[31] in 207: SysAD[31] out 208: SysADC[2] in 209: SysADC[2] out 210: SysADC[3] in 211: SysADC[3] out 212: SysEN15 213: SysADC[0] in 214: SysADC[0] out 215: SysADC[1] in 216: SysADC[1] out 217: SysAD[0] in 218: SysAD[0] out 219: SysAD[1] in 220: SysAD[1] out 221: SysEN16 222: SysAD[2] in 223: SysAD[2] out 224: SysAD[3] in 225: SysAD[3] out 226: PCST[8] 227: PCST[7] 228: PCST[6] 229: PCST[5] 230: PCST[4] 231: internal pad 232: internal pad 233: internal pad 234: internal pad 235: internal pad 236: DivMode[2] [JTDO] Note: MasterClock does not support scan registers. Bidirectional signals have eahch pair of scan registers. ColdReset*, Reset* and BufSel signals are handled as internal signals. Figure 14.3.4 shows the Boundary-scan register. The Boundary-scan register includes all of the inputs and outputs of the TX4955 processor, except some clock and phase lock loop signals. The pins of the TX4955 chip can be configured to drive any arbitrary pattern by scanning into the Boundary-scan register from the Shift-DR state. Incoming data to the processor is examined by shifting while in the Capture-DR state with the Boundary-scan register enabled. 14-6 Chapter 14 JTAG Interface The Boundary-scan register is a single, 87-bit-wide for TMPR4955B or 236-bit-wide for TMPR4955C, shift register-based path containing cells connected to all input and output pads on the TX4955 processor. 86(TMPR4955B) 235(TMPR4955C) 0 See BSDL file in detail attached in the production Figure 14.3.4 Format of the Boundary-scan Register <TMPR4955B> 4 bits (SysEN) of the BSR are JTAG output enables. 79 bits of the BSR are for 79 external signals of the processor. 4 bits of the BSR are for internal signals of the processor. At the end of this chapter, Table 14.3.2 lists the scan order of these 87 scan bits, starting from JTDI and ending with JTDO. <TMPR4955C> 16 bits (SysEN) of the BSR are JTAG output enables. 132 bits of the BSR are for 80 external signals of the processor. 88 bits of the BSR are for internal signals of the processor. At the end of this chapter, Table 14.3.3 lists the scan order of these 236 scan bits, starting from JTDI and ending with JTDO. The JTDI input is loaded to the MSB of the Boundary Scan register. The LSB of the Boundary Scan register is retrieved from the JTDO output. 14.3.4 Device Identification Register The Device Identification register is a 32-bit shift register. It is used to read serially from the IC the identification code indicating the IC manufacturer, product number, and version. The following shows the Device Identification register structure. 31 28 27 12 11 Version Product number 4 bits 16 bits 1 manufacturer identification code 11 bits Figure 14.3.5 Device Identification Register The TX4955 device identification codes are as follows; TMPR4955B: 0x10017031 TMPR4955C: 0x0002C031 The device identification code is shifted out starting from the LSB. MSB LSB JTDO Figure 14.3.6 Devide Identification Register shift Direction 14-7 0 1 Chapter 14 JTAG Interface 14.3.5 Test Access Port (TAP) The Test Access Port (TAP) consists of the five signal pins: TRST* JTDI, JTDO, JTMS, and JTCK. Serial test data and instructions are communicated over these five signal pins, along with control of the test to be executed. As Figure 14.3.7 shows, data is serially scanned into one of the four registers (Instruction register, Bypass register, Device Identification register, or the Boundary-scan register) from the JTDI pin, or it is scanned from one of these four registers onto the JTDO pin. The JTMS input controls the state transitions of the main TAP controller state machine. The JTCK input is a dedicated test clock that allows serial JTAG data to be shifted synchronously, independent of any chip-specific or system clocks. JTCK JTMS and JTDI sampled on rising edge of JTCK JTDO sampled on falling edge of JTCK Data scanned in serially 7 Data scanned out serially 0 7 Instruction register 0 Instruction register 0 0 Bypass register 86(TMPR4955B) 235(TMPR4955C) Bypass register JTDI pin 0 Boundary-scan registe JTMS pin 86(TMPR4955B) 235(TMPR4955C) JTDO pin 0 31 Boundary-scan register 0 Device Identification register Figure 14.3.7 JTAG Test Access Port Data on the JTDI and JTMS pins is sampled on the rising edge of the JTCK input clock signal. Data on the JTDO pin changes on the falling edge of the JTCK clock signal. 14.3.6 TAP Controller The processor implements the 16-state TAP controller as defined in the IEEE JTAG specification. 14.3.7 Controller Reset The TAP controller state machine can be put into Reset state the following: • assertion of the TRST* signal (Low) resets the TAP controller. • keeping the JTMS input signal asserted through five consecutive rising edges of JTCK input. 14-8 Chapter 14 JTAG Interface 14.3.8 TAP Controller The state transition diagram of the TAP controller is shown in Figure 14.3.8. Each arrow between states is labeled with a 1 or 0, indicating the logic value of JTMS that must be set up before the rising edge of JTCK to cause the transition. 1 Test-Logic-Reset 0 0 Run-Test/Idle 1 Select-DR-Scan 1 Select-IR-Scan 0 0 Capture-DR 1 Capture-IR 1 0 0 Shift-DR Shift-IR 0 1 1 Exit 1-IR 0 1 0 Pause-DR Pause-IR 0 1 0 1 Exit 2-DR 0 Exit 2-IR 1 1 Update-DR 1 0 1 Exit 1-DR 0 1 0 Update-IR 1 0 Figure 14.3.8 TAP Controller State Diagram The following paragraphs describe each of the controller state. The left vertical column in Figure 14.3.8 is the data column, and the right vertical column is the instruction column. The data column and instruction column reference data register (DR) and instruction register (IR), respectively. 14-9 Chapter 14 JTAG Interface • Test-Logic-Reset When the TAP controller is in the Test-Logic-Reset state, the value 0x3 is loaded into the parallel output latch, selecting the Device Identification register as default. The three most significant bits of the Boundary-scan register are cleared to 0, disabling the outputs. The controller remains in this state while JTMS is high. If JTMS is held low while the controller is in this state, then the controller moves to the Run-Test/Idle state. • Run-Test/Idle In the Run-Test/Idle state, the IC is put in a test mode only when certain instructions such as a built-in self test (BIST) instruction are present. For instructions that do not cause any activities in this state, all test data registers selected by the current instruction retain their previous states. The controller remains in this state while JTMS is held low. When JTMS is high, the controller moves to the Select-DR-Scan state. • Select-DR-Scan This is a temporary controller state. Here, the IC does not execute any specific functions. If JTMS is held low when the controller is in this state, then the controller moves to the Capture-DR state. If JTMS is held high, the controller moves to the Select-IR-Scan state in the instruction column. • Select-IR-Scan This is a temporary controller state. Here, the IC does not execute any specific functions. If JTMS is held low when the controller is in this state, then the controller moves to the Capture-IR state. If JTMS is held high, the controller returns to the Test-Logic-Reset state. • Capture-DR In this controller state, if the test data register selected by the current instruction on the rising edge of JTCK has parallel inputs, then data can be parallel-loaded into the shift portion of the data register. If the test data register does not have parallel inputs, or if data need not be loaded into the selected data register, then the data register retains its previous state. If JTMS is held low while the controller is in this state, the controller moves to the Shift-DR state. If JTMS is held high, the controller moves to the Exit1-DR state. • Shift-DR In this controller state, the test data register connected between JTDI and JTDO shifts data one stage towards its serial output. When the controller is in this state, then it remains in the Shift-DR state if JTMS is held low, or moves to the Exit1-DR state if JTMS is held high. 14-10 Chapter 14 JTAG Interface • Exit 1-DR This is a temporary controller state. If JTMS is held low when the controller is in this state, then the controller moves to the Pause-DR state. If JTMS is held high, the controller moves to the Update-DR state. • Pause-DR This state allows the shifting of the data register selected by the instruction register to be temporarily suspended. Both the instruction register and the data register retain their current states. When the controller is in this state, then it remains in the Pause-DR state if JTMS is held low, or moves to the Exit2-DR state if JTMS is held high. • Exit 2-DR This is a temporary controller state. When the controller is in this state, then it returns to the Shift-DR state if JTMS is held low, or moves on to the Update-DR state if JTMS is held high. • Update-DR In this state, data is latched, on the rising edge of JTCK, onto the parallel outputs of the data registers from the shift register path. The data held at the parallel output does not change while data is shifted in the associated shift register path. When the controller is in this state, it moves to either the Run-Test/Idle state if JTMS is held low, or the Select-DR-Scan state if JTMS is held high. • Capture-IR In this state, data is parallel-loaded into the instruction register. The value of the loaded data is “00000001”. The Capture-IR state is used for testing the instruction register. Faults in the instruction register, if any exists, may be detected by shifting out the data loaded in it. When the controller is in this state, it moves to either the Shift-IR state if JTMS is low, or the Exit1-IR state if JTMS is high. • Shift-IR In this state, the instruction register is connected between JTDI and JTDO and shifts the captured data toward its serial output on the rising edge of JTCK. When the controller is in this state, it remains in the Shift-IR state if JTMS is low, or moves to the Exit1-IR state if JTMS is high. 14-11 Chapter 14 JTAG Interface • Exit 1-IR This is a temporary controller state. When the controller is in this state, then it moves to either the Pause-IR state if JTMS is held low, or the Update-IR state if JTMS is held high. • Pause-IR This state allows the shifting of the instruction register to be temporarily suspended. Both the instruction register and the data register retain their current states. When the controller is in this state, it remains in the Pause-IR state if JTMS is held low, or moves to the Exit2-IR state if JTMS is held high. • Exit 2-IR This is a temporary controller state. When the controller is in this state, it moves to either the Shift-IR state if JTMS is held low, or the Update-IR state if JTMS is held high. • Update-IR This state allows the instruction previously shifted into the instruction register to be output in parallel on the rising edge of JTCK. Then it becomes the current instruction, setting a new operational mode. When the controller is in this state, it moves to either the Run-Test/Idle state if JTMS is low, or the Select-DR-Scan state if JTMS is high. 14-12 Chapter 14 JTAG Interface 14.4 Instructions for JTAG This section defines the instructions supplied and the operations that occur in response to those instructions. 14.4.1 The EXTEST Instruction This instruction is used for external interconnect test, and targets the boundary scan register between JTDI and JTDO. The EXTEST instruction permits BSR cells at output pins to shift out test patterns in the Update-DR state and those at input pins to capture test results in the Capture-DR state. Typically, before EXTEST is executed, the Boundary-scan register (BSR) should be initialized by using the SAMPLE/PRELOAD instruction. If the BSR is not initialized, invalid data is transferred in the Update-DR state. This eliminates the possibility that bus conflicts damage the IC outputs. The flow of data through the Boundary-scan register while the EXTEST instruction is selected is shown in Figure 14.4.1, which follows: Boundary Scan Path INPUT Core Logic OUTPUT JTDO JTDI Figure 14.4.1 Test Data Flow While the EXTEST Instruction is Selected The following steps describe the basic test algorithm of an external interconnect test. 1. Initialize the TAP controller to the Test-Logic-Reset state. 2. Load the instruction register with SAMPLE/PRELOAD. This causes the Boundary-scan register to be connected between JTDI and JTDO. 3. Initialize the Boundary-scan register by shifting in determinate data. 4. Then, load the initial test data into the Boundary-scan register. 5. Load the Instruction register with EXTEST. 6. Capture the data applied to the input pin into the Boundary-scan register. 7. Shift out the captured data while simultaneously shifting in the next test pattern. 8. Read out the data in the Boundary-scan register onto the output pin. Steps 6 to 8 are repeated for each test pattern. 14-13 Chapter 14 JTAG Interface 14.4.2 The SAMPLE/PRELOAD Instruction This instruction targets the Boundary-scan register between JTDI and JTDO. As the instruction's name implies, two functions are performed through use of the SAMPLE/ PRELOAD instruction. • SAMPLE allows the input and output pads of an IC to be monitored. While it does so, it does not disconnect the system logic from the IC pins. The SAMPLE function occurs in the Capture-DR controller state. The SAMPLE instruction can read the value of the I/O pins of IC on the rising edge of JTCK. The flow of data for the SAMPLE phase of the SAMPLE/PRELOAD instruction is shown in Figure 14.4.2. Boundary Scan Path INPUT Core Logic JTDI OUTPUT JTDO Figure 14.4.2 Test Data Flow While SAMPLE is Selected • PRELOAD allows the Boundary-scan register to be initialized before another instruction is selected. For example, prior to selection of the EXTEST instruction, initialization data is shifted into the Boundary-scan register using PRELOAD as described in the previous subsection. PRELOAD permits shifting of the Boundary-scan register without interfering with the normal operation of the system logic. The flow of data for the PRELOAD phase of the SAMPLE/PRELOAD instruction is shown in Figure 14.4.3. Boundary Scan Path INPUT Core Logic JTDI OUTPUT JTDO Figure 14.4.3 Test Data Flow While PRELOAD is Selected 14-14 Chapter 14 JTAG Interface 14.4.3 The BYPASS Instruction This instruction targets the bypass register between JTDI and JTDO. The Bypass register provides a minimum length serial path through the IC (or between JTDI and JTDO) when the IC is not required for the current test. The BYPASS instruction does not cause interference to the normal operation of the on-chip system logic. The flow of data through the Bypass register while the BYPASS instruction is selected is shown in Figure 14.4.4. Bypass Register JTDI JTDO 1-bit Figure 14.4.4 Test Data Flow While the Bypass Instruction is Selected 14.4.4 The IDCODE Instruction This instruction targets the device identification register between JTDI and JTDO to identify manufacturer identity, product number, and version number. 14-15 Chapter 14 JTAG Interface 14-16 Chapter 15 CPU Instruction Set Summary 15. CPU Instruction Set Summary 15.1 Introduction Each instruction is 32 bits long. These instructions are upward compatible with the MIPS I, II and III instruction set architecture. 15.2 Instruction Format There are three instruction formats: Immediate (I-type), Jump (J-type) and Register (R-type), as shown in Figure 15.2.1. Having just three instruction formats simplifies instruction decoding. If more complex functions or addressing modes are required, they can be produced with the compiler using combinations of the instructions. Immediate (I-type) 31 26 25 op Jump (J-type) 31 21 20 rs 26 16 15 immediate 25 0 op Register (R-type) 31 target 26 op 0 rt 25 21 20 rs 16 15 rt op Operation code (6 bits) rs Source register (5 bits) 11 rd 10 6 5 sa rt Target (source or destination) register, or branch condition (5 bits) rd Destination register (5 bits) immediate Immediate, branch displacement, address displacement (16 bits) target Branch target address (26 bits) sa Shift amount (5 bits) funct Function (6 bits) Figure 15.2.1 Instruction Formats and Subfield Mnemonics 15-1 0 funct Chapter 15 CPU Instruction Set Summary 15.3 Instruction Set Overview 15.3.1 Load and Store Instructions (Table 15.3.1) Load and Store instructions move data between memory and general purpose registers, and are all I-type instructions. The only directly supported addressing mode is “base register plus 16-bit signed immediate offset”. Table 15.3.1 CPU Instruction Set: Load and Store Instructions Instruction Description Note LB Load Byte MIPS I LBU Load Byte Unsigned MIPS I LH Load Halfword MIPS I LHU Load Halfword Unsigned MIPS I LW Load Word MIPS I LWL Load Word Left MIPS I LWR Load Word Right MIPS I SB Store Byte MIPS I SH Store Halfword MIPS I SW Store Word MIPS I SWL Store Word Left MIPS I SWR Store Word Right MIPS I LD Load Doubleword MIPS III LDL Load Doubleword Left MIPS III LDR Load Doubleword Right MIPS III LL Load Linked MIPS II LLD Load Linked Doubleword MIPS III LWU Load Word Unsigned MIPS III SC Store Conditional MIPS II SCD Store Conditional Doubleword MIPS III SD Store Doubleword MIPS III SDL Store Doubleword Left MIPS III SDR Store Doubleword Right MIPS III SYNC Sync MIPS II 15-2 Chapter 15 CPU Instruction Set Summary 15.3.2 Computational Instructions (Table 15.3.2) Computational instructions perform arithmetic, logical or shift operations on values in registers. This instruction format can be R-type or I-type. With R-type instructions, the one or two source operands are computed and its result is saved to one destination register. With I-type instructions, one of the operands is 16-bit immediate data. Computational instructions can be classified as follows. • ALU immediate • Three-operand register-type • Shift • Multiply/Divide Table 15.3.2 CPU Instruction Set: Computational Instructions Instruction Description Note (ALU Immediate) ADDI Add Immediate MIPS I ADDIU Add Immediate Unsigned MIPS I SLTI Set on Less Than Immediate MIPS I SLTIU Set on Less Than Immediate Unsigned MIPS I ANDI AND Immediate MIPS I ORI OR Immediate MIPS I XORI Exclusive OR Immediate MIPS I LUI Load Upper Immediate MIPS I DADDI Doubleword Add Immediate MIPS III DADDIU Doubleword Add Immediate Unsigned MIPS III (ALU 3-Operand, register type) ADD Add MIPS I ADDU Add Unsigned MIPS I SUB Subtract MIPS I SUBU Subtract Unsigned MIPS I SLT Set on Less Than MIPS I SLTU Set on Less Than Unsigned MIPS I AND AND MIPS I OR OR MIPS I XOR Exclusive OR MIPS I NOR NOR MIPS I DADD Doubleword Add MIPS III DADDU Doubleword Add Unsigned MIPS III DSUB Doubleword Subtract MIPS III DSUBU Doubleword Subtract Unsigned MIPS III (Shift) SLL Shift Left Logical MIPS I SRL Shift Right Logical MIPS I SRA Shift Right Arithmetic MIPS I SLLV Shift Left Logical Variable MIPS I SRLV Shift Right Logical Variable MIPS I SRAV Shift Right Arithmetic Variable MIPS I DSLL Doubleword Shift Left Logical MIPS III DSRL Doubleword Shift Right Logical MIPS III DSRA Doubleword Shift Right Arithmetic MIPS III DSLLV Doubleword Shift Left Logical Variable MIPS III DSRLV Doubleword Shift Right Logical Variable MIPS III 15-3 Chapter 15 CPU Instruction Set Summary Instruction Description Note DSRAV Doubleword Shift Right Arithmetic Variable MIPS III DSLL32 Doubleword Shift Left Logical +32 MIPS III DSRL32 Doubleword Shift Right Logical +32 MIPS III DSRA32 Doubleword Shift Right Arithmetic +32 MIPS III (Multiply and Divide) MULT Multiply MIPS I MULTU Multiply Unsigned MIPS I DIV Divide MIPS I DIVU Divide Unsigned MIPS I MFHI Move From HI MIPS I MTHI Move To HI MIPS I MFLO Move From LO MIPS I MTLO Move To LO MIPS I DMULT Doubleword Multiply MIPS III DMULTU Doubleword Multiply Unsigned MIPS III DDIV Doubleword Divide MIPS III DDIVU Doubleword Divide Unsigned MIPS III 15.3.3 Jump and Branch Instructions (Table 15.3.3) Jump and branch instructions change the control flow of a program. All jump and branch instructions occur with a delay of one instruction: that is, the instruction immediately following the jump or branch (this is known as the instruction in the delay slot) always executes while the target instruction is being fetched from storage. Branch-likely instructions are used for static branch prediction. The instruction in the delay slot is executed only when the branch is taken; the instruction in the delay slot is nullified if the branch is not taken. Table 15.3.3 CPU Instruction Set: Jump and Branch Instructions Instruction Description Note J Jump MIPS I JAL Jump And Link MIPS I JR Jump Register MIPS I JALR Jump And Link Register MIPS I BEQ Branch on Equal MIPS I BNE Branch on Not Equal MIPS I BLEZ Branch on Less Than or Equal to Zero MIPS I BGTZ Branch on Greater Than Zero MIPS I BLTZ Branch on Less Than Zero MIPS I BGEZ Branch on Greater than or Equal to Zero MIPS I BLTZAL Branch on Less Than Zero And Link MIPS I BGEZAL Branch on Greater than or Equal to Zero And Link MIPS I BEQL Branch on Equal Likely MIPS II BNEL Branch on Not Equal Likely MIPS II BLEZL Branch on Less Than or Equal to Zero Likely MIPS II BGTZL Branch on Greater Than Zero Likely MIPS II BLTZL Branch on Less Than Zero Likely MIPS II BGEZL Branch on Greater Than or Equal to Zero Likely MIPS II BLTZALL Branch on Less Than Zero And Link Likely MIPS II BGEZALL Branch on Greater Than or Equal to Zero And Link Likely MIPS II 15-4 Chapter 15 CPU Instruction Set Summary 15.3.4 Special Instructions (Table 15.3.4) There are special instructions used for software trap. The instruction format is R-type for all two. Table 15.3.4 CPU Instruction Set: Special Instructions Instruction Description Note SYSCALL System Call MIPS I BREAK Break MIPS I 15.3.5 Exception Instructions (Table 15.3.5) These instructions are R-type or I-type. When the condition of the following instructions is true, theTrap Exception occurres. Table 15.3.5 CPU Instruction Set: Exception Instructions Instruction Description Note TGE Trap if Greater Than or Equal MIPS II TGEU Trap if Greater Than or Equal Unsigned MIPS II TLT Trap if Less Than MIPS II TLTU Trap if Less Than Unsigned MIPS II TEQ Trap if Equal MIPS II TNE Trap if Not Equal MIPS II TGEI Trap if Greater Than or Equal Immediate MIPS II TGEIU Trap if Greater Than or Equal Immediate Unsigned MIPS II TLTI Trap if Less Than Immediate MIPS II TLTIU Trap if Less Than Immediate Unsigned MIPS II TEQI Trap if Equal Immediate MIPS II TNEI Trap if Not Equal Immediate MIPS II 15-5 Chapter 15 CPU Instruction Set Summary 15.3.6 Coprocessor Instructions (Table 15.3.6) Coprocessor instructions invoke coprocessor operations. The format of these instructions depends on which coprocessor is used. Table 15.3.6 CPU Instruction Set: Coprocessor Instructions Instruction Description Note LWCz Load Word to Coprocessor z (z = 1, 2) SWCz Store Word from Coprocessor z (z = 1, 2) MIPS I MTCz Move To Coprocessor z (z = 1, 2) MIPS I MFCz Move From Coprocessor z (z = 1, 2) MIPS I CTCz Move Control To Coprocessor z (z = 1, 2) MIPS I CFCz Move Control From Coprocessor z (z = 1, 2) MIPS I MIPS I COPz Coprocessor Operation z (z = 1, 2) MIPS I BCzT Branch on Coprocessor z True (z = 0, 1, 2) MIPS I BCzF Branch on Coprocessor z False (z = 0, 1, 2) MIPS I BCzTL Branch on Coprocessor z True Likely (z = 0, 1, 2) MIPS II BCzFL Branch on Coprocessor z False Likely (z = 0, 1, 2) MIPS II LDCz Load Double Coprocessor z (z = 1, 2) MIPS III SDCz Store Double Coprocessor z (z = 1, 2) MIPS III DMTCz Doubleword Move To Coprocessor z (z = 1, 2) MIPS III DMFCz Doubleword Move From Coprocessor z (z = 1, 2) MIPS III 15.3.7 CP0 Instructions (Table 15.3.7) Coprocessor 0 instructions are used for operations involving the system control coprocessor (CP0) registers, processor memory management and exception handling. Table 15.3.7 Instruction Set: CP0 Instructions Instruction Description Note MTC0 Move To CP0 MFC0 Move From CP0 MIPS I DMTC0 Doubleword Move To CP0 MIPS III DMFC0 Doubleword Move From CP0 MIPS III TLBR Read Indexed TLB Entry TLBWI Write Indexed TLB Entry TLBWR Write Random TLB Entry MIPS I TLBP Probe TLB for Matching Entry CACHE Cache MIPS III ERET Exception Return MIPS III WAIT Enter power management mode 15-6 Chapter 15 CPU Instruction Set Summary 15.3.8 Multiply and Divide Instructions (Table 15.3.8) Table 15.3.8 Extensions to the ISA: Multiply and Divide Instructions Instruction Description MULT Multiply (3-operand) MULTU Multiply Unsigned (3-operand) Note DMULT Doubleword Multiply (3-operand) DMULTU Doubleword Multiply Unsigned (3-operand) MADD Multiply and ADD (3-operand) extended MADDU Multiply and ADD Unsigned (3-operand) extended 15.3.9 Debug Instructions (Table 15.3.9) Table 15.3.9 Extensions to the ISA: Debug Instructions Instruction CTC0 Description Note Move Control To Coprocessor 0 CFC0 Move Control From Coprocessor 0 SDBBP Software Debug Breakpoint extended DERET Debug Exception Return extended 15.3.10 Other Instructions (Table 15.3.10) Table 15.3.10 Other Instructions Instruction PREF Description Note Prefetch 15.4 Instruction Execution Cycles Because the TX49/H4 Core employs the high-speed Multiply and Add Calculator (MAC), multiply instructions, such as MULT, MULTU, DMULT and DMULTU are executed faster. And, TX49/H4 Core is improved the execution of divide instructions, too. Instruction Latency Repeat (2op/3op) MULT 2/3 operand 4/4 1/3 MADD 2/3 operand 4/4 1/3 DMULT 2/3 operand 7/7 6/6 DIV 37 36 DDIV 69 68 15-7 Chapter 15 CPU Instruction Set Summary 15.5 Defining Access Types Access type indicates the size of a TX49 data item to be loaded or stored, set by the load or store instruction opcode. Regardless of access type or byte ordering (endianness), the address given specifies the low-order byte in the addressed field. For a big-endian configuration, the low-order byte is the most-significant byte; for a little-endian configuration, the low-order byte is the least-significant byte. The access type, together with the three low-order bits of the address, determines which byte is accessed within the addressed doubleword (shown in Figure 15.5.1). Only the combinations shown in Figure 15.5.1 are permissible; other combinations cause the Address Error exception. Access Type Mnemonic (Value) Doubleword (7) Septibyte (6) Sextibyte (5) Quintibyte (4) Word (3) Triplebyte (2) Halfword (1) Byte (0) Low-Order Address Bits Bytes Accessed Big Endian (63-----------------31-----------------0) Byte Little Endian (63-----------------31-----------------0) Byte 7 2 1 0 0 0 0 0 1 2 3 4 5 6 0 0 0 0 1 2 3 4 5 6 0 0 1 1 2 3 4 5 6 7 1 2 3 4 5 2 3 4 5 6 2 3 4 3 4 5 4 5 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 0 0 1 1 2 1 2 1 2 6 5 4 3 2 1 0 6 5 4 3 2 1 0 7 6 5 4 3 2 1 5 4 3 2 1 0 7 7 6 5 4 3 2 4 3 2 1 0 6 7 7 6 5 4 3 3 2 1 0 6 7 7 6 5 4 2 1 0 3 2 1 3 2 3 3 4 0 7 5 6 5 6 7 7 6 5 6 5 4 1 1 2 3 4 5 5 6 7 7 0 4 6 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 Figure 15.5.1 Byte Access within a Doubleword 15-8 Chapter 15 CPU Instruction Set Summary 15.6 Bit Encoding of CPU Instruction OPcodes The Table 15.6.1 shows the bit codes for all TX4956 CPU instructions (ISA and extended ISA). Table 15.6.1 CPU Operation Code Bit Encoding OPcode 31 26 0 OPcode [31:29] 0 [28:26] 0 1 2 3 4 5 6 7 SPECIA λ REGIMM λ J JAL BEQ BNE BLEZ BGTZ 1 ADDI ADDIU SLTI SLTIU ANDI ORI XORI LUI 2 COP0 α COP1 α COP2 α COP3 α θ BEQL BNEL BLEZL BGTZL 3 DADDI ε DADDIU ε LDL ε LDR ε MAC λ * * * 4 LB LH LWL LW LBU LHU LWR LWU ε 5 SB SH SWL SW SDL ε SDR ε SWR CACHE 6 LL LWC1 α LWC2 α PREF LLD ε LDC1 α LDC2 α LD ε 7 SC SWC1 α SWC2 α * SCD ε SDC1 α SDC2 α SD ε SPECIAL Function 31 26 5 OPcode = SPECIAL 0 SPECIAL Function [5:3] [2:0] 0 1 2 3 4 5 6 7 0 SLL * SRL SRA SLLV * SRLV SRAV 1 JR JALR * * SYSCALL BREAK SDBBP SYNC 2 MFHI MTHI MFLO MTLO DSLLV ε * DSRLV ε DSRAV ε 3 MULT MULTU DIV DIVU DMULT ε DMULTε DDIV ε DDIVU ε 4 ADD ADDU SUB SUBU AND OR XOR NOR 5 * * SLT SLTU DADD ε DADDU ε DSUB ε DSUBU ε 6 TGE TGEU TLT TLTU TEQ * TNE * 7 DSLL ε * DSRL ε DSRA ε DSLL32 ε * DSRL32 ε DSRA32 ε 15-9 Chapter 15 CPU Instruction Set Summary REGIMM rt 31 26 20 OPcode = REGIMM 16 0 REGIMM rt [18:16] 0 1 2 3 4 5 6 7 0 BLTZ BGEZ BLTZL BGEZL * * * * 1 TGEI TGEIU TLTI TLTIU TEQI * TNEI * 2 BLTZAL BGEZAL BLTZALL BGEZALL * * * * 3 * * * * * * * * [20:19] COPz rs 31 26 25 OPcode = COPz 21 0 COPz rs [23:21] 0 1 2 3 4 5 6 0 MF DMF ε CF γ MT DMT ε CT γ 1 BC γ γ γ γ γ γ γ [25:24] 2 7 CO 3 COPz rt 31 26 20 OPcode = COPz 16 0 COPz rt [18:16] 0 1 2 3 4 5 6 0 BCF BCT BCFL BCTL γ γ γ γ 1 γ γ γ γ γ γ γ γ 2 γ γ γ γ γ γ γ γ 3 γ γ γ γ γ γ γ γ [20:19] 7 COP0 Function 31 26 5 OPcode = COP0 0 COP0 Function [2:0] 0 1 2 3 4 5 6 0 φ TLBR TLBWI φ φ φ TLBWR φ 1 TLBP φ φ φ φ φ φ φ 2 φ φ φ φ φ φ φ φ 3 ERET φ φ φ φ φ φ DERET 4 WAIT φ φ φ φ φ φ φ 5 φ φ φ φ φ φ φ φ 6 φ φ φ φ φ φ φ φ 7 φ φ φ φ φ φ φ φ [5:3] 15-10 7 Chapter 15 CPU Instruction Set Summary MAC Function 31 26 5 OPcode = MAC 0 MAC Function [2:0] 0 1 2 3 4 5 6 0 MADD MADDU γ γ γ γ γ γ 1 γ γ γ γ γ γ γ γ 2 γ γ γ γ γ γ γ γ 3 γ γ γ γ γ γ γ γ 4 γ γ γ γ γ γ γ γ 5 γ γ γ γ γ γ γ γ 6 γ γ γ γ γ γ γ γ 7 γ γ γ γ γ γ γ γ [5:3] 7 Key : *: This opcode is reserved for future use. An attempt to execute it causes a Reserved Instruction exception. γ: This opcode is reserved for future use. An attempt to execute it causes a Reserved Instruction exception. λ: This opecode indicates an instruction class. The instruction word must be further decoded by examining additional tables that show the values for another instruction field. α: This opcode is a coprocessor operation, not a CPU operation. If the processor state does not allow access to the specified coprocessor, the instruction causes a Coprocessor Unusable exception. It is included in the table because it uses a primary opecode in the instruction encodeing map. φ: This opcode is reserved for future use, but does not cause a Reserved Instruction exception in TX4956 implementations. It is treated as “NOP”. θ: This opcode is valid when BC is only selected in COPz rs; In other case, it causes a Reserved Instruction exception. ε: This opcode is valid when the processor is operating either in the Kernel mode or in the 64-bit non-Kernel (User or Supervisor) mode; In other case, it causes a Reserved Instruction exception. 15-11 Chapter 15 CPU Instruction Set Summary 15-12 Chapter16 FPU Instruction Set Details 16. FPU Instruction Set Details 16.1 Instruction Formats There are three basic instruction format types: • Immediate instructions (I-Type), which include load and store operations. • Register instructions (R-Type), which include the two-and three-register Floating-Point operations. • Branch instructions and Move instructions etc. The instruction description subsections that follow show how the three basic instruction formats above are used by: • Load and store instructions • Register transfer instructions • Floating-Point Computational instructions • Floating-Point branch instructions Floating-point instructions are mapped onto the coprocessor 1 instructions, defining coprocessor unit number one (CP1) as the floating-point unit. Each operation is valid only for certain formats. Implementations may support some of these formats and operations only through emulation, but only need support combinations that are valid, which are marked with a V in Table 16.1.1 below. Table 16.1.1 shows Valid FPU Instruction Formats. Table 16.1.1 Valid FPU Instruction Formats Operation Source Format Single Double Word Longword ADD V V R R SUB V V R R MUL V V R R DIV V V R R SQRT V V R R ABS V V R R MOV V V – – NEG V V R R TRUNC.L V V – – ROUND.L V V – – CEIL.L V V – – LOOR.L V V – – TRUNC.W V V – – ROUND.W V V – – CEIL.W V V – – FLOOR.W V V – – CVT.S – V V V CVT.D V – V V CVT.W V V – – CVT.L V V – – C V V R R V: Valid R: Reserved for future use (if specified, Floating-Point exception (unimplemented instruction exception) occurs.) –: not supported (if specified, Floating-Point exception (unimplemented instruction exception) occurs.) 16-1 Chapter16 FPU Instruction Set Details The coprocessor branch on condition true/false instructions can be used to logically negate any predicate. Thus, the 32 possible conditions require only 16 distinct comparisons, as shown in Table 16.1.2 below. Table 16.1.2 shows Logical Negation of Predicates by Condition True/False. Table 16.1.2 Logical Negation of Predicates by Condition True/False Condition Mnemonic True False F UN EQ UEQ OLT ULT OLE ULE T OR NEQ OGL UGE OGE UGT OGT Relations Code Greater Than Less Than Equal 0 1 2 3 4 5 6 7 F F F F F F F F F F F F T T T T F F T T F F T T Invalid Operation exception if Unordered unordered F T F T F T F T No No No No No No No No SF ST 8 F F F F Yes NGLE SEQ NGL LT NGE LE NGT GLE SNE GL NLT GE NLE GT 9 10 11 12 13 14 15 F F F F F F F F F F T T T T F T T F F T T T F T F T F T Yes Yes Yes Yes Yes Yes Yes 16.2 Instruction Set Summary 16.2.1 Floating-Point Loads, Stores, and Moves All movement of data between the floating-point coprocessor and memory is accomplished by coprocessor load and store operations, which reference the floating-point coprocessor’s General-Purpose Registers. These operations are unformatted; no format conversions are performed and, therefore, no Floating-Point exceptions occur due to these operations. Data may also be directly moved between the floating-point coprocessor and the processor by move to coprocessor and move from coprocessor instructions. Like the floating-point load and store operations, move to/from operations perform no format conversions and never cause Floating-Point exceptions. An additional pair of coprocessor registers are available, called Floating-Point Control registers for which the only data movement operation supported are moves to and from processor General-Purpose Registers. 16.2.2 Floating-Point Computational Instructions The floating-point unit’s operation set includes the flowings: • floating-point addition • floating-point subtraction • floating-point multiplication • floating-point division • floating-point square root 16-2 Chapter16 FPU Instruction Set Details • conversion between fixed-point and floating-point format • conversion between single-precision and double-precision floating-point formats • floating-point comparision. These operations satisfy IEEE Standard 754’s requirements for accuracy. Specifically, these operations obtain a result which is identical to performing the result with infinite precision and then rounding to the specified format, using the current rounding mode. Instructions must specify the certain format of their operands. Only the format conversion instructions support mixed format operations. 16.3 Load and Store Instructions In the TX49, the instruction immediately following a load may use the contents of the register loaded. In such cases, the hardware will interlock, requiring additional real cycles, so scheduling load delay slots is still desirable, although not absolutely required for functional code. When the FR bit in the Status register equals zero, the Floating-Point General Registers (FGR) are 32-bits wide. When the FR bit in the Status register equals one, the Floating-Point General Registers (FGR) are 64-bits wide. The behavior of the load/store instructions in dependent on the width of the FGRs. In the load/store operation descriptions, the functions listed in Table 16.3.1 are used to summarize the handling of virtual addresses and physical memory. Table 16.3.1 Load/Store Common Functions Function Meaning AddressTranslation Uses the TLB to find the physical address given the virtual address. The function fails and an exception is taken if the required translation is not present in the TLB. LoadMemory Uses the cache and main memory to find the contents of the word containing the specified physical address. The low-order two bits of the address and the access type field indicates which of each of the four bytes within the data word need to be returned. If the cache is enabled for this access, the entire wordis returned and loaded into the cache. StoreMemory Uses the cache, write buffer and main memory to store the word or part of word specified as data in the word containing the specified physical address. The low-order two bits of the address and the access type field indicates which of each of the four bytes within the data word should be stored. 16-3 Chapter16 FPU Instruction Set Details Figure 16.3.1 shows the I-Type instruction format used by load and store operations. I-Type (Immediate) 31 where: op base ft 26 25 21 20 16 15 0 op base ft offset 6 5 5 16 is a 6-bit operation code is the 5-bit base register specifier is a 5-bit. source (for stores) or destination (for loads) FPA register specifier offset is the 16-bit signed immediate offset Figure 16.3.1 Load and Store Instruction Format All coprocessor loads and stores reference aligned word data items. Thus, for word loads and stores, the access type field is always WORD, and the low-order two bits of the address must always be zero. For double word loads and stores, the access type field is always DOUBLEWORD, and the low-order three bits of the address must always be zero. Regardless of byte-numbering order (endianness), the address specifies that byte which has the smallest byte-address of all of the bytes in the addressed field. For a Big-endian machine, this is the leftmost byte; for a Little-endian machine, this is the rightmost byte. 16-4 Chapter16 FPU Instruction Set Details 16.4 Computational Instructions Computational instructions include all of the arithmetic floating-point operations performed by the FPU. Figure 16.4.1 shows the R-Type instruction format used for computational operations. R-Type (Register) 31 26 25 21 20 16 15 11 10 6 5 0 COP1 fmt ft fs fd function 6 5 5 5 5 6 where: COP1 fmt fs ft fd function is a 6-bit major operation code is a 5-bit format specifier is a 5-bit source1 register is a 5-bit source2 register is a 5-bit destination register is a 6-bit function field Figure 16.4.1 Computational Instruction Format Each floating-point instruction can be applied to a number of operand formats. The operand format for an instruction is specified by the 5-bit fmt field; decoding for this field is shown in Table 16.4.1. Table 16.4.1 Format Field Decoding Code Mnemonic Size Format 16 S single Binary floating-point 17 D double Binary floating-point 18 Reserved 19 Reserved 20 W single 32-bit binary fixed-point 21 L longword 64-bit binary fixed-point 22-31 Reserved The function indicates which floating-point operation is to be performed. Table 16.4.2 lists all floating-point instructions. 16-5 Chapter16 FPU Instruction Set Details Table 16.4.2 Floating-Point Instructions and Operations Function[5:0] Mnemonic Operation 0 ADD Add 1 SUB Subtract 2 MUL Multiply 3 DIV Divide 4 SQRT Square root 5 ABS Absolute value 6 MOV Move 7 NEG Negate 8 ROUND.L Convert to single fixed-point, rounded to nearest/even 9 TRUNC.L Convert to single fixed-point, rounded toward zero 10 CEIL.L Convert to single fixed-point, rounded to +∞ 11 FLOOR.L Convert to single fixed-point, rounded to −∞ 12 ROUND.W Convert to single fixed-point, rounded to nearest/even 13 TRUNC.W Convert to single fixed-point, rounded toward zero 14 CEIL.W Convert to single fixed-point, rounded to +∞ 15 FLOOR.W Convert to single fixed-point, rounded to −∞ 16-31 – Reserved 32 CVT.S Convert to single floating-point 33 CVT.D Convert to double floating-point 34 – Reserved 35 – Reserved 36 CVT.W Convert to binary fixed-point 37 CVT.L Convert to 64-bit binary fixed-point 38-47 – Reserved 48-63 C Floating-point compare 16-6 Chapter16 FPU Instruction Set Details In the following pages, the notation FGR refers to the FPU’s 32 General-Purpose Registers FGRO through FGR31, and FPR refers to the FPU’s Floating-Point Registers. When the FR bit in the Status register (SR26) equals zero, only the even Floating-Point Registers are valid and the FPU’s 32 General-Purpose Registers are 32-bits wide. When the FR bit in the Status register (SR26) equals one, both odd and even Floating-Point Registers may be used and the FPU’s 32 General-Purpose Registers are 64-bits wide. The following routines are used in the description of the floating-point operations to get the value of an FPR or to change the value of an FGR: 32 Bit Mode value < - - ValueFPR (fpr, fmt) /* undefined for odd fpr */ case fmt of S, W: value < - - FGR[fpr + 0] D: /* undefined for fpr not even */ value < - - FGR[fpr + 1]⎥ ⎢FGR[fpr + 0] end StoreFPR (fpr, fmt, value): /* undefined for odd fpr */ case fmt of S, W: FGR[fpr + 1] < - - undefined FGR[fpr + 0] < - - value D: FGR[fpr + 1] < - - value63:32 FGR[fpr + 0] < - - value31:0 end 64 Bit Mode value < - - ValueFPR (fpr, fmt) case fmt of S: value < - - FGR[fpr]31:0 D, L: value < - - FGR[fpr] W: value < - - FGR[fpr] end StoreFPR (fpr, fmt, value): case fmt of S, W: FGR[fpr] < - - undefined32⎥ ⎢value D, L: FGR[fpr] < - - value end 16-7 Chapter16 FPU Instruction Set Details 16.5 Bit Encoding of FPU Instruction OP codes Table 16.5.1 shows the bit codes for all TX49 FPU instructions (ISA and extended ISA). Table 16.5.1 FPU Operation Code Bit Encoding OP code 31 26 0 OP code [31:29] [28:26] 0 1 2 3 4 5 6 7 0 1 2 COP1 3 4 5 6 LWC1 LDC1 θ 7 SWC1 SDC1 θ Sub 31 26 25 OP code 21 0 Sub [23:21] 0 1 2 3 4 5 6 7 0 MF DMF η θ CF δ MT DMT η θ CT δ 1 BC δ δ δ δ δ δ δ 2 S Dθ δ δ W Lηθ δ δ 3 δ δ δ δ δ δ δ δ [25:24] 16-8 Chapter16 FPU Instruction Set Details Br 31 26 20 OP code 16 0 Br [18:16] 0 1 2 3 4 5 6 7 0 BCF BCT BCFL BCTL γ γ γ γ 1 γ γ γ γ γ γ γ γ 2 γ γ γ γ γ γ γ γ 3 γ γ γ γ γ γ γ γ [20:19] CP1 Function 31 26 5 0 CP1 Function OP code [5:3] [2:0] 0 1 2 3 4 5 6 7 0 ADD SUB MUL DIV SQRT ABS MOV NEG 1 ROUND.L η θ TRUNC.L η θ CEIL.L η θ FLOOR.L η θ ROUND.W TRUNC.W CEIL.W FLOORW 2 δ δ δ δ δ δ δ δ 3 δ δ δ δ δ δ δ δ 4 CVT.S CVT.D θ δ δ CVT.W CVT.L η θ δ δ 5 δ δ δ δ δ δ δ δ 6 C.F C.UN C.EQ C.UEQ C.OLT C.ULT C.OLE C.ULE 7 C.SF C.NGLE C.SEQ C.NGL C.LT C.NGE C.LE C.NGT Key: Note: γ: This opcode is reserved for future use. An attempt to execute it causes a Reserved Instruction exception. δ: Thie opcode is reserved for future use. An attempt to execute it causes a Unimplemented operation exceptions in all current implementations. η: This opcode is valid only when MIPS III instructions are enabled. An attempt to execute these without MIPS III instruction enabled will cause an Unimplemented operation exception. θ: This opcode is valid only when the TX49 has a double precision FPU in hardware. An attempt to execute these without it will cause an Unimplemented operation exception. FPU Instructions are valid only when TX49 has with FPU(CP1). An attempt to execute these insturctions causes a Coprocessor Unusable exception, independent of C0_SR(bit 29)’s value. 16-9 Chapter16 FPU Instruction Set Details 16-10 Chapter 17 Electrical Characteristics 17. Electrical Characteristics ESD Precautions: For handling precautions, see Section 1.1, Electrostatic Discharge (ESD), in the chapter on General Safety Precautions and Usage Considerations. 17.1 TMPR4955B Electrical Characteristics 17.1.1 Absolute Maximum Ratings VSS = 0 V (GND) Symbol Ratings Unit Supply Voltage (I/O) Parameter VCCIOMax −0.3 to 3.9 V Supply Voltage (Core) VCCIntMax −0.3 to 3.0 V VIN −0.3 to VCCIO + 0.3 V TSTG −40 to + 125 °C Input Voltage (Note 2) Storage Temperature Note 1: The absolute maximum ratings are rated values that must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any absolute maximum rating is exceeded, a device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. Thus, when designing products which include this device, ensure that no absolute maximum rating value will ever be exceeded. Note 2: Even VCCIO + 0.3 shall not exceed the VCCIOMax rating. 17.1.2 Recommended Operating Conditions VSS = 0 V (GND) Parameter Symbol Min Max 3.1 3.5 V VCCInt 1.4 1.6 V TC 0 +70 °C Supply Voltage (I/O) VCCIO Supply Voltage (Core) Operating Case Temperature Note: Conditions I/O = 3.3 V Unit The recommended operating conditions for a device are those under which it can be guaranteed that the device will operate as specified. If the device is used under operating conditions other than the recommended operating conditions (supply voltage, operating temperature range, specified AC and DC values, etc.), malfunction may occur. Thus, when designing products which include this device, ensure that the recommended operating conditions for the device are always adhered to. 17-1 Chapter 17 Electrical Characteristics 17.1.3 DC Characteristics 17.1.3.1 DC Characteristics TC = 0°C to 70°C, VCCInt = 1.5 V ± 0.1 V, VCCIO = 3.3 V ± 0.2 V Parameter Symbol Conditions Min Max Units VCCIO − 0.6 ⎯ V ⎯ 0.4 V 2 VCCIO + 0.3 0.8VCCIO VCCIO + 0.3 IOH = −4 mA (4-mA buffer) Output High Voltage VOH IOH = −8 mA (8-mA buffer) IOH = −12 mA (12-mA buffer) IOL = 4 mA (4-mA buffer) Output Low Voltage VOL IOL = 8 mA (8-mA buffer) IOL = 12 mA (12-mA buffer) Input High Voltage Input Low Voltage VIH Except for MasterClock input VIHC Applies to MasterClock V VIL Except for MasterClock input −0.5 0.8 VILC Applies to MasterClock −0.5 0.2VCCIO ⎯ ±10 µA (*1) (*2) Applies to pins except V Input Leakage ILI Input Leakage (with Pull-up) (Note 1) ILlu −70 −10 µA Input Leakage (with Pull-down) (Note 2) ILId 10 70 µA Output Leakage ILO ⎯ ±20 µA Input Capacitance CIN ⎯ 10 pF Note 1: Applies to the following input pins that have an internal pull-up resistor. Int[5:0]*, NMI*, Reset*, JTMS, JTCK, JTDI, TPC1 (If they need be pulled down, use a resistor with ≤ 20 kΩ.) Note 2: Applies to the following input pins that have an internal pull-down resistor. TRST*, RdRdy*, TPC2, TPC3, DivMode[2] (If they need be pulled up, use a resistor with ≤ 20 kΩ.) 17.1.3.2 Operating Current TC = 0°C to 70°C, VCCInt = 1.5 V ± 0.1 V, VCCIO = 3.3 V ± 0.2 V Parameter Symbol Operating Current 1 (Core Power Supply: when Normal Operating Mode) ICCInt1 Operating Current 2 (Core Power Supply: when Drystone 2.1 running) ICCInt2 Operating Current 3 (Core Power Supply: when HALT Mode operating) ICCInt3 Operating Current 4 (Core Power Supply: when MasterClock Stopped) ICCInt4 Operating current (Power supply for I/O pin) ICCIO Conditions Typ. Max CPUCLK = 200 MHz 300 450 CPUCLK = 300 MHz 400 550 CPUCLK = 200 MHz 200 300 CPUCLK = 300 MHz 300 400 CPUCLK = 200 MHz 100 170 CPUCLK = 300 MHz 130 200 MasterClock = 0 MHz CPUCLK = 0 MHz 50 80 MasterClock = 133 Hz BufSel = 100% (8-mA buffer) Load = 25 pF 80 100 MasterClock = 100 MHz BufSel = 100% (8-mA buffer) Load = 25 pF 60 17-2 Units mA mA mA mA mA 80 Chapter 17 Electrical Characteristics 17.1.4 AC Characteristics 17.1.4.1 Clock Timing TC = 0°C to 70°C, VCCInt = 1.5 V ± 0.1 V, VCCIO = 3.3 V ± 0.2 V Min Max Units MasterClock High Width Parameter Symbol tMCH Transition ≤ 2 ns 2 ⎯ ns MasterClock Low Width tMCL Transition ≤ 2 ns 2 ⎯ ns MasterClock Frequency (Note 1) fMCK 33 133 MHz Products for 200 MHz 133 200 MHz Products for 300 MHz 133 300 ⎯ Internal Operation Frequency Conditions MasterClock Period tMCP ⎯ 7.5 30 ns MasterClock Rise Time tMCR ⎯ ⎯ 2 ns MasterClock Fall Time tMCF ⎯ ⎯ 2 ns Note 1: Operation of the TX4955B is only guaranteed with the Phase Lock Loop enabled. Note 2: All output timings assume a 25-pF capacitive load. 17.1.4.2 System Interface TC = 0°C to 70°C, VCCInt = 1.5 V ± 0.1 V, VCCIO = 3.3 V ± 0.2 V Parameter Data Output (Note 1, 2, 3) tDO Min Max BufSel = 0 100% (8-mA buffer) Conditions 1.0 (Note 4) 5.0 BufSel = 1 50% (4-mA buffer) 1.0 (Note 4) 5.5 Units ns Data Setup (Note 3) tDS ⎯ 2.5 ⎯ ns Data Hold (Note 3) tDH ⎯ 1.0 ⎯ ns Note 1: Note 2: Note 3: Note 4: 17.1.5 Symbol Timings are measured from 1.5 V of MasterClock to 1.5 V of each signal. Capacitive load for all output timings is 25 pF. Applies to all system interface signals. Offers a guarantee of design. Timing Diagrams 17.1.5.1 Clock Timing tMCP tMCL tMCH tMCL MasterClock tMCM 0.8 *VCCIO 0.2 *VCCIO 1.5 V tMCR 17-3 tMCF Chapter 17 Electrical Characteristics 17.1.5.2 Clock Relationships Cycle 1 2 3 4 MasterClock CPUCLK (Internal Signal) GBUSCLK (Internal Signal) SysAD Driven D D D D tDO SysAD Received D D D D tDS tDH 17.1.5.3 System Interface Timing MasterClock GBUSCLK (Internal Signal) tDO tDS SysAD SysCmd Valid Output tDO Valid Input tDH ValidOut*, Release* Validln*, ExtRqst*, WrRdy*, RdRdy*, Int[5:0]*, NMI* tDH tDS tDH Valid Input 17-4 Chapter 17 Electrical Characteristics 17.1.5.4 Power-On Reset Timing VCC IO VCC Int VCC PLL MasterClock (MClk) GBUSCLK (Internal Clock) PLLReset* MasterClock & PLL Stabilization Time ≥ 1 ms ≥ 10 ms ColdReset* Reset* 17.1.5.5 ColdReset Timing MasterClock tDS tDH DivMode[2:0] tDS tDH ≥ 16 Master Clock cycles Reset* ≥ 64,000 Master Clock cycles ColdReset* 17.1.5.6 Soft Reset Timig MasterClock tDS tDH tDS Reset* ≥ 16 Master Clock cycles ColdReset* 17-5 Chapter 17 Electrical Characteristics 17.2 TMPR4955C Electrical Characteristics 17.2.1 Absolute Maximum Ratings VSS = 0 V (GND) Parameter Symbol Ratings Unit Supply Voltage (I/O) VCCIOMax −0.3 to 3.9 V Supply Voltage (Core) VCCIntMax −0.3 to 2.0 V VIN −0.3 to VCCIO + 0.3 V TSTG −40 to + 125 °C Input Voltage (Note 2) Storage Temperature Note1: The absolute maximum ratings are rated values that must not be exceeded during operation, even for an instant. Any one of the ratings must not be exceeded. If any absolute maximum rating is exceeded, a device may break down or its performance may be degraded, causing it to catch fire or explode resulting in injury to the user. Thus, when designing products which include this device, ensure that no absolute maximum rating value will ever be exceeded. Note 2: Even VCCIO + 0.3 shall not exceed the VCCIOMax rating. 17.2.2 Recommended Operating Conditions VSS = 0 V (GND) Parameter Symbol Max Unit I/O = 3.3 V 3.1 3.5 V 2.3 2.7 V VCCInt 1.188 1.312 V TC −20 +85 °C VCCIO Supply Voltage (Core) Note: Min I/O = 2.5 V Supply Voltage (I/O) Operating Case Temperature Conditions The recommended operating conditions for a device are those under which it can be guaranteed that the device will operate as specified. If the device is used under operating conditions other than the recommended operating conditions (supply voltage, operating temperature range, specified AC and DC values, etc.), malfunction may occur. Thus, when designing products which include this device, ensure that the recommended operating conditions for the device are always adhered to. 17-6 Chapter 17 Electrical Characteristics 17.2.3 DC Characteristics 17.2.3.1 DC Characteristics TC = −20°C to 85°C, VCCInt = 1.25 V ± 5 %, VCCIO = 3.3 V ± 0.3 V or 2.5 V ± 0.2 V Parameter Symbol Output High Voltage VOH Output Low Voltage VOL Input High Voltage IOH = −16 mA (16-mA buffer) IOL = 8 mA (8-mA buffer) IOL = 16 mA (16-mA buffer) VIH Except for MasterClock input VIHC Applies to MasterClock VIL Input Low Voltage Conditions IOH = −8 mA (8-mA buffer) Min Max Units VCCIO − 0.6 ⎯ V ⎯ 0.4 V V 2 VCCIO + 0.3 0.8VCCIO VCCIO + 0.3 Except for MasterClock input When I/O=3.3V −0.5 0.8 Except for MasterClock input When I/O=2.5V −0.5 0.6 −0.5 0.2VCCIO ⎯ ±10 µA V VILC Applies to MasterClock Input Leakage ILI Applies to pins except(*1) (*2) Input Leakage (Note 1) (with Pull-up) ILlu −70 −10 µA Input Leakage (with Pull-down) (Note 2) ILid 10 70 µA Output Leakage ILO ⎯ ±20 µA Input Capacitance CIN ⎯ 10 pF Note 1: Applies to the following input pins that have an internal pull-up resistor. Int[5:0]*, NMI*, Reset*, JTMS, JTCK, JTDI, TPC[1] (If they need be pulled down, use a resistor with ≤ 20 kΩ.) Note 2: Applies to the following input pins that have an internal pull-down resistor. TRST*, RdRdy*, TPC[2], TPC[3] (If they need be pulled up, use a resistor with ≤ 20 kΩ.) 17.2.3.2 Operating Current TC = −20°C to 85°C, VCCInt = 1.25 V ± 5 %, VCCIO = 3.3 V ± 0.2 V or 2.5 V ± 0.2 V Parameter Symbol Typ. Max Units CPUCLK = 400 MHz 330 620 mA ICCInt2 CPUCLK = 400 MHz 260 500 mA Operating Current 3 (Core Power Supply: when HALT Mode operating) ICCInt3 CPUCLK = 400 MHz 110 280 mA Operating Current 4 (Core Power Supply: when MasterClock Stopped) ICCInt4 MasterClock = 0 MHz CPUCLK = 0 MHz 30 200 mA MasterClock = 133 Hz BufSel = 1 50% (8-mA buffer) Load = 25 pF 120 150 MasterClock = 100 MHz BufSel = 1 50% (8-mA buffer) Load = 25 pF 100 130 MasterClock = 133 Hz BufSel = 0 100% (16-mA buffer) Load = 25 pF 80 100 MasterClock = 100 MHz BufSel = 0 100% (16-mA buffer) Load = 25 pF 60 Operating Current 1 (Core Power Supply: when Normal Operating Mode) ICCInt1 Operating Current 2 (Core Power Supply: when Drystone 2.1 running) Operating current (When 3.3V Power supply for I/O pin) Operating current (When 2.5V Power supply for I/O pin) ICCIO33 ICCIO25 Conditions 17-7 mA mA 80 Chapter 17 Electrical Characteristics 17.2.4 AC Characteristics 17.2.4.1 Clock Timing TC = −20°C to 85°C, VCCInt = 1.25 V ± 5 %, VCCIO = 3.3 V ± 0.2 V or 2.5 V ± 0.2 V Min Max Units MasterClock High Width Parameter Symbol tMCH Transition ≤ 2 ns Conditions 2 ⎯ ns MasterClock Low Width tMCL Transition ≤ 2 ns 2 ⎯ ns MasterClock Frequency (Note 1) fMCK 33 133 MHz Internal Operation Frequency ⎯ 133 400 MHz Products for 400 MHz MasterClock Period tMCP ⎯ 7.5 30 ns MasterClock Rise Time tMCR ⎯ ⎯ 2 ns MasterClock Fall Time tMCF ⎯ ⎯ 2 ns Note 1: Operation of the TX4955C is only guaranteed with the Phase Lock Loop enabled. Note 2: All output timings assume a 25-pF capacitive load. 17.2.4.2 System Interface TC = −20°C to 85°C, VCCInt = 1.25 V ± 5 %, VCCIO = 3.3 V ± 0.2 V Parameter Symbol Data Output (Note 1, 2, 3) tDO Min Max BufSel = 0 100% (16-mA buffer) Conditions 1.0 (Note 4) 4.0 BufSel = 1 50% (8-mA buffer) 1.0 (Note 4) 4.5 Units ns Data Setup (Note 3) tDS ⎯ 2.3 ⎯ ns Data Hold (Note 3) tDH ⎯ 0.5 ⎯ ns TC = −20°C to 85°C, VCCInt = 1.25 V ± 5 %, VCCIO = 2.5 V ± 0.2 V Parameter Symbol Data Output (Note 1, 2, 3) Conditions Max 1.0 (Note 4) 4.5 BufSel = 1 50% (8-mA buffer) 1.0 (Note 4) 5.0 Units ns Data Setup (Note 3) tDS ⎯ 2.5 ⎯ ns Data Hold (Note 3) tDH ⎯ 0.5 ⎯ ns Note 1: Note 2: Note 3: Note 4: 17.2.5 tDO Min BufSel = 0 100% (16-mA buffer) Timings are measured from 1.5 V of MasterClock to 1.5 V of each signal. Capacitive load for all output timings is 25 pF. Applies to all system interface signals. Offers a guarantee of design. Timing Diagrams 17.2.5.1 Clock Timing tMCP tMCL tMCH tMCL MasterClock tMCM 0.8 *VCCIO 0.2 *VCCIO 1.5 V tMCR 17-8 tMCF Chapter 17 Electrical Characteristics 17.2.5.2 Clock Relationships Cycle 1 2 3 4 MasterClock CPUCLK (Internal Signal) GBUSCLK (Internal Signal) SysAD Driven D D D D tDO SysAD Received D D D D tDS tDH 17.2.5.3 System Interface Timing MasterClock GBUSCLK (Internal Signal) tDO tDS SysAD SysCmd Valid Output tDO Valid Input tDH ValidOut*, Release* Validln*, ExtRqst*, WrRdy*, RdRdy*, Int[5:0]*, NMI* tDH tDS tDH Valid Input 17-9 Chapter 17 Electrical Characteristics 17.2.5.4 Power-On Reset Timing VCC IO VCC Int VCC PLL MasterClock (MClk) GBUSCLK (Internal Clock) PLLReset* MasterClock & PLL Stabilization Time ≥ 1 ms ≥ 10 ms ColdReset* Reset* 17.2.5.5 ColdReset Timing MasterClock tDS tDH DivMode[2:0] tDS tDH ≥ 16 Master Clock cycles Reset* ≥ 64,000 Master Clock cycles ColdReset* 17.2.5.6 Soft Reset Timig MasterClock tDS tDH tDS Reset* ≥ 16 Master Clock cycles ColdReset* 17-10 Chapter 18 Package Dimension 18. Package Dimension 18.1 TMPR4955BFG/TMPR4955CFG • QFP160-P-2828-0.65A 18-1 Chapter 18 Package Dimension 18-2 Appendix A PLL Passive Components Appendix A. PLL Passive Components The Phase Locked Loop circuit requires several passive components for proper operation, which are connected to VccPLL, and VssPLL, as illustrated in Figure A.1. VccInt TX4955 R L VccPLL C1 C2 C3 VssPLL R L C1, C2, C3, R and L are Board Components which should be placed as close as possible to the processor. VSS Figure A.1 PLL Recommended Circuit Values: • R = 5.6 Ω (Note 1) • L = 2.2 µH • C1 = 1 nF (Note 1) • C2 = 82 nF (Note 1) • C3 = 10 µF (Note 1) • VccInt = 1.5 V ± 0.1V(TMPR4955B), 1.25 V ± 5%(TMPR4955C) The inductors (L) can be used as alternatives to the resistors (R) to filter the power supply. It is essential to isolate the analog power and ground for the PLL circuit (VccPLL/VssPLL) from the regular power and ground (VccInt/Vss). Note 1: These value should be changed to suitable value for each board. A-1 Appendix A PLL Passive Components A-2 Appendix B Movement parameter setting of a processor Appendix B. Movement parameter setting of a processor A table explains movement parameter with a processor. Item Writeback protocol Description These modes are selected by G2SConfig-Register. Write mode Writeback data rate R4000 compatible 01 Reserved 32-bit:AWxx reserved 10 Reissue write 32-bit:AW 11 Pipeline write 32-bit:AW These modes are selected by G2SConfig-Register. Date rate Clock multiplier (Clock ratio of MasterClock) 00 0 Consecutive translation 32-bit:AWWWWWWW 1 Dummy cycle 32-bit:AWxxWxxWxxWxx WxxWxxWxxWxx These modes are selected by external pin (DivMode[2:0]) which are loaded at Power-on or deasserting of ColdReset*. <TMPR4955B> DivMode[2:0] EC-bit 000 010 ratio 1:4 001 111 1:2.5 010 000 1:2 011 001 1:3 100 – – 101 101 1:4.5 110 110 1:5 111 – – DivMode[2:0] EC-bit ratio 000 010 1:4 001 111 1:2.5 010 000 1:2 011 001 1:3 100 100 1:3.5 101 101 1:4.5 110 110 1:5 111 011 1:6 <TMPR4955C> Endian set Endian is selected by external pin (Endian) which are loaded at Power-on or deasserting of ColdReset*. 0: Little Endian 1: Big Endian Timer Interrupt Timer-Interrupt is selected by external pin (TintDis). 0: Timer-Interrup is enable 1: Timer-Interrupt is disable SysAD bus protocol type SysAD bus protocol type is selected by external pin (MODE43*) which are loaded at Power-on or deasserting of ColdReset*. 0: R4300 type 1: R5000 type Note 1: Address (32-bit), W: Word (32-bit), x:Idle cycle Note 2: Initial set of data rate Single write: AWxx (R4300 compatible) Block write: AWWWWWWWW B-1 Appendix B Movement parameter setting of a processor B-2 Appendix C Differences between TMPR4955BFG and TMPR4955CFG Appendix C. Differences between TMPR4955BFG and TMPR4955CFG Items TMPR4955BFG TMPR4955CFG Part Number (abbreviation) TMPR4955BFG-200/-300 (TX4955B-200/-300) TMPR4955CFG-400 (TX4955C-400) 2 CPU Core TX49/H3 Core TX49/H4 Core 3 Internal maximum operating frequency 200 MHz / 300 MHz 400 MHz 4 The frequency relationship between the system bus interface (SysAD bus) and the CPU core 1:2, 1:2.5, 1:3, 1:4, 1:4.5, 1:5 1:2, 1:2.5, 1:3, 1:3.5, 1:4, 1:4.5, 1:5, 1:6 5 PRId (CP0) FCR0 (CP1) JTAGID PRId: FCR0: JTAGID: PRId: FCR0: JTAGID: 6 Output Buffer Selection 4 mA, 8 mA, 12 mA 8 mA, 16 mA Pin Assignment No.2: No.35: No2: No.35: 8 The signals not supporting JTAG boundary scan registers MasterClock: DivMode[2]: ColdReset*: Reset*: BufSel[1]: BufSel[0]: 1 7 0x00002d30 0x00002d30 0x10017031 BufSel[1] BufSel[0] not support not support handled as internal signals handled as internal signals handled as internal signals handled as internal signals 0x00002d40 0x00002d40 0x0002C031 BufSel VccIO MasterClock: ColdReset*: Reset*: BufSel: not support handled as internal signals handled as internal signals handled as internal signals 9 VccInt (Internal Power Supply) VccInt = 1.5 V ±0.1 V VccInt = 1.25 V ±5% 10 AC / DC Characteristics Refer Chapter 17 Refer Chapter 17 11 Recommended Operating Case Temperature Tc = 0 ∼ 70°C Tc = -20 ∼ 85°C C-1 Appendix C Differences between TMPR4955BFG and TMPR4955CFG C-2