Home
IBM PowerPC 403GA User's Manual
Contents
1. 6 16 18 20 24 26 27 28 31 obi 2 3 obs 5 ch 25 el ots 7 13 14 15 17 19 21 23 rhs d de de de Sc SC cho en Figure 4 18 DMA Status Register DMASR 0 3 cso Channel 0 3 Terminal Count Status TC will be set whenever the Transfer Count Cs3 0 Terminal count has not been reached in the reaches 0 and the channel does not chain Transfer Count Register for channels 0 3 respectively 1 Terminal count has been reached in the Transfer Count Register for channels 0 3 respectively 4 7 TSO Channel 0 3 End Of Transfer Status Valid only if EOT TC has been programmed for the EOT func TS3 tion 0 End of transfer has not been requested for channels 0 3 respectively 1 End of transfer has been requested for channels 0 3 respectively 8 11 RIO Channel 0 3 Error Status BIU errors RI3 0 No error Bus Protection 1 Error Non configured Bank Bus Error Input Time out Check DMA errors Unaligned Address 12 CTO Chained Transfer on Channel 0 0 No chained transfer has occurred 1 Chaining has occurred 13 16 IRO Internal DMA Request IR3 0 No internal DMA request pending 1 A DMA request from an internal device is pending 4 32 PPC403GA User s Manual 17 20 ERO External DMA Request ER3 0 No external DMA request pending 1 A DMA request from an external device is pending 21 24 CBO Channel Busy C
2. Mnemonic Register Name SPR Number Access CDBCR Cache Debug Control Register 0x3D7 Read Write CTR Count Register 0x009 Read Write DAC1 Data Address Compare 1 Ox3F6 Read Write DAC2 Data Address Compare 2 Ox3F7 Read Write DBCR Debug Control Register Ox3F2 Read Write DBSR Debug Status Register 0x3F0 Read Clear DCCR Data Cache Cacheability Register 0x3FA Read Write DEAR Data Exception Address Register 0x3D5 Read Only ESR Exception Syndrome Register 0x3D4 Read Write EVPR Exception Vector Prefix Register 0x3D6 Read Write IAC1 Instruction Address Compare 1 0x3F4 Read Write IAC2 Instruction Address Compare 2 0x3F5 Read Write ICCR Instruction Cache Cacheability Register 0x3FB Read Write ICDBDR Instruction Cache Debug Data Register 0x3D3 Read Only LR Link Register 0x008 Read Write PBL1 Protection Bound Lower 1 0x3FC Read Write PBL2 Protection Bound Lower 2 0x3FE Read Write PBU1 Protection Bound Upper 1 0x3FD Read Write 11 4 PPC403GA User s Manual Table 11 3 PPC403GA Special Purpose Registers cont Mnemonic Register Name SPR Number Access PBU2 Protection Bound Upper 2 Ox3FF Read Write PIT Programmable Interval Timer 0x3DB Read Write PVR Processor Version Number Ox11F Read Only SPRGO SPR General 0 0x110 Read Write SPRG1 SPR General 1 0x111 Read Write SPRG2 SPR
3. 1 Wait TWT 00011 k gt Hold 01 lt M Wait 00000 Hold 00 CSon 0 CSon 1 a ON a eS CSon 0 CSon 1 0 CSon 1 WEon 0 WEon 0 1WEon 1 WEoff 1 WEoff 0 Ba A VC WS CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon 1 Data Out Data Out The cycle of dead time shown in cycle 7 is used to illustrate that two independent transfers are occurring The cycle of dead time is not guaranteed and when bus utilization is high will not be present First Transfer Bank Regis ter Settings Seq Line Fills Burst Bus Enable Width Ready Enable Transfer Wait CSon Transfer Hold Bit 13 Bit14 Bits 15 16 Bit 17 Bits 18 23 Bit 24 Bits 28 30 X 0 XX 0 000011 0 1 001 Second Transfer Bank Regis ter Settings Seq Line Fills Bus Width Ready Enable Transfer Wait CSon Transfer Hold Bit 13 Bits 15 16 Bit 17 Bits 18 23 Bit 24 Bits 28 30 X XX 0 000000 0 000 Figure 3 8 Timing Diagram SRAM Write Memory and Peripheral Interface 3 15 3 6 1 3 WBE Signal Usage The byte write enable outputs WBE0 WBE3 select the bytes to be written in a memory write access The usage of these lines varies controlled by the bus width programmed into the bank register describing the memory region Table 3 3 Usage of WBE0 WBES3 vs Bus
4. Mnemonic Register Name DCR Number Access BEAR Bus Error Address Register 0x90 Read Only BESR Bus Error Syndrome Register 0x91 Read Write BRO Bank Register 0 0x80 Read Write BR1 Bank Register 1 0x81 Read Write BR2 Bank Register 2 0x82 Read Write BR3 Bank Register 3 0x83 Read Write BR4 Bank Register 4 0x84 Read Write BR5 Bank Register 5 0x85 Read Write 11 2 PPC403GA User s Manual Table 11 2 PPC403GA Device Control Registers cont Mnemonic Register Name DCR Number Access BR6 Bank Register 6 0x86 Read Write BR7 Bank Register 7 0x87 Read Write DMACCO DMA Chained Count 0 0x04 Read Write DMACC1 DMA Chained Count 1 OxCC Read Write DMACC2 DMA Chained Count 2 0xD4 Read Write DMACC3 DMA Chained Count 3 0xDC Read Write DMACRO DMA Channel Control Register 0 0xC0 Read Write DMACR1 DMA Channel Control Register 1 0xC8 Read Write DMACR2 DMA Channel Control Register 2 0xDO Read Write DMACR3 DMA Channel Control Register 3 0xD8 Read Write DMACTO DMA Count Register 0 0xC1 Read Write DMACT1 DMA Count Register 1 0xC9 Read Write DMACT2 DMA Count Register 2 0xD1 Read Write DMACT3 DMA Count Register 3 0xD9 Read Write DMADAO DMA Destination Address Reg 0 0xC2 Read Write DMADA1 DMA Destination Address Reg 1 OxCA Read Write DMADA2 DMA Destination Address Reg 2 0xD2 Read Write DMADA3 DMA
5. Other Mnemonic Operands Function Registers Page Changed addze RT RA Add XER CA to RA 10 15 Place answer in RT addze Place carry out in XER CA CRICRO addzeo XER SO OV addzeo CR CRO XER SO OV and RA RS RB AND RS with RB 10 16 Place answer in RA and CR CRO andc RA RS RB AND RS with RB 10 17 Place answer in RA andc CR CRO andi RA RS IM AND RS with 160 IM CR CRO 10 18 Place answer in RA andis RA RS IM AND RS with IM 160 CR CRO 10 19 Place answer in RA b target Branch unconditional relative 10 20 LI lt target ClAle ze NIA CIA EXTS LI 20 ba Branch unconditional absolute LI lt targetg o9 NIA EXTS LI 20 bl Branch unconditional relative LR CIA 4 LI lt target ClAle ze NIA CIA EXTS LI 20 bla Branch unconditional absolute LR CIA 4 LI lt targetg o9 NIA EXTS LI 20 Alphabetical Instruction Summary A 3 Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed be BO BI target Branch conditional relative CTR if BO 0 10 21 BD e target CIA 16 29 NIA CIA EXTS BD 20 bca Branch conditional absolute CTR if BO 0 BD e target16 29 NIA EXTS BD 20 bel Branch conditional relative CTR if BO 0 BD lt target C
6. Memory Peripheral Transfer Size Width Size pack unpack Byte Byte Byte Not required Halfword Byte Byte Allowed if memory is Byte writeable Word Byte Byte Allowed if memory is Byte writeable Byte Halfword Halfword Packing Unpacking occurs Data in memory must be halfword aligned Halfword Halfword Halfword Not required Word Halfword Halfword Allowed if memory is Byte or Halfword writeable Data in memory must be halfword aligned Byte Word Word Packing Unpacking occurs Data in memory must be word aligned Halfword Word Word Packing Unpacking occurs Data in memory must be word aligned Word Word Word Not required 4 2 8 Chained Operations The DMA channels also support DMA data chaining Data chaining can only be used with buffered and fly by mode transfers In either mode the PPC403GA will begin transferring data between the memory and the peripheral until one of these Chaining Conditions is detected e The channel will chain when the Transfer Count reaches zero AND Chaining is enabled AND TC Chain Mode is enabled e The channel will chain when EOT is active AND EOT Chain Mode is enabled AND Chaining is enabled Immediately upon completion of the transfers the count register is reloaded with a new count value from the DMACC and the address register is reloaded with the a new address from the DMASA Transfers then continue uninterrupted DMA Operations 4 23 Chaining will stop when any of
7. XER see also Section 2 3 2 5 on page 2 9 SPR SO CA TBC 4 4 4 0 1 2 3 24 25 31 ov Figure 11 52 Fixed Point Exception Register XER 0 SO Summary Overflow Reset only by mtspr specifying the XER 0 no overflow has occurred or by merxr 1 overflow has occurred 1 OV Overflow 0 no overflow has occurred 1 overflow has occurred 2 CA Carry 0 carry has not occurred 1 carry has occurred 3 24 reserved 25 31 TBC Transfer Byte Count Used by Iswx and stswx Written by mtspr specifying the XER 11 72 PPC403GA User s Manual Signal Descriptions Table 12 1 lists the PPC403GA signals ordered by signal name Table 12 2 lists the PPC403GA signals ordered by pin number Active low signals are shown with overbars CASO Multiplexed signals are alphabetized under the first unmultiplexed signal names on the same pins Table 12 1 PPC403GA Signal Descriptions Signal Name Pin UO Type Function A6 92 UO Address Bus Bit 6 When the PPC403GA is bus master this is an address output from the PPC403GA When the PPC403GA is not bus master this is an address input from the external bus master to determine bank register usage A7 93 VO Address Bus Bit 7 See description of A6 A8 94 VO Address Bus Bit 8 See description of A6 AQ 95 VO Address Bus Bit 9 See description of A6 A10 96 VO Address Bus Bit 10 See descript
8. SPCTL see also Section 7 3 2 on page 7 13 MMIO eh Ale d Ee 0 1 2 3 4 5 6 7 DIR DB pty Figure 11 36 Serial Port Control Register SPCTL 0 1 LM Loopback Modes 00 Normal Operation 01 Internal Loopback Mode 10 Automatic Echo Mode 11 Reserved 2 DTR Data Terminal Ready 0 DTR signal is inactive 1 DTR signal is active 3 RTS Request To Send 0 RTS signal is inactive 1 RTS is active 4 DB Data Bits When DB 0 a data frame contains the least 0 7 Data bits significant seven bits bits 1 7 in the SPTB or 1 8 Data bits the SPRB 5 PE Parity Enable When PE 0 parity detection and generation 0 No parity are disabled for the serial port receiver and 1 Parity enabled transmitter 6 PTY Parity When PTY 0 even parity is used in parity 0 Even parity detection and generation When PTY 1 odd 1 Odd parity parity is used 7 SB Stop Bits When SB 0 one stop bit is used to detect the 0 One stop bit end of a received frame and one stop bit is 1 Two stop bits transmitted at the end of each data frame When SB 1 two stop bits are used 11 54 PPC403GA User s Manual SPHS SPHS see also Section 7 3 3 on page 7 14 MMIO GE 0 F ds Figure 11 37 Serial Port Handshake Register SPHS 0 DIS DSR Input Inactive Error To reset the DIS bit the application software 0 DSR input is active must store a 1 in this bit location at the address 1 D
9. cccccssssseeeeeeeeeeeeeeeeeeeees 6 1 Interrupt ETC 6 2 Machine State Register MSR AE 6 2 Save Restore Register 0 and 1 SRRO SRR1 eeeeeeeeeeeeeseeeeeeeeeeeeeeeseeeseeeenaeeesaee 6 4 Save Restore Register 2 and 3 SRR2 SRR amp eeeeceeecceeeeeseeeeeeeteaeeeeeeseeeseeeenaeessaes 6 5 Exception Vector Prefix Register EVPR AA 6 7 External Interrupt Enable Register EXIER AA 6 8 External Interrupt Status Register E NI 6 9 Input Output Configuration Register IOCR esceeeseeeeeeseeeeeeeeeeeeeneeseaeeeeeseaeeeeeeeeaes 6 11 Exception Syndrome Register ESR cecceseceeeseeseeeeeeeeeeeeeeaeeseeeeeeeeeaeeeeeseeeseneeeaes 6 13 Bus Error Syndrome Register BESR A 6 14 Bus Error Address Register BEAR AAA 6 15 Data Exception Address Register DEAR AA 6 16 Exception Causes and Machine State cceccececceeeeeseeeeneeseeeeeneeseeeseeeseaeeeeeeseeeseeeeeaeeeea 6 16 Reset Exceptlons Seene size ceabecdvassvhasa dive ENEE ege od izes 6 16 GOKE RESEb EET E E sch adtiaace seeuncatesteangncs 6 17 Chip RSet sissies tied ere Eeer EE 6 17 System Reset sive haere eee an ets 6 17 Critical Interrupt Pin ExCeption AA 6 18 Machine Check Exceptions AAA 6 19 Protection Exception WEE 6 20 External Interrupt ExXCeption ssns ainia a e aiaa 6 21 AlIQrime tit te 6 22 Program Exception ssi iss nietin EE oxen oc Pests pd aS Aaaa Eal i UA E eV ai 6 23 E RENE 6 23 Programmable Interval Timer 2 cccessceese
10. 0 So 0 noncacheable 1 cacheable 0x0000 0000 0x07FF FFFF 1 S1 0 noncacheable 1 cacheable 0x0800 0000 OxOFFF FFFF 2 S2 0 noncacheable 1 cacheable 0x1000 0000 0x17FF FFFF 3 S3 0 noncacheable 1 cacheable 0x1800 0000 Ox1FFF FFFF 4 S4 0 noncacheable 1 cacheable 0x2000 0000 0x27FF FFFF 5 S5 0 noncacheable 1 cacheable 0x2800 0000 Ox2FFF FFFF 6 S6 0 noncacheable 1 cacheable 0x3000 0000 0x37FF FFFF 7 S7 0 noncacheable 1 cacheable 0x3800 0000 Ox3FFF FFFF 8 S8 0 noncacheable 1 cacheable 0x4000 0000 0x47FF FFFF 9 EI 0 noncacheable 1 cacheable 0x4800 0000 Ox4FFF FFFF 10 S10 0 noncacheable 1 cacheable 0x5000 0000 0x57FF FFFF 11 S11 0 noncacheable 1 cacheable 0x5800 0000 OxSFFF FFFF 12 12 0 noncacheable 1 cacheable 0x6000 0000 Ox67FF FFFF 8 8 PPC403GA User s Manual 13 13 0 noncacheable 1 cacheab 0x6800 0000 Ox6FFF FFFF 14 S14 0 noncacheable 1 cacheab 0x7000 0000 0x77FF FFFF 15 S15 0 noncacheable 1 cacheab 0x7800 0000 Ox7FFF FFFF 16 S16 0 noncacheable 1 cacheab 0x8000 0000 0x87FF FFFF 17 S17 0 noncacheable 1 cacheabl 0x8800 0000 Ox8FFF FFFF 18 18 0 noncacheable 1 cacheab 0x9000 0000 0x97FF FFFF 19 S19 0 noncacheable 1 cacheab 0x9800 0000 Ox9FFF FFFF 20 20 0 noncacheable 1 cacheab 0xA000 0000
11. DCCR see also Section 8 3 2 on page 8 8 SPR T ac Gig SS 10 i sie ay ai 20 SS 24 Sp T dii 07 1 2 3 4 5 6 7 8 9 10 11 12 13 DI 16 17 18 19 20 21 22 23 24 25 26 27 2820 30 31 A de ds T de el sla is De glo Si ae obs Ka ahs ae Figure 11 13 Data Cache Cacheability Register DCCR 0 S0 0 noncacheable 1 cacheable 0x0000 0000 OxO7FF FFFF 1 S1 0 noncacheable 1 cacheable 0x0800 0000 OxOFFF FFFF 2 ER 0 noncacheable 1 cacheable 0x1000 0000 0x17FF FFFF 3 S3 0 noncacheable 1 cacheable 0x1800 0000 0x1FFF FFFF 4 S4 0 noncacheable 1 cacheable 0x2000 0000 0x27FF FFFF 5 S5 0 noncacheable 1 cacheable 0x2800 0000 Ox2FFF FFFF 6 S6 0 noncacheable 1 cacheable 0x3000 0000 0x37FF FFFF 7 S7 0 noncacheable 1 cacheable 0x3800 0000 Ox8FFF FFFF 8 EI 0 noncacheable 1 cacheable 0x4000 0000 0x47FF FFFF 9 EI 0 noncacheable 1 cacheable 0x4800 0000 Ox4FFF FFFF 10 10 0 noncacheable 1 cacheable 0x5000 0000 0x57FF FFFF 11 S11 0 noncacheable 1 cacheable 0x5800 0000 OxSFFF FFFF 12 12 0 noncacheable 1 cacheable 0x6000 0000 Ox67FF FFFF 13 13 0 noncacheable 1 cacheable 0x6800 0000 Ox6FFF FFFF 14 S14 0 noncacheable 1 cacheable 0x7000 0000 0x77FF FFFF 15 S15 0 noncacheable 1 cacheable 0x7800 0000 Ox7FFF FFFF 16 S16 0 noncacheable 1 cacheable 0x8000 0000 0x87FF FFFF 17 S17 0 noncacheable 1 cacheable 0x8800 0000
12. Mnemonic bt bta btl btla btctr btctrl Operands cr_bit target cr_bit Function Branch if CRer pit 1 Extended mnemonic for bc 12 cr_bit target Other Registers Changed Extended mnemonic for bca 12 cr_bit target Extended mnemonic for bcl 12 cr_bit target LR Extended mnemonic for bcla 12 cr_bit target Branch if CRer pit 1 to address in CTR Extended mnemonic for bectr 12 cr_bit LR Extended mnemonic for bectrl 12 cr_bit LR Page 10 21 10 28 btir btirl cr_bit Branch if CRer pit 1 to address in LR Extended mnemonic for bclr 12 cr_bit Extended mnemonic for belrl 12 cr_bit LR 10 32 bun buna bunl bunla cr_field target Branch if unordered Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 3 target Extended mnemonic for bca 12 4 cr_field 3 target Extended mnemonic for bel 12 4 cr_field 3 target LR Extended mnemonic for bcla 12 4 cr_field 3 target LR 10 21 bunctr bunctrl cr_field Branch if unordered to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 3 Extended mnemonic for bectrl 12 4 cr_field 3 LR 10 28 Instructions By Category B 17 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bunir Operands
13. bne bnea bnel bnela cr_field target Branch if not equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 2 target Extended mnemonic for bca 4 4 cr_field 2 target Extended mnemonic for bel 4 4 cr_field 2 target LR Extended mnemonic for bela 4 4 cr_field 2 target LR 10 21 bng bnga bngl bngla cr_field target Branch if not greater than Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 1 target Extended mnemonic for Extended mnemonic for bel 4 4 cr_field 1 target bca 4 4 cr_field 1 target LR Extended mnemonic for bcla 4 4 cr_field 1 target LR 10 21 bni bnla bnil bnila cr_field target Branch if not less than Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 0 target Extended mnemonic for bca 4 4 cr_field 0 target Extended mnemonic for bel 4 4 cr_field 0 target LR Extended mnemonic for bcla 4 4 cr_field 0 target LR 10 21 Instruction Set 10 25 bc Branch Conditional Table 10 6 Extended Mnemonics for bc bca bcl bcla cont Other Mnemonic Operands Function Registers Page Changed bns cr_field target Branch if not summary overflow 10 21 Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 3 target bnsa Extended mnemonic
14. cecceeceeeseeeseeeeeeeeeeeeeneeseeeeeaeeseaeeeeeseaeeseeeeeaeessaeesenetsaten 8 2 Instruction Cache Cacheability Register ICCR c ceesceeeceeeeeeeeeeeeeeeseeeeeeeeeaeeeeeesneeens 8 4 le NIT 8 5 ICU Deh ggihg EE 8 6 Data Cache Unfug edu eh lnk Se Ed es ids ae ieee 8 6 DataiGache Operations ninesini Seet a a eai a ira o iS 8 7 Data Cache Cacheability Register DCCR ceecceeeceeeeeeeeeeeeeeeeeeeeeaeeteeeeeaeeeeaeeeeeesentens 8 8 DCW RE e 8 9 DCU Debugging EE 8 10 Re e Ui Le REN 9 1 Development Tool SUPPOSE A 9 1 ege MEET 9 1 Internal Ree Be TE 9 2 D PPC403GA User s Manual External Debug Mode siipiin aiae ntaa ee annee vaaata daaa aa ae a aaea r aaa aaa aaant 9 2 Real time Trace Debug Mode cccccceseeceeeseeeteseeeneneeeeseseeenesaeeeeaneeseseeenenseaeesseseneaes 9 2 Bus Status Debug Mode 2 ece eet Hecht Zeg geed ae 9 2 Processor Control et dderE cesceccgeedswiecct oa i ea a EE En AEE E e EEE iada 9 3 Processor Status siio si nidia genee deed e raataa ee Mannie an te ee went aE Ed 9 4 Debug Events ninia Ee EE eege en tee otie 9 4 Debug EE 9 5 Debug Registers romeren a ns Ge ei ee en ei se 9 6 Debug Control Register DBOR A 9 6 Debug Status Register DBSR AAA 9 8 Data Address Compare Registers DAC DAC 9 10 Instruction Address Compare IAC1 IAC2 oe eeeeeeceeeeeeeneeeneeteaeeeeeeeeeeeeaeeeeaeeteeeeeeenees 9 11 Ree lte 9 11 FACES E EE 9 11 Be le Ee TEE 9 12 Trace Status CONDECION so sc
15. sc System call exception is generated SRR1 lt MSR SRRO PC PC e EVPRo 45 x 0C00 MSR WE EE PR PEJ 0 10 130 B 46 PPC403GA User s Manual Table B 13 Processor Management Instructions cont Mnemonic sync Operands Function Synchronization All instructions that precede sync complete before any instructions that follow sync begin When sync completes all storage accesses initiated prior to sync will have completed Other Registers Changed Page 10 161 tw TO RA RB Trap exception is generated if comparing RA with RB any condition specified by TO is true 10 162 twi TO RA IM Trap exception is generated if comparing RA with EXTS IM any condition specified by TO is true 10 164 Instructions By Category B 47 B 48 PPC403GA User s Manual C Instruction Timing and Optimization This appendix contains information in three categories 1 Much of the opportunity for code optimization for the PPC403GA derives from the superscalar operation of the processor Many of the coding guidelines for optimiza tion derive from the restrictions which the processor places on superscalar opera tion A very brief introduction to this topic is given in Section C 1 Background Information below A detailed reference on folding is given in Section C 4 Detailed Folding Rules on page C 10 2 O
16. DCR DCRN 10 69 10 100 mfmsr RT Move from MSR to RT RT lt MSR 10 102 mfspr RT SPRN Move from SPR to RT RT lt SPR SPRN Privileged for all SPRs except LR CTR and XER 10 103 mtdcr mtmsr DCRN RS RS Move to DCR from RS DCR DCRN RS Move to MSR from RS MSR lt RS 10 107 10 109 Instructions By Category B 3 Table B 3 Privileged Instructions cont Other Mnemonic Operands Function Registers Page Changed mtspr SPRN RS Move to SPR from RS 10 110 SPR SPRN RS Privileged for all SPRs except LR CTR and XER rfci Return from critical interrupt 10 123 PC SRR2 MSR SRR3 rfi Return from interrupt 10 124 PC SRRO MSR lt SRR1 wrtee RS Write value of RS46 to the External Enable 10 166 bit MSR EE wrteei E Write value of E to the External Enable 10 167 bit MSR EE B 4 PPC403GA User s Manual B 4 Assembler Extended Mnemonics In the appendix Assembler Extended Mnemonics of the PowerPC Architecture it is required that a PowerPC assembler support at least a minimal set of extended mnemonics These mnemonics encode to the opcodes of other instructions the only benefit of extended mnemonics is improved usability Code using extended mnemonics can be easier to write and to understand Table B 4 lists the extended mnemonics r
17. In a Little Endian memory system NOT in the memory of a PowerPC processor in Little Endian mode memory looks as follows after the structure is stored 14 13 12 11 00 01 02 03 04 05 06 07 28 27 26 25 24 23 22 21 08 09 DA 0B DC oD 0E OF 2 18 PPC403GA User s Manual 34 33 32 31 A RB Cc D 10 11 12 13 14 15 16 17 E FE OG 52 51 18 19 1A 1B 1C 1D 1E 1F 64 63 62 61 20 21 22 23 With a PowerPC processor in Little Endian mode memory looks as follows after the structure is stored 11 12 13 14 00 01 02 03 04 05 06 07 21 22 23 24 25 26 27 28 08 09 DA 0B DC oD 0E OF D Cc B A 31 32 33 34 10 11 12 13 14 15 16 17 51 52 OG F E 18 19 1A 1B 1c 1D 1E 1F 61 62 63 64 20 21 22 23 Note that viewed from memory the last case is neither Big Endian nor Little Endian It will now be shown how this case was obtained and how this case appears to be a Little Endian memory when viewed from the processor In the Little Endian mode the three low order bits of the address are altered at the interface between the processor and the memory subsystem The processor is unaware of these alterations all address computation activities of the processor incrementing of the Instruction Address Register computation of Effective Address computation of new address on Load with Update instructions etc proceed unchanged from the Big
18. PPC403GA User s Manual For the PowerPC Little Endian mode to be considered equivalent to the true Little Endian memory the values returned to the processor must match those shown for the true Little Endian case A word store of 0x1112_1314 in a PowerPC system in Little Endian mode would produce the following in memory 04 05 06 07 This may be probed with a word load two halfword loads or four byte loads These results would be produced Word load from processor address 00 hits memory address 04 0x1112_1314 Halfword load from processor address 00 hits memory address 06 0x1314 Halfword load from processor address 02 hits memory address 04 0x1112 Byte load from processor address 00 hits memory address 07 0x14 Byte load from processor address 01 hits memory address 06 0x13 Byte load from processor address 02 hits memory address 05 0x12 Byte load from processor address 03 hits memory address 04 0x11 This example shows that the processor sees precisely the correct results for a Little Endian system The processor is unaware that the data was stored in unexpected places in memory 2 5 1 Non processor Memory Access in Little Endian The system designer must be aware of this unexpected relocation of data in the memory system of a PowerPC processor in Little Endian mode if it is desired to equip the system with any feature which observes the memory dire
19. 20 31 reserved 2 11 Privileged Mode Operation 2 11 1 Background and Terminology In the PowerPC architecture there are a number of terms used to describe the concept of a privileged mode The mode in which the processor is privileged to execute ALL instructions is referred to as both Privileged Mode and Supervisor State The opposite state in which the processor is NOT allowed to execute certain instructions is called both User Mode and Problem State These terms are used in pairs Privileged Non privileged Privileged Mode User Mode Supervisor State Problem State The architecture uses the abbreviation PR for the MSR bit that controls the mode state The MSR PR bit when set to b 1 indicates the processor is in Problem State Thus when the MSR PR bit is OFF ie b 0 the processor is in Supervisor State 2 11 2 MSR Bits and Exception Handling The current value of the MSR PR bit is saved in the SRR1 SRR3 along with all the other MSR bits upon any interrupt and the MSR PR bit is then set to b 0 in all cases This means that all exception handlers operate in Supervisor State and can execute all instructions The MSR PR bit is restored along with the other MSR bits from SRR1 SRR3 upon execution of an rfi rfci instruction 2 36 PPC403GA User s Manual Privileged violations are just another form of Program Exception see Sectio
20. 662 0 6 11 16 21 EA lt RB RA MS EA 4 lt RS 2431 Il RS 16 2 Il RS s 15 Il RS o 7 31 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The contents of register RS are byte reversed the least significant byte becomes the most significant byte the next least significant byte becomes the next most significant byte and so on The result is stored into word at the effective address If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 149 stwcx Store Word Conditional Indexed stwcx RS RA RB 31 RS RA RB 150 1 0 6 11 16 21 31 EA lt RB RA O if RESERVE 1 then MS EA 4 lt RS RESERVE lt 0 CR CRO lt 20 1 XER else CR CRO lt 20 0 XER An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple
21. Cycle SysClk DMAR DMAA A6 A29 DO 31 RASn CAS0 3 DRAMOE DRAMWE R W Figure 4 9 Fly By Transfer from 3 cycle DRAM to a 32 bit Peripheral Once the DMA channel is configured the peripheral initiates a transfer by placing a 0 on the PPC403GA DMAR pin When the transfer is from a memory to a peripheral as shown in 4 12 PPC403GA User s Manual Figure 4 7a on page 4 10 the PPC403GA outputs the correct control signals to the memory so that the memory can output one data item The PPC403GA places a 0 on the DMAA pin while the memory access is in progress the peripheral captures the data on the rise of DMAA When the transfer is from peripheral to memory the peripheral drives the data bus while DMAA is low DMA Operations 4 13 4 2 4 Fly By Burst Fly By Burst transfers allow the DMA channel to use the burst capability of a memory device In Fly By Burst Mode transfers the PPC403GA provides addresses and control signals to the memory and control signals to the peripheral Once the DMA channel is configured the peripheral initiates a transfer by placing a 0 on the DMAR pin for that channel The PPC403GA accesses the memory using the parameters in the BIU Bank Register corresponding to the DMA memory address The PPC403GA signals the peripheral to accept place data on the bus using DMAA and DMADXFER If the memory is capable and DMAR remains active the subsequent transfer
22. RA lt ROTL RS n Extended mnemonic for rlwinm RA RS n 0 31 Extended mnemonic for rlwinm RA RS n 0 31 CRI CRO 10 126 A 30 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic rotrwi rotrwi Operands RA RS n Function Rotate right immediate RA ROTL RS 32 n Extended mnemonic for rlwinm RA RS 32 n 0 31 Other Registers Changed Extended mnemonic for rlwinm RA RS 32 n 0 31 CRI CRO Page 10 126 sc System call exception is generated SRR1 MSR SRRO PC PC e EVPRo 15 x 0C00 MSR WE EE PR PEJ lt 0 10 130 slw slw RA RS RB Shift left RS by RB p7 91 ne RB o7 31 r ROTL RS n if RB og 0 thenm lt MASK O 31 n elsem lt 20 RA eram CRI CRO 10 131 slwi slwi RA RS n Shift left immediate n lt 32 RA o 31 n lt RS n 31 RA 32 n 31 e 0 Extended mnemonic for rlwinm RA RS n 0 31 n Extended mnemonic for rlwinm RA RS n 0 31 n CRI CRO 10 126 sraw sraw RA RS RB Shift right algebraic RS by RB 27 314 ne RB 27 31 r ROTL RS 32 n if RB og 0 then m lt MASK n 31 elsem lt 270 s e RS o RA e r a m v 82s a am XER CA lt s A r A m 0 CRI CRO 10 132 srawi srawi RA RS SH Shift right algebraic RS b
23. enable desired timers Si mtspr TBHI me base bi set time base hi first to catch possible ripple mtspr TBLO time_base_ set time base low 3 mtspr PIT pit_count set desired pit count S Ee ee Wi Initialize Exceptions in the Machine State Register Ki ZC Ki Exceptions must be enabled immediately after timer Ki facilities to avoid missing a timer exception Ki IW zf The MSR also controls the user supervisor mode Ri protection mode and the wait state These modes must be initialized by the operating system or application code Le ZS EE mtmsr machine_state ZS Gegen SA initialization of non processor facilities should be performed at this time ay ZS EE EE a Eeer SA branch to operating system or application code I JS p a ee Ss ee Si ba amp code_load_address Reset and Initialization 5 13 5 14 PPC403GA User s Manual Interrupts Exceptions and Timers An interrupt is the action in which the processor saves its old context MSR and instruction pointer and begins execution at a pre determined interrupt handler address with a modified MSR Exceptions are the events which will if enabled cause the processor to take an interrupt PPC403GA exceptions are generated by signals from internal and external peripherals instructions the internal timer facility debug events or error conditions Six external interrupt pins are provided on the PPC403GA one critic
24. srw RA RS RB Rc 0 srw RA RS RB Rc 1 31 RS RA RB 536 Rc 0 6 11 16 21 31 n lt RB o7 34 r ROTL RS 32 n if Plo 0 then m lt MASK n 31 else m lt 320 RA eram The contents of register RS are shifted right by the number of bits specified by bits 27 through 31 of register RB Bits shifted right out of the least significant bit are lost and 0 bits are supplied to fill the vacated bit positions on the left The result is placed into register RA If bit 26 of register RB contains a one register RA is set to 0 Registers Altered e RA e CR CRO z ct a so H Re contains 1 Architecture Note 10 This instruction is part of the PowerPC User Instruction Set Architecture 10 134 PPC403GA User s Manual stb Store Byte stb RS D RA 38 RS RA D 0 6 11 16 31 EA lt EXTS D RA IO MS EA 1 e Dk An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is O when the RA field is 0 and is the contents of register RA otherwise The least significant byte of register RS is stored into the byte at the effective address in main storage Registers Altered e None Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 135 stbu Store Byte with Update stbu RS D RA 39 RS RA D 0 6 11
25. If a carry out occurs XER CA is set to 1 Registers Altered e RT e XER CA e CR CRO z ecr a so if Re contains 1 e XER SO OV if OE contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 29 Extended Mnemonics for subfc subfc subfco subfco Other Mnemonic Operands Function Registers Page Changed subc RT RA RB Subtract RB from RA 10 156 RT lt RB RA 1 Place carry out in XER CA Extended mnemonic for subfc RT RB RA subc Extended mnemonic for CR CRO subfc RT RB RA subco Extended mnemonic for XER SO OV subfco RT RB RA subco Extended mnemonic for CR CRO subfco RT RB RA XER SO OV 10 156 PPC403GA User s Manual subfe Subtract From Extended subfe RT RA RB OE c 0 subfe RT RA RB OE c 1 subfeo RT RA RB OE c 0 subfeo RT RA RB OE c 1 31 RT RA RB OE 136 Re RT lt RA RB XER CA if 4 RA RB XER CA 2 2 1 then 6 XER CA lt 1 else XER CA lt 0 31 The sum of the ones complement of register RA register RB and XER CA is placed into register RT XER CA is set to a value determined by the unsigned magnitude of the result of the subtraction operation Registers Altered RT e XERI CA e CR CRO ecr a so H Re contains 1 e XER SO OV if OE contains 1 Architecture Note This
26. Other Mnemonic Operands Function Registers Page Changed Ihzux RT RA RB Load halfword from EA RA O RB 10 83 and pad left with zeroes RT 160 MS EA 2 Update the base address RA e EA Ihzx RT RA RB Load halfword from EA RA O RB 10 84 and pad left with zeroes RT 160 MS EA 2 li RT IM Load immediate 10 10 RT lt EXTS IM Extended mnemonic for addi RT 0 value lis RT IM Load immediate shifted 10 13 RT lt IM So Extended mnemonic for addis RT 0 value Imw RT D RA Load multiple words starting from 10 85 EA RA O EXTS D Place into consecutive registers RT through GPR 31 RA is not altered unless RA GPR 31 Iswi RT RA NB Load consecutive bytes from EA RA 0 10 86 Number of bytes n 32 if NB 0 else n NB Stack bytes into words in CEIL n 4 consecutive registers starting with RT to Reina lt RT CEIL n 4 1 32 GPR 0 is consecutive to GPR 31 RA is not altered unless RA Re nac Iswx RT RA RB Load consecutive bytes from 10 88 EA RA 0 RB Number of bytes n XER TBC Stack bytes into words in CEIL n 4 consecutive registers starting with RT to Reinat lt RT CEIL n 4 1 32 GPR 0 is consecutive to GPR 31 RA is not altered unless RA Re nac RB is not altered unless RB Droa If n 0 content of RT is undefined lwarx RT RA RB Load word from EA RA 0 RB 10 90 and place in RT RT lt MS EA 4 Set the Reservation
27. PPC403GA User s Manual DBCR cont 30 JOI JTAG Serial Outbound Interrupt Enable 0 Disable 1 Enable 31 Jil JTAG Serial Inbound Interrupt Enable 0 Disable 1 Enable Register Summary 11 21 DBSR DBSR see also Section 9 7 2 on page 9 8 SPR IC EXC UDE IA2 DW1 DW2 JIO yy yy Jf a 0 2 3 4 6 8 9 10 11 12 21 22 23 24 28 29 30 1 5 7 9 11 31 d de d ob ek IDE D a pa Figure 11 12 Debug Status Register DBSR 0 IC Instruction Completion Debug Event 0 Event Didn t Occur 1 Event Occurred 1 BT Branch Taken Debug Event 0 Event Didn t Occur 1 Event Occurred 2 EXC Exception Debug Event 0 Event Didn t Occur 1 Event Occurred 3 TIE TRAP Instruction Debug Event 0 Event Didn t Occur 1 Event Occurred 4 UDE Unconditional Debug Event 0 Event Didn t Occur 1 Event Occurred 5 IA1 Instruction Address Compare 1 Debug Event 0 Event Didn t Occur 1 Event Occurred 6 IA2 Instruction Address Compare 2 Debug Event 0 Event Didn t Occur 1 Event Occurred 7 D I Data Address Read Compare 1 Debug Event 0 Event Didn t Occur 1 Event Occurred 8 DW1 Data Address Write Compare 1 Debug Event 0 Event Didn t Occur 1 Event Occurred 9 DR2 Data Address Read Compare 2 Debug Event 0 Event Didn t Occur 1 Event Occurred 10 DW2 Data Address Write C
28. RB 10 58 10 66 icbt RA RB Load the instruction cache block which contains the effective address RA O RB 10 67 iccci RA RB Invalidate instruction cache congruence class associated with the effective address RA O RB 10 68 B 44 PPC403GA User s Manual Table B 11 Cache Control Instructions cont Other Mnemonic Operands Function Registers Page Changed icread RA RB Read either tag or data information from the 10 69 instruction cache congruence class associated with the effective address RA O RB Place the results in ICDBDR B 12 Interrupt Control Instructions The interrupt control instructions allow the user to move data between general purpose registers and the machine state register return from interrupts and enable or disable maskable external interrupts Table B 12 shows the Interrupt control instruction set Table B 12 Interrupt Control Instructions Other Mnemonic Operands Function Registers Page Changed mfmsr RT Move from MSR to RT 10 102 RT lt MSR mtmsr RS Move to MSR from RS 10 109 MSR lt RS rfci Return from critical interrupt 10 123 PC SRR2 MSR lt SRR3 rfi Return from interrupt 10 124 PC SRRO MSR lt SRR1 wrtee RS Write value of RS46 to the External Enable 10 166 bit MSR EE wrteei E Write value of E to the External Enable 10
29. Sg G t 7 he 28 ele edie Figure 11 23 External Interrupt Enable Register EXIER CIE Critical Interrupt Enable 0 Critical Interrupt Pin interrupt disabled 1 Critical Interrupt Pin interrupt enabled 1 3 reserved SRIE Serial Port Receiver Interrupt Enable 0 Serial port receiver interrupt disabled 1 Serial port receiver interrupt enabled STIE Serial Port Transmitter Interrupt Enable 0 Serial port transmitter interrupt disabled 1 Serial port transmitter interrupt enabled JRIE JTAG Serial Port Receiver Interrupt Enable 0 JTAG serial port receiver interrupt disabled 1 JTAG serial port receiver interrupt enabled JTIE JTAG Serial Port Transmitter Interrupt Enable 0 JTAG serial port transmitter interrupt disabled 1 JTAG serial port transmitter interrupt enabled DOIE D11E DMA Channel 0 Interrupt Enable 0 DMA Channel 0 interrupt disabled 1 DMA Channel 0 Interrupt enabled DMA Channel 1 Interrupt Enable 0 DMA Channel 1 interrupt disabled 1 DMA Channel 1 interrupt enabled 10 D2lE DMA Channel 2 Interrupt Enable 0 DMA Channel 2 interrupt disabled 1 DMA Channel 2 interrupt enabled 11 D3IE DMA Channel 3 Interrupt Enable 0 DMA Channel 3 interrupt disabled 1 DMA Channel 3 interrupt enabled 12 26 reserved 27 EOIE External Interrupt 0 Enable 0 Interrupt from External Interrupt 0 pin disabled 1 Inter
30. 10 152 stwux RS RA RB Store word RS in memory at EA RA O RB Update the base address RA e EA 10 153 stwx RS RA RB Store word RS in memory at EA RA 0 RB 10 154 Instructions By Category B 33 B 6 Arithmetic and Logical Instructions Table B 6 shows the set of arithmetic and logical instructions supported by the PPC403GA Arithmetic operations are performed on integer or ordinal operands stored in registers Instructions using two operands are defined in a three operand format where the operation is performed on the operands stored in two registers and the result is placed in a third register Instructions using one operand are defined in a two operand format where the operation is performed on the operand in one register and the result is placed in another register Several instructions also have immediate formats in which one operand is coded as part of the instruction itself Most arithmetic and logical instructions can optionally set the condition code register based on the outcome of the instruction Table B 6 Arithmetic and Logical Instructions Other Mnemonic Operands Function Registers Page Changed add RT RA RB Add RA to RB 10 7 Place answer in RT add CR CRO addo XER SO OV addo CR CRO XER SO OV addc RT RA RB Add RA to RB 10 8 Place answer in RT
31. Figure 3 20 Figure 3 21 Figure 3 22 Figure 3 23 Figure 3 24 Figure 3 25 PPC403GA Block Diagram ceecccesceseceeeeeeeeeeeeeeeeeeeesaeeseeeeeeeseaeeeeeseaeeeeeeeeatee 1 4 PPC403GA Address Map A 2 4 General Purpose Register RO R31 eeceeseeeeeeeeeeeeeeeeeneeteaeeeeessaeeseeeeeaeesaaee 2 5 Count Register CTR ege adie ha ea ei de ein he 2 6 Link Register ET 2 7 Processor Version Register PVR ssceseseeeeeseeeeeseeeeeneeeeenneeeseneeeeenetereaes 2 8 Special Purpose Register General SPRGO SPRG amp cceesceeeeteeetteeees 2 9 Fixed Point Exception Register XER AAA 2 9 Condition Register CH 2 11 PPC403GA Data types AE 2 15 PPC403GA Instruction Queue oe ceeeeeeeeeeeeeeeeeeeeeteeeeeseeeeeeeeaeeeeaeeeaeeeeaeeteneenaes 2 23 Protection Bound Lower Register PBL1 PBL2 A 2 35 Protection Bound Upper Register PBU1 PBU2 AAA 2 36 e Ee 3 1 Grouping of External BIU Signals 2 0 0 ecceeseeeeeeeneeseeeeeeeeseaeeteereaeeseeeenaeesaaee 3 3 Attachment of Devices of Various Widths to the PPC403GA Data Bus 3 6 Usage of Address Bits ue NEE SEENEN ENEE NEE EE eiia tiai 3 7 Parameter Definitions SRAM Single Transfer eccssceeseeereeeteeeeeeeeaes 3 12 Parameter Definitions SRAM Burst Mode A 3 13 Timing Diagram SRAM Read ecceeceeeeeeeeeeneeeeeeeeeeeeeeeseeeseeeenaeeseeeeeaeenea 3 14 Timing Diagram SRAM Write ceeeeeceeeeeseeeeeneeeeeeeeaeeeeeeseeeseeeeeeeseeeeneeeee 3 15
32. RA lt RS v IM t60 The IM Field is extended to 32 bits by concatenating 16 0 bits on the right Register RS is ORed with the extended IM field and the result is placed into register RA Registers Altered e RA Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 122 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family rfci Return From Critical Interrupt rfci 19 51 0 6 21 31 PC lt SRR2 MSR lt SRR3 The program counter PC is restored with the contents of SRR2 and the MSR is restored with the contents of SRR3 Instruction execution returns to the address contained in the PC Registers Altered e MSR Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations Instruction Set 10 123 rfi Return From Interrupt rfi 19 50 6 PC lt SRRO MSR lt SRR1 21 31 The program counter PC is restored with the contents of SRRO and the MSR is restored with the contents of SRR1 Instruction execution returns to the address contained in the PC Registers Altered e MSR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC Operating
33. cntlzw RA RS Count leading zeros in RS 10 41 Place result in RA cntlzw CR CRO divw RT RA RB Divide RA by RB signed 10 60 Place answer in RT divw CR CRO divwo XER SO OV divwo CR CRO XER SO OV Instructions By Category B 35 Table B 6 Arithmetic and Logical Instructions cont Other Mnemonic Operands Function Registers Page Changed divwu RT RA RB Divide RA by RB unsigned 10 61 P Place answer in RT divwu CR CRO divwuo XER SO OV divwuo CR CRO XER SO OV eqv RA RS RB Equivalence of RS with RB 10 63 RA lt RS RB eqv CR CRO extsb RA RS Extend the sign of byte RS 24 31 10 64 Place the result in RA extsb CR CRO extsh RA RS Extend the sign of halfword RS 46 31 10 65 Place the result in RA extsh CR CRO mulhw RT RA RB Multiply RA and RB signed 10 112 Place hi order result in RT mulhw prodo s3 lt RA x RB signed CR CRO RT e prodo 31 mulhwu RT RA RB Multiply RA and RB unsigned 10 113 Place hi order result in RT mulhwu prodo s3 lt RA x RB unsigned CRICRO RT e prodo 31 mulli RT RA IM Multiply RA and IM signed 10 114 Place lo order result in RT prodo 47 lt RA x IM signed RT lt prodig 47 mullw RT RA RB Multiply RA and RB signed 10 115 Place lo order result in RT mullw prody g3 lt RA x RB
34. e icread instruction cache read This is a debugging instruction which reads either an instruction cache tag entry or an instruction word from an instruction cache line The behavior of the instruction is con trolled by bits in the CDBCR This is a privileged mode instruction Cache Operations 8 5 8 2 4 ICU Debugging The icread instruction detailed description on page 10 69 is a debugging tool for reading the instruction cache entries for the congruence class specified by EAso 07 The cache information will be read into the Instruction Cache Debug Data Register ICDBDR 31 Figure 8 5 Instruction Cache Debug Data Register ICDBDR 0 31 Instruction Cache Information see icread page 10 69 If CDBCR 37 0 the information will be one word of instruction cache data from the addressed line The word is specified by EA za If CDBCR3 0 the data will be from the A side otherwise from the B side If CDBCRo7 1 the information will be the cache tag If CDBCR3 0 the tag will be from the A side otherwise from the B side Instruction cache tag information is represented as follows 0 21 TAG Cache Tag 22 26 reserved 27 V Cache Line Valid 0 Not valid 1 Valid 28 30 reserved 31 LRU Least Recently Used 0 Not least recently used 1 Least recently used 8 3 Data Cache Unit The DCU contains a two way set associative 1KB copy back cache me
35. mtdcr BR5 bank Bb configuration if bank_6_ exists mtdcr BR6 bank_6_ configuration if bank_7_ exists mtdcr BR7 bank_7_configuration NY _ Reconfigure bank 0 if necessary Ri fe a Sea ge a S A O O E E Wi if configuring bank 0 while accessing bank 0 is NOT allowed move_code amp another_bank mtdcr BRO bank 0 configuration move_code amp another_bank 4 blr bla amp another_bank branch to bank 0 configuration code and save the return point 2 L eee Invalidate both caches and enable cacheability S ZE eee zt e E Invalidate the instruction cache Z ENEE eS Ki address 0 start at first line for line 0 line lt 64 line the i cache has 64 congruence classes vi iccci address iccci instruction invalidates congruence class address 16 point to the next congruence class ZS eege eeng Wi Invalidate the data cache ir nr er address 0 start at first line SI for line 0 line lt 32 line the d cache has 32 congruence classes dccci address decci instruction invalidates congruence class address 16 point to the next congruence class Reset and Initialization 5 9 P Enable cacheability lt H_ ANA mtspr DCCR d_cache_cacheability enable d cache mtspr ICCR i_cache_cacheability enable i cache Load operating system and or application code including exce
36. 10 32 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bge bgea bgel bgela Operands cr_field tar get Function Branch if greater than or equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 0 target Other Registers Changed Extended mnemonic for bca 4 4 cr_field 0 target Extended mnemonic for bel 4 4 cr_field 0 target LR Extended mnemonic for bcla 4 4 cr_field 0 target LR Page 10 21 bgectr bgectrl cr_field Branch if greater than or equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 0 Extended mnemonic for bectrl 4 4 cr_field 0 LR 10 28 bgelr bgelrl cr_field Branch if greater than or equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 0 Extended mnemonic for belrl 4 4 cr_field 0 LR 10 32 bgt bgta bgtl bgtla cr_field tar get Branch if greater than Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 1 target Extended mnemonic for bca 12 4 cr_field 1 target Extended mnemonic for bel 12 4 cr_field 1 target LR Extended mnemonic for bcla 12 4 cr_field 1 target LR 10 21 Alphabetical Instruction Summary A 9 Table A 1 PPC403GA Instruction Syntax Summary con
37. 31 RS RA RB 661 0 6 11 16 21 31 EA lt RB RAJO n lt XER TBC r RS 1 i0 do while n gt 0 if i 0 then rer i if r 32 then re o0 MS EA 1 lt GPR r ii 7 ic i 8 if i 32 then i 0 EA lt EA 1 nen 1 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise A byte count is contained in XER TBC The contents of a series of consecutive GPRs starting with register RS continuing through GPR 381 wrapping to GPR 0 and continuing to the final byte count are stored starting at the effective address The bytes in each GPR are accessed starting with the most significant byte The byte count determines the number of transferred bytes If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields 10 146 PPC403GA User s Manual stswx Store String Word Indexed Programming Note If XER TBC contains 0 the stswx instruction transfers no bytes the instruction will be treated as a no op The PowerPC Architecture states that if XER TBC 0 and if the EA is such that a precise data exception would normally occur if not for the zero length then stswx will be treated as a no op and the precise exception will not occur A violation of the Protection Bounds registers is an e
38. Chip select is valid one SysClk cycle after address is valid 25 OEN Output Enable On Timing Controls when the data bus goes active 0 Output Enable is valid when for writes as well as reads chip select is valid 1 Output Enable is valid one SysClk cycle after chip select is valid 26 WBN Write Byte Enable On Timing 0 Write byte enables are valid when Chip Select is valid 1 Write byte enables are valid one SysClk cycle after chip select is valid 27 WBF Write Byte Enable Off Timing 0 Write byte enables become inactive when chip select becomes inactive 1 Write byte enables become inactive one SysClk cycle before chip select becomes inactive 28 30 TH Transfer Hold Contains the number of hold cycles inserted at the end of a transfer Hold cycles insert idle bus cycles between transfers to enable slow periph erals to remove data from the data bus before the next transfer begins reserved for BRO BR3 For BRO BR3 on a write this bit is ignored on a read a zero is returned 31 SD SRAM DRAM Selection for BR4 BR7 For BR4 BR7 in SRAM configuration 0 DRAM usage this bit must be 1 1 SRAM usage 11 10 PPC403GA User s Manual BR4 BR7 DRAM Configuration BR4 BR7 DRAM see also Section 3 7 2 on page 3 36 DCR BAS BU ERM IEM ARM DAC RAR RR 4 4 poy yf 0 7 8 10 11 che 14 15 16 17 18 19 20 21 22 23 24 25 26 27 30 31 ij he Oc ls a ai t t BS SLF BW
39. Disable 1 Enable Data Address Compare 1 Size 00 Compare All Bits 01 Ignore1 LSB 10 Ignore 2 LSBs 11 Ignore 4 LSBs 20 D2R Data Address Compare 2 Read Enable 0 Disable 1 Enable 21 D2W Data Address Compare 2 Write Enable 0 Disable 1 Enable Debugging 9 7 22 23 D2S Data Address Compare 2 Size 00 Compare All Bits 01 Ignore1 LSB 10 Ignore 2 LSBs 11 Ignore 4 LSBs 24 reserved 25 SBT Second Branch Taken Debug Event 0 Disable 1 Enable 26 SED Second Exception Debug Event 0 Disable 1 Enable 27 STD Second TRAP Debug Event 0 Disable 1 Enable 28 SIA Second Instruction Address Compare Enable Uses address register IAC2 0 Disable 1 Enable 29 SDA Second Data Address Compare Enable Uses DBCR fields D2R D2W and D2S 0 Disable and address register DAC2 1 Enable 30 JOI JTAG Serial Outbound Interrupt Enable 0 Disable 1 Enable 31 Jil JTAG Serial Inbound Interrupt Enable 0 Disable 1 Enable 9 7 2 Debug Status Register DBSR This register is designed to be used by development tools not application software It is strongly recommended that this register be treated as a read only register Writing to this register can produce unexpected results The Debug Status Register DBSR contains status on Debug Events the JTAG Serial Buffers and the most recent reset The status is obta
40. If Reset Caused by Watchdog Timer bits 2 3 bits 2 3 bits 2 3 Undefined Undefined Undefined After Power up Unchanged Unchanged Unchanged If Reset not caused by Watchdog Timer Reset and Initialization 5 3 Table 5 4 Contents of Serial Port Registers After Reset Register Bits Core Reset Chip Reset System Reset Comment SPLS 0 Unchanged 0 0 Receive Buffer Not Full 5 Unchanged 1 1 Transmitter Buffer Empty 6 Unchanged 1 1 Transmitter Shifter Empty SPCTL 0 Unchanged 0 0 Auto echo Disabled 1 Unchanged Unchanged Unchanged Loop Back Mode Unchanged 2 Unchanged 0 0 Data Terminal Ready Inactive 3 Unchanged 0 0 Request To Send Inactive SPRC 0 Unchanged 0 0 Disable Receiver SPTC 0 Unchanged 0 0 Disable Transmitter 7 Unchanged 0 0 Disable Pattern Generation Mode Table 5 5 Contents of Device Configuration Registers After Reset Register Bits Core Reset Chip Reset System Reset Comment BESR 0 0 0 0 No Data Bus Error BRO 0 31 Unchanged OxFF18 3FFE OxFF18 3FFE f Byte Boot Width at the time of the most recent System Reset Unchanged OxFF18 BFFE OxFF18 BFFE f Half word Boot Width at the time of the most recent System Reset Unchanged OxFF19 3FFE OxFF19 3FFE f Full word Boot Width at the time of the most recent System Reset BR1 3 0 31 Unchanged OxFFOO 3FFE OxFFOO 3FFE f Byte Boot Width at the time of the most recent System Reset Unchanged OxFFOO BFFE OxFFOO BFFE f Half word Boot
41. No interrupt pending from the serial port transmitter 1 Interrupt pending from the serial port transmitter 6 JRIS JTAG Serial Port Receiver Interrupt Status 0 No interrupt pending from the JTAG serial port receiver 1 Interrupt pending from the JTAG serial port receiver 7 JTIS JTAG Serial Port Transmitter Interrupt Status 0 No interrupt pending from the JTAG serial port transmitter 1 Interrupt pending from the JTAG serial port transmitter 8 DOIS DMA Channel 0 Interrupt Status 9 D1iIS DMA Channel 1 Interrupt Status 0 No interrupt pending from DMA Channel 0 1 Interrupt pending from DMA Channel 0 0 No interrupt pending from DMA Channel 1 1 Interrupt pending from DMA Channel 1 10 D2IS DMA Channel 2 Interrupt Status 0 No interrupt pending from DMA Channel 2 1 Interrupt pending from DMA Channel 2 11 D3IS DMA Channel 3 Interrupt Status 0 No interrupt pending from DMA Channel 3 1 Interrupt pending from DMA Channel 3 12 26 reserved 27 Eols External Interrupt 0 Status 0 No interrupt pending from External Interrupt 0 pin 1 Interrupt pending from External Interrupt 0 pin 28 E1IS External Interrupt 1 Status 0 No interrupt pending from External Interrupt 1 pin 1 Interrupt pending from External Interrupt 1 pin 11 38 PPC403GA User s Manual EXISR cont 29 E2IS External Interrupt 2 Status 0 No interrupt pending from External
42. OE XSize1 is used as one of two external transfer size input bits XSize0 1 Ready 13 Ready Ready is used to insert externally generated device paced wait states into bus transactions The Ready pin is enabled via the Ready Enable bit in PPC403GA bank registers RecvD 27 Serial Port Receive Data Reset 91 1 0 Reset A logic 0 input placed on this pin for eight SysClk cycles causes the PPC403GA to begin a system reset When a system reset is internally invoked the Reset pin becomes a logic 0 output for three SysClk cycles and the system must maintain Reset active for a total of eight cycles minimum RW 127 VO Read Write When the PPC403GA is bus master RAW is an output which is high when data is read from memory and low when data is written to memory R W is driven with the same timings as the address bus When the PPC403GA is not bus master R W is an input from the external bus master which indicates the direction of data transfer SerClk 26 Serial Port Clock Through the Serial Port Clock Source bit in the Input Output Configuration register IOCR users may choose the serial port clock source from either the input on the SerClk pin or processor SysClk The maximum allowable input frequency into SerClk is half the SysClk frequency SysClk SysClk is the processor system clock input SysClk supports a 50 50 duty cycle clock input at the rated chip frequency TCK
43. Ox8FFF FFFF 18 18 0 noncacheable 1 cacheable 0x9000 0000 Ox97FF FFFF 19 19 0 noncacheable 1 cacheable 0x9800 0000 Ox9FFF FFFF 20 20 0 noncacheable 1 cacheable 0xA000 0000 OxA7FF FFFF 21 21 0 noncacheable 1 cacheable 0xA800 0000 OxAFFF FFFF 22 22 0 noncacheable 1 cacheable 0xB000 0000 0xB7FF FFFF 23 S23 0 noncacheable 1 cacheable 0xB800 0000 OxBFFF FFFF 24 S24 0 noncacheable 1 cacheable 0xC000 0000 OxC7FF FFFF 25 S25 0 noncacheable 1 cacheable 0xC800 0000 OxCFFF FFFF 11 24 PPC403GA User s Manual DCCR cont 26 S26 0 noncacheable 1 cacheab 0xD000 0000 OxD7FF FFFF 27 S27 0 noncacheable 1 cacheab 0xD800 0000 OxDFFF FFFF 28 S28 0 noncacheable 1 cacheab 0xE000 0000 OxE7FF FFFF 29 S29 0 noncacheable 1 cacheab 0xE800 0000 OxEFFF FFFF 30 S30 0 noncacheable 1 cacheab 0xF000 0000 OxF7FF FFFF 31 S31 0 noncacheable 1 cacheab 0xF800 0000 OxFFFF FFFF Register Summary 11 25 DEAR DEAR see also Section 6 1 11 on page 6 16 SPR Figure 11 14 Data Exception Address Register DEAR 0 31 Address of Data Error synchronous 11 26 PPC403GA User s Manual DMACC0 DMACC3 DMACC0 DMACC3 see also Section 4 3 6 on page 4 36 DCR 0 15 16 31 Figure 11 15 DMA Chained Count Registers DMACC0O DMACC3 0 15 re
44. PBL2 When any access is attempted to an address within the range of the BAS field and the bank is designated as invalid a Non configured Error occurs When a write access is attempted to an address within the range of the BAS field and the bank is designated as Read Only a BIU protection error occurs Also when a read access is attempted to an address within the range of the BAS field and the bank is designated as Write Only a BIU protection error occurs If the transaction is an instruction fetch an Instruction Machine Check exception may occur see Section 2 13 1 3 Instruction Machine Check Handling on page 2 46 If the transaction is a data access a Data Machine Check exception will occur see Section 2 13 1 4 Data Machine Check Handling on page 2 48 If the error occurred during a DMA access an External Interrupt may result See Section 4 2 11 Errors on page 4 28 e The SLF field bit 13 controls incoming data order on line fills If 1 then all line fills will be in sequential order first word transferred is the first word of the cache line whether or not the target address is the first word of the cache line If 0 then all fills will be in target word first order first word transferred is the word at the target address then the following sequential addresses to the highest address in the cache line then sequentially from the first word of the cache line until the entire line is transferred Line flushe
45. RB 1 subf CR CRO subfo XER SO OV subfo CR CRO XER SO OV subfc RT RA RB Subtract RA from RB 10 156 RT lt RA RB 1 subfc Place carry out in XER CA CRICRO subfco XER SO OV subfco CR CRO XER SO OV A 34 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed subfe RT RA RB Subtract RA from RB with carry in 10 157 RT lt RA RB XER CA subfe Place carry out in XER CA CRICRO subfeo XER SO OV subfeo CR CRO XER SO OV subfic RT RA IM Subtract RA from EXTS IM 10 158 RT lt RA EXTS IM 1 Place carry out in XER CA subme RT RA RB Subtract RA from 1 with carry in 10 159 RT lt RA 1 XER CA subme Place carry out in XER CA CR CRO submeo XER SO OV submeo CR CRO XER SO OV subfze RT RA RB Subtract RA from zero with carry in 10 160 RT lt RA XER CA subfze Place carry out in XER CA CRICRO subfzeo XER SO OV subfzeo CR CRO XER SO OV subi RT RA IM Subtract EXTS IM from RA 0 10 10 Place answer in RT Extended mnemonic for addi RT RA IM subic RT RA IM Subtract EXTS IM from RA 0 10 11 Place answer in RT Place carry out in XER CA Extended mnemonic for addic RT RA IM subic R
46. Register Contents After A Reset on page 5 3 contains an listing of the state of each PPC403GA register whose value is affected by chip reset 6 2 1 3 System Reset System reset exceptions occur when enabled by the Debug Control Register JTAG Control Register the second expiration of the watchdog timer if it is enabled in the timer control register or when initiated by an active level on the reset pin Initiating an external system reset requires driving a logic 0 into the PPC403GA RESET pin for a minimum of eight clock cycles After an internal system reset registers within the PPC403GA are reset and the Interrupts Exceptions and Timers 6 17 reset pin outputs an active level for at least three SysClk cycles Section 5 3 Register Contents After A Reset on page 5 3 contains an listing of the state of each PPC403GA register whose value is affected by system reset 6 2 2 Critical Interrupt Pin Exception To initiate a critical exception the user must transition from a logic 1 to a logic 0 on the Critical Interrupt pin To guarantee detection this negative level must have a duration greater than one SysClk pin cycle The critical exception will be recognized if enabled by MSR CE Note the MSR CE bit also controls the occurrence of the Watchdog Timer WDT first time out interrupt However after the occurrence of this timer interrupt control is passed to a different exception vector than for the interrupt discussed in the precedi
47. Register Summary 11 49 PBL1 PBL2 PBL1 PBL2 see also Section 2 10 on page 2 33 SPR 0 19 20 31 Figure 11 32 Protection Bound Lower Register PBL1 PBL2 0 19 Lower Bound Address address bits 0 19 20 31 reserved 11 50 PPC403GA User s Manual PBU1 PBU2 Register Summary PBU1 PBU2 see also Section 2 10 on page 2 33 SPR 0 19 20 31 Figure 11 33 Protection Bound Upper Register PBU1 PBU2 0 19 Upper Bound Address address bits 0 19 20 31 reserved 11 51 PIT PIT see also Section 6 2 9 on page 6 24 SPR Figure 11 34 Programmable Interval Timer PIT 0 31 Programmed Interval Remaining The number of clocks until the PIT event 11 52 PPC403GA User s Manual PVR see also Section 2 3 2 3 on page 2 8 FAM PVR SPR 11412 M 15 16 19 20 23 24 27 28 Figure 11 35 Processor Version Register PVR 31 0 11 FAM Processor Family FAM 0x002 for the 4xx family 12 15 MEM Family Member 0 16 19 CL Core Level 0 20 23 CFG Configuration 0 24 27 MAJ Major Change Level 1 28 31 MIN Minor Change Level 1 The Minor Change Level field may change due to minor processor updates Except for the value of this field such changes do not impact this document Register Summary 11 53 SPCTL
48. SRRO Loaded with the address of the next instruction to be executed SRR1 Loaded with the contents of the MSR MSR WE 0 PR 0 CE Unchanged EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged PC EVPR O0 15 Ox0C00 6 2 9 Programmable Interval Timer The PPC403GA initiates a Programmable Interval Timer PIT interrupt after detecting a time out from the PIT if the exception is enabled via TCR PIE and MSR EE Time out is considered to be detected when at the beginning of a cycle TSR PIS 1 for the PIT exception this will be the cycle after the PIT decrements on a PIT count of one The instruction in the execute stage at that cycle is flushed blocked from completing and its address is stored as the next sequential instruction in SRRO Simultaneously the current contents of the MSR are loaded into SRR1 and the MSR is loaded with the values shown in Table 6 9 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x1000 Exception processing begins with this program counter address To clear the PIT interrupt the exception handling routine must clear the PIT interrupt bit TSR 4 by writing a 1 to that bit position in the Timer Status Register Executing the return from interrupt instruction rfi restores the contents of the program counter and the MSR from SRRO and SRR1 respectively and the PPC403GA begins
49. Table 2 12 Table 2 13 Table 2 14 Table 2 15 Table 2 16 Table 2 17 Table 2 18 Table 2 19 Table 2 20 Table 2 21 Table 2 22 Table 2 23 Table 2 24 Table 3 1 Table 3 2 Table 3 3 Table 3 4 Table 3 5 Table 3 6 Table 3 7 Table 3 8 Table 3 9 Table 3 10 Table 4 1 Table 4 2 Table 4 3 Table 4 4 Special Purpose Register SPR List cceeeeeseseeeeeeeeeeeeseeeeeeeeeaeeseeeeeeesaaes 2 6 Device Control Register DCR List eceeceeeeeeseeeeeeeeeeeeneeeeaeeeneeseeeseneeeaes 2 14 Memory Mapped I O MMIO List eeceeeeeeeeeeeeeeeeeeeeeeeeneeeeaeeeeeseeeseeeeeaes 2 14 Address Alteration in Little Endian Mode AAA 2 20 Bits of the BO Field ee eet Seege 2 27 Conditional Branch BO Field 00 0 eeeeeseeseeeeeeeeeeeeeneeseeeeeeeseaeeeeeseeeseeeenaeeeea 2 27 SRAM Mapping eege EAR dot eae dai deena 2 32 Handling of Dcache Instructions AA 2 35 Privileged WEE 2 37 PPC403GA Exception Priorities Types and Classes cccseeeeceeteeereteees 2 44 Exception Vector Offsets ne ss eosin ct ed en a ees eect ele eee 2 45 ESR Usage for Program Exceptions cecceesceeeeeeeeeeeeeeeeeeeeeaeesneeeeeeeeneeeaes 2 46 ESR Usage for Instruction Machine Checks AA 2 47 PPC403GA Instruction Set SUMMALY eeeeeceeeeeeeeeeeeeeeseeeeeaeeeeeeeeaeeeeneeeaes 2 49 Instructions Specific to PowerPC Embedded Controller AA 2 50 Data Movement Instructions AA 2 51 Arithmetic and Logical Instructions AA 2 51 Co
50. This instruction is part of the PowerPC User Instruction Set Architecture 10 170 PPC403GA User s Manual Register Summary With the exception of the serial port registers all registers contained in the PPC403GA are architected as 32 bits Table 11 1 through Table 11 4 define the addressing required to access the registers The pages following these tables define the bit usage within each register 11 1 Reserved Registers In the tables of register numbers which follow Device Control Registers in Table 11 2 Special Purpose Registers in Table 11 3 Memory Mapped Registers in Table 11 4 some register numbers are shown as reserved The registers marked reserved should be neither read nor written 11 2 Reserved Fields For all registers with fields marked as reserved the reserved fields should be written as zero and read as undefined That is when writing to a register with a reserved field write a zero to that field When reading from a register with a reserved field ignore that field 11 Good coding practice is to perform the initial write to a register with reserved fields as described in the preceding paragraph and to perform all subsequent writes to the register using a read modify write strategy That is read the register alter desired fields with logical instructions and then write the register 11 3 General Purpose Register Numbering The PPC403GA contains 32 General Purpose Registers GPRs The contents of these
51. Timing Diagram SRAM Read Extended with Ready cecceseeeeeeeeee 3 17 Timing Diagram SRAM Write Extended with Ready ccseseeeeeeeee 3 18 SRAM ROM Burst Read Request s eseeeeeeeeeeieeieerretretrerinstnstrnernstnetenernent 3 20 SRAM ROM Burst Write Request with Wait and Hold cceeeeeeeeeeeeeeeee 3 21 Bank Registers SRAM Configuration DGPO DP 3 22 Parameter Definitions DRAM AAA 3 28 DRAM Single Transfer Read eccseceeeeeeeeeeeeeeeeeeeeaeeeeeeeeeeseaeeeaeeeeaeeseneeeaes 3 29 DRAM Single Transfer Write ceceeeceeeeeceeeeeeeeeeeeeeeeeeeeeeeaeeeeaeeeaeeseaeeseneeeaes 3 30 DRAM 3 2 2 2 Page Mode Head 3 31 DRAM 2 1 1 1 Page Mode Head 3 32 DRAM 3 2 2 2 Page Mode Write AAA 3 33 DRAM 2 1 1 1 Page Mode Write AAA 3 34 DRAM Refresh Timing CAS Before RAS 1 Bank cccccesssseeeeeteeeeeeeeees 3 35 Bank Registers DRAM Configuration DPA DPI 3 36 Example of DRAM Connection ccecceeeeeeeeeeeeeeeeeeeeeeeeeeesneeeeaeeeeeeeaeeeeeeenaes 3 44 Sample PPC403GA External Bus Master System cccceeeeeeeeeeereeeeeeeee 3 49 HoldReq HoldAck Bus Arbitration A 3 51 Figures xvii Figure 3 26 Figure 3 27 Figure 4 1 Figure 4 2 Figure 4 3 Figure 4 4 Figure 4 5 Figure 4 6 Figure 4 7 Figure 4 8 Figure 4 9 Figure 4 10 Figure 4 11 Figure 4 12 Figure 4 13 Figure 4 14 Figure 4 15 Figure 4 16 Figure 4 17 Figure 4 18 Figure 4 19 Figure 4 20 Figure 4
52. TxReady and Transmit Shift Register Empty TxEmpty are the only two bits in the SPLS register that reflect transmitter status represented by bits TBR and TSR respectively The following table describes what the possible combinations of these status bits represent Table 7 4 TxReady TxEmpty status representation TxReady TxEmpty Meaning 1 1 Transmitter is idle no data in transmit buffer Note that this is the transmitter status out of reset 0 1 Transmitter is idle data was either just loaded into transmit buffer or is being held there due to handshaking line loss 1 0 Transmitter is transmitting a character no new data loaded into transmit buffer 0 0 Transmitter is transmitting a character next character waiting in transmit buffer 7 6 PPC403GA User s Manual Data to be transmitted is first loaded into the SPTB TxReady will update from a logic 1 toa logic 0 If the transmitter is enabled DSR CTS is active and the SPTSR is empty TxEmpty 1 the data is immediately transferred to the SPTSR causing TxEmpty to update from a logic 1 to a logic 0 and TxReady to return to a value of logic 1 indicating that the SPTB is ready to be loaded with another piece of data When a piece of data is transferred to the SPTSR the appropriate start stop and parity bits are added and the transmission of the character begins immediately Note that for 7 data bit frame formats the least significant 7 bits of th
53. WEN IMCT vs Figure 11 21 Exception Syndrome Register ESR 0 IMCP nstruction Machine Check Protection 0 BIU Bank Protection Error did not occur 1 BIU Bank Protection Error occurred 1 IMCN nstruction Machine Check Non configured 0 BIU Non configured Error did not occur 1 BIU Non configured Error occurred 2 IMCB nstruction Machine Check Bus Error 0 BIU Bus Error did not occur 1 BIU Bus Error occurred 3 IMCT nstruction Machine Check Timeout 0 BIU Timeout Error did not occur 1 BIU Timeout Error occurred 4 PEI Program Exception Illegal 0 Illegal Instruction error did not occur 1 Illegal Instruction error occurred 5 PEP Program Exception Privileged 0 Privileged Instruction error did not occur 1 Privileged Instruction error occurred 6 PET Program Exception Trap 0 Trap with successful compare did not occur 1 Trap with successful compare occurred 7 31 reserved 11 34 PPC403GA User s Manual EVPR EVPR see also Section 6 1 4 on page 6 7 SPR 0 15 16 31 Figure 11 22 Exception Vector Prefix Register EVPR 0 15 Exception Vector Prefix 16 31 reserved Register Summary 11 35 EXIER EXIER see also Section 6 1 5 on page 6 8 CIE SRIE JRIE DOIE D2IE ia aie DCR EQIE E2IE E4IE J 6 8 10 11 12 26 27 29 30 31 5 Ste
54. address of its highest order byte or Little Endian the address of an operand is the address of its lowest order byte Endian mode can be set to automatically change when entering and leaving an interrupt handler 1 3 8 Register Set Summary The registers can be grouped into five basic categories based on their access mode general purpose registers GPRs special purpose registers SPRs the machine state register MSR the condition register CR and device control registers DCRs 1 3 8 1 General Purpose Registers The PPC403GA contains 32 32 bit GPRs The contents of these registers can be transferred from memory using load instructions and stored to memory using store instructions GPRs are specified as operands in many PPC403GA instructions 1 10 PPC403GA User s Manual 1 3 8 2 Special Purpose Registers SPR SPRs contain status and control for resources within the RISC core Only the fixed point exception register XER link register LR and count register CTR can be accessed by user mode programs Access to all other SPRs is privileged SPRs are accessed using mtspr and mfspr instructions 1 3 8 3 Machine State Register The PPC403GA contains a 32 bit machine state register MSR The contents of a GPR can be written to the MSR using the mtmsr instruction and the MSR contents can be read into a GPR using the mfmsr instruction 1 3 8 4 Condition Register The PPC403GA contains a 32 bit condition register CR Ins
55. address select for that bank CS5 RAS2 148 O Chip Select Si DRAM Row Address Select 2 Same function as CS4 RAS3 but controls bank 5 CS6 RAST 147 O Chip Select 6 DRAM Row Address Select 1 Same function as CS4 RAS3 but controls bank 6 CS7 RASO 146 O Chip Select 7 DRAM Row Address Select 0 Same function as CS4 RAS3 but controls bank 7 DO 42 VO Data bus bit 0 Most significant bit D1 43 VO Data bus bit1 D2 44 VO Data bus bit 2 D3 45 VO Data bus bit 3 D4 46 VO Data bus bit 4 D5 47 VO Data bus bit 5 D6 48 VO Data bus bit 6 D7 51 VO Data bus bit 7 D8 52 VO Data bus bit 8 D9 53 VO Data bus bit 9 D10 54 VO Data bus bit 10 D11 55 VO Data bus bit 11 D12 56 VO Data bus bit 12 D13 57 VO Data bus bit 13 D14 58 VO Data bus bit 14 D15 62 VO Data bus bit 15 Signal Descriptions 12 3 Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function D16 63 VO Data bus bit 16 D17 64 VO Data bus bit 17 D18 65 VO Data bus bit 18 D19 66 VO Data bus bit 19 D20 67 VO Data bus bit 20 D21 68 VO Data bus bit 21 D22 71 VO Data bus bit 22 D23 72 VO Data bus bit 23 D24 73 VO Data bus bit 24 D25 74 VO Data bus bit 25 D26 75 VO Data bus bit 26 D27 76 VO Data bus bit 27 D28 77 VO Data bus bit 28 D29 78 VO Data bus bit 29 D30 79 VO Data bus bit 30 D31 82 VO Data bus bit 31 DMAAO 156 O DMA Channel
56. bca 4 cr_bit target Extended mnemonic for bel 4 cr_bit target LR Extended mnemonic for bcla 4 cr_bit target LR 10 21 bfctr bfctrl cr_bit Branch if CRer pit 0 to address in CTR Extended mnemonic for bectr 4 cr_bit Extended mnemonic for bech 4 cr_bit LR 10 28 bflr bfirl cr_bit Branch if CRer pit 0 to address in LR Extended mnemonic for bclr 4 cr_bit Extended mnemonic for belrl 4 cr_bit LR Instructions By Category 10 32 B 9 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bge Operands cr_field target bgea bgel bgela Function Branch if greater than or equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 0 target Other Registers Changed Extended mnemonic for bca 4 4 cr_field 0 target Extended mnemonic for bel 4 4 cr_field 0 target LR Extended mnemonic for bcla 4 4 cr_field 0 target LR Page 10 21 bgectr cr_field bgectrl Branch if greater than or equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 0 Extended mnemonic for bectrl 4 4 cr_field 0 LR 10 28 bgelr cr_field bgelrl Branch if greater than or equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 0 Extended mnemon
57. bdzf cr_bit target bdzfa bdzfl bdzfla Decrement CTR Branch if CTR 0 AND CRey pit 0 Extended mnemonic for bc 2 cr_bit target Extended mnemonic for bca 2 cr_bit target Extended mnemonic for bcl 2 cr_bit target LR Extended mnemonic for bcla 2 cr_bit target LR 10 21 A 6 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bdzflr bdzfirl Operands cr_bit Function Decrement CTR Branch if CTR 0 AND CR pit 0 to address in LR 7 Extended mnemonic for belr 2 cr_bit Other Registers Changed Extended mnemonic for belrl 2 cr_bit LR Page 10 32 bdzt bdzta bdztl bdztla cr_bit target Decrement CTR Branch if CTR 0 AND Co pit 1 Extended mnemonic for bc 10 cr_bit target Extended mnemonic for bca 10 cr_bit target Extended mnemonic for bcl 10 cr_bit target LR Extended mnemonic for bcla 10 cr_bit target LR 10 21 bdztir bdztirl cr_bit Decrement CTR Branch if CTR 0 AND CRer pit 1 to address in LR Extended mnemonic for bclr 10 cr_bit Extended mnemonic for belrl 10 cr_bit LR 10 32 beq beqa beql beqla cr_field tar get Branch if equal Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 2 target Extended mnemonic for bca 12 4
58. cr_field bunirl Function Branch if unordered to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 3 Other Registers Changed Extended mnemonic for belrl 12 4 cr_field 3 LR Page 10 32 clrlwi RA RS n clrlwi Clear left immediate n lt 32 RA o n 1 e 0 Extended mnemonic for rlwinm RA RS 0 n 31 Extended mnemonic for rlwinm RA RS 0 n 31 CRICRO 10 126 clrislwi RA RS b n clrislwi Clear left and shift left immediate n lt b lt 32 RA b n 31 n lt RS p 31 RA 32 n 31 e 0 RA o p n 1 PO Extended mnemonic for rlwinm RA RS n b n 31 n Extended mnemonic for rlwinm RA RS n b n 31 n CRICRO 10 126 clrrwi RA RS n clrrwi cmplw BF RA RB Clear right immediate n lt 32 RA 32 n 31 e 0 Extended mnemonic for rlwinm RA RS 0 0 31 n Extended mnemonic for rlwinm RA RS 0 0 31 n Compare Logical Word Use CRO if BF is omitted Extended mnemonic for cmpl BF 0 RA RB CRICRO 10 126 10 39 cmplwi BF RA IM Compare Logical Word Immediate Use CRO if BF is omitted Extended mnemonic for cmpli BF 0 RA IM 10 40 cmpw BF RA RB Compare Word Use CRO if BF is omitted Extended mnemonic for cmp BF 0 RA RB 10 37 B 18 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Mnem
59. if AA 1 then BD lt targety 29 NIA EXTS BD 20 else BD lt target CIA j6 29 NIA lt CIA EXTS BD 20 if LK 1 then LR CIA 4 If bit 2 of the BO field contains 0 the CTR is decremented The BI field specifies a bit in the CR to be used as the condition of the branch The next instruction address NIA is the effective address of the branch The NIA is formed by adding a displacement to a base address The displacement is obtained by concatenating two 0 bits to the right of the BD field and sign extending the result to 32 bits If the AA field contains 0 the base address is the address of the branch instruction which is also the current instruction address CIA If the AA field contains 1 the base address is 0 The BO field controls options that determine when program flow is transferred to the NIA The BO field also controls Branch Prediction a performance improvement feature See Section 2 8 4 and Section 2 8 5 for a complete discussion If the LK field contains 1 then CIA 4 is placed into the LR Registers Altered e CTR if BO contains 0 e LR if LK contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 21 bc Branch Conditional Table 10 6 Extended Mnemonics for bc bca bcl bcla Other Mnemonic Operands Function Registers Page Changed bdnz target Decrement CTR 10 21 Branch if CTR 0
60. mtsprg2 mtsprg3 mier mtsrr1 mtsrr2 mtsrr3 mitbhi mttblo mttcr mttsr mtxer Operands RS Function Move to special purpose register SPRN Extended mnemonic for mtspr SPRN RS Other Registers Changed Page 10 110 nop Preferred no op triggers optimizations based on no ops Extended mnemonic for ori 0 0 0 10 121 not RA RS not B 24 Compement register RA lt RS Extended mnemonic for nor RA RS RS Extended mnemonic for nor RA RS RS PPC403GA User s Manual CRICRO 10 118 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic rotlw rotlw Operands RA RS RB Function Rotate left RA lt ROTL RS RB 27 31 Extended mnemonic for rlwnm RA RS RB 0 31 Other Registers Changed Extended mnemonic for rlwnm RA RS RB 0 31 CRI CRO Page 10 129 rotlwi rotlwi rotrwi rotrwi RA RS n RA RS n Rotate left immediate RA lt ROTL RS n Extended mnemonic for rlwinm RA RS n 0 31 Extended mnemonic for rlwinm RA RS n 0 31 Rotate right immediate RA ROTL RS 32 n Extended mnemonic for rlwinm RA RS 32 n 0 31 CRICRO Extended mnemonic for rlwinm RA RS 32 n 0 31 CRI CRO 10 126 10 126 slwi slwi srwi srwi RA RS n RA RS n Shift left immediate n lt 32 RA o 31 n lt RS n 31 RA 32
61. nor as Big Endian This has consequences that will be discussed further when using memory mapped hardware or when using external master data transfers with other processors A PowerPC system can implement the appearance of Little Endian behavior only within aligned doublewords eight byte blocks whose lowest address is an exact integer multiple of eight The memory location after a store of byte halfword word or doubleword objects using byte halfword word or doubleword store instructions respectively is illustrated in the following example borrowed from the PowerPC Architecture reference Note that the doubleword object is included here for reference only the PPC403GA does not support doubleword operations Programming Model 2 17 Consider this C language structure struct int a 0x1112_1314 word long long b 0x2122 2324 2526 2728 doubleword char c 0x3132_ 3334 word char d 7 A B C D E F G array of bytes short e 0x5152 halfword int f 0x6162_6364 word Is In Big Endian which is the reset default state of a PowerPC processor memory looks as follows after the structure is stored in these tables addresses are shaded data is not 11 12 13 14 00 01 02 03 04 05 06 07 21 22 23 24 25 26 27 28 08 09 DA 0B DC oD 0E OF 31 32 33 34 A RB Cc s 10 11 12 13 14 15 16 17 E Be OG 51 52 18 19 1A 1B 1C 1D 1E 1F 61 62 63 64 20 21 22 23
62. registers can be transferred from memory via load instructions and stored to memory via Register Summary 11 1 store instructions GPRs are also addressed by all integer instructions Table 11 1 PPC403GA General Purpose Registers Mnemonic Register Name GPR Number Access RO R31 General Purpose Register 0 31 0x0 Ox1F Read Write 11 4 Machine State Register and Condition Register Numbering These registers are accessed via special instructions hence they do not require addressing Accessing these registers using mtspr mfspr mtder or mfder instructions is considered invalid and yields boundedly undefined results 11 5 Device Control Register Numbering Device Control Registers DCRs are on chip registers that are architecturally considered outside of the processor core They are accessed with the mtdcr move to device control register and mfdcr move from device control register instructions which are defined in Chapter 10 The mtder mfder instructions themselves are privileged for all cases Thus all DCRs are privileged See Section 2 11 Privileged Mode Operation on page 2 36 for further discussion of privileged operation DCRs are used to control the use of the DRAM SRAM ROM PIA banks the I O configuration the DMA channels and also hold status address for bus errors The registers marked reserved should be neither read nor written Table 11 2 PPC403GA Device Control Registers
63. s Manual Iwzux Load Word and Zero with Update Indexed lwzux RT RA RB 31 RT RA RB 55 0 6 11 16 21 31 EA lt RB RA O RA EA RT lt MS EA 4 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The effective address is placed into register RA The word at the effective address is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA e RT Invalid Instruction Forms e Reserved fields e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 95 lwzx Load Word and Zero Indexed lwzx RT RA RB 31 RT RA RB 23 0 6 11 16 21 31 EA lt RB RA O RT lt MS EA 4 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The word at the effective address is placed into register RT If instruction bit 31 contains 1 the contents of CR
64. twlle Trap if RA logically less than or equal to RB Extended mnemonic for tw 6 RA RB twllt Trap if RA logically less than RB Extended mnemonic for tw 2 RA RB twing Trap if RA logically not greater than RB Extended mnemonic for tw 6 RA RB twinl Trap if RA logically not less than RB Extended mnemonic for tw 5 RA RB twit Trap if RA less than RB Extended mnemonic for tw 16 RA RB twne Trap if RA not equal to RB Extended mnemonic for tw 24 RA RB twng Trap if RA not greater than RB Extended mnemonic for tw 20 RA RB twnl Trap if RA not less than RB Extended mnemonic for tw 12 RA RB tw TO RA RB Trap exception is generated if comparing 10 162 RA with RB any condition specified by TO is true Alphabetical Instruction Summary A 37 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic tweqi Operands RA IM twgei twgti twlei twigei twigti twllei twillti twingi twinli twlti twnei twngi twnli Function Trap if RA equal to EXTS IM Extended mnemonic for twi 4 RA IM Trap if RA greater than or equal to EXTS IM Extended mnemonic for twi 12 RA IM Trap if RA greater than EXTS IM Extended mnemonic for twi 8 RA IM Trap if RA less than or equal to EXTS IM Extended mnemonic for twi 20 RA IM Trap if RA logically greater than or equal to EXTS IM Extended mnemonic for twi 5 RA
65. 0 Acknowledge DMAAO has an active level when a transac tion is taking place between the PPC403GA and a peripheral DMAA1 157 DMA Channel 1 Acknowledge See description of DMAAO DMAA2 158 DMA Channel 2 Acknowledge See description of DMAAO DMAA3 XACK 159 DMA Channel 3 Acknowledge External Master Transfer Acknowledge When the PPC403GA is bus master this signal is DMAA3 see description of DMAAO When the PPC403GA is not the bus master this signal is XACK an output from the PPC403GA which has an active level when data is valid during an external bus master transaction DMARO 2 l DMA Channel 0 Request External devices request a DMA transfer on channel 0 by putting a logic 0 on DMARO DMAR1 3 l DMA Channel 1 Request See description of DMARO DMAR2 4 l DMA Channel 2 Request See description of DMARO DMAR3 XREQ 5 l DMA Channel 3 Request External Master Transfer Request When the PPC403GA is the bus master this signal is DMAR3 see description of DMARO When the PPC403GA is not the bus master this signal is the XREQ input The external bus master places a logic 0 on XREQ to initiate a transfer to the DRAM controlled by the PPC403GA DRAM controller 12 4 PPC403GA User s Manual Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function DRAMOE 137 O DRAM Output Enable DRAMOE has an active level when either the PPC403GA or an external bus master is reading
66. 0x40000000 Read Clear SPRB Receive Buffer Read 0x40000009 Read Only SPRC Receiver Command Register 0x40000007 Read Write SPTB Transmit Buffer Write 0x40000009 Write Only SPTC Transmitter Command Register 0x40000008 Read Write reserved 0x40000001 reserved 0x40000003 11 6 PPC403GA User s Manual BEAR BEAR see also Section 6 1 10 on page 6 15 DCR 31 Figure 11 1 Bus Address Error Register BEAR 0 31 Address of Bus Error asynchronous Register Summary 11 7 BESR BESR see also Section 6 1 9 on page 6 14 DSES ae DCR 2 31 D 1 E S 3 4 dr Figure 11 2 Bus Error Syndrome Register BESR DSES Data Side Error Status 0 No data side error 1 Data side error DMES DMA Error Status 0 No DMA operation error 1 DMA operation error RWS Read Write Status 0 Error operation was a Write 1 Error operation was a Read 3 4 ET Error Type 00 Protection violation write to Read Only bank or read from Write Only bank 01 Access to a non configured bank 10 Active level on bus error input pin 11 Bus time out 5 31 reserved 11 8 PPC403GA User s Manual BRO BR7 SRAM Configuration BRO BR7 SRAM see also Section 3 6 4 on page 3 22 DCR BAS BU BME RE TWT CSN WBN TH 0 7 8 on 12 13 14 15 16 17 18 21 22 23 24 25 26 27 28 30 31 BS SLF B FWT BWT
67. 1 OE Wa D A WBEO WBES gt SS NA CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon 1 Ds S See em Note The cycle of dead time shown in cycle 7 is used to illustrate that two independent transfers are occurring The cycle of dead time is not guaranteed and when bus utilization is high will not be present First Transfer Bank Register Settings Seq Line Bus Ready Transfer CSon WEoff Transfer Fills Width Enable Wait Hold Bit 13 Bits 15 16 Bit17 Bits 18 23 Bit 24 Bit27 Bits 28 30 x XX 0 000011 0 1 x 001 Second Transfer Bank Register Settings Seq Line Burst Bus Ready Transfer CSon Transfer Fills Enable Width Enable Wait Hold Bit 13 Bit14 Bits 15 16 Bit17 Bits 18 23 Bit24 Bits 28 30 x 0 XX 0 000000 0 0 x 000 Figure 3 7 Timing Diagram SRAM Read 3 14 PPC403GA User s Manual 3 6 1 2 SRAM Write Example Figure 3 8 shows the timing of chip select output enable write byte enables the address bus and the data bus relative to the system clock SysClk for a write cycle to SRAM or peripheral Two different accesses are illustrated each with different timing parameters This results from the sharing of the bus by devices defined in different bank registers Note that the cycle when the data bus turns on is determined by the OEon parameter WBEO WBE3 DO D31 Note a
68. 1 a NN WE D7 _ai7 CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon 1 D0 D3 SS SO OOOO E BUSERR 4 gt lt gt lt gt lt gt lt gt Wait 1 Burst 1 Burst 1 Burst 1 Hold Cycles Cycles Cycles Cycles Notes 1 WBE 2 3 are address bits 30 31 if the Bus Width is programmed as Byte or Halfword 2 See Table 3 3 for WBEn signal definition based on Bus Width 3 WAIT must be programmed gt CSon OEon If WAIT is gt CSon OEon then all signals will retain the values shown in cycle 4 until the WAIT timer expires 4 If hold is programmed 001 then all signals will retain the values shown in cycle 8 until the HOLD timer expires Bank Register Settings Seq Line Burst Bus Ready First Burst CSon Transfer Fills Enable Width Enable Wait Wait Hold Bit 13 Bit14 Bits 15 16 Bit17 Bits 18 21 Bits 22 23 Bit 24 Bits 28 30 Figure 3 11 SRAM ROM Burst Read Request 3 20 PPC403GA User s Manual 3 6 3 2 SRAM Burst Write Example An example of SRAM ROM burst mode write is shown in Figure 3 12 Cycle SysClk A6 A29 WBE2 A30 WBE3 A31 CSon 0 CSon 1 CSon 0 CSon 1 0 CSon 1 WEon 0 WEon 0 1 WEon 1 WEoff 1 WEoff 1 WEoff 1 WEoff 0 WBEO 3 GA KN Ch CN MN WT CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon 1 DO D31 LH TK te Ks BUSERR EK KEK K
69. 1 Latch data bus on rising edge of CAS on the deactivation of CAS provides more time for data to arrive Register Summary 11 45 IOCR cont 27 28 RDM Real Time Debug Mode 00 Trace Status Outputs Disabled 01 Program Status and Bus Status 10 Program Status and Trace Output 11 reserved 29 TCS Timer Clock Source 0 Clock source is the SysClk pin 1 Clock source is the TimerClk pin 30 SCS Serial Port Clock Source 0 Clock source is the SysClk pin 1 Clock source is the SerClk pin 31 SPC Serial Port Configuration 0 DSR DTR 1 CTS RTS 11 46 PPC403GA User s Manual LR LR see also Section 2 3 2 2 on page 2 7 SPR 0 31 Figure 11 30 Link Register LR 0 31 Link Register Contents If LR represents an instruction address then LRgo 31 should be zero Register Summary 11 47 MSR MSR see also Section 6 1 1 on page 6 2 11 48 PPC403GA User s Manual ig ne rR el T E 2 0 12 13 14 15 16 17 18 19 20 21 22 23 27 28 29 30 31 CE EE PE Figure 11 31 Machine State Register MSR 0 12 reserved 13 WE Wait State Enable 0 The processor is not in the wait state and continues processing 1 The processor enters the wait state and remains in the wait state until an exception is taken or the PPC403GA is reset or an external debug tool clears th
70. 1 0 7 225 clocks 1 017 SEC ti 3 229 clocks 16 27 SEC On the first occurrence of the WDT event if enabled by TCR 4 and MSR CE a WDT Interrupt occurs See Section 6 2 11 for details of register behavior under the Watchdog interrupt The interrupt handler will be expected to reset TSR 1 via software This is done by writing a word to TSR using mtspr with a 1 in bit 1 and any other bits that are to be cleared and 0 in all other bits The write data to the status register is not direct data but a mask A 1 causes the bit to be cleared and a 0 has no effect If any occurrence of the WDT event finds TSR 1 has not been cleared a hardware reset occurs if that has been enabled by TCR 2 3 The preceding statement assumes that TSR O the Enable Next Watchdog bit is 1 That bit will be discussed below The assumption is that TSR 1 was not cleared because the processor was unable to execute the critical interrupt handler leaving reset as the only available means to restart the system A more thorough view of Watchdog behavior is afforded by the following table which describes the Watchdog state machine Enable WDT WDT Status TSR O TSRI 1 Action when timer interval expires 0 0 Set Enable Next Watchdog TSR 0 1 Leave TSR 1 unchanged 0 1 Set Enable Next Watchdog TSR 0 1 Leave TSR 1 unchanged 1 0 Leave TSR 0 unchanged Set Watchdog interrupt status bit TSR 1 1 If Watchdog inter
71. 1 whenever a machine check error is detected in the PPC403GA The Error pin then remains a logic 1 until the machine check error is cleared in the Exception Syndrome Register and or Bus Error Syndrome Register Signal Descriptions 12 5 Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function GND 1 Ground All ground pins must be used 10 Ground All ground pins must be used 15 Ground All ground pins must be used 29 Ground All ground pins must be used 30 Ground All ground pins must be used 41 Ground All ground pins must be used 50 Ground All ground pins must be used 59 Ground All ground pins must be used 60 Ground All ground pins must be used 70 Ground All ground pins must be used 81 Ground All ground pins must be used 90 Ground All ground pins must be used 101 Ground All ground pins must be used 102 Ground All ground pins must be used 111 Ground All ground pins must be used 121 Ground All ground pins must be used 130 Ground All ground pins must be used 141 Ground All ground pins must be used 150 Ground All ground pins must be used Halt 9 l Halt from external debugger active low HoldAck 134 O Hold Acknowledge HoldAck outputs a logic 1 when the PPC403GA relin quishes its external bus to an external bus master HoldAck outputs a logic 0 when the PPC403GA regains control o
72. 10 indicates a 32 bit data bus Figure 3 3 shows how devices of various widths are attached to the PPC403GA data bus The IEM field bit 17 allows system designers to configure an external address multi plexer to allow external bus masters to access DRAM The RCT field bit 18 controls the time from RAS activation to CAS activation during an access If RCT 0 the time will be 1 system clock period If RCT 1 the time will be 2 system clock periods RCT 1 extends the time that the row address is presented to the DRAM The ARM field bit 19 enables refresh modes other than the standard automatic refresh based on elapsed cycles see the discussion of the RR field on page 3 40 and the discussion of Alternate Refresh Mode in Section 3 7 3 on page 3 42 If ARM 0 then standard automatic DRAM refresh is in effect The PM field bit 20 controls burst DRAM operation where on accesses beyond the first the row address is not re specified When PM 1 burst access is allowed under the Page Mode DRAM protocol in Page Mode each new column addresses is latched at the falling edge of CAS When PM 0 all accesses are single transfers both row and column addresses supplied for each transfer The FAC field bits 21 22 specifies first access wait time This parameter is in effect on any access in which the row address is specifed single transfer or first transfer of a burst The period where CAS is active will be extended by a numbe
73. 10 109 mtspr 10 110 mulhw 10 112 mulhw 10 112 mulhwu 10 113 mulhwu 10 113 mulli 10 114 mullw 10 115 mullw 10 115 mullwo 10 115 mullwo 10 115 PPC403GA User s Manual N nand 10 116 nand 10 116 neg 10 117 neg 10 117 nego 10 117 nego 10 117 nor 10 118 nor 10 118 notation xxv 10 2 10 4 O on chip peripheral bus 3 48 OPB 3 48 optimization coding guidelines C 3 alignment C 6 boolean variables C 3 branch prediction C 5 compound branches C 3 data cache usage C 4 dependency upon CR C 4 dependency upon LR and CTR C 5 floating point emulation C 3 instruction cache usage CA load latency C 5 pipeline branch folding C 2 or 10 119 or 10 119 orc 10 120 orc 10 120 ori 10 121 oris 10 122 overview PPC403GA 1 1 1 3 P Pattern Generation Mode 7 7 PBL1 PBL2 11 50 PBU1 PBU2 11 51 PIT 6 24 6 31 11 52 PowerPC architecture 1 2 PPC403GA 1 1 1 3 pre fetch queue 2 23 priority BIU access 3 3 privileged DCRs 2 38 privileged instructions 2 37 privileged mode 2 36 privileged operation 2 36 privileged SPRs 2 37 problem state 2 36 program exception 6 23 programmable interval timer 6 24 6 31 protection 6 20 pseudocode 10 4 PVR 2 8 11 53 Q queue 2 23 R RO R31 2 5 11 40 refresh 3 40 register Numbering DCR 11 2 register numbering CR 11 2 GPR 11 1 MMIO 11 6 MSR 11 2 SPR 11 4 registers BEAR 6 15 11 7 BESR 6 14 11 8 BRO BR3 SRAM 3 22 BRO BR7 SRAM 11 9 BR4 BR7
74. 10 140 sthu 10 141 sthux 10 142 sthx 10 143 stmw 10 144 storage synchronization 2 42 stswi 10 145 stswx 10 146 stw 10 148 stwbrx 10 149 stwex 10 150 stwu 10 152 stwux 10 153 stwx 10 154 subf 10 155 subf 10 155 subfc 10 156 subfc 10 156 subfco 10 156 subfco 10 156 subfe 10 157 subfe 10 157 subfeo 10 157 subfeo 10 157 subfic 10 158 subfme 10 159 subfme 10 159 subfmeo 10 159 subfmeo 10 159 subfo 10 155 subfo 10 155 subfze 10 160 subfze 10 160 subfzeo 10 160 subfzeo 10 160 superscalar operation C 1 fold blocking branches C 11 cr logical and mert C 11 during debug C 13 supervisor state 2 36 sync 10 161 synchronization context 2 39 execution 2 41 storage 2 42 system call 6 23 T TBHI 6 29 11 68 TBLO 6 29 11 69 TCR 6 36 11 70 time base 6 29 timers 6 28 clocks 6 28 FIT 6 33 fixed interval timer 6 33 PIT 6 31 programmable interval timer 6 31 TCR 6 36 time base 6 29 comparison with PowerPC 6 30 timer control register 6 36 timer status register 6 35 TSR 6 35 watchdog 6 33 timings instruction C 7 branch prediction C 8 branches and cr logicals C 7 general rules C 7 instruction cache misses C 9 loads and stores C 9 strings C 8 TSR 6 35 11 71 tw 10 162 twi 10 164 types 2 15 U user mode 2 36 Ww watchdog timer 6 26 6 33 wrtee 10 166 wrteei 10 167 X XER 2 9 11 72 xor 10 168 xori 10 169 xoris 10 170 Index ia l 12 PPC403GA User s Manual Overview Prog
75. 10 154 PPC403GA User s Manual subf Subtract From subf RT RA RB OE 0 Re 0 subf RT RA RB OE 0 Re 1 subfo RT RA RB OE 1 Re 0 subfo RT RA RB OE 1 Rc 1 31 RT RA RB OE 40 Re 0 6 11 16 21 22 31 RT lt RA RB 1 The sum of the ones complement of register RA register RB and 1 is stored into register RT Registers Altered e RT e CRICRO cr eo so if Re contains 1 e XER SO OV if OE contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 28 Extended Mnemonics for subf subf subfo subfo Other Mnemonic Operands Function Registers Page Changed sub RT RA RB Subtract RB from RA 10 155 RT lt RB RA 1 Extended mnemonic for subf RT RB RA sub Extended mnemonic for CR CRO subf RT RB RA subo Extended mnemonic for XER SO OV subfo RT RB RA subo Extended mnemonic for CR CRO subfo RT RB RA XER SO OV Instruction Set 10 155 subfc Subtract From Carrying subfc RT RA RB OE 0 Re 0 subfc RT RA RB OE 0 Rc 1 subfco RT RA RB OE 1 Rc 0 subfco RT RA RB OE 1 Re 1 31 RT RA RB OE 8 Re 0 6 11 16 21 22 31 RT RA RB 1 if RA RB 1 gt 282 1 then XER CA lt 1 else XER CA lt 0 The sum of the ones complement of register RA register RB and 1 is stored into register RT
76. 12 4 cr_field 3 target buna Extended mnemonic for bca 12 4 cr_field 3 target bunl Extended mnemonic for LR bel 12 4 cr_field 3 target bunla Extended mnemonic for LR bcla 12 4 cr_field 3 target Instruction Set 10 27 bcectr Branch Conditional to Count Register bectr BO BI LK 0 bectrl BO BI LK 1 19 BO BI 528 LK 0 6 T 16 21 31 if BO 0 then CTR lt CTR 1 if BO 1 v CTR 0 BO A BO 1 v Ge BO then NIA lt CTRo 2 20 if LK 1 then LR CIA 4 The BI field specifies a bit in the CR to be used as the condition of the branch The next instruction address NIA is the target address of the branch The NIA is formed by concatenating the 30 most significant bits of the CTR with two 0 bits on the right The BO field controls options that determine when program flow is transferred to the NIA The BO field also controls Branch Prediction a performance improvement feature See Section 2 8 4 and Section 2 8 5 for a complete discussion If the LK field contains 1 then CIA 4 is placed into the LR Registers Altered e CTR if BO contains 0 e LR if LK contains 1 Invalid Instruction Forms e Reserved fields e If bit 2 of the BO field contains 0 the instruction form is invalid but the pseudocode applies If the branch condition is true the branch is taken the NIA is the contents of the CTR after it is decremented Architecture Note This instruction is part of the
77. 13 14 15 16 17 18 19 20 21 22 23 27 28 29 30 31 CE EE PE Figure 11 47 Save Restore Register 3 SRR3 0 12 reserved 13 WE Wait State Enable 0 The processor is not in the wait state and continues processing 1 The processor enters the wait state and remains in the wait state until an exception is taken or the PPC403GA is reset or an external debug tool clears the WE bit 14 CE Critical Interrupt Enable CE controls these interrupts 0 Critical exceptions are disabled critical interrupt pin 1 Critical exceptions are enabled watchdog timer first time out 15 ILE Interrupt Little Endian MSR ILE is copied to MSR LE when an 0 Interrupt handlers execute interrupt is taken in Big Endian mode 1 Interrupt handlers execute in Little Endian mode 16 EE External Interrupt Enable EE controls these interrupts 0 Asynchronous exceptions are disabled non critical external DMA 1 Asynchronous exceptions are enabled serial port JTAG serial port programmable interval timer fixed interval timer 17 PR Problem State 0 Supervisor State all instructions allowed 1 Problem State limited instructions available 18 reserved 19 ME Machine Check Enable 0 Machine check exceptions are disabled 1 Machine check exceptions are enabled 20 21 reserved 22 DE Debug Exception Enable 0 Debug exceptions are disabled 1 Debug exceptions are enabled 23 27 reserved 28 PE Protection Enable 0 Protection exceptions are disabled 1
78. 14 CE Critical Interrupt Enable CE controls these interrupts 0 Critical exceptions are disabled critical interrupt pin 1 Critical exceptions are enabled watchdog timer first time out 15 ILE Interrupt Little Endian MSR ILE is copied to MSR LE when an 0 Interrupt handlers execute interrupt is taken in Big Endian mode 1 Interrupt handlers execute in Little Endian mode 16 EE External Interrupt Enable EE controls these interrupts 0 Asynchronous exceptions are disabled non critical external DMA 1 Asynchronous exceptions are enabled serial port JTAG serial port programmable interval timer fixed interval timer 6 6 PPC403GA User s Manual 17 PR Problem State 0 Supervisor State all instructions allowed 1 Problem State limited instructions available 18 reserved 19 ME Machine Check Enable 0 Machine check exceptions are disabled 1 Machine check exceptions are enabled 20 21 reserved 22 DE Debug Exception Enable 0 Debug exceptions are disabled 1 Debug exceptions are enabled 23 27 reserved 28 PE Protection Enable 0 Protection exceptions are disabled 1 Protection exceptions are enabled 29 PX Protection Exclusive Mode 0 Protection mode is inclusive as defined in Section 2 10 on page 2 33 1 Protection mode is exclusive as defined in Section 2 10 on page 2 33 30 reserved 31 LE Little Endian 0 Processor executes in Big Endian mode 1 Processor e
79. 16 31 EA amp EXTS D RA O MS EA 1 Dk RA EA An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The least significant byte of register RS is stored into the byte at the effective address in main storage The effective address is placed into register RA Registers Altered e RA Invalid Instruction Forms RA 0 Architecture Note 10 This instruction is part of the PowerPC User Instruction Set Architecture 10 136 PPC403GA User s Manual stbux Store Byte with Update Indexed stbux RS RA RB 31 RS RA RB 247 0 6 11 16 21 31 EA lt RB RA O MS EA 1 lt RS 24 31 RA EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The least significant byte of register RS is stored into the byte at the effective address in main storage The effective address is placed into register RA If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA Invalid Instruction Forms e Reserved fields e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Inst
80. 16 bits or 4 if the transfer width is a word 32 bits after each transfer in the transaction 7 SAI Source Address Increment valid only during memory to memory moves don t care in other modes 0 Hold the source address do not increment 1 Increment the source address by 1 if the transfer width is one byte 8 bits 2 if the transfer width is a halfword 16 bits or 4 if the transfer width is a word 32 bits after each transfer in the transaction 8 CP Channel Priority 0 Channel has low priority for the external or internal bus 1 Channel has high priority for the external or internal bus 11 28 PPC403GA User s Manual DMACRO0O DMACRS cont 9 10 TM Transfer Mode 00 Buffered mode DMA 01 Fly by mode DMA 10 Software initiated memory to memory mode DMA 11 Hardware initiated device paced memory to memory mode DMA 11 12 PSC Peripheral Setup Cycles 00 No cycles for setup time will be inserted during DMA transfers 01 One SysClk cycle of setup time will be inserted between the time DMAR is accepted on a peripheral read or the data bus is driven on a peripheral write and DMAA is asserted for the peripheral part of the transfer in buffered and fly by modes 10 Two SysClk cycles of setup time are inserted 11 Three SysClk cycles of setup time are inserted 13 18 PWC Peripheral Wait Cycles The value 0 63 of the PWC bits determines the number of SysClk cycles
81. 16 internally to the receiver and the transmitter to generate the required Baud Rate Clock frequency The baud rate for the serial port can be calculated via the following equation Baud Rate 1 x Clock Source 16 BRDH BRDL 1 where Clock Source is the frequency of either SysClk or SerClk based on the setting of the SCS bit of the OCH register Table 7 3 shows the contents of the baud rate divisor registers and the resulting baud rates Serial Port Operation 7 5 when a 3 6864 MHz clock input is applied to the SerClk input and the external clock input is selected in the SCS bit of the IOCR Table 7 3 Baud Rate Divisor Selection BRDH Contents BRDL Contents Baud Rate 0x02 OxFF 300 0x00 OxBF 1200 0x00 Ox5F 2400 0x00 Ox2F 4800 0x00 0x17 9600 0x00 0x0B 19200 0x00 0x05 38400 7 2 2 SPU Transmitter As mentioned previously the main components of the serial port transmitter are an eight bit transmit buffer SPTB a parallel to serial shift register SPTSR and a command register SPTC To enable the transmitter the ET bit of the SPTC must be set to 1 If ET is set to 0 the transmitter is disabled no data is transmitted and no interrupts DSR inactive CTS inactive Transmit Buffer Ready or Transmitter Shift Register Empty are requested If ET is reset to 0 during transmission the transmission immediately terminates and the XmitD output is driven to 1 Transmit Buffer Ready
82. 19 Memory Address Address a Memory to Memory Transfer Data Data Memory GC ei Memory DMAR Address b Device Paced Memory to Memory Transfer 403GA Address Figure 4 14 Overview of Memory to Memory Mode DMA Transfer Table 4 4 Sample DMACR Settings for Memory to Memory Transfer Bit Name Description DAI Destination Address Increment 1 Increment the destination address by 1 if the transfer width is one byte 8 bits 2 if the transfer width is a halfword 16 bits or 4 if the transfer width is a word 32 bits after each transfer in the transaction SAI Source Address Increment valid only during memory to memory moves don t care in other modes 1 Increment the source address by 1 if the transfer width is one byte 8 bits 2 if the transfer width is a halfword 16 bits or 4 if the transfer width is a word 32 bits after each transfer in the transaction CP Channel Priority 1 Channel has high priority for the external or internal bus 4 20 PPC403GA User s Manual Table 4 4 Sample DMACR Settings for Memory to Memory Transfer Bit Name Description 9 10 TM Transfer Mode 10 Software initiated memory to memory mode DMA 11 12 PSC Peripheral Setup Cycles don t care 13 18 PWC Peripheral Wait Cycles don t care 19 21 PHC Peri
83. 2 11 based on the outcome of the comparison Table 2 18 shows the comparison instructions supported by the PPC403GA Table 2 18 Comparison Instructions cmp cmpi cmpl cmpli 2 14 5 Branch Instructions The architecture provides conditional and unconditional branches to any storage location The conditional branch instructions provide a capability to test the condition codes set by a prior instruction and branch accordingly In addition conditional branch instructions may also decrement and test the Count Register as part of determination of the branch condition and may save the return address in the link register The target address for a branch may be a displacement from the current instruction s address or may be contained in the link or count registers or may be an absolute address Table 2 19 Branch Instructions UNCONDITIONAL CONDITIONAL b bc ba bca bl bel bla bcla bectr bectrl belr belrl 2 14 6 Condition Register Logical Instructions Condition Register Logical instructions allow the user to combine the results of several comparisons without incurring the overhead of conditional branching These instructions may significantly improve code performance if multiple conditions are tested prior to making a branch decision Table 2 20 summarizes the Condition Register Logical Instructions 2 52 PPC403GA User s Manual Table 2 20 Condition Register Logical Instructions crand crnor crand
84. 21 Figure 4 22 Figure 6 1 Figure 6 2 Figure 6 3 Figure 6 4 Figure 6 5 Figure 6 6 Figure 6 7 Figure 6 8 Figure 6 9 Figure 6 10 Figure 6 11 Figure 6 12 Figure 6 13 Figure 6 14 Figure 6 15 Figure 6 16 xviii External Bus Master Read Using the Internal DRAM Controller 0 3 54 Burst Write to 3 2 2 2 Page Mode DRAM A 3 56 PPC403GA DMA Controller Interfaces A 4 1 DMA Controller Block Diagram 0 c cecceeecceeeeeeeeeeeeeeteaeeeeeeeeaeeteeeeeaeeseaeeeeeeteaeen 4 2 Overview of Buffered Mode Transfers A 4 4 DMACR Setting for Buffered DRAM Read Peripheral Write ceeeeee 4 6 Buffered Mode Transfer from a 32 bit 2 1 1 1 DRAM to a 32 bit Peripheral 4 8 Buffered Mode Transfer from a 32 bit Peripheral to a 32 bit DRAM 4 9 Overview of Fly by Mode DMA Transfer eecceecceeeeeeeeeeeeeeeeeeeteeeeeeeneeeeas 4 10 DMACR Setting for Fly By Memory Read Peripheral Write 0 008 4 11 Fly By Transfer from 3 cycle DRAM to a 32 bit Peripheral 0 0 4 12 DMACR Setting for Fly By Burst Peripheral Write A 4 16 DMA Fly by Burst 2 1 1 1 DRAM 2 Transfers ccceeeeseeeceeeeeeeeeeeeeetees 4 17 DMA Fly by Burst 3 2 2 2 DRAM Single Transfers ccccssceseeeeeeeeeeeees 4 18 DMACR Setting for Memory to Memory Transfer eceeceeeeeseseeeeeeeneeeees 4 19 Overview of Memory to Memory Mode DMA Transfer ceeereieeeereeee 4 20 Me
85. 3 2 4 on page 2 8 SPR Figure 11 41 Special Purpose Register General SPRGO SPRG3 0 31 General Data Privileged user specified no hardware usage Register Summary 11 59 SPTB SPTB see also Section 7 3 7 on page 7 16 MMIO e Figure 11 42 Serial Port Transmit Buffer SPTB 0 7 Transmit Data Data to be transmitted by the SPTSR 11 60 PPC403GA User s Manual SPTC SPTC see also Section 7 3 8 on page 7 18 MMIO ET TIE SPE PGM 4 4 Din cl 4 5 6 7 Ne ok DME EIE TB Figure 11 43 Serial Port Transmitter Command Register SPTC ET Enable Transmitter Chip Reset or System Reset clears to 0 0 Disable transmitter 1 Enable transmitter 1 2 DME DMA Mode Interrupt Enable 00 DMA disabled TBR interrupt disabled 01 DMA disabled TBR interrupt enabled 10 DMA enabled serial port transmitter is DMA channel 2 destination 11 DMA enabled serial port transmitter is DMA channel 3 destination TIE Transmitter Empty Interrupt Enable 0 Transmitter shift register empty interrupt disabled 1 Transmitter shift register empty interrupt enabled EIE Transmitter Error Interrupt Enable 0 Transmitter shift register error interrupt disabled 1 Transmitter shift register error interrupt enabled SPE Stop Pause on CTS Inactive 0 Pause mode when CTS is inactive 1 Stop mode when CTS is inactive TB Transmit Break 0 Disable b
86. 36 20 48 1001 768 SysClk cycles 23 04 30 72 1010 1024 SysClk cycles 30 72 40 96 1011 1536 SysClk cycles 46 08 61 44 1100 2048 SysClk cycles 61 44 81 92 1101 3072 SysClk cycles 92 16 122 88 1110 4096 SysClk cycles 122 88 163 84 1111 6144 SysClk cycles 184 32 245 76 Table 3 5 RR Field for Alternate Refresh Mode Value Action 0001 Immediate Refresh 0010 Self Refresh Hold RAS 0100 Self Refresh Hold CAS 0110 Self Refresh Hold RAS and CAS Memory and Peripheral Interface 3 41 3 7 3 Alternate Refresh Mode BRn ARM is the Alternate Refresh Mode bit When ARM 0 refresh for this bank is done normally at the rate programmed in the DRAM Refresh Rate field of the bank register When ARM 1 Alternate Refresh Mode is enabled In Alternate Refresh Mode the DRAM Refresh Rate field now indicates either Immediate Refresh or Self Refresh While in the Alternate Refresh mode the internal refresh request generator will be ignored and it is up to the software to either put the device in Self Refresh mode or use the Immediate Refresh to meet the refresh requirements of the device Software must ensure that there are no DRAM accesses while any bank is in the Alternate Refresh Mode If the Alternate Refresh mode bit is set and a DRAM access is attempted a Non Configured error will occur 3 7 3 1 Immediate Refresh Immediate Refresh is a means of using the refresh controller internal to t
87. 4 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The word at the effective address is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Execution of the Iwarx instruction sets the reservation bit Registers Altered e RT Invalid Instruction Forms e Reserved fields Programming Note The reservation bit can be set to 1 only by the execution of the Iwarx instruction When execution of the stwex instruction completes the reservation bit will be 0 independent of whether or not the stwex instruction sent RS to memory CR CRO eq must be examined to determine if RS was sent to memory It is intended that lwarx and stwex be used in pairs in a loop to create the effect of an atomic operation to a memory area which is a semaphore between asynchronous processes loop war read the semaphore from memory set reservation alter change the semaphore bits in register as required stwcex attempt to store semaphore reset reservation bne loop an asynchronous process has intervened try again All usage of lwarx and stwex including usage within asynchronous processes should be paired as shown in this example If the asynchronous p
88. BIU Cache lines are always flushed or filled in their entirety even if the program does not request the rest of the bytes in the line 8 3 2 Data Cache Cacheability Register DCCR The DCU is configured for operation by writing a 32 bit special purpose register the Data Cache Cacheability Register DCCR Following system reset all DCCR bits are reset to zero so that no memory regions are cacheable Before memory regions can be designated as cacheable in the DCCR it is necessary to execute the decci instruction 32 times once for each congruence class in the cache array This invalidates all 32 congruence classes prior to enabling the cache The DCCR can then be reconfigured and the DCU can begin normal operation Each bit of the DCCR represents the cacheability state of a 128MB region of the effective address space When a DCCR bit is set to one the memory region corresponding to that bit is allowed to be cached Data blocks in cacheable regions can be placed in the data cache and reused by the execution unit without causing external memory accesses 7 GO S2 S4 S6 Ss S10 S12 S14 S16 S18 S20 S22 S24 S26 S28 S30 een E f O 2 3 4 617 8 10 11 12 13 DI 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 5 9 di S3 de ii do li s sls al slo sh ebe ele ely Ka d Figure 8 7 Data Cache Cacheability Register DCCR 0
89. CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 96 PPC403GA User s Manual mcrf Move Condition Register Field mcrf BF BFA 19 BF BFA 0 0 6 9 11 14 21 31 m lt BFA n BF CR CRn lt CR CRm The contents of the CR field specified by the BFA field are placed into the CR field specified by the BF field Registers Altered e CR CRn where nis specified by the BF field Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 97 mecerxr Move to Condition Register from XER merxr BF 31 BF 512 0 6 9 21 31 n lt BF CR CRn lt XERp 3 XERo 3 lt 40 The contents of XERg 3 are placed into the CR field specified by the BF field XERo 3 are then set to 0 This transfer is positional by bit number so the mnemonics associated with each bit are changed See the following table for clarification Bit XER Usage CR Usage 0 SO LT 1 OV GT 2 CA EQ 3 reserved SO If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e CR CRn where nis specified by the BF field e XER SO OV CA Invalid Instruction Forms e Reserved fields Architecture Note
90. CRpgg The CR bit specified by the BA field is ANDed with the ones complement of the CR bit specified by the BB field the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 43 creqv Condition Register Equivalent creqv BT BA BB 19 BT BA BB 289 0 6 11 16 21 31 Chor ZC CRea Cep The CR bit specified by the BA field is XORed with the CR bit specified by the BB field the ones complement of the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 13 Extended Mnemonics for creqv Other Mnemonic Operands Function Registers Page Changed crset bx Condition register set 10 44 Extended mnemonic for creqv bx bx bx 10 44 PPC403GA User s Manual crnand Condition Register NAND crnand BT BA BB 0 6 11 16 21 31 Cher lt CRga Gel The CR bit specified by the BA field is ANDed with the CR bit specified by the BB field the ones complement of the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms
91. Destination Address Reg 3 0xDA Read Write DMASAO DMA Source Address Register 0 0xC3 Read Write DMASA1 DMA Source Address Register 1 0xCB Read Write DMASA2 DMA Source Address Register 2 0xD3 Read Write DMASA3 DMA Source Address Register 3 0xDB Read Write DMASR DMA Status Register OxE0 Read Clear EXIER External Interrupt Enable Register 0x42 Read Write EXISR External Interrupt Status Register 0x40 Read Clear IOCR Input Output Configuration Register OxA0 Read Write reserved 0x41 reserved OxE1 Register Summary 11 3 11 6 Special Purpose Register Numbering Special Purpose Registers SPRs are on chip registers that are architecturally considered part of the processor core They are accessed with the mtspr move to special purpose register and mfspr move from special purpose register instructions which are defined in Chapter 10 The only SPRs that are not privileged are the Link Register LR Count Register CTR and the Fixed point Exception Register XER All other SPRs are privileged for both read and write See Section 2 11 Privileged Mode Operation on page 2 36 for further discussion of privileged operation SPRs are used to control the use of the debug facilities the timers the interrupts the protection mechanism memory cacheability and other architected processor resources The registers marked reserved should be neither read nor written Table 11 3 PPC403GA Special Purpose Registers
92. Environment Architecture 10 124 PPC403GA User s Manual rlwimi Rotate Left Word Immediate then Mask Insert rlwimi RA RS SH MB ME Rce 0 rlwimi RA RS SH MB ME Rc 1 20 RS RA SH MB ME Rc 0 6 Ti 16 21 26 31 r lt ROTL RS SH m lt MASK MB ME RA amp ra m v RA A m The contents of register RS are rotated left by the number of bit positions specified in the SH field A mask is generated having 1 bits starting at the bit position specified in the MB field and ending in the bit position specified by the ME field with 0 bits elsewhere If the starting point of the mask is at a higher bit position than the ending point the 1 bits portion of the mask wraps from the highest bit position back around to the lowest The rotated data is inserted into register RA in positions corresponding to the bit positions in the mask that contain a 1 bit Registers Altered e RA e CR CRO t et eo so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 Table 10 25 Extended Mnemonics for rlwimi rlwimi Other Mnemonic Operands Function Registers Page Changed inslwi RA RS n b Insert from left immediate n gt 0 10 125 RA b ban 1 RS o n 1 Extended mnemonic for rlwimi RA RS 32 b b b n 1 inslwi Extended mnemonic for CR CRO rlwimi RA RS 32 b b b n 1 insrwi RA RS n b Insert from right i
93. For logical compares the numbers are considered to be unsigned all 32 bits are significant no sign bit As an example consider the comparison of 0 with OxFFFF FFFF In an arithmetic compare 0 is larger in a logical compare OxFFFF FFFF is larger Compare instructions can direct the results of the comparison to any CR field via the BF field bits 6 8 of the instruction The first data operand of a compare instruction is always the contents of a GPR The second data operand can be the contents of a GPR or can be immediate data derived from the IM field bits 16 31 of the instruction See the instruction descriptions page 10 37 through page 10 40 for precise details After a compare the CR field specified by BF is updated and can be interpreted as follows LT bit 0 The first operand is less than the second operand GT bit 1 The first operand is greater than the second operand EQ bit 2 The first operand is equal to the second operand SO bit 3 Summary overflow a copy of XER SO 2 3 3 2 The CRO Field After compare instructions with BF field of 0 the CRO field is interpreted as shown in Section 2 3 3 1 above After most other fixed point instructions that update CR CRO it is interpreted as follows LT bit 0 Less than 0 set if the high order bit of the 32 bit result is 1 GT bit 1 Greater than 0 set if the 32 bit result is non zero and the high order bit of the result is 0 EQ bit 2 Equal to zero set if the 32 b
94. General 2 0x112 Read Write SPRG3 SPR General 3 0x113 Read Write SRRO Save Restore Register 0 0x01A Read Write SRR1 Save Restore Register 1 0x01B Read Write SRR2 Save Restore Register 2 0x3DE Read Write SRR3 Save Restore Register 3 0x3DF Read Write TBHI Time Base High 0x3DC Read Write TBLO Time Base Low 0x3DD Read Write TCR Timer Control Register 0x3DA Read Write TSR Timer Status Register 0x3D8 Read Clear XER Fixed Point Exception Register 0x001 Read Write reserved 0x000 reserved 0x010 reserved 0x3D0 reserved 0x3D1 reserved 0x3D2 reserved 0x3D9 reserved Ox3F1 reserved Ox3F3 reserved Ox3F8 reserved Ox3F9 Register Summary 11 5 11 7 Memory Mapped UO Register Numbering Currently the only peripheral attached to the On Chip Peripheral Bus OPB is the serial port The control status data registers for all peripherals attached to the OPB are memory mapped The serial port registers are shown in the table below Load and store instructions are used to access the serial port registers Registers marked as reserved should be neither read nor written Table 11 4 PPC403GA Memory Mapped I O Registers Mnemonic Register Name Address Access BRDH Baud Rate Divisor High Reg 0x40000004 Read Write BRDL Baud Rate Divisor Low Reg 0x40000005 Read Write SPCTL Control Register 0x40000006 Read Write SPHS Handshake Status Register 0x40000002 Read Clear SPLS Line Status Register
95. IM Trap if RA logically greater than EXTS IM Extended mnemonic for twi 1 RA IM Trap if RA logically less than or equal to EXTS IM Extended mnemonic for twi 6 RA IM Trap if RA logically less than EXTS IM Extended mnemonic for twi 2 RA IM Trap if RA logically not greater than EXTS IM Extended mnemonic for twi 6 RA IM Trap if RA logically not less than EXTS IM Extended mnemonic for twi 5 RA IM Trap if RA less than EXTS IM Extended mnemonic for twi 16 RA IM Trap if RA not equal to EXTS IM Extended mnemonic for twi 24 RA IM Trap if RA not greater than EXTS IM Extended mnemonic for twi 20 RA IM Trap if RA not less than EXTS IM Extended mnemonic for twi 12 RA IM Other Registers Changed Page 10 164 twi TO RA IM Trap exception is generated if comparing RA with EXTS IM any condition speci fied by TO is true 10 164 A 38 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed wrtee RS Write value of RS46 to the External Enable 10 166 bit MSR EE wrteei E Write value of E to the External Enable 10 167 bit MSR EE xor RA RS RB XOR RB with RS 10 168 Place answer in RA xor CR CRO xori RA RS IM XOR RB with 80 IM 10 169 Place answer in RA xoris RA RS IM X
96. Ibzux 10 74 Ibzx 10 75 Iha 10 76 bau 10 77 haus 10 78 Ihax 10 79 Ihbrx 10 80 Ihz 10 81 bau 10 82 haus 10 83 Ihzx 10 84 little endian 2 17 mode control 2 22 non processor memory access 2 21 Imw 10 85 logical compare 2 12 LR 2 7 11 47 Iswi 10 86 Iswx 10 88 lwarx 10 90 Iwbrx 10 92 lwz 10 93 lwzu 10 94 Iwzux 10 95 lwzx 10 96 machine check 6 19 merf 10 97 merxr 10 98 memory interface access priority 3 3 address bit usage 3 7 bus attachment 3 5 alternative 3 6 bus width after reset 3 5 cacheability 3 8 DRAM 3 27 address multiplexing 3 45 example connection 3 44 signals 3 27 SIMMs 3 44 timing CAS Before RAS Refresh 3 35 page mode read 3 31 page mode write 3 33 read 3 29 write 3 30 DRAM refresh 3 40 external bus master 3 49 Index l 7 i EI memory banks supported 3 4 refresh 3 40 ROM 3 11 signals 3 2 SRAM 3 11 burst mode 3 19 bus timeout error 3 16 device paced transfers 3 16 signals 3 11 timing 3 11 burst read 3 20 burst write 3 21 device paced read 3 17 device paced write 3 18 read 3 14 write 3 15 WBE signal usage 3 16 memory map 2 2 bank register alignment 3 10 cacheability regions 2 3 DRAM 2 3 SRAM 2 3 SRAM DRAM OPB addressing 3 9 memory mapped registers 2 14 memory organization 2 2 double mapping 2 2 supported memory 2 3 memory protection 2 33 mfcr 10 99 mfdcr 10 100 mfmsr 10 102 mfspr 10 103 mftb 6 30 6 31 MSR 2 13 6 2 11 48 mtcrf 10 105 mtdcr 10 107 mtmsr
97. If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Programming Note 31 The SPR number SPRN specified in the assembler language coding of the mfspr instruction refers to an actual SPR number see Table 11 3 The assembler handles the unusual register number encoding to generate the SPRF field Also see Section 2 11 4 fora discussion of the encoding of Privileged SPRs Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 103 mfspr Move From Special Purpose Register Table 10 18 Extended Mnemonics for mfspr Mnemonic mfcdbcr mfctr mfdac1 mfdac2 mfdbsr mfdecr mfdear mfesr mfevpr mfiac1 mfiac2 mficcr mficdbdr mflr mfpbl1 mfpbl2 mfpbu1 mfpbu2 mfpit mfpvr mfsprg0 mfsprg1 mfsprg2 mfsprg3 mfsrrO mfsrr1 mfsrr2 mfsrr3 mftbhi mftblo mftcr mftsr mfxer RT Operands Function Move from special purpose register SPRN Extended mnemonic for mfspr RT SPRN Other Registers Changed Page 10 103 10 104 PPC403GA User s Manual mtcrf Move to Condition Register Fields micrf FXM RS 31 RS FXM 144 0 6 11 12 20 21 31 mask lt 4 FXMp 4 FXM Il FXMg I 4 FXM7 CR lt RS A mask v CR A mask Some or all of the contents of register RS are placed into the CR as s
98. Instruction Set 10 69 This instruction is specific to the PowerPC Embedded Controller family icread Instruction Cache Read Invalid Instruction Forms e Reserved fields Programming Note Execution of this instruction is privileged Insert at least one instruction between icread and mficdbdr icread r5 r6 read cache information nop minimum separation mficdbdr r7 move information to GPR Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations 10 70 PPC403GA User s Manual isync Instruction Synchronize isync 19 150 0 6 21 31 The isync instruction is a context synchronizing instruction Execution of an isync instruction ensures that all instructions preceding the isyne instruction execute in the context established before the isync instruction and that all instructions following the isyne instruction are executed within the context established by all preceding instructions The isync instruction causes all prefetched instructions in the instruction queue to be discarded and refreshed If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Note PowerPC Architecture contains a detailed discussion about context sync
99. Interrupt 2 pin 1 Interrupt pending from External nterrupt 2 pin 30 31 E3IS EAIS External Interrupt 3 Status 0 No interrupt pending from External Interrupt 3 pin 1 Interrupt pending from External External Interrupt 4 Status nterrupt 3 pin 0 No interrupt pending from External Interrupt 4 pin 1 Interrupt pending from External nterrupt 4 pin Register Summary 11 39 GPR GPR see also Section 2 3 1 on page 2 5 31 Figure 11 25 General Purpose Register RO R31 0 31 General Purpose Register data 11 40 PPC403GA User s Manual IAC1 IAC2 IAC1 IAC2 see also Section 9 7 4 on page 9 11 SPR 0 29 30 31 Figure 11 26 Instruction Address Compare IAC1 IAC2 0 29 Instruction Address Compare Word Address omit 2 lo order bits of complete address 30 31 reserved Register Summary 11 41 ICCR ICCR see also Section 8 2 2 on page 8 4 SPR T T SN aig l S10 SS sik Se SR 20 SS 24 Sp T dii 07 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 2820 30 31 A de ds T de el sla sis Ka ats eh SE abe a ahs ae Figure 11 27 Instruction Cache Cacheability Register ICCR 0 So 0 noncacheable 1 cacheab
100. Iwarx with any store other than stwex then the reservation bit would not have been cleared in the asynchronous process and the code above would have overwritten the semaphore 10 150 PPC403GA User s Manual stwex Store Word Conditional Indexed Registers Altered e CRI CRO iz ct Eo so Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 151 stwu Store Word with Update stwu RS D RA 37 RS RA D 0 6 11 16 31 EA lt EXTS D RA O MS EA 4 lt RS RA lt EA An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The contents of register RS are stored into the word at the effective address The effective address is placed into register RA Registers Altered e RA Invalid Instruction Forms e RA 0 Architecture Note 10 This instruction is part of the PowerPC User Instruction Set Architecture 10 152 PPC403GA User s Manual stwux RS RA RB stwux Store Word with Update Indexed 31 RS RA RB 183 0 6 11 16 EA lt RB RAO MS EA 4 lt RS RA lt EA 21 31 An effective address is for
101. JTAG Test Clock Input TCK is the clock source for the PPC403GA test access port TAP The maximum clock rate into the TCK pin is one half of the processor SysClk clock rate TDI Test Data In The TDI is used to input serial data into the TAP When the TAP enables the use of the TDI pin the TDI pin is sampled on the rising edge of TClk and this data is input to the selected TAP shift register TDO 16 Test Data Output TDO is used to transmit data from the PPC403GA TAP Data from the selected TAP shift register is shifted out on TDO TestA 23 Reserved for manufacturing test Tied low for normal operation TestB 24 Reserved for manufacturing test Tied high for normal operation Signal Descriptions 12 7 Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function TestC HoldPri 37 l TestC HoldReq Priority TestC Reserved for manufacturing test during the reset interval While Reset is active this signal should be tied low for normal operation HoldReq Priority When Reset is not active this signal is sampled to determine the priority of the external bus master signal HoldReq If HoldPri 0 then the HoldReq signal is considered high priority otherwise HoldReq is considered low priority TestD 38 Reserved for manufacturing test Tied low for normal operation TimerClk 25 l Ti
102. Mnemonic bnuctr Operands cr_field bnuctrl Function Branch if not unordered to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 3 Other Registers Changed Extended mnemonic for bectrl 4 4 cr_field 3 LR Page 10 28 bnulr cr_field bnulrl Branch if not unordered to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 3 Extended mnemonic for belrl 4 4 cr_field 3 LR 10 32 bso cr_field target bsoa bsol bsola Branch if summary overflow Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 3 target Extended mnemonic for bca 12 4 cr_field 3 target Extended mnemonic for bel 12 4 cr_field 3 target LR Extended mnemonic for bcla 12 4 cr_field 3 target LR 10 21 bsoctr cr_field bsoctrl Branch if summary overflow to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 3 Extended mnemonic for bectrl 12 4 cr_field 3 LR 10 28 bsolr cr_field bsolrl B 16 Branch if summary overflow to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 3 Extended mnemonic for belrl 12 4 cr_field 3 PPC403GA User s Manual LR 10 32 Table B 4 Extended Mnemonics for PPC403GA cont
103. Mnemonic Operands Function Registers Page Changed la RT D RA Load address RA 0 10 10 D is an offset from a base address that is assumed to be RA RT lt RA EXTS D Extended mnemonic for addi RT RA D li RT IM Load immediate 10 10 RT lt EXTS IM Extended mnemonic for addi RT 0 IM subi RT RA IM Subtract EXTS IM from RA 0O 10 10 Place answer in RT Extended mnemonic for addi RT RA IM 10 10 PPC403GA User s Manual addic RT RA IM addic Add Immediate Carrying 12 RT RA 0 6 11 RT RA EXTS IM if RA EXTS IM Z 282 1 then XER CA lt 1 else XER CA lt 0 The sum of the contents of register RA and the contents of the IM field sign extended to 32 bits is placed into register RT If a carry out occurs XER CA is set to 1 Registers Altered e RT e XER CA Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 3 Extended Mnemonics for addic Other Mnemonic Operands Function Registers Page Changed subic RT RA IM Subtract EXTS IM from RA 10 11 Place answer in RT Place carry out in XER CA Extended mnemonic for addic RT RA IM Instruction Set 10 11 addic Add Immediate Carrying and Record addic RT RA IM 0 6 11 16 31 RT lt RA EXTS IM if RA EXTS IM gt 282 1 then XER CA lt 1 else XER
104. OEN WBF SD Figure 11 3 Bank Registers SRAM Configuration BRO BR7 0 7 BAS Base Address Select Specifies the starting address of the SRAM bank 8 10 BS Bank Size 000 1 MB bank 001 2 MB bank 010 4 MB bank 011 8 MB bank 100 16 MB bank 101 32 MB bank 110 64 MB bank 111 Reserved 11 12 BU Bank Usage 00 Disabled invalid or unused bank 01 Bank is valid for read only RO 10 Bank is valid for write only WO 11 Bank is valid for read write R W 13 SLF Sequential Line Fills 0 Line fills are Target Word First 1 Line fills are Sequential 14 BME Burst Mode Enable For cache line fills and flushes bus master burst 0 Bursting is disabled operations DMA flyby burst and DMA memory 1 Bursting is enabled to memory line burst operations and all packing and unpacking operations 15 16 BW Bus Width 00 8 bit bus 01 16 bit bus 10 32 bit bus 11 Reserved 17 RE Ready Enable 0 Ready pin input is disabled 1 Ready pin input is enabled 18 23 TWT Transfer Wait Wait states on all non burst transfers Used if field BME 0 18 21 FWT First Wait Wait states on first tranfer of a burst Used if field BME 1 Register Summary 11 9 BRO BR7 SRAM Configuration cont 22 23 BWT Burst Wait Wait states on non first transfers of a burst Used if field BME 1 24 CSN Chip Select On Timing 0 Chip select is valid when address is valid 1
105. OV divwuo CR CRO XER SO OV eieio Storage synchronization All loads and 10 62 stores that precede the eieio instruction complete before any loads and stores that follow the instruction access main storage Implemented as syne which is more restrictive eqv RA RS RB Equivalence of RS with RB 10 63 RA lt HS RB eqv CR CRO extlwi RA RS n b Extract and left justify immediate n gt 0 10 126 RA o n 1 e RS p ben 1 RA n 31 90 Extended mnemonic for rlwinm RA RS b 0 n 1 extlwi Extended mnemonic for CR CRO rlwinm RA RS b 0 n 1 extrwi RA RS n b Extract and right justify immediate n gt 0 10 126 RA 32 n 31 e Bib RA o 31 n e 7 0 Extended mnemonic for rlwinm RA RS b n 32 n 31 extrwi Extended mnemonic for CR CRO rlwinm RA RS b n 32 n 31 extsb RA RS Extend the sign of byte RS 24 31 10 64 Place the result in RA extsb CR CRO extsh RA RS Extend the sign of halfword RS 16 31 10 65 Place the result in RA extsh CR CRO icbi RA RB Invalidate the instruction cache block which 10 66 contains the effective address RA O RB icbt RA RB Load the instruction cache block which con 10 67 tains the effective address RA O RB A 20 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic iccci Operands RA RB Function Invalidate instruction cache congruence class associated with the effective address RA O RB Oth
106. Operands RA RS n b insrwi Function Insert from right immediate n gt 0 RA b b n 1 lt RS 32 n 31 Extended mnemonic for rlwimi RA RS 32 b n b b n 1 Other Registers Changed Extended mnemonic for rlwimi RA RS 32 b n b b n 1 CRICRO Page 10 125 la RT D RA Load address RA 0 D is an offset from a base address that is assumed to be RA RT lt RA EXTS D Extended mnemonic for addi RT RA D 10 10 RT IM Load immediate RT lt EXTS IM Extended mnemonic for addi RT 0 value 10 10 lis RT IM Load immediate shifted RT lt IM 160 Extended mnemonic for addis RT 0 value 10 13 B 20 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic mfbear mfbesr mfbr0 mfbr1 mfbr2 mfbr3 mfbr4 mfbr5 mfbr6 mfbr7 mfdmaccO mfdmacc1 mfdmacc2 mfdmacc3 mfdmacr0 mfdmacr1 mfdmacr2 mfdmacr3 mfdmact0O mfdmact1 mfdmact2 mfdmact3 mfdmada0 mfdmadat1 mfdmada2 mfdmada3 mfdmasa0 mfdmasa1 mfdmasa2 mfdmasa3 mfdmasr mfexisr mfexier mfiocr Operands RT Function Move from device control register DORN Extended mnemonic for mfdcr RT DCRN Other Registers Changed Page 10 100 Instructions By Category B 21 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic mfcdbcr mfctr mfdac1 mfdac2 mfdbsr mfdcecr mfdear
107. Operands Function Registers Page Changed b target Branch unconditional relative 10 20 LI lt target ClAle ze NIA CIA EXTS LI 20 ba Branch unconditional absolute LI lt targetg o9 NIA EXTS LI 20 bl Branch unconditional relative LR CIA 4 LI lt target ClAle ze NIA CIA EXTS LI Zo bla Branch unconditional absolute LR CIA 4 LI lt targetg o9 NIA EXTS LI 20 bc BO BI target Branch conditional relative CTR if BO 0 10 21 BD lt target CIA 16 29 NIA CIA EXTS BD 20 bca Branch conditional absolute CTR if BO 0 BD e target16 29 NIA EXTS BD 20 bel Branch conditional relative CTR if BO 0 BD lt target CIA 16 29 LR CIA 4 NIA CIA EXTS BD 20 bcla Branch conditional absolute CTR if BO 0 BD e targets g 29 LR lt CIA 4 NIA EXTS BD 20 bectr BO BI Branch conditional to address in CTR CTR if BO 0 10 28 Using CTR at exit from instruction 3 bectrl NIA CTRo 29 Il 20 CTR if BO 0 LR CIA 4 B 40 PPC403GA User s Manual Table B 8 Branch Instructions cont Other Mnemonic Operands Function Registers Page Changed belr BO BI Branch conditional to address in LR CTR if BOs 0 10 32 Using LR at entry to instruction belrl NIA amp LRo 29 I 20 CTR if BOs 0 LR CIA 4 B 9 Comparison Instructions Comparison instructions perform arithm
108. Per IEEE 1149 1 standard JTAG 3 0011 Private JTAG 5 0101 Private JTAG 7 0111 Private JTAG B 1011 Private Bypass 1111 Per IEEE 1149 1 standard Debugging 9 15 9 8 2 3 JTAG Boundary Scan Chain Table 9 4 Boundary Scan Chain Bit Signal Name Type Pin Signals Enabled 0 DMARO 2 1 DMAR1 3 2 DMAR2 4 3 DMAR3 XREQ 5 4 Halt 9 5 BootW l 11 6 BusError 12 7 Ready 13 8 HoldReq l 14 9 TSO 0 17 10 TS1 oO 18 11 TS2 O 19 12 TimerClk 25 13 INTO 31 14 INT1 32 15 INT2 33 16 INT3 34 17 INT4 35 18 CINT 36 19 TestC HoldPri 37 20 TestD 38 21 DO VO 42 22 D1 vO 43 23 D2 VO 44 24 D3 VO 45 25 D4 vO 46 26 D5 VO 47 27 D6 vO 48 28 DBusEn0 Internal DO D7 9 16 PPC403GA User s Manual Table 9 4 Boundary Scan Chain cont Bit Signal Name Type Pin Signals Enabled 29 DBusEn1 Internal D8 D15 30 D7 vO 51 31 D8 vO 52 32 D9 vO 53 33 D10 vO 54 34 D11 O 55 35 D12 O 56 36 D13 vO 57 37 D14 VO 58 38 D15 vO 62 39 D16 vO 63 40 D17 VO 64 41 D18 O 65 42 D19 O 66 43 D20 O 67 44 D21 O 68 45 DBusEn2 Internal D16 D23 46 DBusEn3 Internal D24 D31 47 D22 VO 71 48 D23 VO 72 49 D24 O 73 50 D25 UO 74 51 D26 O 75 52 D27 O 76 53 D28 vO 77 54 D29 O 78 55 D30 vO 79 56 D31 vO 82 57 TS6 83 58 TS5 84
109. Peripheral Interface 3 29 3 7 1 2 DRAM Write Example The following figure illustrates the timing of a single non burst DRAM write Note that the Early RAS Mode feature is illustrated here Cycle SysClk A11 29 RW RASn CAS0 3 DRAMOE DRAMWE D0 31 AMuxCAS 3 30 1 early C Coum s S N El Early RAS Mode bit 14 0 normal Bank Register Settings Seq Line Fills Bus Width External Mux RAS CAS Timing Page First Mode Access Burst Access Pre chg Cycles Refresh RAS Refresh Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit 20 Bit 21 22 Bit 23 24 Bit 25 Bit 26 Bits 27 30 x 10 0 0 0 00 XX 0 x XXXX Figure 3 16 DRAM Single Transfer Write PPC403GA User s Manual 3 7 1 3 DRAM Page Mode Read Example The following figure illustrates the timing of a 3 2 2 2 burst DRAM read Early RAS Mode and DRAM Read on CAS features are not illustrated here but they may be used if desired DRAM Read on CAS only applies to DRAM read operations Cycle 10 SysClk ka CAS CAS2 CAS3 CAS4 A11 29 Column 4 x I RASn 7 L E cAsO3 7 D DEE e O aa S wa D emma e DRAME 7 NL ern DRAMWE DO 31 AMuxCAS le _ E Bank Register Settings
110. Peripheral Width Transfer Width is the same as Peripheral Width 10 Word 32 bits 6 DAI Destination Address Increment 0 Hold the destination address do not increment 7 SAI Source Address Increment valid only during memory to memory moves don t care in other modes 4 6 PPC403GA User s Manual Table 4 1 Sample DMACR Settings for Buffered Transfer Bit Name Description 8 CP Channel Priority 1 Channel has high priority for the external or internal bus 9 10 TM Transfer Mode 00 Buffered mode DMA 11 12 PSC Peripheral Setup Cycles in this example zero 13 18 PWC Peripheral Wait Cycles in this example zero 19 21 PHC Peripheral Hold Cycles in this example zero 22 ETD End of Transfer Terminal Count EOT TC Pin Direction ES 1 The EOT TC pin is programmed as a terminal count TC output When programmed as TC and the terminal count is reached this signal will go active the cycle after DMAA goes inactive 23 TCE Terminal Count Enable 1 Channel stops when terminal count reached 24 CH Chaining Enable 0 DMA Chaining is disabled 25 BME Burst Mode Enable In all modes except fly by and M2M line burst 0 Channel does not burst to memory must have BME 0 26 ECE EOT Chain Mode Enable ETD must be programmed for EOT 0 Channel will stop when EOT is active 27 TCD TC Chain Mode Disable 0 If Chaining is enabled channel will chain when TC re
111. PowerPC User Instruction Set Architecture 10 28 PPC403GA User s Manual bcctr Branch Conditional to Count Register Table 10 7 Extended Mnemonics for bcctr bcctrl Mnemonic betr betrl Operands Function Branch unconditionally to address in CTR Extended mnemonic for bectr 20 0 Other Registers Changed Extended mnemonic for bectrl 20 0 LR Page 10 28 beqctr beqctrl cr_field Branch if equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 2 Extended mnemonic for bectrl 12 4 cr_field 2 LR 10 28 bfctr bfctrl cr_bit Branch if CRer pit 0 to address in CTR Extended mnemonic for bectr 4 cr_bit Extended mnemonic for bectrl 4 cr_bit LR 10 28 bgectr bgectrl cr_field Branch if greater than or equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 0 Extended mnemonic for bectrl 4 4 cr_field 0 LR 10 28 bgtctr bgtctrl cr_field Branch if greater than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 1 Extended mnemonic for bectrl 12 4 cr_field 1 LR 10 28 blectr blectrl cr_field Branch if less than or equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 1 Extend
112. RA gt EXTS IM then c lt 1 if RA EXTS IM then c lt 1 c3 lt XER SO n lt BF CRICRn lt Gos The IM field is sign extended to 32 bits The contents of register RA are compared with the extended IM field using a 32 bit signed compare The CR field specified by the BF field is updated to reflect the results of the compare and the value of XER SO is placed into the same CR field Registers Altered e CR CRn where nis specified by the BF field Invalid Instruction Forms e Reserved fields Programming Note Since the PPC403GA supports only the 32 bit version of the PowerPC cmpi Compare Immediate instruction use of the extended mnemonic cmpwi BF RA IM is recommended Table 10 10 Extended Mnemonics for cmpi Other Mnemonic Operands Function Registers Page Changed cmpwi BF RA IM Compare Word Immediate 10 38 Use CRO if BF is omitted Extended mnemonic for cmpi BF 0 RA IM 10 38 PPC403GA User s Manual cmpl Compare Logical cmpl BF 0 RA RB 31 BF RA RB 32 0 6 9 11 16 21 31 Gas lt D if RA lt RB then Go amp 1 if RA gt RB then c lt 1 if RA RB thenc lt 1 C XER SO n lt BF CRICRn lt cos The contents of register RA are compared with the contents of register RB using a 32 bit unsigned compare The CR field specified by the BF field is updated to reflect the results of the compare and the value
113. RCT PM FAC PCC SD Figure 11 4 Bank Registers DRAM Configuration BR4 BR7 0 7 BAS Base Address Select Specifies the starting address of the DRAM bank 8 10 BS Bank Size 000 1 MB bank 001 2 MB bank 010 4 MB bank 011 8 MB bank 100 16 MB bank 101 32 MB bank 110 64 MB bank 111 Reserved 11 12 BU Bank Usage 00 Disabled invalid or unused bank 01 Bank is valid for read only RO 10 Bank is valid for write only WO 11 Bank is valid for read write R W 13 SLF Sequential Line Fills 0 Line fills are Target Word First 1 Line fills are Sequential 14 ERM Early RAS Mode 0 normal RAS activation approximately 1 2 cycle following address valid 1 early RAS activation approximately 1 4 cycle following address valid 15 16 BW Bus Width 00 8 bit bus 01 16 bit bus 10 32 bit bus 11 Reserved 17 IEM Internal External Multiplex If an external bus master is used an external 0 Address bus multiplexed internally multiplexer must also be used 1 Address bus multiplexed externally 18 RCT RAS Active to CAS Active Timing 0 CAS becomes active one SysClk cycle after RAS becomes active 1 CAS becomes active two SysClk cycles after RAS becomes active 19 ARM Alternate Refresh Mode 0 Normal refresh 1 Immediate or Self refresh Use alternate values of field RR Register Summary 11 11 BR4 BR7 DRAM Configuration cont 20 PM Page Mode
114. Refresh Fills Width Mux Timing Mode Access Access Cycles RAS Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit20 Bit 21 22 Bit 23 24 Bit 25 Bit 26 Bits 27 30 x 10 0 0 0 00 00 0 x XXXX Figure 3 20 DRAM 2 1 1 1 Page Mode Write 3 34 PPC403GA User s Manual 3 7 1 5 DRAM CAS Before RAS Refresh Example The following figure illustrates CAS before RAS refresh See page 3 40 for a discussion of the controls for this mode of refresh v er ER Early RAS Mode does not affect the activation of RAS during refresh RAS is always activated 1 cycle following the activation of CAS during a refresh operation ka RASactive 0 PreChg 0 RASn CAS0 3 DRAMOE DRAMWE DO 31 Figure 3 21 DRAM Refresh Timing CAS Before RAS 1 Bank Memory and Peripheral Interface 3 35 3 7 2 Bank Registers for DRAM Devices Four bank registers BR4 through BR7 can control either SRAM or DRAM devices When configured to control DRAM devices BR4 BR7 control row address select RAS lines RAS3 through RASO respectively Figure 3 22 shows the fields of BR4 BR7 when these registers are configured to control DRAM like devices Section 3 6 4 describes the usage of BR4 BR7 for SRAM devices Bits 0 13 15 16 of the bank register have the same usage whether for SRAM or DRAM For BR4 BR7 bit 31 controls the interpretation of bits 14 17 30
115. SPC bit of the IOCR is a logic 1 indicating that DSR CTS represents a CTS handshaking input The SPE bit in the SPTC determines whether the transmitter enters either pause mode or stop mode based on the status of the CTS handshaking input When SPE is set to 0 the transmitter enters pause mode If the CTS handshaking input goes inactive during the transmission of a character the transmitter will finish the transmission of the character and then wait for the CTS input line to return to its active state before continuing operations Note that the CTS inactive status bit in the SPHS register will be set but in this mode the transmitter does not wait for the bit to be cleared before continuing When SPE is set to 1 the transmitter enters stop mode In this case if the CTS handshaking input goes inactive the transmitter will also finish the transmission of the current character and flag the error in the SPHS register but this time it will suspend its operation until both the CTS handshaking input returns to its active state and the CTS inactive status bit has been cleared in the SPHS register Serial Port Operation 7 7 If the serial port uses DSR CTS as a DSR signal SPC of IOCR logic 0 losing the DSR signal always forces the serial port transmitter into a stop mode of operation until the DSR Inactive bit in the SPHS is reset to 0 and the DSR input is active 7 2 2 3 Transmitter Line Break Generation Setting the Transmit Break TB bit
116. Section 2 12 3 for further discussion of syne and eieio Instruction Cache state is considered part of the context and thus requires a context synch op to guarantee ordering of l cache accesses Hence the following sequence is required for self modify ing code 2 40 PPC403GA User s Manual STORE to change D cache contents dcbst to flush the new storage contents from D cache to memory sync to guarantee the dcbst completes with respect to all processors in the system could use eieio for internal ordering only icbi context changing op invalidates I cache contents isync context synch op causes re fetch using new I cache context and new memory context due to previous sync In a similar manner if software wishes to ensure that all storage accesses are complete prior to executing a mtdcr to change a Bank Configuration register example 4B above software must issue a sync after all storage accesses and before the mtder Likewise if software wishes to ensure that all instruction fetches after the mtdcr use the new Bank Config register contents software must issue an isync after the mtdcr and before the first instruction that should be fetched in the new context 7 isync is used to guarantee all subsequent instructions are fetched and executed using the context established by all previous instructions isyne is context synchronizing isync causes all pre fetched instructions to be discarded an
117. Seq Line Bus External RAS CAS Page First Burst Pre chg Refresh Refresh Fills Width Mux Timing Mode Access Access Cycles RAS Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit20 Bit 21 22 Bit 23 24 Bit 25 Bit 26 Bits 27 30 x 10 0 0 0 01 01 0 x XXXX Figure 3 17 DRAM 3 2 2 2 Page Mode Read Memory and Peripheral Interface 3 31 The following figure illustrates the timing of a 2 1 1 1 burst DRAM read Note that the Early RAS Mode and DRAM Read on CAS features are illustrated here DRAM Read on CAS only applies to DRAM read operations Cycle SysClk lt ka ka CAS1 CAS2 CAS3 CAS4 Precharge A11 29 Xow Cord RASn TT NOE TR cAso3 TN LN ZA VY 7 DRAMOE 7 Ne S oo DRAMWE DRAM Read on CAS IOCR 26 1 Doan TZ C AMuxCAS e Ath Note The RAS timing illustrated in cycle 8 assumes that the transfer which follows will utilize Early RAS Mode Note that Precharge time has been reduced slightly Bank Register Settings Seq Line Bus External RAS CAS Page First Burst Pre chg Refresh Refresh Fills Width Mux Timing Mode Access Access Cycles RAS Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit20 Bit 21 22 Bit 23 24 Bit 25 Bit 26 Bits 27 30 D 10 0 0 0 00 00 0 D XXXX Figure 3 18 DRAM 2 1 1 1 Page Mode Read 3 32 PPC403GA User s Manual 3 7 1 4 DRAM Page
118. Set 10 51 dcbst Data Cache Block Store dcbst RA RB 31 RA RB 54 0 6 11 16 21 31 EA lt RA 0 RB DCBST EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise If the cache block at the effective address is marked as modified the cache block is copied back to main storage and marked as unmodified in the data cache If the data block at the effective address is in the data cache and is not marked as modified or if the data block at the effective address is not in the data cache no operation is performed The operation specified by this instruction is performed whether or not the effective address is marked as cacheable in the DCCR If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Note Because the debst instruction simply copies back data cache blocks into main storage without modification the debst instruction is considered a load with respect to memory protection and cannot cause a protection exception Debugging Note This instruction is considered a write with respect to data address compare DAC debug exceptions See Chapter 9 for more information about PPC403GA on chip debug facilities Architecture Note This ins
119. System reset will be forced by the Watchdog 4 WIE Watchdog Interrupt Enable 0 DisableWDT interrput 1 Enable WDT interrupt 5 PIE PIT Interrupt Enable 0 Disable PIT interrput 1 Enable PIT interrupt 6 7 FP FIT Period 00 29 clocks 01 213 clocks 10 217 clocks 11 221 clocks 8 FIE FIT Interrupt Enable 0 Disable FIT interrput 1 Enable FIT interrupt 9 ARE Auto Reload Enable disables on reset 0 Disable auto reload 1 Enable auto reload 10 31 reserved 11 70 PPC403GA User s Manual TSR TSR see also Section 6 3 6 on page 6 35 SPR ENW a FIS Figure 11 51 Timer Status Register TSR 0 ENW Enable Next Watchdog See Section 6 3 5 on page 6 33 0 Action on next Watchdog event is to set TSR O 1 Action on next Watchdog event is governed by TSR 1 1 WIS Watchdog Interrupt Status 0 No Watchdog interrupt is pending 1 Watchdog interrupt is pending 2 3 WRS Watchdog Reset Status 00 No Watchdog reset has occurred 01 Core reset has been forced by the Watchdog 10 Chip reset has been forced by the Watchdog 11 System reset has been forced by the Watchdog 4 PIS PIT Interrupt Status 0 No PIT interrupt is pending 1 PIT interrupt is pending 5 FIS FIT Interrupt Status 0 No FIT interrupt is pending 1 FIT interrupt is pending 6 31 reserved Register Summary 11 71 XER
120. User s Manual 22 31 adde Add Extended adde RT RA RB OE 0 Re 0 adde RT RA RB OE 0 Re 1 addeo RT RA RB OE 1 Rc 0 addeo RT RA RB OE 1 Re 1 31 RT RA RB OE 138 Re RT lt RA RB XER CA 6 11 if RA RB XER CA X 22 1 then XER CA lt 1 else XER CA lt 0 The sum of the contents of register RA register RB and XER CA is placed into register RT 21 22 31 XER CA is set to a value determined by the unsigned magnitude of the result of the add operation Registers Altered RT e XERI CA e CR CRO r ct a so H Re contains 1 e XER SO OV if OE contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 9 addi Add Immediate addi RT RA IM 14 RT RA IM 0 6 11 16 31 RT RA O EXTS IM If the RA field is 0 the IM field sign extended to 32 bits is placed into register RT If the RA field is nonzero the sum of the contents of register RA and the contents of the IM field sign extended to 32 bits is stored into register RT Registers Altered e RT Programming Note To store the sign extended contents of the immediate field in the GPR specified by the RT field set the RA field to 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 2 Extended Mnemonics for addi Other
121. Width Bus Width WBEO Usage WBET Usage WBE2Usage WBE Usage bytes 1 write byte enable 1 inactive A30 A31 2 hi byte lo byte A30 A31 write enable write enable 4 byte 0 byte 1 byte 2 byte 3 write enable write enable write enable write enable e For memory regions defined as eight bit regions WBE2 and WBE3 are address bits A30 and A31 and WBEO is the write enable line e For memory regions defined as 16 bit regions WBE2 is address bit A30 WBE3 is address bit A31 and WBEO and WBE1 are the high byte and low byte write enables e For memory regions defined as 32 bit regions WBEO through WBE3 are the write byte enables corresponding to bytes 0 through 3 on the data bus respectively 3 6 2 Device Paced Transfers The ready signal Ready is an input which allows the insertion of externally generated device paced wait states Ready is monitored only when the Bank Register is programmed with Ready Enable 1 Note e If Wait 0 Ready Enable and the Ready input are ignored and single cycle transfers will occur e Sampling of the Ready input begins Wait cycles BRn TWT cycles after the beginning of the transfer Sampling continues once per cycle until either Ready is high when sam pled or a timeout occurs see below For examples see Figure 3 9 Timing Diagram SRAM Read Extended with Ready on page 3 17 and Figure 3 10 Timing Diagram SRAM Write Extended with Ready on page
122. a cache line containing the 4th 7th instructions all of which get accessed if the address is cachable If the address is non cachable as controlled by the ICCR then only the 1st 4th instructions get accessed 2 9 2 2 Pre Fetch of Branch to Count Branch to Link When predicting that a Branch to the CTR or a Branch to the LR betr blr instruction will be taken the fetcher will not attempt to access the address contained in the CTR LR if there is a CTR LR updating instruction ahead of the branch in the instruction queue up to DCD see Section 2 6 for discussion of the instruction queue In such a case the fetcher recognizes that the CTR LR contains wrong data which could be some random value leftover from a previous use of the CTR LR and could likely be pointing to an invalid address or an I O device In these cases the fetcher will wait for the CTR LR updating instruction to enter EXE at which time the correct CTR LR contents are known and the fetcher can use this value in the prediction In this manner the fetcher can be prevented from speculatively accessing a completely random address The fetcher will only access up to 7 instructions down the sequential path past an unresolved branch or down the taken path of a relative or absolute branch or at the contents of the CTR LR when the CTR LR contents are known to be correct 2 30 PPC403GA User s Manual 2 9 2 3 Fetching Past an Interrupt Causing Returning Inst
123. a multiple of 4 If it is not it will cause an alignment exception A series of consecutive words starting at the effective address are loaded into a set of consecutive GPRs starting with register RT and continuing to and including GPR 31 Register RA is not altered by this instruction unless RA is GPR 31 which is an invalid form of this instruction The word which would have been placed into register RA is discarded Registers Altered e RT through GPR 31 Invalid Instruction Forms 10 e RA is in the range of registers to be loaded including the case where RA RT 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 85 Iswi Load String Word Immediate Iswi RT RA NB 31 RT RA NB 597 0 6 1 16 21 34 EA lt RA O if NB 0 then CNT lt 32 else CNT lt NB n CNT Reina amp RT CEIL CNT 4 1 32 re RT 1 i 0 do while n gt 0 if i O then rer i if r 32 then re o0 if r RA v r PBemwall then GPR r 0 if r RA v r Bea ll then GPR r i7 MS EA 1 i i 8 if i 32 then i 0 EA amp EA 1 nen i An effective address is determined by the RA field If the RA field contains 0 the effective address is 0 Otherwise the effective address is the contents of register RA A byte count CNT is determined by examining the NB field If the NB field is 0 the byte count is CNT 32 Otherwise the
124. a standard UART Bytes of data are received and transmitted via the RecvD and XmitD lines respectively Handshaking interaction between the SPU and external devices occurs directly via the DTR RTS and DSR CTS I Os 7 1 1 2 Internal Loopback Mode In internal loopback mode data being transmitted is internally routed to the receiver The DTR RTS outputs from the receiver are also o internally routed to the DSRICTS inputs of the transmitter Externally the XmitD and DTR RTS outputs are held in their inactive states and any transitions on the RecvD and DSR CTS inputs are ignored Note that in this mode of operation both the transmitter and the receiver must be enabled 7 1 1 3 Automatic Echo Mode In automatic echo mode as each bit of data is received on the RecvD input it is retransmitted on the XmitD output with a delay of one baud rate clock cycle Thus the transmitter is acting in a pass through mode implying that any errors in the data stream are also transmitted as they are seen Note that in this mode the receiver must be enabled and the transmitter disabled All handshaking signals will operate as they do in normal mode 7 1 2 SPU Handshaking I O Pair Selection As shown in Figure 7 1 the DTR RTS handshaking outputs and DSR CTS handshaking inputs are multiplexed The Serial Port Configuration SPC bit in the OCH determines the function of the pin To select the DTR DSR I O pair a 0 must be written to the SPC bit and to sel
125. a ue Bis blanket pit Geen EL ee ase LP Re a e eas 2 26 AA Field on Unconditional Branches AAA 2 26 AA Field on Conditional Branches A 2 26 BI Field on Conditional Branches c cecceeeceeeeeeeeeeeeneeeeeeseeeseeeeeeeseaeeeeeseetesieeeeeenaees 2 26 BO Field on Conditional Branches A 2 26 Branch Prediction 3c 35 pasta ah iti eae A a ee i eee 2 28 Spec lative Fettes deieren Ed AEE SEENEN 2 29 Architectural Overview of Speculative ACCESSES cccceccceceeeeeseeeeeseeeeeeneeeessnseeesaes 2 29 Speculative Accesses on PPC403GA eeceeeeeeeeeeeeeeeeeeeeeeeeeeeeaeeseeeeeaeeseeeeeeeseaeeeneeeeas 2 30 Pre Fetch Distance from an Unresolved Branch AAA 2 30 Pre Fetch of Branch to Count Branch to Link Fetching Past an Interrupt Causing Returning Instruction ceeeeeeeeeeeeeeeteees 2 31 Fetching Past tw or twi Instructions 0 0 eee eeeeeee cence terete eeeneeeeeaeeeeesaeeeeeeeeeenaeeeneaeees 2 31 Fetching Past an Unconditional Branch AAA 2 32 Suggested Location of Memory Mapped Hardware cesceesceseeeeeeeeeeeeeeeeeeeeetsees 2 32 SUMMA e Ee atlas saie es cece aes wa ec ls ewe Eeer seca 2 32 Memory Protection sisien dee ii nee ea aii et il ee 2 33 Application to Data Cache Instructions eccceeceeeeeeseeeeeeeeeeneeseeseeeeeeeeeaeeseeeeaeeeneeeeas 2 34 Application to String Instructions 2 35 Protection Bound Lower Register PBL1 PBL2 AA 2 35 Protection Bound Upper Register DRUI DRUI 2 36 Privileged Mo
126. aaah ea een deet ee ns 3 11 So EE 3 11 SRAM Read Example ees de telat Bagi heck ed ee e 3 14 SRAM Write Exam ple si r Ea pa a araea a EES 3 15 WBE Signal Usage E 3 16 Device Paced Transters iiien ae eatae aeee Eaa aaa aa Ea aa aia aaea EARTE aS 3 16 SRAM Device Paced Read Example eecccesceeseeceeeeeseeeeeeeeeeeeneeseaeeseeseeeseneeaes 3 17 SRAM Device Paced Write Example ceecceesceeeeeeeeeeeeeeeeeeseeeeeeeseaeesneeteeeeeeeeaes 3 18 SRAM ROM Burst Mode AAA 3 19 SRAM Burst Read Example AAA 3 20 SRAM Burst Write Example AA 3 21 Bank Registers for SRAM Devices eecceesceeeeeeeeeeeeeeeeeeeseeeeaeeseeeeeaeeseaeeeaeeseaeeseneteaes 3 22 The DRAM EE 3 27 Signals nc sah eed Se teh Seege Ee nde et 3 27 DRAM Read Wu EE 3 29 DRAM Write Example inian ea etad r aieeaa e pae e aaaea e 3 30 DRAM Page Mode Read Example AAA 3 31 Contents vii DRAM Page Mode Write Example AAA 3 33 DRAM CAS Before RAS Refresh Example cccceesceeeeeeeeeeeeeeeeneeeeeeeeneeseaeesieeeeeens 3 35 Bank Registers for DRAM Devices AA 3 36 Alternate Refresh Mode ccccscceeeseeeeceseeeeeseceeeseseeseeeeessenseenseeeseseeeeesentensenenesseners 3 42 immediate Refresh Geste anc REESEN NENNEN NEE ENEE deg 3 42 SelfiRefresh Mode EREET TRAET ETET E A TTT 3 42 Example of DRAM Connection eeceeeeesseeeneeeeeeeeaeeeeeeeeaeeseeeeeaeeseaeeeaeeseaeesieeseaeenaees 3 44 Noteabout SIMMS eegene euer Eed Ee 3 44 Address Bus Mult
127. address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise If the instruction block at the effective address is not in the instruction cache and is marked as cacheable in the ICCR the instruction block is loaded into the instruction cache If the instruction block at the effective address is in the instruction cache or if the effective address is marked as non cacheable in the ICCR no operation is performed If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Notes Execution of this instruction is privileged This instruction allows a program to begin a cache block fetch from main storage before the program needs the instruction The program can later branch to the instruction address and fetch the instruction from the cache without incurring the latency of a cache miss Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations Instruction Set 10 67 This instruction is specific to the PowerPC Embedded Controller family ICCCI Instruction Cache Congruence Class Invalidate iccci RA RB 31 RA RB 966 0 6 T 16 21 31 EA lt RA 0 RB ICBT EA A
128. address To clear the FIT interrupt the exception handling routine must clear the FIT interrupt bit TSR 5 by writing a 1 to that bit position in the Timer Status Register Executing the return from interrupt instruction rfi restores the contents of the program counter and the MSR from SRRO and SRR1 respectively and the PPC403GA begins execution at the contents of the program counter Table 6 10 Register Settings during Fixed Interval Timer Exceptions SRRO Loaded with the address of the next instruction to be executed SRR1 Loaded with the contents of the MSR MSR WE 0 PR 0 CE Unchanged EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged PC EVPR 0 15 0x1010 TSR Set to indicate type of timer event Interrupts Exceptions and Timers 6 25 6 2 11 Watchdog Timer The PPC403GA initiates a Watchdog Timer WDT interrupt after detecting the first time out from the Watchdog Timer and if the exception is enabled via TCR WIE and MSR CE Time out is considered to be detected when at the beginning of a cycle TSR WIS 1 for the WDT exception this will be the second cycle after the 0 1 transition of the appropriate time base bit The instruction in the execute stage at that cycle is flushed blocked from completing and its address is stored in SRR2 Simultaneously the current contents of the MSR are loaded into SRR3 and the MSR is loaded with the values shown in Tabl
129. all external OPB and RISC core data transfers In addition the BIU arbitrates access for the DMA controller to the external bus and OPB bus for peripheral transfers The BIU also supports attachment of an external bus master allowing the external master to use the internal DRAM controller in the BIU to access DRAM 1 3 2 1 External Interfaces to DRAM SRAM ROM and UO The BIU provides a 32 bit external data bus supporting direct connection of 8 16 and 32 bit memory banks and I O devices A 24 bit address bus is provided plus four low order byte enables for a total of 64MB addressability per device or memory bank In addition eight decoded device select signals are available giving 512MB total addressability for a combination of DRAM SRAM ROM and memory mapped I O devices A maximum of four memory banks can be configured as DRAM The other four configurable interfaces must be programmed as SRAM ROM or I O devices 1 6 PPC403GA User s Manual Bank Registers are provided to configure the properties of each of the eight banks These configurable properties include device width setup wait and hold cycle timings device paced or programmed wait states device size 1MB 64MB DRAM refresh and precharge rates DRAM page mode and others 1 3 2 2 RISC Core Interface The interface from the BIU to the RISC core includes a 32 bit data bus to the ICU and DCU for line fills a 32 bit data bus from the DCU for line flushes and separ
130. an internal 32 bit address and 32 bit data bus for on chip peripheral integration In the PPC403GA the serial port is the only slave device attached to it The OPB architecture supports direct attachment of 8 16 and 32 bit devices using a dynamic bus sizing scheme All transfers are device paced with time out detection handled within the BIU The bus supports transfer rates of up to one transfer four bytes per cycle Transfers from the processor or cache are received by the BIU from the ICU or DCU these result in transfers on the OPB when the addresses correspond to the OPB address space In addition DMA operations to devices on the OPB can be performed with the device communicating either as a peripheral under control of the DMA controller or as a memory or MMIO device under control of the BIU Overview 1 7 1 3 2 5 External Bus Master Interface The PPC403GA provides support for an external bus master to take control of the external bus from the BIU While in this mode the BIU monitors the external bus master interface for requests to the DRAM that is controlled by the DRAM controller internal to the BIU If the external master makes such a transfer request the BIU handles the control signals to the DRAM such as the RAS CAS lines and the output and write enables leaving the address and data buses under control of the external master The BIU supports external DRAM transfers of byte halfword and word sizes as well as burst t
131. are automatically stored in Save Restore Register 1 SRR1 If a critical exception is taken the contents of the MSR are stored in Save Restore Register3 SRR3 When a return from interrupt rfi or return from critical interrupt rfci instruction is executed the contents of the MSR are restored from SRR1 or SRR3 respectively Figure 6 1 shows the MSR bit definitions and describes the function of each MSR bit The contents of the MSR can be read into general purpose registers via the move from machine state register mfmsr instruction The contents of a general purpose register can be written to the MSR via the move to machine state register mtmsr instruction The MSR EE bit External Interrupt Enable may be set cleared atomically using the wrtee or wrteei instructions 6 2 PPC403GA User s Manual R e PR ME DE PX LE pay 0 12 hs 14 aa 17 T 20 21 A 27 be 29 30 31 CE EE PE Figure 6 1 Machine State Register MSR 0 12 reserved 13 WE Wait State Enable 0 The processor is not in the wait state and continues processing 1 The processor enters the wait state and remains in the wait state until an exception is taken or the PPC403GA is reset or an external debug tool clears the WE bit 14 CE Critical Interrupt Enable CE controls these interrupts 0 Critical exceptions are disabled critical interrupt pin 1 Critical exceptions are enabled watchdog timer
132. bcla 4 4 cr_field 3 target LR Page 10 21 bnsctr cr_field bnsctrl Branch if not summary overflow to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 3 Extended mnemonic for bectrl 4 4 cr_field 3 LR 10 28 bnslir cr_field bnslirl Branch if not summary overflow to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 3 Extended mnemonic for belrl 4 4 cr_field 3 LR 10 32 bnu cr_field tar get bnua bnul bnula Branch if not unordered Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 3 target Extended mnemonic for bca 4 4 cr_field 3 target Extended mnemonic for bel 4 4 cr_field 3 target LR Extended mnemonic for bcla 4 4 cr_field 3 target LR 10 21 A 14 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bnuctr bnuctrl Operands cr_field Function Branch if not unordered to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 3 Other Registers Changed Extended mnemonic for bectrl 4 4 cr_field 3 LR Page 10 28 bnulr bnulrl cr_field Branch if not unordered to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field
133. bectr 12 cr_bit LR Extended mnemonic for bectrl 12 cr_bit LR Page 10 21 10 28 btir cr_bit btirl Branch if CRer pit 1 to address in LR Extended mnemonic for belr 12 cr_bit Extended mnemonic for belrl 12 cr_bit LR 10 32 bun cr_field tar get buna bunl bunla Branch if unordered Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 3 target Extended mnemonic for bca 12 4 cr_field 3 target Extended mnemonic for bel 12 4 cr_field 3 target LR Extended mnemonic for bcla 12 4 cr_field 3 target LR 10 21 bunctr cr_field bunctrl Branch if unordered to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 3 Extended mnemonic for bectrl 12 4 cr_field 3 LR 10 28 A 16 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bunir bunirl Operands cr_field Function Branch if unordered to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 3 Other Registers Changed Extended mnemonic for belrl 12 4 cr_field 3 LR Page 10 32 clrlwi clrlwi RA RS n Clear left immediate n lt 32 RA o n 1 e 0 Extended mnemonic for rlwinm RA RS 0 n 31 Extended mnemonic for rlwinm RA RS 0 n 31 CR C
134. bit and an external interrupt is pending the architecture requires that the exception be taken before the next instruction after the mtmsr is executed PPC403GA meets this requirement by preventing any instructions from folding onto the mtmsr see Section 2 23 for a definition and discussion of folding The mtmsr is not in general context synchronizing however so the PPC403GA does not for example discard prefetched instructions and re fetch Finally while syne and eieio are execution synchronizing they are also more restrictive in their requirement of memory ordering Stating that an op is execution synchronizing does not imply the storage ordering This is an additional specific requirement of sync eieio 2 12 3 Storage Synchronization sync is used to guarantee that all previous storage references are completed with respect to the PPC403GA prior to letting the sync instruction complete and hence prior to any subsequent instructions beginning execution syne is execution synchronizing An example of the use of sync stw store to I O device sync wait for store to actually complete off chip mtbr7 disable access to device eieio is used to guarantee the order of storage accesses All storage accesses prior to eieio will complete prior to any storage accesses after the eieio It may be necessary to force storage ordering on a processor that for example normally re orders loads ahead of stores Example of the use of eieio
135. bit registers Different register numbers are used for read only access user mode and write only access privileged mode The PowerPC Architecture provides for a mftb move from time base instruction for user mode read access to the time base The register numbers used with this instruc tion to specify the time base registers 0x10C and 0x10D are not SPR numbers How ever the mftb instruction opcode differs from the mfspr opcode by only one bit The PowerPC Architecture allows an implementation to ignore this bit and handle the mftb instruction as mfspr Accordingly these register numbers may not be used for other SPRs Further PowerPC compilers are not free to use the mftb opcode with register numbers other than those specified in the PowerPC Architecture as user mode time base registers 0x10C and 0x10D The PowerPC Architecture does not provide for privileged mode only read access of the time base by definition the user mode read access mechanism is also available in privileged mode The PowerPC Architecture provides privileged mode write access to the time base using mtspr instructions with SPR numbers 0x11C and 0x11D For the PPC403GA The PPC403GA defines a 56 bit time base also accessed via two 32 bit registers the high order 8 bits of the high order register are reserved The same register number is used for both read and write access both in privileged mode only 6 30 PPC403GA User s Manual e The PPC403GA does
136. bx crxor BT BA BB XOR bit CRpa with CRep 10 49 Place answer in CRpr dcbf RA RB Flush store then invalidate the data 10 50 cache block which contains the effective address RA 0O RB dch RA RB Invalidate the data cache block which con 10 51 tains the effective address RA 0 RB dcbst RA RB Store the data cache block which contains 10 52 the effective address RA O RB dcbt RA RB Load the data cache block which contains 10 53 the effective address RA O RB dcbtst RA RB Load the data cache block which contains 10 54 the effective address RA O RB dcbz RA RB Zero the data cache block which contains 10 55 the effective address RA O RB dccci RA RB Invalidate the data cache congruence class 10 57 associated with the effective address RA O RB dcread RT RA RB Read either tag or data information from the 10 58 data cache congruence class associated with the effective address RA 0 RB Place the results in RT divw RT RA RB Divide RA by RB signed 10 60 F Place answer in RT divw CR CRO divwo XER SO OV divwo CR CRO XER SO OV Alphabetical Instruction Summary A 19 Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed divwu RT RA RB Divide RA by RB unsigned 10 61 P Place answer in RT divwu CR CRO divwuo XER SO
137. by bits in the CDBCR This is a privileged mode instruction 8 3 4 DCU Debugging The dcread instruction detailed description on page 10 58 is a debugging tool for reading the data cache entries for the congruence class specified by EA23 27 The cache information will be read into a General Purpose Register If CDBCR 37 0 the information will be one word of data cache data from the addressed line The word is specified by EA e za If CDBCR3 0 the data will be from the A side otherwise from the B side If CDBCR 37 1 the information will be the cache tag If CDBCR3 0 the tag will be from the A side otherwise from the B side Data cache tag information is represented as follows 0 22 TAG Cache Tag 23 25 reserved 26 D Cache Line Dirty 0 Not dirty 1 Dirty 8 10 PPC403GA User s Manual 27 V Cache Line Valid 0 Not valid 1 Valid 28 30 reserved 31 LRU Least Recently Used 0 Not least recently used 1 Least recently used Cache Operations 8 11 8 12 PPC403GA User s Manual Debugging This chapter provides an overview of the debug facilities of the PPC403GA processor The PPC403GA debug facilities include debug modes for the various types of debugging encountered during hardware and software development Also included are debug events which allow the developer to control the debug process The debug modes and debug events are controlled using debug
138. byte ordering 2 17 C cache data 2 25 8 6 debugging 8 1 8 10 instructions 8 9 debugging 8 1 instruction 2 24 8 1 debugging 8 1 8 6 instructions 8 5 cacheability 3 8 cacheability regions 2 3 CDBCR 11 15 cmp 10 37 cmpi 10 38 cmpl 10 39 cmpli 10 40 cntlzw 10 41 cntlzw 10 41 compare arithmetic 2 12 logical 2 12 context synchronization 2 39 CR 2 11 11 16 crand 10 42 crandc 10 43 creqv 10 44 critical interrupt pin 6 18 crnand 10 45 crnor 10 46 cror 10 47 crorc 10 48 crxor 10 49 CTR 2 6 11 17 D DAC1 DAC2 6 26 9 10 11 18 data alignment 2 15 datacache 2 25 8 6 debugging 8 1 8 10 instructions 8 9 datatypes 2 15 DBCR 9 6 11 19 PPC403GA User s Manual DBSR 9 8 11 22 dcbf 10 50 debi 10 51 dcbst 10 52 debt 10 53 dcbtst 10 54 dcbz 10 55 dccci 10 57 DCCR 8 8 11 24 dcread 10 58 DEAR 6 16 11 26 debug exceptions 6 26 branch taken 6 26 DAC 6 26 IAC 6 26 instruction completion 6 26 non critical exceptions 6 26 TRAP 6 26 unconditional 6 26 debugging boundary scan chain 9 16 debug events 9 4 debug interfaces 9 11 JTAG test access port 9 13 trace status port 9 11 development tools 9 1 flow 9 5 modes 9 1 bus status 9 2 external 9 2 internal 9 2 real time trace 9 2 processor control 9 3 processor status 9 4 registers 9 6 device control registers 2 14 device paced transfers 3 16 bus timeout error 3 16 divw 10 60 divw 10 60 divwo 10 60 divwo 10 60 divwu 10 61 divwu 10 61 divwuo 10
139. condition s in the SPLS register Errors are cleared from the SPLS register by writing a logic 1 to the appropriate bit Note that an Overrun Error occurs when the SPRSR is holding a valid character it cannot move into the SPRB due to the conditions mentioned and another character starts to be received In this event the character in the SPRSR is overwritten with the new character and the Overrun Error OE bit in the SPLS register is set 7 2 3 1 Receiver Control of RTS Recall that the function of the DTR RTS handshaking output is selected via the SPC bit of the IOCR Assume that the SPC bit of the IOCR is a logic 1 indicating that DTR RTS represents a RTS handshaking output The Pause Mode Enable PME of bit of the SPRC register determines if the spu receiver will be given control of the state of the RTS handshaking output If the PME bit is set to 0 software controls the RTS output via the RTS bit in the SPCTL register If the PME bit is set to 1 the receiver hardware controls the RTS output provided that the RTS bit in the SPCTL register is set active In this mode the serial port receiver attempts to pause the sending device prevent it from sending characters in order to give the processor a chance to catch up by driving the RTS output inactive if one of two conditions exist 1 The SPRB is full RBR of SPLS register 1 and there are only six more bits of the incoming character left to be received 2 Any of the receiver error
140. contains 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 65 icbi Instruction Cache Block Invalidate icbi RA RB 31 RA RB 982 0 6 11 16 21 31 EA lt RA 0 RB ICBI EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise If the instruction block at the effective address is in the instruction cache the cache block is marked invalid If the instruction block at the effective address is not in the instruction cache no additional operation is performed The operation specified by this instruction is performed whether or not the effective address is marked as cacheable in the ICCR If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture 10 66 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family icbt Instruction Cache Block Touch icbt RA RB 31 RA RB 262 0 6 11 16 21 31 EA lt RA 0 RB ICBT EA An effective address is formed by adding an index to a base
141. cr_field Branch if unordered to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 3 Extended mnemonic for belrl 12 4 cr_field 3 LR 10 32 10 36 PPC403GA User s Manual cmp BF 0 RA RB cmp Compare 31 BF RA RB Cos lt 40 if R G lt RB then cy 1 if RA gt RB thenc amp 1 if RA RB then c gt 1 C3 lt XER SO n amp BF CR CRn lt Ges 31 The contents of register RA are compared with the contents of register RB using a 32 bit signed compare The CR field specified by the BF field is updated to reflect the results of the compare and the value of XER SO is placed into the same CR field If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e CR CRn where nis specified by the BF field Invalid Instruction Forms e Reserved fields Programming Note Since the PPC403GA supports only the 32 bit version of the PowerPC cmp Compare instruction use of the extended mnemonic cmpw BF RA RB is recommended Table 10 9 Extended Mnemonics for cmp Other Mnemonic Operands Function Registers Page Changed cmpw BF RA RB Compare Word 10 37 Use CRO if BF is omitted Extended mnemonic for cmp BF 0 RA RB Instruction Set 10 37 cmpi Compare Immediate cmpi BF 0 RA IM Co 3 Sr 40 if RA lt EXTS IM then cy lt 1 if
142. cycle so the bandwidth from the ICU of two instructions per cycle is ordinarily sufficient to keep the queue full Cache Operations 8 3 8 2 2 Instruction Cache Cacheability Register ICCR The instruction cache on the PPC403GA may be enabled for a 128MB region via control bits in the Instruction Cache Cacheability Register ICCR a 32 bit special purpose register Following system reset all ICCR bits are reset to zero so that no memory regions are cacheable Before regions can be designated as cacheable in the ICCR itis necessary to execute the iccci instruction 64 times once for each congruence class in the cache array This invalidates all 64 congruence classes prior to enabling the cache The ICCR can then be reconfigured and the ICU can begin normal operation Each bit of the ICCR shown in Figure 8 4 represents the cacheability state of a 128MB region of the effective address space When an ICCR bit is set to one the memory region corresponding to that bit is allowed to be cached Instructions fetched from that region are placed in the instruction cache where they can be accessed as needed by the execution unit So S2 S4 S6 ss S10 S12 pli S16 S18 S20 S22 S24 S26 SS S30 pe ee ee a ae fi 0 1 2 3 4 51 6 7 8 9 10 11 12 13 16 17 18 19 20 21 22 23 24 25 26 27 30 31 3 J ds T S Sg le she Ale el SE ae als D Se Sp Figure 8 4 Instruction Cach
143. data access a Data Machine Check exception will occur see Section 2 13 1 4 Data Machine Check Handling on page 2 48 If the error occurred during a DMA access an External Interrupt may result See Section 4 2 11 Errors on page 4 28 e The SLF field bit 13 controls incoming data order on line fills If 1 then all line fills will be in sequential order first word transferred is the first word of the cache line whether or not the target address is the first word of the cache line If 0 then all fills will be in target word first order first word transferred is the word at the target address then the following sequential addresses to the highest address in the cache line then sequentially from the first word of the cache line until the entire line is transferred Line flushes are always transferred in sequential order regardless of the state of the SLF field All packing and unpacking of bytes or halfwords within a word are always transferred in sequential order regardless of the state of the SLF field 3 24 PPC403GA User s Manual The BME field bit 14 controls bursting for cache line fills and flushes bus master burst operations DMA flyby burst and DMA memory to memory line burst operations and all packing and unpacking operations If 1 then bursting is enabled When burst ing is enabled the parameters Chip Select On CST Output Enable On OET and Write Byte Enable On WBN are valid only for the f
144. debug event occurs prior to the Compare execution of an instruction at an address that matches the con tents of one of the two Instruction Address Compare Registers Instruction The Instruction Completion debug event occurs after the comple Completion tion of each instruction Trap The Trap debug event occurs prior to the execution of a trap instruction where the conditions are such that the trap will occur Unconditional The Unconditional debug event occurs immediately upon being set using the JTAG debug port 9 6 Debug Flow Section 9 5 briefly describes the debug operations that the PPC403GA can perform after it detects a debug event That section then lists the debug events that the PPC403GA can detect A simple debug event is the detection of a single item from the list for example perform the debug operation when a read is detected from a certain address In addition to these simple debug events the PPC403GA also detects compound debug events A compound debug event is a specified sequence of simple debug events for example perform the debug operation on the first branch taken after a read is detected from a certain address three times ER When executing code with debug events enabled this is the logic that is followed 1 Execute code waiting for a debug event to be detected by hardware When a debug event is detected go to 2 2 Is DBCR FER 0 e No decrement DBCR FER and go to 1 e Yes goto 3 3 Set DBSR b
145. disables other External Interrupts from interrupting the exception handler before SRRO and SRR1 are saved The MSR is also loaded with the other values shown in Table 6 5 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0500 Exception processing begins at the address in the program counter Once inside the exception handling routine the device requesting the External Interrupt can be determined by examining the External Interrupt Status Register To clear the bits set in the EXISR by the serial port JTAG and DMA interrupts requires writing bits in the status registers for each of those devices Clearing level triggered interrupts generated via the External Interrupt pins requires resetting the external interrupt source to remove the interrupt Clearing edge triggered interrupts generated via the external interrupt pins requires writing a 1 to that pin s bit in the EXISR Executing the return from interrupt instruction rfi restores the contents of the program counter and the MSR from SRRO and Interrupts Exceptions and Timers 6 21 SRR1 respectively The PPC403GA begins execution at the address in the program counter Table 6 5 Register Settings during External Interrupt Exceptions SRRO Loaded with the address of the next instruction to be executed SRR1 Loaded with the contents of the MSR MSR WE 0 PR 0 CE Unchange
146. edge triggered 1 External Interrupt 0 pin is positive level edge triggered 2 EIT External Interrupt 1 Triggering 0 The External Interrupt 1 pin is level sensitive 1 The External Interrupt 1 pin is edge triggered 3 E1L External Interrupt 1 Active Level 0 External Interrupt 1 pin is negative level edge triggered 1 External Interrupt 1 pin is positive level edge triggered 4 EST External Interrupt 2 Triggering 0 The External Interrupt 2 pin is level sensitive 1 The External Interrupt 2 pin is edge triggered 5 E2L External Interrupt 2 Active Level 0 External Interrupt 2 pin is negative level edge triggered 1 External Interrupt 2 pin is positive level edge triggered 6 E3T External Interrupt 3 Triggering 0 The External Interrupt 3 pin is level sensitive 1 The External Interrupt 3 pin is edge triggered T E3L External Interrupt 3 Active Level 0 External Interrupt 3 pin is negative level edge triggered 1 External Interrupt 3 pin is positive level edge triggered 8 E4T External Interrupt 4 Triggering 0 The External Interrupt 4 pin is level sensitive 1 The External Interrupt 4 pin is edge triggered 9 E4L External Interrupt 4 Active Level 0 External Interrupt 4 pin is negative level edge triggered 1 External Interrupt 4 pin is positive level edge triggered 10 25 reserved 26 DRC DRAM Read on CAS For DRAM read operations only 0 Latch data bus on rising edge of SysClk
147. eqv Equivalent eqv RA RS RB Rc 0 eqv RA RS RB Rc 1 31 RS RA RB 284 Re 0 6 T T6 21 31 RA RS RB The contents of register RS are XORed with the contents of register RB the ones complement of the result is placed into register RA Registers Altered e RA e CRI CRO cr eo so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 63 extsb Extend Sign Byte extsb RA RS Rc 0 extsb RA RS Rc 1 31 RS RA 954 Re 0 6 11 16 21 31 RA e EXTS RS z4 51 The least significant byte of register RS is sign extended to 32 bits by replicating bit 24 of the register into bits 0 through 23 of the result The result is placed into register RA Registers Altered e RA e CR CRO ct a so H Re contains 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 64 PPC403GA User s Manual extsh Extend Sign Halfword extsh RA RS Rc 0 extsh RA RS Re 1 31 RS RA 922 Rc 0 6 T 16 21 31 RA lt EXTS RS 16 31 The least significant halfword of register RS is sign extended to 32 bits by replicating bit 16 of the register into bits 0 through 15 of the result The result is placed into register RA Registers Altered e RA e CR CRO ct a so H Re
148. exceptions are those for which it is possible not required just possible for the saved instruction pointer to be something else All PPC403GA exceptions fall into three basic classes asynchronous imprecise exceptions synchronous precise exceptions and asynchronous precise exceptions PPC403GA exceptions are generated by signals from internal and external peripherals instructions the internal timer facility debug events or error conditions Six external interrupt pins are provided on the PPC403GA one critical interrupt and five general purpose individually maskable interrupts Except for system reset and machine checks all PPC403GA exceptions are handled precisely Precise handling implies that the address of the excepting instruction synchronous exceptions other than System Call or the address of the next instruction to be executed asynchronous exceptions and the System Call synchronous exception is passed to the exception handling routine Precise handling also implies that all instructions prior to the instruction whose address is reported to the exception handling routine have completed execution and that no subsequent instruction has begun execution The specific instruction whose address is reported may not have begun execution may have partially completed or may have finished execution as specified for each exception type see Section 6 2 Exception Causes and Machine State beginning on page 6 16 Asynchronous imprecise exc
149. for bca 4 4 cr_field 3 target bnsl Extended mnemonic for LR bcl 4 4 cr_field 3 target bnsla Extended mnemonic for LR bcla 4 4 cr_field 3 target bnu cr_field target Branch if not unordered 10 21 Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 3 target bnua Extended mnemonic for bca 4 4 cr_field 3 target bnul Extended mnemonic for LR bel 4 4 cr_field 3 target bnula Extended mnemonic for LR bcla 4 4 cr_field 3 target bso cr_field target Branch if summary overflow 10 21 Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 3 target bsoa Extended mnemonic for bca 12 4 cr_field 3 target bsol Extended mnemonic for LR bel 12 4 cr_field 3 target bsola Extended mnemonic for LR bcla 12 4 cr_field 3 target bt cr_bit target Branch if CRe pit 1 10 21 Extended mnemonic for be 12 cr_bit target bta Extended mnemonic for bca 12 cr_bit target btl Extended mnemonic for LR bel 12 cr_bit target btla Extended mnemonic for LR bcla 12 cr_bit target 10 26 PPC403GA User s Manual Table 10 6 Extended Mnemonics for bc bca bcl bcla cont bc Branch Conditional Other Mnemonic Operands Function Registers Page Changed bun cr_field target Branch if unordered 10 21 Use CRO if cr_field is omitted Extended mnemonic for be
150. for further discussion Table 2 1 Special Purpose Register SPR List CDBCR see Chapter 8 CTR see Chapter 2 DAC1 DAC2 DBCR DBSR see Chapter 9 DCCR see Chapter 8 DEAR ESR EVPR see Chapter 6 IAC1 IAC2 see Chapter 9 ICCR ICDBDR see Chapter 8 LR see Chapter 2 PBL1 PBL2 PBU1 PBU2 see Chapter 2 PIT see Chapter 6 PVR see Chapter 2 SPRGO SPRG1 SPRG2 SPRG3 see Chapter 2 SRRO SRR1 SRR2 SRR3 see Chapter 6 TBHI TBLO TCR TSR see Chapter 6 XER see Chapter 2 2 3 2 1 Count Register CTR CTR is loaded via the mtspr instruction After loading the register may be used in two ways The register contents may be a loop count which can be automatically decremented and tested by certain branch instructions This construct yields zero overhead looping Alternatively the register contents may be a target address for the branch to counter instruction This allows absolute addressed branching to anywhere in the 4 GB memory space Figure 2 3 Count Register CTR 0 31 Count Count for branch conditional with decrement Address for branch to counter instructions 2 6 PPC403GA User s Manual 2 3 2 2 Link Register LR LR may be loaded via the mtspr instruction or via any of the branch instructions which have the LK bit set to 1 These branch instructions load LR with the address of the instruction following the branch instruction 4 address of the br
151. interest to a programmer using the PPC403GA Some of the material in this chapter is of interest only to the system level programmer for example discussion of interrupts and exceptions Other material is of more general interest for example discussion of memory organization These topics include e Memory organization beginning on page 2 2 e Commonly used registers beginning on page 2 5 Other registers are covered in their topic chapters for example DMA registers in the DMA chapter All registers are summarized in chapter 11 e Data types and alignment beginning on page 2 15 e Little Endian mode beginning on page 2 17 e Instruction queue beginning on page 2 23 e Data and Instruction caches beginning on page 2 24 e Branching control beginning on page 2 26 e Speculative fetching beginning on page 2 29 e Memory protection beginning on page 2 33 e Privileged mode operation beginning on page 2 36 e Context execution and storage synchronization beginning on page 2 38 e Interrupts and exceptions beginning on page 2 43 Also see Chapter 6 for further discussion of this topic e Instructions summarized by category beginning on page 2 49 Also see chapter 10 details of each instruction appendix A alphabetical short form description of each instruction and each extended mnemonic and appendix B short form descriptions of instructions by category Programming Model 2 1 2 2 Memory Organizat
152. interrupts are taken the PPC403GA stores the address of the next instruction which would have been executed into SRR2 For EXC debug interrupts SRR2 is loaded with the vector of the initial exception which caused the EXC debug event SRR3 is loaded with the contents of the MSR and the MSR is loaded with the values shown in Table 6 12 For all debug interrupts the high order 16 bits of the program counter are then loaded with 6 26 PPC403GA User s Manual the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x2000 Exception processing begins at the new address in the program counter Executing the return from critical interrupt instruction rfci restores the contents of the program counter and the MSR from SRR2 and SRR3 respectively and the PPC403GA begins execution at the address contained in the program counter Table 6 12 Register Settings during Debug Exceptions SRR2 Loaded with the address of the next instruction to be executed SRR3 Loaded with the contents of the MSR MSR WE 0 PR O CE 0 EE 0 ME Unchanged DE 0 PE 0 PX Unchanged PC EVPR 0 15 0x2000 DBSR Set to indicate type of debug event Interrupts Exceptions and Timers 6 27 6 3 Timer Architecture SysClk o TBLO TBHI 7 O 31 0 31 TimerClk o 32 bits 24 bits PIT FIT WDT IOCR 29 bit 15 217 clocks bit 11 Gil clocks bit7 225 clocks b
153. it is safe to fetch down the target path 2 10 Memory Protection Two pairs of Bounds Registers are provided to protect against inadvertent write access PBL1 PBU1 and PBL2 PBU2 These register pairs indicate a memory range for which access protection is provided The PX bit in the Machine State Register MSR specifies whether the range registers are inclusive write access is allowed only INSIDE the two ranges or exclusive write access is allowed only OUTSIDE the two ranges PX 1 means exclusive Situations may be set up where the regions overlap but the following rule holds In exclusive mode write access WITHIN EITHER region gives a Protection Exception In inclusive mode write access OUTSIDE BOTH regions gives a Protection Exception The comparison is as follows PBL lt EA lt PBU where EA is the Effective Address of the write access Notice that this includes the PBL but excludes the PBU in the region The bound registers are 20 bit registers which get compared to the upper 20 bits of the EA This means that the protected region is a multiple of 4K bytes All of memory is open to Read access Only Write access is protected The BIU Bank Configuration Registers DCR s contain a secondary protection mecha nism for hardware protection The enable bits for a particular device one of the 8 exter nal devices supported within the DRAM and or SRAM space independently control Read Write acce
154. line is marked as least recently used LRU via an LRU bit in the tag array Whenever a cache fill is to occur the line to receive the incoming data is the LRU line After the cache line fill the LRU bit is then set to identify as least recently used the line opposite the line just filled Each line is written to the cache location selected by its index and the LRU status of that congruence class As illustrated in Figure 8 3 the processor is capable under some circumstances of executing more than one instruction at a time The ICU can send two instructions per cycle to the execution unit This enables the incoming flow of instructions to keep pace with the execution rate A separate bypass path is available to handle cache inhibited instructions and to improve performance during line fill operations If a request from the fetcher causes an entire line to be obtained from memory the queue does not have to wait for the entire line to reach the cache As soon as the target word the word requested by the fetcher is available it is sent via the bypass path to the queue while the line fill continues 8 2 1 Instruction Cache Operations The instruction cache is used to minimize access latency for frequently executed instructions Instruction lines from cacheable memory regions are copied into the ICU from which they can be accessed by the fetcher far more quickly than they can be obtained from memory Cache lines are loaded either target wo
155. machine code for the instruction contains the following representation of the SPR number b 11010 00000 Note that the two 5 bit fields are reversed in the machine code for compatibility with the earlier Power architecture Privileged SPRs are indicated by the high order bit of the machine coding which is actually the middle bit of the SPR number When considering the SPR number as a hexadecimal number if the second digit of the three digit hex number is odd ie 1 3 5 7 9 B D F then that SPR is privileged For the example above the SPR number was x 01A The second hex digit 1 is odd therefore this SPR is privileged 2 11 5 Privileged DCRs The mtder mfder instructions themselves are privileged for all cases Thus all DCRs are privileged 2 11 6 Operation with an External Debugger An external debugger is considered to be a privileged user It is given access to all resources in order to facilitate program debug Therefore the occurrence of a privileged exception is prevented when a privileged instruction is executed using instruction stuffing by the JTAG mechanism while the processor is in Problem State 2 12 Context Execution and Storage Synchronization The following is a discussion of synchronization in general and of the supporting operations in the PPC403GA in particular The reader is also referred to the PowerPC Architecture sections 5 7 1 7 2 1 7 3 9 7 and Appendix L 2 38 PPC403GA Use
156. merxr 10 98 mfcr 10 99 mider 10 100 mfmsr 10 102 mfspr 10 103 mftb 6 30 6 31 mtcrf 10 105 mtder 10 107 mtmsr 10 109 mtspr 10 110 mulhw 10 112 mulhw 10 112 mulhwu 10 113 mulhwu 10 113 mulli 10 114 mullw 10 115 mullw 10 115 mullwo 10 115 mullwo 10 115 nand 10 116 nand 10 116 neg 10 117 neg 10 117 nego 10 117 nego 10 117 nor 10 118 nor 10 118 or 10 119 or 10 119 orc 10 120 Index orc 10 120 ori 10 121 oris 10 122 rfci 10 123 rfi 10 124 rlwimi 10 125 rlwimi 10 125 rlwinm 10 126 rlwinm 10 126 rlwnm 10 129 rlwnm 10 129 sc 10 130 slw 10 131 slw 10 131 sraw 10 132 sraw 10 132 srawi 10 133 srawi 10 133 srw 10 134 srw 10 134 sto 10 135 stbu 10 136 stbux 10 137 stbx 10 138 sth 10 139 sthbrx 10 140 sthu 10 141 sthux 10 142 sthx 10 143 stmw 10 144 stswi 10 145 stswx 10 146 stw 10 148 stwbrx 10 149 stwex 10 150 stwu 10 152 stwux 10 153 stwx 10 154 subf 10 155 subf 10 155 subfc 10 156 subfc 10 156 subfco 10 156 subfco 10 156 subfe 10 157 subfe 10 157 subfeo 10 157 L PPC403GA User s Manual subfeo 10 157 subfic 10 158 subfme 10 159 subfme 10 159 subfmeo 10 159 subfmeo 10 159 subfo 10 155 subfo 10 155 subfze 10 160 subfze 10 160 subfzeo 10 160 subfzeo 10 160 sync 10 161 tw 10 162 twi 10 164 wrtee 10 166 wrteei 10 167 xor 10 168 xori 10 169 xoris 10 170 instruction cache 2 24 8 1 debugging 8 1 8 6 instructions 8 5 instruction fields 10 2 instructi
157. mnemonic for tw 12 RA RB twgt Trap if RA greater than RB Extended mnemonic for tw 8 RA RB twle Trap if RA less than or equal to RB Extended mnemonic for tw 20 RA RB twige Trap if RA logically greater than or equal to RB Extended mnemonic for tw 5 RA RB twigt Trap if RA logically greater than RB Extended mnemonic for tw 1 RA RB twlle Trap if RA logically less than or equal to RB Extended mnemonic for tw 6 RA RB twllt Trap if RA logically less than RB Extended mnemonic for tw 2 RA RB twing Trap if RA logically not greater than RB Extended mnemonic for tw 6 RA RB twinl Trap if RA logically not less than RB Extended mnemonic for tw 5 RA RB twit Trap if RA less than RB Extended mnemonic for tw 16 RA RB twne Trap if RA not equal to RB Extended mnemonic for tw 24 RA RB twng Trap if RA not greater than RB Extended mnemonic for tw 20 RA RB twnl Trap if RA not less than RB Extended mnemonic for tw 12 RA RB Instruction Set 10 163 twi Trap Word Immediate twi TO RA IM 3 TO RA IM 0 6 11 16 31 if RA lt EXTS IM A TO 1 then TRAP if RA gt EXTS IM A TO 1 then TRAP if RA EXTS IM A TO 1 then TRAP if RA lt EXTS IM A TO 1 then TRAP if RA gt EXTS IM A TO 1 then TRAP Register RA is compared with the IM field which has been sign extended to 32 bits If any comparison condition indicated by the TO field is
158. n Rotate right immediate 10 126 RA lt ROTL RS 32 n Extended mnemonic for rlwinm RA RS 32 n 0 31 rotrwi Extended mnemonic for CR CRO rlwinm RA RS 32 n 0 31 Instruction Set 10 127 rlwinm Rotate Left Word Immediate then AND with Mask Table 10 26 Extended Mnemonics for rlwinm rlwinm cont Other Mnemonic Operands Function Registers Page Changed slwi RA RS n Shift left immediate n lt 32 10 126 RA o 31 n lt RS n 31 RA 32 n 31 amp 0 Extended mnemonic for rlwinm RA RS n 0 31 n slwi Extended mnemonic for CR CRO rlwinm RA RS n 0 31 n srwi RA RS n Shift right immediate n lt 32 10 126 RA n 31 lt RS o 31 n RA o n 1 lt 0 Extended mnemonic for rlwinm RA RS 32 n n 31 srwi Extended mnemonic for CR CRO rlwinm RA RS 32 n n 31 10 128 PPC403GA User s Manual rlwnm Rotate Left Word then AND with Mask rlwnm RA RS RB MB ME Rc 0 rlwnm RA RS RB MB ME Ro 1 23 RS RA RB MB ME Re 0 6 11 16 21 26 31 r lt ROTL RS RB 27 31 mc MASK MB ME RA lt lt ram The contents of register RS is rotated left by the number of bit positions specified by the contents of register RB bits 27 through 31 A mask is generated having 1 bits starting at the bit position specified in the MB field and ending in the bit position specified by the ME field with 0 bits elsewhere I
159. ne ee 10 53 0 6 0 EE 10 54 Ob Pa E TR Pe 10 55 0 00 DEE EEN 10 57 CCEA EECH 10 58 el EE 10 60 CUI WU KEE EE EE 10 61 NSO EE 10 62 VE 10 63 EE 10 64 KREE EEN 10 65 eil WEE 10 66 ICD EE 10 67 Lei e 10 68 IGF OAD EE EEN 10 69 Ee 10 71 WD Ze EE 10 72 e em PP lo SE E aE EA 10 73 EU ee Eer ee e e lee 10 74 ek EE 10 75 le EE 10 76 WAU ceSeeds Se EE 10 77 et Er EE 10 78 EN GE 10 79 ll EE 10 80 e EE 10 81 E WEE 10 82 ET EE 10 83 ee AEE EE EE a E 10 84 und hace etd tate Nace tee es heed scat Ma este EE 10 85 ISI E E e enee EE ee ven ee Eet GE Ee 10 86 E EE 10 88 UL le EEN 10 90 Do A kaa eae asa rad odes da ade 10 92 UE EEN 10 93 e 10 94 PPC403GA User s Manual Mie EE 10 96 TINCT EE EE EE 10 97 lei WEE 10 98 DIE ze gei dehk Ena a a ege oth EN eege ee viens ities peels teein aaa ELS 10 99 MIEP ac cia cease G50 A EEN 10 100 UN e 10 102 MET EE 10 103 UE BEE EE EE 10 105 TINO GE due Eege ege ee Eed 10 107 IMUM SI eg ee Eeer D el sot bbs ie Sei Be nT el ees 10 109 AU 10 110 REINER ek ee eege 10 112 ALETI WUD e Een dee ge DE ee ENEE e ere 10 113 RL geet dee tege chick sath eier bh oe ott Ht Meath orale ohhh Meee eege 10 114 UU EE 10 115 nand EE 10 116 OG EE 10 117 NOM egene EEN ENEE EENEG oes ea teu dered a a EE a NEEN ieee esos 10 118 Lee 10 119 lte 10 120 egene cei Se raided or ade stl Sn Hert Me cate E s An th Sn ee le nab he Shs oo toh tn att Meas 10 121 ONIS ist BOS SMS ae ME ok a A OS SEE ie OEE e E
160. nein area B 41 Rotate and Shift Instructions ccccccecssceceseeeeeesneeeeseeeeeeeeeeescneeeesseeessaeess B 42 Cache Control INStructionS B 44 Interrupt Control Instructions B 45 Processor Management Instructions 0 0 0 eee eeeeeeeeeneeeeeeeeeeeseeeeeeneeeeenneeeneaeees B 46 Tables xxiii Table C 1 Table C 2 Table C 3 xxiv CTR and LR Updating Instructions CR Updating Instructions Foldable Instructions PPC403GA User s Manual About This Book This user s manual provides the architectural overview programming model and detailed information about the registers and the instruction set of the IBM PowerPC 403GA 32 bit RISC embedded controller The PPC403GA RISC embedded controller features e PowerPC Architecture e Single cycle execution for most instructions e Buffered fly by or memory to memory four channel DMA e Direct connect DRAM SRAM ROM and I O interfaces e On chip 2KB instruction cache and 1KB copy back data cache e Serial and JTAG ports e Controller for one critical and five noncritical interrupt lines e Extensive development tool support Who Should Use This Book This book is for system hardware and software developers and for application developers who need to understand for the PPC403GA The audience should understand embedded system design operating systems RISC processing and design for testability How to Use This Book Thi
161. not in the data cache an entire line is brought from memory to the cache The program does not have to wait for the completion of this entire line fill The processor receives the first fullword of data immediately upon being received from main storage via a cache bypass mechanism Subsequent requests to the cache line being filled will also be forwarded Cache lines are always flushed or filled in their entirety unless an external memory subsystem error occurs during the operation Programming Model 2 25 2 8 Branching Control 2 8 1 AA Field on Unconditional Branches The unconditional branches b ba bl bla carry the displacement to the branch target address as a 26 bit value the 24 bit LI field right extended with two zeroes This displacement is always regarded as a signed 26 bit number hence it covers a range of 32 megabytes For the relative AA 0 forms b bl the target address is the Current Instruction Address the address of the branch instruction plus the signed displacement For the absolute AA 1 forms ba bla the target address is Zero plus the signed displacement If the sign bit LI 0 is zero the displacement is naturally interpreted as the actual target address If the sign bit is one the address is below zero wraps to high memory For example if the displacement is Ox8FF FFFC the 26 bit representation of negative four the target address is OxFFFF FFFC zero minus four bytes or four bytes fro
162. of DRAM will have higher priority and will continue to get refreshed at the rate programmed 3 7 3 2 Self Refresh Mode Several DRAM s available today provide support for self refresh mode In this mode the RAS and CAS signals are held active and the DRAM device will perform the row refreshes internally No data accesses are allowed during this time and the output of the device 3 42 PPC403GA User s Manual remains HiZ The advantage of using self refresh mode is that the power dissipation of the DRAM device is 30 to 40 times less than when the device is in the active mode Thus for those applications which run on battery power and have long intervals where the DRAM s are not accessed the power requirement of the system can be significantly reduced Self Refresh Mode is supported by providing the code the ability to activate the RAS and CAS signals and hold them on for extended periods of time To accomplish this the Alternate Refresh mode bit is set in the DRAM bank con trol register and one of the following codes is set into the Refresh Rate field of the same bank control register 0010 This code will cause the RAS signal for that bank of DRAM to be acti vated and remain active until either the Refresh Rate field is changed or the Alternate refresh mode bit is reset 0100 This code will cause all 4 CAS signals to be activated and remain active until either the Refresh Rate field is changed or the Alternate Refresh mode bit is
163. of the received data frame were a zero When this error is detected the Framing Error FE bit of the SPLS register is set Note that framing errors are also flagged when a line break is detected A line break is detected when a character is received and all of the bits of the frame including data parity and stop bits are zeros This condition will cause the Line Break LB bit of the SPLS is set to 1 Note that line breaks are only detected on character boundaries If a line break begins within a character a framing error is detected If the line break condition persists for the time equivalent to receiving another character the line break error is detected After a line break is detected the serial port receiver begins searching for the end of the line break defined as a period of logic one equivalent to the time required to receive one data bit of a frame When the end of the line break is detected receiver operation continues normally Serial Port Operation 7 9 There are two cases where the SPRSR receives a character without errors but that character is not transferred to the SPRB and is instead held in the SPRSR The first is when the SPRB is full and the second is if there are any receiver errors noted earlier posted in the SPLS register The character being held in the SPRSR will not be moved into the SPRB until application software either removes the character currently in the SPRB by performing a read operation or clears the error
164. of the SPTC to a logic 1 forces a continuous stream of zeros on the XmitD output assuming that the transmitter is enabled The SPU transmitter will continue to transmit break characters until the TB bit is reset to a logic 0 Setting the TB bit to 1 should only be done when the serial port transmitter is idle Forcing the transmission of break characters when the serial port transmitter is active has undefined results 7 2 2 4 Transmitter DMA Mode The DMA Mode Interrupt Enable DME field of the SPTC controls the use of the serial port transmitter as a DMA destination as well as the enable masking of the TxReady TBR interrupt The following table describes what the bit settings represent Table 7 5 DMA Mode Interrupt Enable field representation DME Meaning 00 SPU transmitter disabled as a DMA destination device TxReady TBR interrupt generation disabled 01 SPU transmitter disabled as a DMA destination device TxReady TBR interrupt generation enabled 10 SPU transmitter used as a destination for DMA Channel 2 11 SPU transmitter used as a destination for DMA Channel 3 When the transmitter is used as a destination for DMA transfers requests are made to the appropriate DMA channel whenever TxReady in the SPLS register is a logic 1 The DMA responds to the request by providing another character to transfer to the SPTB To operate in this mode the appropriate DMA Channel Control Register DMACRn must be configured
165. of the data and instruction caches The user may fill flush invalidate and zero blocks 16 byte lines in the data cache The user may also invalidate congruence classes in both caches and invalidate individual lines in the instruction cache Table B 11 Cache Control Instructions Mnemonic dcbf Operands RA RB Function Flush store then invalidate the data cache block which contains the effective address RA O RB Other Registers Changed Page 10 50 dch RA RB Invalidate the data cache block which contains the effective address RA O RB 10 51 dcbst RA RB Store the data cache block which contains the effective address RA O RB 10 52 dcbt RA RB Load the data cache block which contains the effective address RA O RB 10 53 dcbtst RA RB Load the data cache block which contains the effective address RA O RB 10 54 dcbz RA RB Zero the data cache block which contains the effective address RA O RB 10 55 dccci RA RB Invalidate the data cache congruence class associated with the effective address RA O RB 10 57 dcread icbi RT RA RB RA RB Read either tag or data information from the data cache congruence class associated with the effective address RA 0 RB Place the results in RT Invalidate the instruction cache block which contains the effective address RA O
166. pending within 3 cycles from the previous PPC403GA initiated transfer 5 XREQ must be driven inactive by the external bus master in cycle 8 until the HoldAck signal is deactivated by the processor Figure 3 25 HoldReq HoldAck Bus Arbitration Memory and Peripheral Interface 3 51 3 9 2 DRAM Accesses by the External Bus Master In a typical system design the PPC403GA DRAM controller will remain responsible for system DRAM to maintain consistency of DRAM refresh even when the external master controls the bus In that case a method is needed for the external master to transfer data to and from DRAM which is under control of the PPC403GA That method is provided by the XREQ XACK protocol described in this section Since this protocol only applies to DRAM the high order address bits which identify the DRAM address space are assumed and not transferred A valid request cycle is defined as any cycle in which XREQ is active and the BIU is idle or in the last cycle of a previous bus master request last cycle of precharge for single transfers last cycle of CAS for burst transfers Transfer direction R W transfer size XSize0 1 and transfer address are communicated from the External Master to the PPC403GA during valid request cycles as described in the following paragraphs While the external bus is in the HoldAck state the RW input signal is sampled by the PPC403GA during any valid request cycle The R W signal is used by the P
167. predecessor instruction in DCD has occurred for Folding from IO to be permitted Note that the PPC403GA can only fold one instruction at a time Suppose that A B and C are sequential instructions If instruction A is executing and instruction B is executing in parallel folded onto A then it is not possible to fold instruction C onto instruction B C 1 3 Branch Folding The PPC403GA will fold branch instructions in several situations see Section C 3 2 on page C 7 and Section C 4 on page C 10 When a branch instruction is folded it will effectively take zero cycles to execute For the PPC403GA to allow the branch to fold dependencies of the branch CR and CTR contents that are tested by conditional branches CTR and LR contents that are used as branch target addresses must have already been satisfied If the instructions that created those dependencies occurred immediately before the branch those dependencies would not yet be satisfied and wait states would be added to allow the dependency satisfaction The wait states can be avoided hidden by useful code by including either one or two instructions between the instruction that created the dependency and the branch as listed in Section C 2 6 and Section C 2 7 C 2 PPC403GA User s Manual C 2 Coding Guidelines C 2 1 Condition Register Bits for Boolean Variables A compiler can often get better performance for Boolean variables
168. registers in the chip The debug registers can be accessed either through software running on the processor or through the JTAG port The debug interfaces include the JTAG port as well as a Trace Status port The JTAG port can also be used for board test The debug modes events controls and interfaces provide a powerful combination of debug facilities for a complete set of hardware and software development tools such as RISCWatch 400 and OS Open from IBM 9 1 Development Tool Support ER The processor provides a powerful set of debug facilities for a wide range of hardware and software development tools The OS Open Real time Operating System Debugger product from IBM is an example of an operating system aware debugger implemented using software traps The RISCWatch 400 product from IBM is an example of a development tool that uses the External Debug Mode Debug Events and the JTAG port to implement a hardware and software development tool The RISCTrace feature of RISCWatch 400 combined with a logic analyzer is an example of a development tool that uses the Real time Trace Debug Mode of the processor to perform real time instruction tracing Logic analyzers from Hewlett Packard and Tektronix provide PPC403GA disassembler support and support for the RISCTrace feature of RISCWatch 400 9 2 Debug Modes There are four debug modes in the PPC403GA Each mode supports different types of debug tools commonly used in embedded systems
169. reserved 2 3 4 5 6 Processor Power OK 7 8 9 JTAG Test Mode Select 10 reserved 11 Processor Halt 12 reserved 13 reserved 14 The pin at this position should be removed 9 14 PPC403GA User s Manual Table 9 2 JTAG Connector Signals cont Connector PPC403GA Pin VO Signal Description 15 nc reserved 16 GND Ground 1 It is suggested that a 10K Ohm pullup resistor be connected to this signal The pullup resistor will reduce chip power consumption It is not required 2 The POWER signal is sourced from the target development board and is used as a status signal It should be the power signal being supplied to the processor either 5V or 3 3V It does not supply power to the RISCWatch 400 hardware A series resistor should be used to provide short circuit current limiting protection If the resistor is present it should be 1K ohm or less 3 Itis required that 10K Ohm pullup resistor be connected to this signal The pullup resis tor will ensure proper chip operation when these inputs are not used 9 8 2 2 JTAG Instructions The JTAG port implements the extest sample preload and bypass instructions as specified by the IEEE 1149 1 standard Invalid instructions behave as the bypass instruction and there are four private instructions Table 9 3 JTAG Instructions Instruction Code Comments Extest 0000 Per IEEE 1149 1 standard Sample Preload 0001
170. reset 6 17 registers device control 2 14 registers JTAG 2 14 registers memory mapped 2 14 registers special purpose 2 5 registers summary 2 5 reservation bit 10 90 10 150 reserved fields 11 1 reserved registers 11 1 reset chip 5 1 core 5 1 DRAM controller behavior 5 5 processor initialization 5 6 processor state after 5 2 register contents after 5 3 system 5 1 types of 5 1 reset registers during 6 16 chip reset 6 17 core reset 6 17 system reset 6 17 rfci 10 123 rfi 10 124 rlwimi 10 125 rlwimi 10 125 rlwinm 10 126 rlwinm 10 126 rlwnm 10 129 rlwnm 10 129 S sc 10 130 self refresh 3 42 serial port baud rate generator 7 5 handshaking pair 7 2 operating mode 7 2 overview 7 1 receiver 7 9 control of RTS 7 10 DMA 7 10 interrupts 7 11 registers 7 3 l 10 PPC403GA User s Manual transmitter 7 6 DMA 7 8 interrupts 7 8 line break 7 8 stop pause 7 7 signals by pinnumber 12 10 by signalname 12 1 slw 10 131 slw 10 131 SPCTL 7 13 11 54 special purpose registers 2 5 speculative fetching 2 29 architectural view 2 29 onthe PPC403GA 2 30 SPHS 7 14 11 55 SPLS 7 15 11 56 SPRB 7 16 11 57 SPRC 7 16 11 58 SPRGO SPRG3 2 8 11 59 SPTB 7 16 11 60 SPTC 7 18 11 61 SRAM timing 3 11 SRAM banks 2 3 sraw 10 132 sraw 10 132 srawi 10 133 srawi 10 133 SRRO 6 4 11 62 SRR1 6 4 11 63 SRR2 6 5 11 65 SRR3 6 5 11 66 srw 10 134 srw 10 134 stb 10 135 stou 10 136 stbux 10 137 stbx 10 138 sth 10 139 sthbrx
171. stb X store to I O device address X this resets a status bit in the device eieio Guarantee stb X completes before next instruction Ibz Y load from I O device address Y this is the status reg that gets updated by the stb X eieio was necessary since the read write addresses were different but in fact affected each other The PPC403GA implements both sync and eieio identically in the manner described above for sync In general PowerPC architecture defines sync as able to function across all processors in a multiprocessor environment and eieio to function only within its executing processor The PPC403GA is designed as a uniprocessor for this implementation sync will not guarantee memory ordering across multiprocessors 2 42 PPC403GA User s Manual 2 13 Interrupts and Exceptions An interrupt is the action in which the processor saves its old context MSR and instruction pointer and begins execution at a pre determined interrupt handler address with a modified MSR Exceptions are the events which will if enabled cause the processor to take an interrupt Asynchronous exceptions are caused by events which are external to the processor s execution and synchronous exceptions are those which are caused by instructions Precise exceptions are those for which the instruction pointer saved by the associated interrupt must be either the address of the excepting instruction or the address of the next sequential instruction Imprecise
172. syntax and function Appendix B contains the same descriptions as Appendix A but grouped by instruction categories as defined here In addition to the instruction mnemonics supported directly by hardware the PowerPC Architecture defines a large number of extended mnemonics which are intended to allow programs to be more readable Each extended mnemonic translates directly into the mnemonic of some hardware instruction typically with carefully specified operands As an example the PowerPC Architecture does not define a shift right word immediate instruction because it is unnecessary The desired result can be accomplished using the rotate left word immediate then AND with mask instruction rlwinm However the operands required to do the job are not obvious so an extended mnemonic is defined srwi RA RS n whichis an extended mnemonic for rlwinm RA RS 32 n n 31 These extended mnemonics transfer the problem of remembering unusual operand combinations from the programmer to the assembler They allow the use of mnemonics that properly reflect the programmer s intentions thus making the code more readable Extended mnemonics are documented in this manual in three places In Chapter 10 under each hardware mnemonic are listed all extended mnemonics which translate into that hardware form In Appendix A extended mnemonics are listed alphabetically with the hardware mnemonics not differentiating between the two In Appendix B all ext
173. the MSR The MSR contents are automatically saved altered and restored by the interrupt handling mechanism For further discussion see Section 6 1 Interrupt Registers on page 6 2 Programming Model 2 13 2 3 5 Device Control Registers Device Control Registers DCRs are on chip registers that exist architecturally outside the processor core and thus are not actually part of the PowerPC Embedded Architecture They are accessed with the mtdcr move to device control register and mfdcr move from device control register instructions which are defined in Chapter 10 DCRs control the use of the DRAM SRAM banks the I O configuration and the DMA channels They also hold status address for bus errors Table 11 2 on page 11 2 shows the mnemonic name and number for each DCR All DCRs are privileged for both read and write See Section 2 11 Privileged Mode Operation on page 2 36 for further discussion Table 2 2 Device Control Register DCR List BEAR BESR see Chapter 6 BRO BR1 BR2 BR3 see Chapter 3 BR4 BR5 BR6 BR7 see Chapter 3 DMACCO DMACC1 DMACC2 DMACC3 see Chapter 4 DMACRO DMACR1 DMACR2 DMACR3 Ssee Chapter4 _ s t DMACTO DMACT1 DMACT2 DMACT3 see Chapter 4 DMADAO DMADA1 DMADA2 DMADA3 see Chapter 4 DMASAO DMASA 1 DMASA2 DMASA3 see Chapter 4 DMASR see Chapter 4 EXISR EXIER IOCR see Chapter 6 2 3 6 Memory Mapped Input Output Registers The registers associated w
174. the data cache unit except in the cases of noncacheable data or cache misses In such cases the DCU passes the address for the data read or write to the BIU To minimize overhead in handling cache misses and noncacheable operands a bypass is available from the BIU which interfaces to the external memory being accessed to the EXU In addition to 32 GPRs the EXU contains status and special purpose registers that can be read or written by executing programs Some registers are only accessible while the processor is in supervisor state while others can be accessed in user mode A robust set of timer facilities is integrated into the EXU Four timer facilities are provided e A 56 bit time base register e A 32 bit Countdown programmable interval timer with auto reload e A fixed interval timer with four selectable intervals e A watchdog timer with four intervals and built in reset The frequency of the time base and other timer facilities is derived from a clock input which may be programmed to connect either to the processor clock SysClk or to an independent external timer clock pin TimerClk A simple memory protection mechanism in the EXU allows system software to manage two programmable regions of memory Each region is specified as a multiple of aligned 4KB pages Once enabled the protection mechanism prevents write access to these regions generating a precise protection exception if a write to the region is attempted Dual level exc
175. the transfer address The PPC403GA receives the address from the external bus master and compares the address to the contents of the bank registers to determine which bank will be accessed With this information and the direction of the transfer the PPC403GA can begin the DRAM transfer During a burst transfer XACK goes active during each transfer to indicate that the data is available to be latched in the case of a read or that the DRAM has captured the data in the case of a write For transfers beyond the first the External Master presents the new address and for writes the new data on the rise of SysClk when XACK 0 For subsequent transfers of the burst the PPC403GA examines XREQ and XSize0 1 during the valid request cycle the last cycle of CAS active If XREQ is found to be active with XSize0 1 b 11 the next transfer of the burst will begin The valid request cycle during CAS active which finds XREQ to be inactive or which finds XSize0 1 b 11 will begin the last transfer of the burst The number of transfers during the burst will be one plus the number of valid request cycles in which XREQ is active and XSize0 1 b 11 Address bits A22 31 for each burst transfer are latched in the BIU so that the BIU can determine whether a page boundary has been crossed during the transfer Page cross detection is done only for sequentially incrementing addresses Refresh requests will be delayed by 16 data transfe
176. time will be inserted between the time DMAR is accepted on a peripheral read or the data bus is driven on a peripheral write and DMAA is asserted for the peripheral part of the transfer in buffered and fly by modes 10 Two SysClk cycles of setup time are inserted 11 Three SysClk cycles of setup time are inserted 13 18 PWC Peripheral Wait Cycles The value 0 63 of the PWC bits determines the number of SysClk cycles that DMAA stays active after the first full SysClk cycle DMAA is active For instance the PWC bits have a value of 5 then DMAA is active for six SysClk cycles 19 21 PHC Peripheral Hold Cycles The value 0 7 of these bits determines the number of SysClk cycles between the time that DMAA becomes inactive until the bus is available for the next bus access During this period the address bus the data bus and control signals remain active 22 ETD End of Transfer Terminal Count EOT TC Pin Direction 0 The EOT TC pin is programmed as an end of transfer EOT input 1 The EOT TC pin is programmed as a terminal count TC output When programmed as TC and the terminal count is reached this signal will go active the cycle after DMAA goes inactive 23 TCE Terminal Count Enable 0 Channel does not stop when terminal count reached 1 Channel stops when terminal count reached 4 30 PPC403GA User s Manual 24 CH Chaining Enable 0 DMA Chaining is disabled 1 DMA chaining is enabled for this channel 25 BME Burst Mode Ena
177. to a peripheral the PPC403GA provides address and control signals to the memory and a control signal to the peripheral The PPC403GA enables the output from the memory and when the valid data is on the data bus the PPC403GA signals the peripheral to accept the data During fly by mode transfers from a peripheral to memory the PPC403GA signals to the peripheral when to place data on the data bus and the PPC403GA provides the address and control signals to write the data to the correct memory address Unlike buffered mode transactions where the PPC403GA must read and then write the data the PPC403GA data bus off chip drivers OCDs are tri stated during the entire fly by transaction Since the PPC403GA does not buffer the data during fly by transfers data is not packed or unpacked during fly by transfers Memory to memory moves can be initiated either by software or by an external device If initiated via software the transfer will begin as soon as the channel is configured and enabled for memory to memory move If memory to memory moves are initiated by hardware also known as device paced memory to memory move the user configures the channel for memory to memory move and transfers begin when an external device places an active request on the channel request line For memory to memory transfers one piece of data is read from the source memory address and it is written to the destination address The PPC403GA serial port unit SPU can also be us
178. to be enabled will cause an exception if the same bit in the EXISR is already set and MSR EE is set Figure 6 7 shows the bit definitions for the External Interrupt Enable Register CIE SRIE JRIE Dir ro EQIE E2IE E4IE 4 x 4 v oji sl 6 8 10 11 12 26 27 29 30 31 E CS Sg odp Se edie Figure 6 7 External Interrupt Enable Register EXIER 0 CIE Critical Interrupt Enable 0 Critical Interrupt Pin interrupt disabled 1 Critical Interrupt Pin interrupt enabled 1 3 reserved 4 SRIE Serial Port Receiver Interrupt Enable 0 Serial port receiver interrupt disabled 1 Serial port receiver interrupt enabled 5 STIE Serial Port Transmitter Interrupt Enable 0 Serial port transmitter interrupt disabled 1 Serial port transmitter interrupt enabled 6 JRIE JTAG Serial Port Receiver Interrupt Enable 0 JTAG serial port receiver interrupt disabled 1 JTAG serial port receiver interrupt enabled 7 JTIE JTAG Serial Port Transmitter Interrupt Enable 0 JTAG serial port transmitter interrupt disabled 1 JTAG serial port transmitter interrupt enabled 8 DOIE DMA Channel 0 Interrupt Enable 0 DMA Channel 0 interrupt disabled 1 DMA Channel 0 Interrupt enabled 9 D11E DMA Channel 1 Interrupt Enable 0 DMA Channel 1 interrupt disabled 1 DMA Channel 1 interrupt enabled 6 8 PPC403GA User s Manual 10 D2lE DMA Channel 2 Interrupt Enable 0
179. to memory mode via programming the DMA Channel Control Register Also the DMA Count and the DMA Destination Address Registers must be initialized Chaining is not allowed for Memory to Memory transfers Memory to memory transfers initiated by software do not require DMAR and DMAA This example presents a transfer between two 32 bit memories which may be either DRAM or SRAM The memory interfaces are configured in the respective BIU bank registers not in the DMA registers Figure 4 13 shows the channel control register settings for this transfer CE TD PW SAI TM E E Gs le TCD NEEN 10 X X XX XXXX XXX 1 1 0 0 ole 28 31 ale d DAI T g s S db gie Figure 4 13 DMACR Setting for Memory to Memory Transfer Table 4 4 describes the bit settings for each field in this DMACR C Reserved Table 4 4 Sample DMACR Settings for Memory to Memory Transfer 0 Peripheral is external to the PPC403GA 10 Word 32 bits Bit Name Description 0 CE Channel Enable 1 Channel is enabled for DMA operation 1 CIE Channel Interrupt Enable 1 All DMA interrupts from this channel end of transfer terminal count reached are enabled 2 TD Transfer Direction Valid only for buffered mode and fly by mode don t care in memory to memory mode 3 PL Peripheral Location 4 5 PW Peripheral Width Transfer Width is the same as Peripheral Width DMA Operations 4
180. which to trap as described under tw and twi Extended opcode for instructions without an OE field Extended opcode for instructions with an OE field Extended opcode for the sc instruction Extended opcode for the stwex instruction Instruction Set 10 3 Extended opcodes in decimal appear in the instruction format diagrams 10 3 Pseudocode The pseudocode that appears in the instruction descriptions provides a semi formal language for describing instruction operations The pseudocode uses the following notation Assignment AND logical operator NOT logical operator v OR logical operator Exclusive OR XOR logical operator Twos complement addition Twos complement subtraction unary minus x Multiplication Division yielding a quotient K Remainder of an integer division 83 32 1 I Concatenation Equal not equal relations lt gt Signed comparison relations Z gt Unsigned comparison relations if then else Conditional execution if condition then a else b where a and b represent one or more pseudocode statements Indenting indicates the ranges of a and b If b is null the else does not appear do Do loop to and by clauses specify incrementing an iteration variable while and until clauses specify terminating conditions Indenting indicates the range of the loop leave Leave innermost do loop or do loop specified in a leave statement n A decimal number
181. x n A hexadecimal number b n A binary number FLD An instruction field 10 4 PPC403GA User s Manual A a PETI Ke REG FLD REG FLD FLD GPR r GPR r DCR DCRN SPR SPRN RA RB _ d XX CEIL x EXTS x PC RESERVE CIA NIA A bit in an instruction field A range of bits in an instruction field A list of bits by number or name in a named field A bit in a named register A range of bits in a named register A list of bits by number or name in a named register A field in a named register A list of fields in a named register General Purpose Register r where 0 lt r lt 31 The contents of General Purpose Register r where 0 lt r lt 31 A DCR specified by the DCRF field in a mfder or mtder instruction An SPR specified by the SPRF field in a mfspr or mtspr instruction GPRs The contents of a GPR where xis A B S or T The contents of the register RA or 0 if the RA field is 0 A four bit object used to store condition results in compare instructions The bit or bit value b is replicated n times Bit positions which are don t cares Least integer x The result of extending x on the left with sign bits Program counter Reserve bit indicates whether a process has reserved a block of storage Current instruction address the 32 bit address of the instruction being described by a sequence of pseudocode This address is used to set the next instruction address NIA Does not corres
182. 0 Single accesses only Page Mode not supported 1 Page Mode burst access supported 21 22 FAC First Access Timing First Access time is 2 FAC if RCT 0 00 First Wait 0 SysClk cycles First Access time is 3 FAC if RCT 1 01 First Wait 1 SysClk cycles 10 First Wait 2 SysClk cycles 11 First Wait 3 SysClk cycles 23 24 BAC Burst Access Timing Burst Access time is 1 BAC 00 Burst Wait 0 SysClk cycles 01 Burst Wait 1 SysClk cycles Note if FAC 0 BAC is ignored and 10 Burst Wait 2 SysClk cycles treated as 0 11 Burst Wait 3 SysClk cycles 25 PCC Precharge Cycles 0 One and one half SysClk cycles 1 Two and one half SysClk cycles 26 RAR RAS Active During Refresh 0 One and one half SysClk cycles 1 Two and one half SysClk cycles 27 30 RR Refresh Interval See Table 3 4 for bit values assigned to various refresh intervals If field ARM 1 use Table 3 5 31 SD SRAM DRAM Selection Must be 0 for DRAM configuration 0 DRAM usage 1 SRAM usage 11 12 PPC403GA User s Manual BRDH BRDH see also Section 7 1 3 on page 7 3 and Section 7 2 1 on page 7 5 MMIO Figure 11 5 Baud Rate Divisor High Register BRDH 0 3 reserved 4 7 Divisor High Bits The four most significant bits of the baud rate divisor concatenated with the contents of the BRDL Register Summary 11 13 BRDL BRDL see als
183. 0 noncacheable 1 cacheable 0xB800 0000 OxBFFF FFFF 24 S24 0 noncacheable 1 cacheable 0xC000 0000 OxC7FF FFFF 25 S25 0 noncacheable 1 cacheable 0xC800 0000 OxCFFF FFFF 11 42 PPC403GA User s Manual ICCR cont 26 S26 0 noncacheable 1 cacheab 0xD000 0000 OxD7FF FFFF 27 S27 0 noncacheable 1 cacheab 0xD800 0000 OxDFFF FFFF 28 S28 0 noncacheable 1 cacheab 0xE000 0000 OxE7FF FFFF 29 S29 0 noncacheable 1 cacheab 0xE800 0000 OxEFFF FFFF 30 S30 0 noncacheable 1 cacheab 0xF000 0000 OxF7FF FFFF 31 S31 0 noncacheable 1 cacheab 0xF800 0000 OxFFFF FFFF Register Summary 11 43 ICDBDR ICDBDR see also Section 8 2 4 on page 8 6 SPR Figure 11 28 Instruction Cache Debug Data Register ICDBDR 0 31 Instruction Cache Information see icread page 10 69 11 44 PPC403GA User s Manual IOCR IOCR see also Section 6 1 7 on page 6 11 DCR si a E2T E8T Eat RDM SS ee ee I o 2 3 4 sle 7 s 9 ho 25 26 27 28 29 30 31 EL cl ch cht eh DRC rts B Figure 11 29 Input Output Configuration Register IOCR 0 EOT External Interrupt 0 Triggering 0 External Interrupt 0 pin is level sensitive 1 External Interrupt 0 pin is edge triggered 1 EOL External Interrupt 0 Active Level 0 External Interrupt 0 pin is negative level
184. 0 1 01 01 0 x XXXX Figure 3 27 Burst Write to 3 2 2 2 Page Mode DRAM 3 56 PPC403GA User s Manual DMA Operations This chapter presents an overview of PPC403GA DMA features followed by detailed discussions of DMA operations signals and registers 4 1 Overview The PPC403GA four channel DMA controller handles data transfers between memory and peripherals and from memory to memory DMARO 2 DMAR3 XReq DMA DMAA0 2 Controller DMAA3 XAck 4 Channels EOT0 2 TC0 2 EOT3 TC3 xSize0 Address Control A6 29 To From D0 31 al P Peripheral Bus BusReq DMADXFER RASO 3 CAS0 3 DRAMOE DRAMWE AMuxCAS CS0 7 SRAM ROM I O OE xXSize1 Controller WBE0 3 DRAM Controller Ready Figure 4 1 PPC403GA DMA Controller Interfaces DMA Operations 4 1 The DMA controller uses both dedicated DMA signals and the external memory and peripheral controls in the bus interface unit BIU as shown in Figure 4 1 The DMA controller provides four independent channels Each channel contains a control register a source address register a destination address register and a transfer count register Each channel supports chained DMA operations so it also contains a chained count register and its source address register functions as the chained address register All DMA channels report their status to the single DMA Status Register as shown in Figure 4 2 Channe
185. 0 88 PPC403GA User s Manual Iswx Load String Word Indexed Registers Altered e RT and subsequent GPRs as described above Invalid Instruction Forms e Reserved fields e RAor RB is in the range of registers to be loaded e RA RT 0 Programming Note If XER TBC is 0 the contents of register RT are undefined The PowerPC Architecture states that if XER TBC 0 and if the EA is such that a precise data exception would normally occur if not for the zero length then Iswx will be treated as a no op and the precise exception will not occur A violation of the Protection Bounds registers is an example of such a precise data exception However the architecture makes no statement regarding imprecise exceptions related to Iswx with XER TBC 0 The PPC403GA will generate an imprecise exception Machine Check on this instruction under these circumstances The instruction passes all protection bounds checking and the address is passed on to the D cache and the address is cacheable and the address misses in the D cache resulting in a line fill request to the BIU and 10 the address encounters some form of bus error non configured etc Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 89 lwarx Load Word and Reserve Indexed lwarx RT RA RB 31 RT RA RB 20 0 6 11 16 21 31 EA lt RB RA 0 RESERVE lt 1 RT lt MS EA
186. 0 A4 determine the cache ability of the memory region Fields BS and BAS are not independent See Section 3 5 3 on page 3 10 including Table 3 2 Restrictions on Bank Starting Address Memory and Peripheral Interface 3 37 Multiple bank registers inadvertently may be programmed with the same base address or as overlapping banks An attempt to use such overlapping banks is reported as a Non Configured error to the Data Cache Instruction Cache or DMA Controller which ever originated the access No external access will be attempted This error may result in a Machine Check exception See Section 2 13 1 3 Instruction Machine Check Han dling on page 2 46 and Section 2 13 1 4 Data Machine Check Handling on page 2 48 If the error occurred during a DMA access an External Interrupt may result See Section 4 2 11 Errors on page 4 28 e The BS field bits 8 10 sets the number of bytes which the bank may access begin ning with the base address set in the BAS field Fields BS and BAS are not indepen dent See Section 3 5 3 on page 3 10 including Table 3 2 Restrictions on Bank Starting Address e The BU field bits 11 12 specify unused chip selects and protect banks of physical devices from read or write accesses This differs from the form of protection discussed in Chapter 2 Programming Model where regions of memory are protected using the Protection Bound Upper Registers PBU1 PBU2 and Protection Bound Lower Regis ters PBL1
187. 0000000 to itself results in an arithmetic overflow and x 00000000 is recorded in the target register CR CRO eq so is set indicating a result of 0 but the infinitely precise result is negative The CR CRO0 so subfield is a copy of XER SO Instructions that do not alter the XER SO bit cannot cause an overflow but even for these instructions CR CRO so is a copy of XER SO Some instructions set CR CRO differently or do not specifically set any of the subfields These instructions include e Compare instructions cmp cmpi cmpl cmpli CR logical instructions crand crandc creqv crnand crnor cror crorc crxor merf Move CR instructions micrf merxr e stwcx The instruction descriptions provide detailed information about how the listed instructions alter CR CRO Table C 2 on page C 10 summarizes the operations that affect the CR 2 3 4 Machine State Register The PPC403GA contains one 32 bit Machine State Register MSR The contents of this register can be written from a GPR via the move to machine state register mtmsr instruction and read into a GPR via the move from machine state register mfmsr instruction The MSR EE bit External Interrupt Enable may be set cleared atomically using the wrtee or wrteei instructions The MSR controls important chip functions such as the enabling disabling of interrupts and debugging exceptions Power management is possible through software control of the Wait State Enable bit within
188. 03GA is the sole source of control signals to the devices That assumption is consistent with the PPC403GA design which attempts to minimize the number of external components required However if a large number of byte and halfword devices are attached to the system the capacitive loading on byte 0 and byte 1 if many halfword devices are used will be much larger than the loading on byte 3 possibly resulting in unacceptable timing performance on byte 0 or byte 1 If a bank register is configured as word wide then byte wide devices may be attached to the bus in any byte lane and accessed using byte loads and stores However this cannot be accomplished with the control bus exactly as it is presented by the PPC403GA External logic is required to develop additional control signals if the data bus is to be utilized in this manner Similarly if a bank register is configured as word wide then halfword wide devices may be attached to the bus in the byte 0 byte 1 lane or in the byte 2 byte 3 lane and accessed using halfword loads and stores Again external logic is required to develop additional control signals if the data bus is to be utilized in this manner 3 6 PPC403GA User s Manual 3 5 Address Bit Usage Note from Figure 3 2 that although the PPC403GA address bus is 32 bits as defined by the PowerPC Architecture only 24 address bits A6 29 are externalized on the PPC403GA The 24 address bits combined with the four decoded l
189. 1 EXIER 6 8 6 11 11 36 EXISR 6 9 11 38 extended mnemonics 2 49 alphabetical B 5 for addi 10 10 for addic 10 11 for addic 10 12 foraddis 10 13 for bc bca bcl bcla 10 22 for becht bech 10 29 for belr beid 10 33 forcmp 10 37 forcmpi 10 38 forcmpl 10 39 forcmpli 10 40 for creqv 10 44 for crnor 10 46 for cror 10 47 for crxor 10 49 for mfdcr 10 101 for mfspr 10 104 for mtcrf 10 106 for mtdcr 10 108 for mtspr 10 111 for nor nor 10 118 foror or 10 119 forori 10 121 for rlwimi rlwimi 10 125 for rlwinm rlwinm 10 126 for rlwnm rlwnm 10 129 for subf subf subfo subfo 10 155 for subfc subfc subfco subfco 10 156 fortw 10 163 fortwi 10 165 Index l 3 i external bus master 3 49 arbitration 3 50 DRAM access 3 52 burst transfers 3 55 single transfers 3 53 interface 3 49 synchronous interface 3 50 valid request cycle 3 52 external interrupts 6 21 DMA 6 21 external interrupt pins 6 21 JTAG port 6 21 serial port 6 21 extsb 10 64 extsb 10 64 extsh 10 65 extsh 10 65 F FIT 6 25 6 33 fixed interval timer 6 25 6 33 fold blocking C 1 branches C 11 cr logical and mert C 11 during debug C 13 folding C 1 C 2 blocking branches C 11 cr logical and mert C 11 during debug C 13 defined C 1 detailed rules C 10 instruction classifications C 10 instructions that can be folded C 11 G GPRO GPR31 2 5 11 40 l IAC1 IAC2 6 26 9 11 11 41 icbi 10 66 icbt 10 67 iccci 10 68 ICCR 8 4 11 42 ICDBDR 1
190. 1 44 icread 10 69 immediate refresh 3 42 ia LA PPC403GA User s Manual initialization 5 6 code example 5 7 requirements 5 6 instruction add 10 7 add 10 7 addc 10 8 addc 10 8 addco 10 8 addco 10 8 adde 10 9 adde 10 9 addeo 10 9 addeo 10 9 addi 10 10 addic 10 11 addic 10 12 addis 10 13 addme 10 14 addme 10 14 addmeo 10 14 addmeo 10 14 addo 10 7 addo 10 7 addze 10 15 addze 10 15 addzeo 10 15 addzeo 10 15 and 10 16 and 10 16 andc 10 17 andc 10 17 andi 10 18 andis 10 19 b 10 20 ba 10 20 be 10 21 bca 10 21 bectr 10 28 bectrl 10 28 bel 10 21 bcla 10 21 belr 10 32 belrl 10 32 bl 10 20 bla 10 20 cmp 10 37 cmpi 10 38 cmpl 10 39 cmpli 10 40 centlzw 10 41 entlzw 10 41 crand 10 42 crande 10 43 creqv 10 44 crnand 10 45 crnor 10 46 cror 10 47 crorc 10 48 crxor 10 49 dcbf 10 50 debi 10 51 dcbst 10 52 dcbt 10 53 dcbtst 10 54 dcbz 10 55 dccci 10 57 dcread 10 58 divw 10 60 divw 10 60 divwo 10 60 divwo 10 60 divwu 10 61 divwu 10 61 divwuo 10 61 divwuo 10 61 eieio 10 62 eqv 10 63 eqv 10 63 extsb 10 64 extsb 10 64 extsh 10 65 extsh 10 65 icbi 10 66 icbt 10 67 iccci 10 68 icread 10 69 isync 10 71 loz 10 72 lozu 10 73 baus 10 74 lbzx 10 75 Iha 10 76 bau 10 77 baus 10 78 Ihax 10 79 Ihbrx 10 80 Ihz 10 81 bau 10 82 Ihzux 10 83 Ihzx 10 84 Imw 10 85 Iswi 10 86 Iswx 10 88 lwarx 10 90 Iwbrx 10 92 lwz 10 93 lwzu 10 94 Iwzux 10 95 lwzx 10 96 merf 10 97
191. 10 122 Ae EE 10 123 AU 10 124 Wl NEE 10 125 EMWIDIDT deed sauce EE E BEE E E EEE SEEE E E EE E E 10 126 M due Eeer EE e A a aE 10 129 T EE E AA E E E E E E E 10 130 I E AE EE Ae ev A E ee E eee 10 131 ee NO A A E EE 10 132 SVAWL EE 10 133 NEE EE 10 134 TE e ee A E E AEE A E E E ESA 10 135 ET eech eene dE T EA TA 10 136 STU EE EE 10 137 Ee Ke eg ae ite E Mee Mace nite dhs take bh IE Met 10 138 EH A he hee KE WEE AA OR SM SE RoR Beene Ee As REO NEE 10 139 Deg 10 140 Dt EE 10 141 Cl EE 10 142 SUNK EE 10 143 SIMW EE 10 144 E EE 10 145 SISWI GE E SM ARS RN SBE SE OI eg i OO NL GM ote Peat as 10 146 GE 10 148 Dee EE 10 149 Contents xiii SW st et eene wie eaten ete herder elas 10 152 SIWUX genie Site ieee teen i ie ee neh ae 10 153 EE 10 154 Sege eegenen eebe datas and alate edt tie hs Sate a ail 10 155 SUD Le 10 156 SUBIC seine ae h loi ate eel Se aie et ee a i hsb el eee 10 157 e UE 10 158 SUD ENC oes eut cg etek chee eis ene ee este hee Mp cnet E Ste ck dE ee eee 10 159 GEET 10 160 SYNC eg l ger et Sege NEE eiea Ba aiea pes 10 161 TW Aen eed A ee es en seed an ee 10 162 wl geed ees BE ee eee ok aed 10 164 WIESEN eee Seed ee a 10 166 VT EE 10 167 LEE 10 168 LAST 10 169 MONS cic Aa ee Seel Rot Sie ee etal EE ere ede ee ee ee Ba 10 170 Register Summary sctisssaccaatunvssnscanssanssusievsiwsweintesassanuaveesanavertevarades 11 1 Reserved Registers ui niie ie Ai en A etn 11 1 Reserved FIGS iss cae teest cence cxeesdeeshyacteesa
192. 10 85 EA RA O EXTS D Place into consecutive registers RT through GPR 31 RA is not altered unless RA GPR 31 Iswi RT RA NB Load consecutive bytes from EA RA 0 10 86 Number of bytes n 32 if NB 0 else n NB Stack bytes into words in CEIL n 4 consecutive registers starting with RT to Reina lt RT CEIL n 4 1 32 GPR 0 is consecutive to GPR 31 RA is not altered unless RA Reinac Iswx RT RA RB Load consecutive bytes from 10 88 EA RA 0 RB Number of bytes n XER TBC Stack bytes into words in CEIL n 4 consecutive registers starting with RT to Reina lt RT CEIL n 4 1 32 GPR 0 is consecutive to GPR 31 RA is not altered unless RA Droa RB is not altered unless RB Rejnac If n 0 content of RT is undefined B 30 PPC403GA User s Manual Table B 5 Data Movement Instructions cont Mnemonic lwarx Operands RT RA RB Function Load word from EA RA 0 RB and place in RT RT lt MS EA 4 Set the Reservation bit Other Registers Changed Page 10 90 Iwbrx RT RA RB Load word from EA RA 0 RB then reverse byte order RT MS EA 3 1 MS EA 2 1 MS EA 1 1 MS EA 1 10 92 lwz RT D RA Load word from EA RA O EXTS D and place in RT RT MS EA 4 10 93 lwzu RT D RA Load word from EA RA O EXTS D and place in RT RT MS EA 4 Update the base addre
193. 13 Reserved 0x4800 0000 0x47FF FFFF Region 8 Reserved and 0x4000 0000 SEN Ox3FFF FFFF Regions 2 7 Reserved 0x1000 0000 OxOFFF FFFF i DRAM Access Regions 0 1 double mapping of 16 17 0x0000 0000 Figure 2 1 PPC403GA Address Map 2 4 PPC403GA User s Manual 2 3 PPC403GA Register Set With the exception of the serial port registers all registers contained in the PPC403GA are architected as 32 bits The registers can be grouped into categories based on their access mode general purpose registers GPR device control registers DCR special purpose registers SPR the machine state register MSR the condition register CR and memory mapped input output registers MMIO Some of the more commonly used registers are discussed in this chapter Other registers are covered in their topic chapters for example DMA registers in the DMA chapter All registers are summarized alphabetically in chapter 11 with cross references to the pages where further discussion may be found For all registers with fields marked as reserved the reserved fields should be written as zero and read as undefined That is when writing to a register with a reserved field write a zero to that field When reading from a register with a reserved field ignore that field Good coding practice is to perform the initial write to a register with reserved fields as described in the preceding paragraph and to perform all subsequent writes to the register
194. 16 95 A9 127 BIM 159 DMAA3 XACK 32 INT1 64 D17 96 A10 128 EOTO TCO 160 Vpp 12 10 PPC403GA User s Manual Alphabetical Instruction Summary A 1 Instruction Set and Extended Mnemonics Alphabetical Table A 1 summarizes the PPC403GA instruction set including required extended mnemonics All mnemonics are listed alphabetically without regard to whether the mnemonic is realized in hardware or software When an instruction supports multiple hardware mnemonics for example b ba bl bla are all forms of b the instruction is alphabetized under the root form The hardware instructions are described in detail in Chapter 10 Instruction Set which is also alphabetized under the root form Chapter 10 also describes the instruction operands and notation Note the following for every Branch Conditional mnemonic Bit 4 of the BO field provides a hint about the most likely outcome of a conditional branch see Section 2 8 5 for a full discussion of Branch Prediction Assemblers should set BO 0 unless a specific reason exists otherwise In the BO field values specified in the table below BO 0 has always been assumed The assembler must allow the programmer to specify Branch Prediction To do this the assembler will support a suffix to every conditional branch mnemonic as follows Predict branch to be taken Predict branch not to be taken As specific examples be also could be coded as ber or bc and bne a
195. 16 bit integer 10 2 PPC403GA User s Manual LI 6 29 LK 31 MB 21 25 ME 26 30 NB 16 20 OPCD 0 5 OE 21 RA 11 15 RB 16 20 Re 31 RS 6 10 RT 6 10 SH 16 20 SPRF 11 20 TO 6 10 21 30 22 30 30 XO XO XO XO 31 An immediate field specifying a 24 bit signed twos complement branch displacement this field is concatenated on the right with DOUT and sign extended to 32 bits Link bit 0 Do not update the link register LR 1 Update the LR with the address of the next instruction Mask begin Used in rotate instructions to specify the beginning bit of a mask Mask end Used in rotate instructions to specify the ending bit of a mask Specifies the number of bytes to move in an immediate string load or store Primary opcode the field name does not appear in instruction descriptions Enables setting the OV and SO fields in the fixed point exception register XER for extended arithmetic A GPR used as a source or target A GPR used as a source Record bit 0 Do not set the CR 1 Set the CR to reflect the result of an operation CR CRO 1 ct cq so iS set to reflect the result as a signed quantity the result as an unsigned quantity or bit string can be deduced from CR CRO _g See Section 2 3 3 on page 2 11 for a further discussion A GPR used as a source A GPR used as a target Specifies a shift amount Specifies a special purpose register SPR Specifies the conditions on
196. 167 bit MSR EE Instructions By Category B 45 B 13 Processor Management Instructions The processor management instructions move data between GPRs and SPRs and DCRs in the PPC403GA these instructions also provide traps system calls and synchronization controls Table B 13 Processor Management Instructions Mnemonic eieio Operands Function Storage synchronization All loads and stores that precede the eieio instruction complete before any loads and stores that follow the instruction access main storage Implemented as syne which is more restrictive Other Registers Changed Page 10 62 isync Synchronize execution context by flushing the prefetch queue 10 71 merxr BF Move XER 0 3 into field CRn where ncBF CR CRn XER SO OV CAJ XER SO OV CAJ lt 30 10 98 mfcr RT Move from CR to RT RT lt CR 10 99 mfdcr RT DCRN Move from DCR to RT RT lt DCR DCRN 10 100 mfspr RT SPRN Move from SPR to RT RT SPR SPRN 10 103 mtcrf FXM RS Move some or all of the contents of RS into CR as specified by FXM field mask 4 FXMp 4 FXM4 Il Il 4 FXMg 4 FXM7 CR lt RS a mask v CR a mask 10 105 mtdcr DCRN RS Move to DCR from RS DCR DCRN RS 10 107 mtspr SPRN RS Move to SPR from RS SPR SPRN lt RS 10 110
197. 2 Serial Port Control Register SPOTL eccceeeseeeeseeeeeeeeneeteaeeeeeeeeeeseaeeeeeeea 7 13 Serial Port Handshake Register GSPHS eecceeeceeeeeeeeeeeeeeeeeeeteneeteeeeeaeeeee 7 14 Serial Port Line Status Register SPLS 0 eceecceeeeeeeeeeeeeeeeeeeeeeteeeseeeeeeeeea 7 15 Serial Port Receive Buffer SPRB A 7 16 Serial Port Receiver Command Register SPRO e ecccseeeeeeeeeeeeeeeeneeeee 7 16 Serial Port Transmit Buffer PID 7 17 Serial Port Transmitter Command Register SPTO ccccseeseeeeeeeeeeeeneeeee 7 18 Cache Debug Control Register ODBOR eeeceeeceeeeeeeeeeteneeeeeeteateseaeeeeetaaee 8 1 Instruction Cache Organization eeceeeceeeeeceeeeeeeeeeeeeeeeeeeaeeseeeeaeesseeseeeeseeenas 8 2 uereg e TEE 8 3 Instruction Cache Cacheability Register ICCR ceecceesceeseeeeereseeeeeneeeeeteees 8 4 Instruction Cache Debug Data Register ICDBDR A 8 6 Data Cache Organization eeceeeceeeeeeeeeeeeeeeeeeeeeeeeeaeeseeeeseeseaeeeeeeseeeeeeeeeaeee 8 7 Data Cache Cacheability Register DCH 8 8 Debug Control Register DBOR A 9 6 Debug Status Register DBSR ecceeseeeeeeeeeeeeeeeeeeeeeeaeeseeeeeaeeeneeeeaeeeeeeeeaeee 9 9 Data Address Compare Registers DAC1 DAC2 0 0 eeceeeceeseeeeeeteeeeeeeeaes 9 10 Instruction Address Compare IAC1 IAC2 oe eeeeeececeeeeeeeeenreeeeeesereeneeeeneeennees 9 11 Trace Status Gonnecton Sars e gue ge deeg REENEN 9 12 JTAG Connector top view
198. 213 24 25 31 OV Figure 2 7 Fixed Point Exception Register XER 0 SO Summary Overflow Reset only by mtspr specifying the XER 0 no overflow has occurred or by merxr 1 overflow has occurred 1 OV Overflow 0 no overflow has occurred 1 overflow has occurred 2 CA Carry 0 carry has not occurred 1 carry has occurred 3 24 reserved 25 31 TBC Transfer Byte Count Used by Iswx and stswx Written by mtspr specifying the XER There are numerous special cases associated with the use of the XER bits The detailed Programming Model 2 9 discussion which follows should help clarify these XER SO XER OV XER CA XER TBC 2 10 Summary overflow set to 1 when an instruction causes XER OV to be set to 1 except for mtspr XER which sets XER SO OV to the value of bit positions 0 and 1 in the source register respectively Once set XER SO is not reset until an mtspr XER is executed with data that explicitly puts a 0 in the SO bit or until an merxr instruction is executed Overflow set to indicate whether or not an instruction that updates XER OV produces a result that overflows the 32 bit target register XER OV 1 indicates overflow For arithmetic operations this occurs when an operation has a carry in to the high order bit of the instruction result that does not equal the carry out of the high order bit that is the exclusive or of the carry in and the carry out is 1 The following instructio
199. 23 10 140 sthu RS D RA Store halfword RS 46 3 in memory at EA RA O EXTS D Update the base address RA e EA 10 141 sthux RS RA RB Store halfword RS 46 3 in memory at EA RA O RB Update the base address RA e EA 10 142 A 32 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic sthx Operands RS RA RB Function Store halfword RS 16 31 in memory at EA RA 0 RB Other Registers Changed Page 10 143 stmw RS D RA Store consecutive words from RS through GPR 31 in memory starting at EA RA O EXTS D 10 144 stswi RS RA NB Store consecutive bytes in memory starting at EA RA 0 Number of bytes n 32 if NB 0 else n NB Bytes are unstacked from CEIL n 4 consecutive registers starting with RS GPR 0 is consecutive to GPR 31 10 145 stswx RS RA RB Store consecutive bytes in memory starting at EA RA 0 RB Number of bytes n XER TBC Bytes are unstacked from CEIL n 4 consecutive registers starting with RS GPR 0 is consecutive to GPR 31 10 146 stw RS D RA Store word RS in memory at EA RA 0 EXTS D 10 148 stwbrx RS RA RB Store word RS byte reversed in memory at EA RA O RB MS EA 4 RS o4 31 Il RS 6 23 I RS g 15 Il RS o 7 10 149 stwex RS RA RB Store w
200. 3 Extended mnemonic for belrl 4 4 cr_field 3 LR 10 32 bso bsoa bsol bsola cr_field tar get Branch if summary overflow Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 3 target Extended mnemonic for bca 12 4 cr_field 3 target Extended mnemonic for bel 12 4 cr_field 3 target LR Extended mnemonic for bcla 12 4 cr_field 3 target LR 10 21 bsoctr bsoctrl cr_field Branch if summary overflow to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 3 Extended mnemonic for bectrl 12 4 cr_field 3 LR 10 28 bsolr bsolrl cr_field Branch if summary overflow to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 3 Extended mnemonic for belrl 12 4 cr_field 3 Alphabetical Instruction Summary LR 10 32 A 15 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bt Operands cr_bit target bta btl btla btctr cr_bit btctrl Function Branch if CRer pit 1 Extended mnemonic for bc 12 cr_bit target Other Registers Changed Extended mnemonic for bca 12 cr_bit target Extended mnemonic for bcl 12 cr_bit target LR Extended mnemonic for bcla 12 cr_bit target Branch if CRer pit 1 to address in CTR Extended mnemonic for
201. 3 18 e Data is latched one cycle following the activation of Ready If 128 cycles elapse from the start of the device paced transfer without the PPC403GA receiving the Ready response from the device a Bus Timeout error will occur Depending on the nature of the bus access this will be either an Instruction Machine Check see Section 2 13 1 3 on page 2 46 or a Data Machine Check see Section 2 13 1 4 on page 2 48 3 16 PPC403GA User s Manual 3 6 2 1 SRAM Device Paced Read Example Figure 3 9 shows the timing of chip select output enable write byte enables the address bus and the data bus relative to the system clock SysClk for a read cycle from SRAM ROM or peripheral device extended by Ready ES 3 gt ka ka ka Wait 00010 Sample Ready Last Cycle Hold 01 CSon 0 CSon 1 CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon 1 C O oe WBEO WBES DTTC CSon 0 CSon 1 0 CSon 1 Latch Data OEon 0 OEon 0 1 OEon 1 4 Debs SSS ee Ready Se LE Not Ready Pe ne Bank Register Settings Seq Line Burst Bus Ready Transfer CSon OEon Transfer Fills Enable Width Enable Wait Hold Bit 13 Bit14 Bits 15 16 Bit17 Bits 18 23 Bit24 Bit 25 Bits 28 30 x 0 XX 1 000010 0 1 0 1 x D 001 i Ready Figure 3 9 Timing Diagram SRAM Read Extended with Ready Memory and Peripheral Interface 3 17 3 6 2 2 SRAM Device Paced
202. 31 MIN Minor Change Level 1 The Minor Change Level field may change due to minor processor updates Except for the value of this field such changes do not impact this document 2 3 2 4 Special Purpose Register General SPRGO SPRG3 These four registers are provided as temporary storage locations As an example the contents of two general purpose registers may be swapped without use of a third general purpose register by using an SPRG as the temporary storage These registers are written using the mtspr instruction and read using the mfspr instruction The SPRGs are privileged for both read and write See Section 2 11 Privileged Mode Operation on page 2 36 for further discussion 2 8 PPC403GA User s Manual 31 Figure 2 6 Special Purpose Register General SPRGO SPRG3 0 31 General Data Privileged user specified no hardware usage 2 3 2 5 Fixed Point Exception Register XER Overflow and carry conditions from arithmetic operations are recorded in XER The Summary Overflow SO field does not indicate that an overflow occurred on the most recent arithmetic operation but that one occurred sometime in the past The only ways to reset SO to zero are via the mtspr instruction with target XER or the merxr instruction The TBC field may be loaded using mtspr with a byte count for load string and store string instructions ang cA S 0 1
203. 59 TS4 85 Debugging 9 17 9 18 Table 9 4 Boundary Scan Chain cont Bit Signal Name Type Pin Signals Enabled 60 TS3 Oo 86 61 AG vO 92 62 A7 vO 93 63 A8 vO 94 64 AQ vO 95 65 A10 vO 96 66 A11 vO 97 67 A12 Oo 98 66 A13 oO 99 69 A14 Oo 103 70 A15 Oo 104 71 A16 Oo 105 72 A17 Oo 106 73 A18 Oo 107 74 A19 Oo 108 75 A20 0 109 76 A21 Oo 110 77 A22 vO 112 78 A23 vO 113 79 A24 vO 114 80 A25 vO 115 81 A26 vO 116 82 A27 vO 117 83 A28 vO 118 84 A29 vO 119 85 WBEO A4 OI 122 86 WBE1 A5 O I 123 87 WBE2 A30 O I 124 88 WBE3 A31 O I 125 89 OE XSize1 O I 126 90 RAW vO 127 PPC403GA User s Manual Table 9 4 Boundary Scan Chain cont Bit Signal Name Type Pin Signals Enabled 91 EOTO TCO VO 128 92 EOT1 TC1 vO 131 93 EOT2 TC2 VO 132 94 EOT3 TC3 xSizeo vO 133 95 HoldAck Oo 134 96 BusReq DMADXFER O 135 97 Error O 136 98 DRAMOE Oo 137 99 DRAMWE O 138 100 AMuxCAS Oo 139 101 CASO 0 142 102 CAST O 143 103 CAS2 O 144 104 CAS3 O 145 105 CS7 RASO O 146 106 CS6 RAST oO 147 107 CS5 RAS2 O 148 108 CS4 RAS3 O 151 109 CS3 oO 152 110 CS2 Oo 153 111 cst 0 154 112 CSO 0 155 113 DMAAO 0 156 114 DMAAT O 157 115 DMAA2 0 158 116 DMAA3 XACK O 159 117 ABus Ena
204. 6 27 28 29 30 31 ch ce rer o ole EG S stp ah b Figure 9 1 Debug Control Register DBCR 0 EDM External Debug Mode 0 Disable 1 Enable WARNING Enabling this mode can cause unexpected results 1 IDM Internal Debug Mode 0 Disable 1 Enable WARNING Enabling this mode can cause unexpected results 9 6 PPC403GA User s Manual RST Reset 00 No Action 01 Core Reset 10 Chip Reset 11 System Reset WARNING Writng 01 10 or 11 to these bits will cause a processor reset to occur Instruction Completion Debug Event 0 Disable 1 Enable BT Branch Taken Debug Event 0 Disable 1 Enable EDE Exception Debug Event Includes critical class of exceptions only while in 0 Disable External Debug Mode 1 Enable TDE TRAP Debug Event 0 Disable 1 Enable FER First Events Remaining Action on Debug Events is enabled when FER 0 If FER 0 a Debug Event causes FER to decrement 13 FT Freeze Timers On Debug Event 0 Free run Timers 1 Freeze Timers 14 IA Instruction Address Compare 1 Enable 0 Disable 1 Enable 15 1A2 Instruction Address Compare 2 Enable 0 Disable 1 Enable 16 DIR Data Address Compare 1 Read Enable 0 Disable 1 Enable 17 18 DIW D1S Data Address Compare 1 Write Enable 0
205. 61 divwuo 10 61 DMA buffered mode transfers 4 4 memory to peripheral 4 6 peripheral to memory 4 9 chained operation 4 23 errors 4 28 fly by burst 4 14 memory to peripheral 4 16 peripheral to memory 4 18 fly by mode transfers 4 10 interrupts 4 27 memory to memory mode transfers 4 19 device paced 4 21 initialted by software 4 19 line burst 4 22 operations 4 3 overview 4 1 packing and unpacking data 4 23 registers 4 29 signals 4 3 transfer priorities 4 26 DMACCO DMACC3 4 36 11 27 DMACRO DMACR3 4 29 11 28 DMACTO DMACT3 4 35 11 30 DMADAO DMADA3 4 34 11 31 DMASAO0 DMASA3 4 34 11 32 DMASR 4 32 11 33 double mapping 2 2 DRAM address multiplexing 3 45 behavior during reset 5 5 example connection 3 44 DRAM banks 2 3 E eieio 10 62 endian modes 2 17 mode control 2 22 non processor memory access 2 21 eqv 10 63 eqv 10 63 ESR 6 13 11 34 EVPR 6 7 11 35 exceptions FIT 6 25 machine check 6 19 PIT 6 24 registers during alignment error 6 22 registers during critical interupt 6 18 registers during debug exceptions 6 27 registers during external interrupts 6 22 registers during FIT interrupt 6 25 registers during machine check 6 19 registers during PIT interrupt 6 24 registers during program exceptions 6 23 registers during protection violation 6 20 registers during system call 6 24 registers during watchdog interrupt 6 26 SRRO SRR1 non critical 6 4 SRR2 SRR3 critical 6 5 execution synchronization 2 4
206. 64 b 110 b vv XX XXXX b vv00 0000 More than one Bank Register is used only when multiple blocks of memory must be described This could occur because the blocks are not contiguous or because the blocks even if contiguous require different memory characteristics for example one block is fast memory and another is slow memory It is an error to have more than one Bank Register describe the same address 3 10 PPC403GA User s Manual 3 6 The SRAM ROM Interface 3 6 1 Signals Five sets of signals are dedicated to the SRAM interface CS0 CS7 Chip selects R W Read not write OE Output enable WBE0 WBE3 Write byte enables Ready An input to allow an external source to control SRAM wait timing The timings of the occurrence of CS OE and WBE signals are programmable via the Bank Registers as follows CS may become active either 0 or 1 clock cycles CSon after the address becomes valid OE may become active either 0 or 1 clock cycles OEon after CS becomes active The Data Bus may be driven with valid data either 0 or 1 clock cycles OEon after CS becomes active on write operations WBE may become active either 0 or 1 clock cycles WBEon after CS becomes active WBE may become inactive either 0 or 1 clock cycles WBEoff before CS becomes inactive CS becomes inactive 1 Wait cycles after the address becomes valid For non burst accesses 0 lt Wait lt 63 For burst access
207. A 2 lt RS j6 31 21 31 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The least significant halfword of register RS is stored into the halfword at the effective address in main storage If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 143 stmw Store Multiple Word stmw RS D RA 47 RS RA D 0 6 11 16 31 EA lt EXTS D RA O r lt RS do while r lt 31 MS EA 4 lt GPR r rer i EA lt EA 4 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The contents of a series of consecutive registers starting with register RS and continuing through GPR 31 are stored into consecutive words in main storage starting at the effective addr
208. A CDBCRg 0 then ICDBDR lt i cache data side A CDBCRo7 0 A CDBCR3 1 then ICDBDR lt i cache data side B f CDBCRo7 1 A CDBCR3 0 then ICDBDR lt i cache tag side A if CDBCR 7 1 A CDBCRg 1 then ICDBDR lt i cache tag side B An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise This instruction is a debugging tool for reading the instruction cache entries for the congruence class specified by EAso 57 The cache information will be read into the Instruction Cache Debug Data Register ICDBDR If CDBCR 37 0 the information will be one word of instruction cache data from the addressed line The word is specified by EAgg o9 If CDBCR3 0 the data wil the A side otherwise from the B side If CDBCRo7 1 the information will be the cache tag If CDBCR3 be from 0 the tag will be from the A side otherwise from the B side Instruction cache tag information is represented as follows 0 21 TAG Cache Tag 22 26 reserved 27 V Cache Line Valid 0 Not valid 1 Valid 28 30 reserved 31 LRU Least Recently Used 0 Not least recently used 1 Least recently used If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e ICDBDR
209. A request the PPC403GA completes any bus operations currently in progress prior to processing this request When the HoldPri input is high the bus master HoldReq has the lowest priority A low priority HoldReq will not gain control of the bus if any of the following is true 1 Any other valid request is pending See Section 3 2 Access Priorities on page 3 3 for the list of possible requests 2 Any bus transfer is in progress 3 Within 3 cycles following a previous operation The 3 cycle blockage is designed to allow successive line fills to continue uninterrupted While the external bus master has control of the bus if the PPC403GA has a bus operation pending the PPC403GA will request to regain control of the bus by activating the BusReq pin To relinquish the bus the external bus master places an inactive level on the HoldReq input All of the external bus master mode signals are qualified with the HoldAck output signal When HoldAck is active multiplexed PPC403GA signals such as EOT3 TC3 XSize0 OE XSize1 DMAR3 XREQ and DMAA3 XACK support external bus master access to PPC403GA DRAM The following outputs are placed in high impedance during HoldAck the data bus D0 31 the address bus A6 29 R W WBE0 3 OE CS0 3 and CS4 7 unless programmed as RAS3 0 Note The bus master interface is a synchronous interface Signals must be presented with timing that is appropriate with respect to the system clock SysClk t
210. B SPRB is read only SPTB SPTB is write only Figure 7 2 represents the serial port registers as they relate to the individual components within the SPU Serial Port Operation 7 3 E SPCTL OPB e Receiver Clock Transmitter Soiree Baud Rate SPRC Generator SPTC gt RecvD t BRDH SPRSR Baud BRDHH SPTB Rate BRDL SPRB A SPTSR D XmitD A SPLS SPHS Figure 7 2 SPU Registers and Buffers The Serial Port Control Register SPCTL controls the overall operation of the serial port It provides the data frame format to the transmitter and receiver number of data stop bits and parity generation detection controls the state of the DTR and RTS signals Active Inactive and specifies the SPU mode of operation Normal Internal Loopback Auto Echo The Line Status Register SPLS and Handshake Status Register SPHS gather status information for the serial port The SPLS contains status information for the receiver RxReady Parity Framing and Overrun Errors and Line Break Detection and the transmitter TxReady and TxEmpty The SPHS contains the status of the input handshake signals CTS DSR Inactive The Baud Rate Generator contains the two baud rate divisor registers BRDH and BRDL Although both baud rate registers are 8 bit registers only the leas
211. B3 0 Channel not currently active 1 Channel currently active 25 27 CT1 Chained Transfer on Channel 1 3 CT3 0 No chained transfer has occurred 1 Chaining has occurred 28 31 reserved DMA Operations 4 33 4 3 3 DMA Destination Address Register DMADA0 DMADA3 The DMA Destination Address Register is a 32 bit register which contains the memory address for buffered or fly by mode transfers For memory to memory mode transfers the DMA Destination Address Register contains the memory destination address When a channel is operating in chained mode the DMA Destination Address Register initially contains the memory transfer address Figure 4 2 shows that when the transfer count reaches zero the DMA Destination Address register is loaded with the contents of the Source Chained Address Register Figure 4 19 shows the DMADA bit definitions In all DMA modes if DMACR DAI 1 the DMADA is incremented by 1 2 or 4 depending on the Transfer Width Peripheral Width If the Transfer Width is Byte the address is always incremented by 1 If the Transfer Width is Halfword and the starting address is halfword aligned the address is incremented by 2 If the Transfer Width is Halfword and the starting address is NOT halfword aligned the Error bit is set for that channel and no transfer occurs If the Transfer Width is Word and the starting address is word aligned the address is incremented by 4 If the Transfer Width is Word and the
212. BF 6 8 BFA 11 13 BI 11 15 BO 6 10 BT 6 10 D 16 31 DCRN 11 20 FXM 12 19 IM Absolute address bit 0 The immediate field represents an address relative to the current instruction address CIA The effective address EA of the branch is either the sum of the LI field sign extended to 32 bits and the branch instruction address or the sum of the BD field sign extended to 32 bits and the branch instruction address 1 The immediate field represents an absolute address The EA of the branch is either the LI field or the BD field sign extended to 32 bits Specifies a bit in the condition register CR used as a source Specifies a bit in the CR used as a source An immediate field specifying a 14 bit signed twos complement branch displacement This field is concatenated on the right with 0b00 and sign extended to 32 bits Specifies a field in the CR used as a target in a compare or merf instruction Specifies a field in the CR used as a source in a merf instruction Specifies a field in the CR used as a source for the condition of a conditional branch instruction Specifies options for conditional branch instructions See Section 2 8 4 Specifies a bit in the CR used as a target as the result of an instruction Specifies a 16 bit signed twos complement integer Specifies a device control register DCR Field mask used to identify CR fields to be updated by the mterf instruction An immediate field used to specify a
213. BR4 BR7 BRn 31 will reflect this selection see Section 3 5 2 Address 4 11 of the starting lowest address of the contiguous block is reflected in BRn 0 7 as described below This is represented by field C of Figure 3 4 The contiguous block of memory that is described by the Bank Register must be selected to be one of the seven sizes shown in Table 3 2 The starting address of the block must be aligned on a boundary that is an integer multiple of the selected size Bits of A 4 11 shown as 0 in Table 3 2 must be zero in the starting address Table 3 2 illustrates field BRn 0 7 which is used to specify the starting address of the block controlled by the bank Bits shown as v are bits which are permitted to be non zero in A 4 11 of the block starting address Bits of BRn 0 7 shown as v are compared to the bits shown as v in A 4 11 to determine whether or not a given address is controlled by Bank Register BRn Bits of BRn 0 7 shown as X are ignored in the comparison Table 3 2 Restrictions on Bank Starting Address Size Size Select Bank Addr Sel eet megabytes BRn 8 10 BRn 0 7 Al4 11 1 b 000 bvvvv vvvv bvvvv vvvv 2 b 001 bivvvv vvvX b vvvv vvv0 4 b 010 b vvvv vv XX b vvvv vv00 8 b 011 b vvvv VXXX b vvvv v000 16 b 100 b vvvv XXXX b vvvv 0000 32 b 101 b vvv X XXXX b vvv0 0000
214. CA lt 0 The sum of the contents of register RA and the contents of the IM field sign extended to 32 bits is placed into register RT XER CA is set to a value determined by the unsigned magnitude of the result of the add operation Registers Altered e RT e XER CA e CRICRO eren so Programming Note addic is one of three instructions that implicitly update CR CRO without having an RC field The other instructions are andi and andis Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 4 Extended Mnemonics for addic Other Mnemonic Operands Function Registers Page Changed subic RT RA IM Subtract EXTS IM from RA O CR CRO 10 12 Place answer in RT Place carry out in XER CA Extended mnemonic for addic RT RA IM 10 12 PPC403GA User s Manual addis Add Immediate Shifted addis RT RA IM 15 RT RA IM 0 6 11 16 31 RT RA O IM 180 If the RA field is 0 the IM field is concatenated on its right with 16 0 bits and placed into register RT If the RA field is nonzero the contents of register RA are added to the contents of the extended IM field The sum is stored into register RT Registers Altered e RT Programming Note An addi instruction stores a sign extended 16 bit value in a GPR An addis instruction followed by an ori instruction stores a 32 bit value in a GPR as shown in the fol
215. CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 1 Extended mnemonic for belrl 4 4 cr_field 1 LR 10 32 bnl bnlia bnili bnila cr_field tar get Branch if not less than Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 0 target Extended mnemonic for bca 4 4 cr_field 0 target Extended mnemonic for bel 4 4 cr_field 0 target LR Extended mnemonic for bcla 4 4 cr_field 0 target LR 10 21 bnictr bnictrl cr_field Branch if not less than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 0 Extended mnemonic for bectrl 4 4 cr_field 0 LR 10 28 bnilr bnillrl cr_field Branch if not less than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 0 Extended mnemonic for belrl 4 4 cr_field 0 Alphabetical Instruction Summary LR 10 32 A 13 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bns Operands cr_field tar get bnsa bnsl bnsla Function Branch if not summary overflow Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 3 target Other Registers Changed Extended mnemonic for bca 4 4 cr_field 3 target Extended mnemonic for bel 4 4 cr_field 3 target LR Extended mnemonic for
216. D RA 32 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RT lt MS EA 4 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The word at the effective address is placed into register RT Registers Altered e RT Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 93 lwzu Load Word and Zero with Update Iwzu RT D RA 33 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RA EA RT lt MS EA 4 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The effective address is placed into register RA The word at the effective address is placed into register RT Registers Altered e RA e RT Invalid Instruction Forms e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 94 PPC403GA User
217. DMA Channel 2 interrupt disabled 1 DMA Channel 2 interrupt enabled 11 D3IE DMA Channel 3 Interrupt Enable 0 DMA Channel 3 interrupt disabled 1 DMA Channel 3 interrupt enabled 12 26 reserved 27 EOIE External Interrupt 0 Enab 0 Interrupt from External Interrupt 0 pin disabled 1 Interrupt from External Interrupt 0 pin enabled ba 28 EIIE External Interrupt 1 Enab 0 Interrupt from External Interrupt 1 pin disabled 1 Interrupt from External Interrupt 1 pin enabled o 29 E2IE External Interrupt 2 Enab 0 Interrupt from External Interrupt 2 pin disabled 1 Interrupt from External Interrupt 2 pin enabled o 30 E3IE External Interrupt 3 Enab 0 Interrupt from External Interrupt 3 pin disabled 1 Interrupt from External Interrupt 3 pin enabled ba 31 EAIE External Interrupt 4 Enab 0 Interrupt from External Interrupt 4 pin disabled 1 Interrupt from External Interrupt 4 pin enabled ba The contents of the EXIER can be loaded into general purpose registers via the move from device control register mfder instruction The contents of a general purpose register can be written to the EXIER via the move to device control register mtdcr instruction 6 1 6 External Interrupt Status Register EXISR This 32 bit register contains the status of the five external hardware interrupts the DMA channel interrupts the JTAG serial port interrupts and the serial po
218. DRAM 3 36 11 11 BR4 BR7 SRAM 3 22 BRDH 7 12 11 13 BRDL 7 12 11 14 CDBCR 11 15 CR 2 11 11 16 CTR 2 6 11 17 DAC1 DAC2 9 10 11 18 DBCR 9 6 11 19 DBSR 9 8 11 22 DCCR 8 8 11 24 DEAR 6 16 11 26 DMACCO DMACC3 4 36 11 27 DMACRO DMACR3 4 29 11 28 DMACT0 DMACT3 4 35 11 30 DMADAO DMADA3 4 34 11 31 DMASAO DMASA3 4 34 11 32 DMASR 4 32 11 33 during alignment error 6 22 during critical interrupt 6 18 during debug exceptions 6 27 during external interrupts 6 22 during FIT interrupt 6 25 during machine check 6 19 during PIT interrupt 6 24 during program exceptions 6 23 during protection violation 6 20 during system call 6 24 during watchdog interrupt 6 26 ESR 6 13 11 34 EVPR 6 7 11 35 EXIER 6 8 6 11 11 36 EXISR 6 9 11 38 GPRO GPR31 2 5 11 40 IAC1 IAC2 9 11 11 41 ICCR 8 4 11 42 ICDBDR 11 44 IOCR 6 11 11 45 LR 2 7 11 47 MSR 2 13 6 2 11 48 PBL1 PBL2 11 50 PBU1 PBU2 11 51 PIT 6 31 11 52 PVR 2 8 11 53 RO R31 2 5 11 40 reserved 11 1 reserved fields 11 1 SPCTL 7 13 11 54 SPHS 7 14 11 55 SPLS 7 15 11 56 SPRB 7 16 11 57 SPRC 7 16 11 58 SPRGO SPRG3 2 8 11 59 SPTB 7 16 11 60 SPTC 7 18 11 61 SRRO 6 4 11 62 SRRO SRR1 non critical 6 4 SRR1 6 4 11 63 SRR2 6 5 11 65 SRR2 SRR3 critical 6 5 SRR3 6 5 11 66 TBHI 6 29 11 68 TBLO 6 29 11 69 TCR 6 33 6 36 11 70 TSR 6 33 6 35 11 71 XER 2 9 11 72 Index registers during reset 6 16 chip reset 6 17 core reset 6 17 system
219. EK KEY lt 4 gt lt gt lt gt lt gt lt gt Wait 1 Burst 1 Burst 1 Burst 1 Hold Cycles Cycles Cycles Cycles Notes 1 WBE 2 3 are address bits 30 31 if the Bus Width is programmed as Byte or Halfword 2 See Table 3 3 for WBEn signal definition based on Bus Width 3 Must program WAIT CSon DLYon WBEoff where DLYon 1 if OEon 1 or WBEon 1 otherwise DLYon 0 When so programmed all signals will retain the values shown in cycle 3 until the WAIT timer expires 4 If hold is programmed gt 001 then all signals will retain the values shown in cycle 12 until the HOLD timer expires Bank Register Settings Seq Line Burst Bus Ready First Burst CSon OEon Transfer Fills Enable Width Enable Wait Wait Hold Bit 13 Bit14 Bits 15 16 Bit17 Bits 18 21 Bits 22 23 Bit 24 Bit 25 Bits 28 30 1 1 XX 0 0100 01 0 1 0 1 001 Figure 3 12 SRAM ROM Burst Write Request with Wait and Hold Memory and Peripheral Interface 3 21 3 6 4 Bank Registers for SRAM Devices Four bank registers BRO through BR3 control SRAM devices only four bank registers BR4 through BR7 can control either SRAM or DRAM devices When configured to control SRAM like devices BRO BR7 control chip selects CS0 CS7 respectively Figure 3 13 shows the fields of BRO BR3 which control only SRAM like devices and also shows the fields of BR4 BR7 when these registers are configured to co
220. ERNAL interrupts As such they also must be enabled by the processor s control mechanisms for external interrupts in addition to enabling them at the source via the DMACR In chapter 6 see the discussion of the External Interrupt Enable Register EXIER fields DOIE D3IE Also in chapter 6 see the discussion of the Machine State Register MSR field EE DMA Operations 4 27 4 2 11 Errors If an error occurs during a DMA transfer on channel n the channel will be disabled and the error will be recorded in the DMASR Error Status bit for this channel DMASR RIn If the DMA Control Register for this channel has been programmed to present interrupts to the processor DMACRr CIE 1 and if the External Interrupt Enable Register has been programmed to enable DMA interrupts from this channel EXIER DnlE 1 then an External Interrupt will occur Whether or not interrupts are enabled errors during DMA transfers are recorded in the Error Status bits RIO RI3 of the DMASR The error may have been posted from the BIU bus protection errors non configured bank errors the bus error input pin and bus timeout errors or from the DMA controller unaligned address errors To determine the type of error examine BESR DMES the DMA Error Status bit of the Bus Error Syndrome Register If no subsequent bus error has occurred between the time of the original DMA error and the time when the BESR is examined then the following is true e I
221. Endian case The alteration described in Table 2 4 depends upon the size of data object being transferred Programming Model 2 19 Table 2 4 Address Alteration in Little Endian Mode Data length Address alteration Type of load or store bytes 1 XOR with 0b111 byte 2 XOR with 0b110 halfword 4 XOR with 0b100 word 8 no change doubleword for reference only Here is a verbal description of the behavior of the alteration in all cases restricted to the bytes within an aligned doubleword e Words reverse position within the doubleword for all word halfword and byte accesses e Halfwords reverse position within each word for all halfword and byte accesses e Bytes reverse position within each halfword for all byte accesses That this results in a Little Endian system as viewed from the processor will now be shown using the first word in the example structure for illustation A word store of 0x1112_1314ina true Little Endian system would produce the following in memory This may be probed with a word load two halfword loads or four byte loads These results would be produced 2 20 14 13 00 01 02 03 Word load from address 00 0x1112_1314 Halfword load from address 00 0x1314 Halfword load from address 02 0x1112 Byte load from address 00 0x14 Byte load from address 01 0x13 Byte load from address 02 0x12 Byte load from address 03 0x11
222. Extended mnemonic for bc 16 0 target bdnza Extended mnemonic for bca 16 0 target bdnzl Extended mnemonic for LR bcl 16 0 target bdnzla Extended mnemonic for LR bcla 16 0 target bdnzf cr_bit target Decrement CTR 10 21 Branch if CTR 0 AND Co pit 0 Extended mnemonic for bc 0 cr_bit target bdnzfa Extended mnemonic for bca 0 cr_bit target bdnzfl Extended mnemonic for LR bcl 0 cr_bit target bdnzfla Extended mnemonic for LR bcla 0 cr_bit target bdnzt cr_bit target Decrement CTR 10 21 Branch if CTR 0 AND CR pit 1 Extended mnemonic for bc 8 cr_bit target bdnzta Extended mnemonic for bca 8 cr_bit target bdnztl Extended mnemonic for LR bcl 8 cr_bit target bdnztla Extended mnemonic for LR bcla 8 cr_bit target 10 22 PPC403GA User s Manual bc Branch Conditional Table 10 6 Extended Mnemonics for bc bca bcl bcla cont Mnemonic bdz bdza bdzl bdzla Operands target Function Decrement CTR Branch if CTR 0 Extended mnemonic for bc 18 0 target Other Registers Changed Extended mnemonic for bca 18 0 target Extended mnemonic for bcl 18 0 target LR Extended mnemonic for bcla 18 0 target LR Page 10 21 bdzf bdzfa bdzfl bdzfla cr_bit target Decrement CTR Branch if CTR 0 AND CRer pit 0 Extended mnemonic for be 2 cr_
223. Extended mnemonic for bel 4 4 cr_field 2 target LR Extended mnemonic for bcla 4 4 cr_field 2 target LR Page 10 21 bnectr cr_field bnectrl Branch if not equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 2 Extended mnemonic for bectrl 4 4 cr_field 2 LR 10 28 bnelr cr_field bnelrl Branch if not equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 2 Extended mnemonic for belrl 4 4 cr_field 2 LR 10 32 bng cr_field tar get bnga bngl bngla Branch if not greater than Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 1 target Extended mnemonic for bca 4 4 cr_field 1 target Extended mnemonic for bel 4 4 cr_field 1 target LR Extended mnemonic for bcla 4 4 cr_field 1 target LR 10 21 A 12 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bngctr bngctrl Operands cr_field Function Branch if not greater than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 1 Other Registers Changed Extended mnemonic for bectrl 4 4 cr_field 1 LR Page 10 28 bnglr bnglrl cr_field Branch if not greater than to address in LR Use
224. Extended mnemonic for tw 5 RA RB twit Trap if RA less than RB Extended mnemonic for tw 16 RA RB twne Trap if RA not equal to RB Extended mnemonic for tw 24 RA RB twng Trap if RA not greater than RB Extended mnemonic for tw 20 RA RB twnl Trap if RA not less than RB Extended mnemonic for tw 12 RA RB Instructions By Category B 27 Table B 4 Extended Mnemonics for PPC403GA cont Other Mnemonic Operands Function Registers Page Changed tweqi RA IM Trap if RA equal to EXTS IM 10 164 Extended mnemonic for twi 4 RA IM twgei Trap if RA greater than or equal to EXTS IM Extended mnemonic for twi 12 RA IM twgti Trap if RA greater than EXTS IM Extended mnemonic for twi 8 RA IM twlei Trap if RA less than or equal to EXTS IM Extended mnemonic for twi 20 RA IM twigei Trap if RA logically greater than or equal to EXTS IM Extended mnemonic for twi 5 RA IM twigti Trap if RA logically greater than EXTS IM Extended mnemonic for twi 1 RA IM twllei Trap if RA logically less than or equal to EXTS IM Extended mnemonic for twi 6 RA IM twllti Trap if RA logically less than EXTS IM Extended mnemonic for twi 2 RA IM twingi Trap if RA logically not greater than EXTS IM Extended mnemonic for twi 6 RA IM twinli Trap if RA logically not less than EXTS IM Extended mnemonic for twi 5 RA IM twlti Trap if RA less than EXTS IM
225. Extended mnemonic for twi 16 RA IM twnei Trap if RA not equal to EXTS IM Extended mnemonic for twi 24 RA IM twngi Trap if RA not greater than EXTS IM Extended mnemonic for twi 20 RA IM twnli Trap if RA not less than EXTS IM Extended mnemonic for twi 12 RA IM B 28 PPC403GA User s Manual B 5 Data Movement Instructions The PPC403GA uses load and store instructions to transfer data between memory and the general purpose registers Load and store instructions operate on byte halfword and word data The data movement instructions also support loading or storing multiple registers character strings and byte reversed data Table B 5 shows the data movement instructions available for use in the PPC403GA Table B 5 Data Movement Instructions Mnemonic Ibz Operands RT D RA Function Load byte from EA RA O EXTS D and pad left with zeroes RT e 40 MS EA 1 Other Registers Changed Page 10 72 Ibzu RT D RA Load byte from EA RA 0 EXTS D and pad left with zeroes RT 40 MS EA 1 Update the base address RA lt EA 10 73 Ibzux RT RA RB Load byte from EA RA O RB and pad left with zeroes RT e 40 MS EA 1 Update the base address RA lt EA 10 74 Ibzx RT RA RB Load byte from EA RA O RB and pad left with zeroes RT lt 240 MS EA 1 10 75 Iha RT D RA
226. FFF FFFF 20 S20 0 noncacheable 1 cacheable 0xA000 0000 OxA7FF FFFF 21 S21 0 noncacheable 1 cacheable 0xA800 0000 OxAFFF FFFF 22 22 0 noncacheable 1 cacheable 0xB000 0000 OxB7FF FFFF 23 S23 0 noncacheable 1 cacheable 0xB800 0000 OxBFFF FFFF 24 S24 0 noncacheable 1 cacheable 0xC000 0000 OxC7FF FFFF 25 25 0 noncacheable 1 cacheable 0xC800 0000 OxCFFF FFFF 26 S26 0 noncacheable 1 cacheable 0xD000 0000 OxD7FF FFFF 27 S27 0 noncacheable 1 cacheable 0xD800 0000 OxDFFF FFFF 28 S28 0 noncacheable 1 cacheable 0xE000 0000 OxE7FF FFFF 29 S29 0 noncacheable 1 cacheable 0xE800 0000 OxEFFF FFFF 30 S30 0 noncacheable 1 cacheable 0xF000 0000 OxF7FF FFFF 31 31 0 noncacheable 1 cacheable OxF800 0000 OxFFFF FFFF 8 2 3 ICU Instructions The following instructions are used to control instruction cache operations For details on these instructions see chapter 10 Instruction Set In the PPC403GA a block is implemented as one cache line of 16 bytes A cache line is the unit of storage affected by all cache block instructions e icbi Instruction cache block invalidate This instruction is issued to invalidate an individual line e icbt Instruction cache block touch A block fill is initiated by issuing this instruction e iccci Instruction cache congruence class invalidate A congruence class of two lines is invalidated by issuing this instruction
227. H m lt MASK MB ME RA e ra m CRI CRO 10 126 rlwnm rlwnm slw RA RS RB MB ME RA RS RB slw Rotate left word then AND with mask re ROTL RS RB 27 31 m lt MASK MB ME RA e ra m Shift left RS by RB 27 34 ne RB 27 31 r ROTL RS n if RB og 0 thenm lt MASK O 31 n elsem lt 320 RA eram CRI CRO CRICRO 10 129 10 131 sraw RA RS RB sraw Shift right algebraic RS by RB o7 31 ne RB 27 31 r ROTL RS 32 n if RB og 0 then m MASK n 31 elsem lt 270 s RS RA amp r a m v s A m XER CA lt s A r A m 0 CRI CRO 10 132 srawi RA RS SH srawi Shift right algebraic RS by SH n amp SH r ROTL RS 32 n m lt MASK n 31 s lt RS o RA amp r a m v s A m XER CA lt s a Ur a ml CR CR0 10 133 B 42 PPC403GA User s Manual Table B 10 Rotate and Shift Instructions cont Other Mnemonic Operands Function Registers Page Changed srw RA RS RB Shift right RS by RB o7 31 10 134 n e RB 27 31 srw r ROTL RS 32 n CR CR0 if RB og 0 then m amp MASK n 31 elsem lt 320 RA lt r am Instructions By Category B 43 B 11 Cache Control Instructions Cache control instructions allow the user to indirectly control the contents
228. IA 46 29 LR CIA 4 NIA amp CIA EXTS BD 20 bcla Branch conditional absolute CTR if BO 0 BD e target16 29 LR lt CIA 4 NIA EXTS BD 20 bectr BO BI Branch conditional to address in CTR CTR if BO 0 10 28 Using CTR at exit from instruction S bectrl NIA CTRo 29 Il 20 CTR if BO 0 LR CIA 4 belr BO BI Branch conditional to address in LR CTR if BO 0 10 32 Using LR at entry to instruction 7 belrl NIA L ns II 20 CTR if BO 0 LR CIA 4 betr Branch unconditionally 10 28 to address in CTR Extended mnemonic for bectr 20 0 betrl Extended mnemonic for LR bccirl 20 0 bdnz target Decrement CTR 10 21 Branch if CTR 0 Extended mnemonic for bc 16 0 target bdnza Extended mnemonic for bca 16 0 target bdnzl Extended mnemonic for LR bcl 16 0 target bdnzla Extended mnemonic for LR bcla 16 0 target A 4 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bdnzir bdnzirl Operands Function Decrement CTR Branch if CTR 0 to address in LR Extended mnemonic for bclr 16 0 Other Registers Changed Extended mnemonic for bclrl 16 0 Page 10 32 bdnzf bdnzfa bdnzfl bdnzfla cr_bit target Decrement CTR Branch if CTR 0 AND CR pit 0 Extended mnemonic for bc 0 cr_bit target Extended mnemonic for bca 0 cr_bit target Extended mnemonic for bcl 0 cr_bit targ
229. If bit 31 has value 1 then the SRAM definition is used If bit 31 has value 0 then the DRAM definition is used BAS BU ERM IEM ARM DAC RAR RR 0 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 30 31 BS SLF BW RCT PM FAC PCC SD Figure 3 22 Bank Registers DRAM Configuration BR4 BR7 0 7 BAS Base Address Select Specifies the starting address of the DRAM bank 8 10 BS Bank Size 000 1 MB bank 001 2 MB bank 010 4 MB bank 011 8 MB bank 100 16 MB bank 101 32 MB bank 110 64 MB bank 111 Reserved 11 12 BU Bank Usage 00 Disabled invalid or unused bank 01 Bank is valid for read only RO 10 Bank is valid for write only WO 11 Bank is valid for read write R W 13 SLF Sequential Line Fills 0 Line fills are Target Word First 1 Line fills are Sequential 14 ERM Early RAS Mode 0 normal RAS activation approximately 1 2 cycle following address valid 1 early RAS activation approximately 1 4 cycle following address valid 15 16 BW Bus Width 00 8 bit bus 01 16 bit bus 10 32 bit bus 11 Reserved 3 36 PPC403GA User s Manual 17 IEM Internal External Multiplex If an external bus master is used an external 0 Address bus multiplexed internally multiplexer must also be used 1 Address bus multiplexed externally 18 RCT RAS Active to CAS Active Timing 0 CAS becomes active one SysClk cycle after RAS becomes active 1 CAS
230. Invalid Instruction Forms e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 73 Ibzux Load Byte and Zero with Update Indexed Ibzux RT RA RB 31 RT RA RB 119 0 6 11 16 21 31 EA lt RB RA 0 RA lt EA RT lt 240 MS EA 1 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The effective address is placed into register RA The byte at the effective address is extended to 32 bits by concatenating 24 0 bits to its left The result is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA e RT Invalid Instruction Forms e Reserved fields e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 74 PPC403GA User s Manual Ibzx RT RA RB Ibzx Load Byte and Zero Indexed 31 RT RA RB 87 0 6 EA lt RB RA O RT lt 0 MS EA 1 21 31 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The byte at the effective address is extended
231. Load halfword from EA RA 0 EXTS D and sign extend RT EXTS MS EA 2 10 76 Ihau RT D RA Load halfword from EA RA O EXTS D and sign extend RT EXTS MS EA 2 Update the base address RA e EA 10 77 Ihaux RT RA RB Load halfword from EA RA O RB and sign extend RT EXTS MS EA 2 Update the base address RA e EA 10 78 Ihax RT RA RB Load halfword from EA RA O RB and sign extend RT EXTS MS EA 2 10 79 Instructions By Category B 29 Table B 5 Data Movement Instructions cont Other Mnemonic Operands Function Registers Page Changed Ihbrx RT RA RB Load halfword from EA RA 0O RB 10 80 then reverse byte order and pad left with zeroes RT 160 MS EA 1 1 MS EA 1 Ihz RT D RA Load halfword from EA RA 0 EXTS D 10 81 and pad left with zeroes RT 160 MS EA 2 Ihzu RT D RA Load halfword from EA RA 0 EXTS D 10 82 and pad left with zeroes RT 160 MS EA 2 Update the base address RA lt EA Ihzux RT RA RB Load halfword from EA RA O RB 10 83 and pad left with zeroes RT 160 MS EA 2 Update the base address RA lt EA Ihzx RT RA RB Load halfword from EA RA 0 RB 10 84 and pad left with zeroes RT 10 MS EA 2 Imw RT D RA Load multiple words starting from
232. M PowerPC 403GA 32 bit RISC embedded controller PPC403GA as a specific implementation of the PowerPC Architecture After a brief overview of the features of the PPC403GA this chapter discusses the layered organization of the PowerPC Architecture The chapter then discusses how the PPC403GA implements a variation of the PowerPC Architecture that has been optimized for embedded control applications PPC403GA compliance with the PowerPC Architecture is discussed Finally the major functional units instruction types and register types of the PPC403GA are discussed along with a block diagram to illustrate principal external interfaces and internal flow of data and control signals 1 1 PPC403GA Overview The PPC403GA 32 bit RISC embedded controller offers high performance and functional integration with low power consumption The PPC403GA RISC CPU executes at sustained speeds approaching one cycle per instruction On chip caches and integrated DRAM and SRAM control functions reduce chip count and design complexity in systems while improving system throughput Features of the PPC403GA include e PowerPC RISC fixed point CPU and PowerPC User Instruction Set Architecture e Thirty two 32 bit general purpose registers e Branch prediction and folding e Single cycle execution for most instructions e Hardware multiplier and divider for faster integer arithmetic e Enhanced string and multiple word handling e Glueless interfaces to DRAM SRAM ROM and per
233. M2M Line Burst mode are summarized inthe following e Line burst only Each transfer request is for 4 words 8 halfwords or 16 bytes e Maximum transfer count 64k lines 256k words e Addresses must be quadword aligned e BIU handles packing unpacking Cycle 10 11 12 13 SysClk lt _ gt 4_ gt it_ gt t ka gt lt 4_ gt _9 9 9 0 1 RAS CAS CAS CAS CAS Prechg RAS CAS CAS CAS CAS Prechg A11 29 w sess re RASn Early RAS Mode Early RAS Mode CAS0 3 LILI NS LS LSVS VI VS DRAMOE DRAMWE delen Latch Data Bus Mode Doan ZD Daia Daia X Dat Daia X Daia X Daia AMuxCAS LA T T kl T TTL Figure 4 15 Memory to Memory Line Burst 2 1 1 1 DRAM 4 22 PPC403GA User s Manual 4 2 7 Packing and Unpacking of Data In transfers between a peripheral and memory the width of the peripheral is considered inviolate The transfer width to the peripheral will be the Peripheral Width byte halfword or word as specified in DMACR PW The DMA controller of the PPC403GA allows this data to be successfully transfered to memory of width different from the peripheral width This is accomplished by packing or unpacking the data while it is in transit packing and unpacking is only supported on the memory side of the transfer Table 4 5 shows the packing unpacking options that are supported Table 4 5 Packing Unpacking Support
234. MACR The Chaining Enable in the DMACR needs to be set Go to Step 9 below Load the DMASA with the chained memory address Load the DMACC with the chained transfer count This will set the Chaining Enable in the DMACR When a Chaining Condition is detected the DMACT is loaded with the DMACC and the DMADA is loaded with the DMASA The Chaining Status bit is set in the DMASR 10 The Chaining Status bit will cause an interrupt if interrupts are enabled 11 If the software wants to continue the chain the Chain Status bit in the DMASR must be reset The sequence can then be repeated starting at step 7 above DMA Operations 4 25 4 2 9 DMA Transfer Priorities Two priority rankings determine the functional priority of the DMA channels and the transfers they perform The first ranking depends on the setting of the channel priority CP field in the DMACR A transfer on a high priority channel takes precedence over a low priority transfer Transfers of the same priority are ranked in order by channel number channel 0 having highest priority The BIU also ranks DMA transfers as either high or low priority A high priority DMA transfer is executed at lower priority than an external master request or a DRAM refresh In turn the high priority DMA transfer executes at a higher priority than a data or instruction cache operation Cache operations take precedence over low priority DMA transfers The priority assigned to a given DMA transfer i
235. MACT3 0 15 reserved 16 31 Number of Transfers remaining DMA Operations 4 35 4 3 6 DMA Chained Count Register DMACC0 DMACC3 When chaining is enabled for Channel 0 3 the DMA Chained Count Register contains the number of transfers in the next DMA transaction for Channel 0 3 When the current DMA transaction is complete the contents of the Channel 0 3 Count Register are loaded with the contents of DMACC0 3 When chaining is disabled for Channel 0 3 the DMA Chained Count Register is not used The DMA Chained Count Register can be accessed via move EI to from device control register mtdcr mfdcr instructions The Chaining Enable bit of the DMA Control Register DMACR0 3 24 is set when the DMACC0 3 is written via mtdcr Figure 4 22 shows the DMACC bit definitions Figure 4 22 DMA Chained Count Registers DMACC0 DMACC3 0 15 reserved 16 31 Chained Count 4 36 PPC403GA User s Manual Reset and Initialization This chapter describes the three types of processor resets the initial state of the processor after each type of reset and the minimum initialization code required to begin executing ER application code Initialization of external system components or system specific chip facilities may need to be performed in addition to the basic initilization code described in this chapter 5 1 Core Chip and System Resets The three different kinds of processor resets tha
236. Mode Write Example The following figure illustrates the timing of a 3 2 2 2 burst DRAM write The Early RAS Mode feature is not illustrated here but it may be used if desired Cycle SysClk A11 29 CAS1 CAS2 CAS3 CAS4 Column 4 RW TN BN BE ZOS n a a a a S S S a N VK IT YLEi VL JY IL JY CAS0 3 DRAMOE DRAMWE Neea D0 31 GH AMuxcAaS L EE E i Kee Data Data Data Data Bank Register Settings Seq Line Fills Bus Width External Mux RAS CAS Timing Page Mode First Access Burst Access Pre chg Cycles Refresh RAS Refresh Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit 20 Bit 21 22 Bit 23 24 Bit 25 Bit 26 Bits 27 30 X 10 0 0 0 01 01 0 x XXXX Figure 3 19 DRAM 3 2 2 2 Page Mode Write Memory and Peripheral Interface 3 33 The following figure illustrates the timing of a 2 1 1 1 burst DRAM write Note that the Early RAS Mode feature is illustrated here Cycle SysClk CAS1 CAS2 CAS3 CAS4 Prechg aes Row KX Col X Col X Cols KX Col Ti ITT TC Leem e D mm D mn E mn D me Den E En EE eg DRAMWE Th ll Do 31 GN C AMuxCAS L A Ath Bank Register Settings Seq Line Bus External RAS CAS Page First Burst Pre chg Refresh
237. Non configured 0 BIU Non configured Error did not occur 1 BIU Non configured Error occurred Interrupts Exceptions and Timers 6 13 IMCB Instruction Machine Check Bus Error 0 BIU Bus Error did not occur 1 BIU Bus Error occurred IMCT Instruction Machine Check Timeout 0 BIU Timeout Error did not occur 1 BIU Timeout Error occurred PEI Program Exception Illegal 0 Illegal Instruction error did not occur 1 Illegal Instruction error occurred PEP Program Exception Privileged 0 Privileged Instruction error did not occur 1 Privileged Instruction error occurred PET Program Exception Trap 0 Trap with successful compare did not occur 1 Trap with successful compare occurred 7 31 reserved 6 1 9 Bus Error Syndrome Register BESR The BESR is a 32 bit register whose bits identify machine check errors on data operations and the type of error See Section 6 2 3 Machine Check Exceptions on page 6 19 for further discussion on data side machine checks Software should clear the BESR before executing the return from critical interrupt rfci On data side errors bus errors on transactions involving the D cache the address of the error will be placed in the BEAR and the description of the error will be placed in the BESR assuming that these registers are not locked by the prior occurrence of a Data Machine Check This information will be locked cannot be ove
238. OR RB with IM 160 10 170 Place answer in RA Alphabetical Instruction Summary A 39 A 40 PPC403GA User s Manual Instructions By Category B 1 Instruction Set Summary Categories Chapter 10 Instruction Set contains detailed descriptions of the instructions their operands and notation Table B 1 summarizes the instruction categories in the PPC403GA instruction set The instructions within each category are listed in subsequent tables Table B 1 PPC403GA Instruction Set Summary Instruction Category Data Movement Base Instructions load store Arithmetic Logical add subtract negate multiply divide and or xor nand nor xnor sign extension count leading zeros andc orc Condition Register Logical crand crnor crxnor crxor crandc crorc crnand cror cr move Branch branch branch conditional branch to LR branch to CTR Comparison compare algebraic compare logical compare immediate Rotate Shift rotate rotate and mask shift left shift righ Cache Control invalidate touch zero flush store dcread icread Interrupt Control write to external interrupt enable bit move to from machine state register return from interrupt return from critical interrupt Processor system call synchronize eieio move to from device control registers move to Management from special purpose registers mtcrf mfcr mtmsr mfmsr B 2 Instructions Specific
239. Other Registers Changed Extended mnemonic for bclrl 8 cr_bit LR Page 10 32 bdz bdza bdzl bdzla target Decrement CTR Branch if CTR 0 Extended mnemonic for bc 18 0 target Extended mnemonic for bca 18 0 target Extended mnemonic for bcl 18 0 target LR Extended mnemonic for bcla 18 0 target LR 10 21 bdzir bdzirl Decrement CTR Branch if CTR 0 to address in LR Extended mnemonic for bclr 18 0 Extended mnemonic for belrl 18 0 LR 10 32 bdzf bdzfa bdzfl bdzfla cr_bit target Decrement CTR Branch if CTR 0 AND CR pit 0 Extended mnemonic for bc 2 cr_bit target Extended mnemonic for bca 2 cr_bit target Extended mnemonic for bel 2 cr_bit target LR Extended mnemonic for bcla 2 cr_bit target LR 10 21 Instructions By Category B 7 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bdzflr Operands cr_bit bdzfirl Function Decrement CTR Branch if CTR 0 AND Co pit 0 to address in LR E Extended mnemonic for bclr 2 cr_bit Other Registers Changed Extended mnemonic for belrl 2 cr_bit LR Page 10 32 bdzt cr_bit target bdzta bdztl bdztla Decrement CTR Branch if CTR 0 AND CR pit 1 Extended mnemonic for bc 10 cr_bit target Extended mnemonic for bca 10 cr_bit ta
240. OxA7FF FFFF 21 21 0 noncacheable 1 cacheab 0xA800 0000 OxAFFF FFFF 22 22 0 noncacheable 1 cacheabl 0xB000 0000 OxB7FF FFFF 23 23 0 noncacheable 1 cacheab 0xB800 0000 OxBFFF FFFF 24 S24 0 noncacheable 1 cacheabl 0xC000 0000 OxC7FF FFFF 25 S25 0 noncacheable 1 cacheab 0xC800 0000 OxCFFF FFFF 26 S26 0 noncacheable 1 cacheab 0xD000 0000 OxD7FF FFFF 27 S27 0 noncacheable 1 cacheab 0xD800 0000 OxDFFF FFFF 28 S28 0 noncacheable 1 cacheab 0xE000 0000 OxE7FF FFFF 29 S29 0 noncacheable 1 cacheab 0xE800 0000 OxEFFF FFFF 30 S30 0 noncacheable 1 cacheab 0xF000 0000 OxF7FF FFFF 31 S31 0 noncacheable 1 cacheab OxF800 0000 OxFFFF FFFF 8 3 3 DCU Instructions Data cache flushes and fills are triggered by load store and cache control instructions executed by the processor Cache control instructions are provided to fill flush or invalidate cache lines The following instructions are used to control data cache operations For details on these instructions see chapter 10 Instruction Set dcbf data cache block flush This instruction causes a line if found in the cache and marked as modified to be flushed to external memory the line is marked invalid This operation is performed regardless of whether the address is marked as cacheable in the DCCR dcbi data cache block invalidate This instruction causes a line if found in the cache to be invalidate
241. PC403GA to determine the direction of the transfer and whether to activate DRAMOE or DRAMWE The EOT3 TC3 XSize0 and OE XSize1 input signals are also sampled by the PPC403GA during any valid request cycle These signals are used by the PPC403GA to determine the size of the transfer and whether the request is for a single transfer or a burst transfer Table 3 10 describes the XSize0 1 definitions along with the Bus Width bit settings in the corresponding bank register Table 3 10 XSize0 1 Bit Definitions XSize0 1 Bus Width Operation 00 00 01 or 10 Byte Transfer 01 00 01 or 10 Halfword Transfer 10 00 01 or 10 Fullword Transfer 11 00 Burst Byte Transfer 11 01 Burst Halfword Transfer 11 10 Burst Fullword Transfer For single transfers any width byte halfword or word of external data may be exchanged with any width of memory device if the transfer size is greater than the bus width the PPC403GA will initiate a burst transfer at the bus width returning an XACK for each transaction For burst transfers the width of the external data must be the same as the width of the memory device When the external bus is in the HoldAck state a set of input signals including WBEO A4 WBE 1 A5 A6 A11 A22 A29 WBE2 A30 WBE3 A31 are sampled by the PPC403GA during any valid request cycle Address bus bits 4 11 are compared to the bank control registers bits 0 7 to determine which DRAM bank the externa
242. Physical Layout ccceeeeeeeeeeeeeeeeneeteneeeeeeeee 9 14 Bus Address Error Register BEAR AAA 11 7 Bus Error Syndrome Register DEG 11 8 Bank Registers SRAM Configuration DGPO DA 11 9 Bank Registers DRAM Configuration DPA DPI 11 11 Baud Rate Divisor High Register BRDH AAA 11 13 Baud Rate Divisor Low Register BRDL AAA 11 14 Cache Debug Control Register ODBOR A 11 15 Condition Register CH 11 16 Count Register CTR e Neger ee ewes nent are 11 17 Data Address Compare Registers DAC1 DAC2 00 eeeeeeeeeseeeteeeeeeeeneeeee 11 18 Debug Control Register DBOR AA 11 19 Debug Status Register DBSR eeceeeceseeeeeeeeeeeeeeeeeeeeeeaeeeeeeseeeseaeeeaeete 11 22 Data Cache Cacheability Register DCCR 0 00 eceeeceeeeeeeeeeeeeeeneeteeeeeneeees 11 24 Figures xix Figure 11 14 Figure 11 15 Figure 11 16 Figure 11 17 Figure 11 18 Figure 11 19 Figure 11 20 Figure 11 21 Figure 11 22 Figure 11 23 Figure 11 24 Figure 11 25 Figure 11 26 Figure 11 27 Figure 11 28 Figure 11 29 Figure 11 30 Figure 11 31 Figure 11 32 Figure 11 33 Figure 11 34 Figure 11 35 Figure 11 36 Figure 11 37 Figure 11 38 Figure 11 39 Figure 11 40 Figure 11 41 Figure 11 42 Figure 11 43 Figure 11 44 Figure 11 45 Figure 11 46 Figure 11 47 Figure 11 48 Figure 11 49 Figure 11 50 Figure 11 51 Figure 11 52 Data Exception Address Register DEAR AAA 11 26 DMA Chained Count Register
243. Pin Sc Pin Signal Names 1 GND 23 INT2 65 D18 97 ANI 129 Vpp 2 DMARO 34 INT3 66 D19 98 A12 130 GND 3 DMART 35 INT4 67 D20 99 A13 131 EOTI TC1 4 DMAR2 36 CINT 68 D21 100 Vpp 132 EOT2 TC2 5 DMAR3 XREQ 37 TestC HoldPri 69 Vpp 101 GND 133 EOT3 TC3 xSize0 6 TCK 38 TestD 70 GND 102 GND 134 HoldAck 7 TMS 39 IVR 71 D22 103 A14 135 BusReq DMADXFER 8 TDI 40 Vpp 72 D23 104 A15 136 Error 9 Halt 41 GND 73 D24 105 A16 137 DRAMOE 10 GND 42 DO 74 D25 106 A17 138 DRAMWE 11 Bootw 43 D1 75 D26 107 A18 139 AMuxCAS 13 BusError 44 D2 76 D27 108 A19 140 Ion 13 Ready 45 D3 77 D28 109 A20 141 GND 14 HoldReq 46 D4 78 D29 110 A21 142 CASO 15 GND 47 D5 79 D30 111 GND 143 CAST 16 TDO 48 D6 80 Vpp 112 A22 144 CAS2 17 TSO A8 Vpp Si GND 113 A23 145 CAS3 18 TS1 50 GND 82 D31 114 A24 146 CS7 RASO 19 TS2 51 D7 83 TS6 115 A25 147 CS6 RAS1 20 Vpp 52 D8 84 TS5 116 A26 148 CS5 RAS2 21 Vpp 53 D9 85 TS4 117 A27 149 Vpp 22 SysClk 54 D10 86 TS3 118 A28 150 GND 23 TestA 55 D11 87 XmitD 119 A29 151 CS4 RAS3 24 TestB 56 D12 88 DTR RTS 120 Vpp 152 CS3 25 TimerClk 57 D13 89 Vpp 121 GND 153 CS2 26 SerClk 58 D14 90 GND 122 WBEO A4 154 CS1 27 RecvD 59 GND oi Reset 123 WBE1 A5 155 CSO 28 DSR CTS 60 GND 92 A6 124 WBE2 A30 156 DMAAO 29 GND EI Ven 93 A7 125 WBE3 A31 157 DMAAT 30 GND 62 D15 94 A8 126 OE XSize1 158 DMAA2 31 INTO 63 D
244. PowerPC 403GA User s Manual Second Edition March 1995 This edition of IBM PowerPC 403GA User s Manual applies to the IBM PPC403GA JC 32 bit embedded controller as well as to subsequent IBM PowerPC 400 embedded controllers until other wise indicated in new versions or technical newsletters The following paragraph does not apply to the United Kingdom or any country where such pro visions are inconsistent with local law INTERNATIONAL BUSINESS MACHINES CORPORA TION PROVIDES THIS MANUAL AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Some states do not allow disclaimer of express or implied warranties in certain transactions therefore this statement may not apply to you IBM does not warrant that the products in this publication whether individually or as one or more groups will meet your requirements or that the publication or the accompanying product descriptions are error free This publication could contain technical inaccuracies or typographical errors Changes are periodically made to the information herein these changes will be incorporated in new editions of the publication IBM may make improvements and or changes in the product s and or program s described in this publication at any time It is possible that this publication may contain references to or information about IBM products m
245. Protection exceptions are enabled 29 PX Protection Exclusive Mode 0 Protection mode is inclusive as defined in Section 2 10 on page 2 33 1 Protection mode is exclusive as defined in Section 2 10 on page 2 33 11 66 PPC403GA User s Manual SRR3 cont 30 reserved 31 LE Little Endian 0 Processor executes in Big Endian mode 1 Processor executes in Little Endian mode Register Summary 11 67 TBHI TBHI see also Section 6 3 2 on page 6 29 SPR Figure 11 48 Time Base High Register TBHI 0 7 reserved 8 31 Time High Current count high order 11 68 PPC403GA User s Manual TBLO TBLO see also Section 6 3 2 on page 6 29 SPR 9 31 Figure 11 49 Time Base Low Register TBLO 0 31 Time Low Current count lo order Register Summary 11 69 TCR TCR see also Section 6 3 7 on page 6 36 SPR WP WIE FP ARE 0 1 2 3 4 5 6 7 8 9 10 31 Figure 11 50 Timer Control Register TCR 0 1 WP Watchdog Period 00 217 clocks 01 221 clocks 10 225 clocks 11 229 clocks 2 3 WRC Watchdog Reset Control TCR 2 3 resets to 00 00 No Watchdog reset will occur This field may be set by software but only once 01 Core reset will be forced by the Watchdog prior to reset 10 Chip reset will be forced by the Watchdog This field cannot be cleared by software 11
246. R The data exception address register DEAR is a 32 bit register which contains the address of the access where a synchronous precise data error occurred The DEAR contents are applicable in alignment and protection violation exceptions Figure 6 13 shows the DEAR bit definitions 31 Figure 6 13 Data Exception Address Register DEAR 0 31 Address of Data Error synchronous The contents of the DEAR can be loaded into a general purpose register via the move from special purpose register mfspr instruction The DEAR is read only and can not be written via a move to special purpose register mtspr instruction 6 2 Exception Causes and Machine State 6 2 1 Reset Exceptions The PPC403GA has three reset modes core reset chip reset and system reset A core reset resets the resources within the core but not the peripherals outside the core A core reset is the only reset which preserves the contents of the bank registers A chip reset resets all resources contained in the chip but does not drive the reset pin on the PPC403GA A system reset is similar to a chip reset however the reset pin on the PPC403GA is driven active to initiate a system reset 6 16 PPC403GA User s Manual For all reset modes the MSR WE ME PR CE DE PE PX EE bits are all set to 0 to disable interrupts until reset processing is complete and the processor begins execution at address OxFFFF FFFC Each reset mode is described i
247. R CRO rlwinm RA RS 0 n 31 10 126 PPC403GA User s Manual rlwinm Rotate Left Word Immediate then AND with Mask Table 10 26 Extended Mnemonics for rlwinm rlwinm cont Other Mnemonic Operands Function Registers Page Changed clrlslwi RA RS b n Clear left and shift left immediate 10 126 n lt b lt 32 RA b n 31 n E RS p 31 RA 32 n 31 amp 0 RA o p n 1 lt PO Extended mnemonic for rlwinm RA RS n b n 31 n clrisiwi Extended mnemonic for CR CRO rlwinm RA RS n b n 31 n clrrwi RA RS n Clear right immediate n lt 32 10 126 RA 32 n 31 lt 0 Extended mnemonic for rlwinm RA RS 0 0 31 n clrrwi Extended mnemonic for CR CRO rlwinm RA RS 0 0 31 n extlwi RA RS n b Extract and left justify immediate n gt 0 10 126 RA o n 1 lt lt _ RS b b n 1 D in lt 0 Extended mnemonic for rlwinm RA RS b 0 n 1 extlwi Extended mnemonic for CR CRO rlwinm RA RS b 0 n 1 extrwi RA RS n b Extract and right justify immediate n gt 0 10 126 RA 32 n 31 _ RS p ban 1 RA o 31 n lt 9 0 Extended mnemonic for rlwinm RA RS b n 32 n 31 extrwi Extended mnemonic for CR CRO rlwinm RA RS b n 32 n 31 rotlwi RA RS n Rotate left immediate 10 126 RA lt ROTL RS n Extended mnemonic for rlwinm RA RS n 0 31 rotlwi Extended mnemonic for CR CRO rlwinm RA RS n 0 31 rotrwi RA RS
248. R0 10 126 clrislwi clrislwi RA RS b n Clear left and shift left immediate n lt b lt 32 RA b n 31 n lt RS p 31 RA 32 n 31 lt 0 RA o b n 1 bag Extended mnemonic for rlwinm RA RS n b n 31 n Extended mnemonic for rlwinm RA RS n b n 31 n CRI CRO 10 126 clrrwi clrrwi cmp RA RS n BF 0 RA RB Clear right immediate n lt 32 RA 32 n 31 e 0 Extended mnemonic for rlwinm RA RS 0 0 31 n Extended mnemonic for rlwinm RA RS 0 0 31 n Compare RA to RB signed Results in CR CRn where n BF CRICRO 10 126 10 37 cmpi BF 0 RA IM Compare RA to EXTS IM signed Results in CR CRn where n BF 10 38 cmpl BF 0 RA RB Compare RA to RB unsigned Results in CR CRn where n BF 10 39 cmpli BF 0 RA IM Compare RA to 180 IM unsigned Results in CR CRn where n BF 10 40 Alphabetical Instruction Summary A 17 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic cmplw Operands BF RA RB Function Compare Logical Word Use CRO if BF is omitted Extended mnemonic for cmpl BF 0 RA RB Other Registers Changed Page 10 39 cmplwi BF RA IM Compare Logical Word Immediate Use CRO if BF is omitted Extended mnemonic for cmpli BF 0 RA IM 10 40 cmpw BF RA RB Compare Word Use CRO
249. R1 Loaded with the contents of the MSR MSR WE 0 PR 0 CE Unchanged EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged PC EVPR 0 15 Ox0600 6 22 PPC403GA User s Manual Table 6 6 Register Settings during Alignment Error Exceptions cont DEAR Loaded with the address that caused the alignment violation 6 2 7 Program Exceptions Program Exceptions are caused by attempting to execute an illegal operation by executing a trap instruction with conditions satisfied or by attempting to execute a privileged instruction while in the problem state When an illegal operation exception is detected the PPC403GA does not execute the instruction causing the exception and stores its address in SRRO Trap instructions can be used as either a program exception or as a debug event When a trap instruction is detected as a program exception i e trap is not enabled as a debug event via the trap enable bit in the debug control register DBCR the PPC403GA stores the address of the trap instruction in SRRO e The current contents of the MSR are loaded into SRR1 The MSR bits are loaded with the values shown in Table 6 7 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0700 Exception processing begins at the new address in the program counter Executing the return from interrupt instructio
250. RA x RB signed RT lt prodsz 63 The 64 bit signed product of register RA and register RB is formed The least significant 32 bits of the result is placed into register RT If all bits in postions 0 through 31 of the 64 bit product do not equal bit 0 of the result in register RT and OE 1 XER SO OV are set to 1 Registers Altered e RT e CR CRO z ct a so H Re contains 1 e XER SO OV if OE 1 Programming Note The least significant 32 bits of the product are correct regardless of whether register RA and register RB are interpreted as signed or unsigned numbers Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 115 nand NAND nand RA RS RB Rc 0 nand RA RS RB Re 1 31 RS RA RB 476 Rc 0 6 11 16 21 31 RA lt RS A RB The contents of register RS is ANDed with the contents of register RB the ones complement of the result is placed into register RA Registers Altered e RA e CR CRO r ecr ca so H Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 116 PPC403GA User s Manual neg Negate neg RT RA OE 0 Rc 0 neg RT RA OE 0 Re 1 nego RT RA OE 1 Rc 0 nego RT RA OE 1 Re 1 31 RT RA OE 104 Re 0 6 27 22 31 RT lt RA 1 The twos complement of the contents of register RA are placed into
251. RT RA 1 Rce 0 addzeo RT RA 1 Re 1 31 RT RA OE 202 Re 0 6 T 16 21 22 31 RT lt RA XER CA if RA XER CA 232 1 then XER CA lt 1 else XER CA lt 0 The sum of the contents of register RA and XER CA is placed into register RT XER CA is set to a value determined by the unsigned magnitude of the result of the add operation Registers Altered e RT e XER CA e CR CRO r ct a so H Re contains 1 e XER SO OV if OE contains 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 15 and AND and RA RS RB Rc 0 and RA RS RB Rc 1 31 RS RA RB 28 Re 0 6 11 16 21 31 RA lt RS A RB The contents of register RS is ANDed with the contents of register RB and the result is placed into register RA Registers Altered e RA e CR CRO z ct a so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 16 PPC403GA User s Manual andc AND with Complement andc RA RS RB Rc 0 andc RA RS RB Rc 1 31 RS RA RB 60 Re 0 6 11 16 21 31 RA RS A RB The contents of register RS is ANDed with the ones complement of the contents of register RB the result is placed into register RA Registers Altered e RA e CR CRO z ct ca so if Re contains 1 Architecture Note This instructi
252. Receiver is source for DMA channel 3 3 EIE Error Interrupt Enable 0 Receiver error interrupt disabled 1 Receiver error interrupts enabled 4 PME Pause Mode Enable 0 RTS is controlled by software 1 RTS is controlled by hardware 5 7 reserved 7 3 7 Serial Port Transmit Buffer SPTB The SPTB holds characters to be transmitted using the SPTSR If the serial port transmitter 7 16 PPC403GA User s Manual is enabled and the SPTSR is empty data loaded into the SPTB is loaded into the SPTSR and transmitted When data is loaded from the SPTB into the SPTSR the TBR bit in the SPLS is reset to 0 and the TSR bit in the SPLS is reset to 1 Figure 7 10 shows the SPTB field Figure 7 10 Serial Port Transmit Buffer SPTB 0 7 Transmit Data Data to be transmitted by the SPTSR Serial Port Operation 7 17 7 3 8 Serial Port Transmit Command Register SPTC Figure 7 11 shows the SPTC fields e TIE SPE PGM o Si Wi Feo 6 7 DME EIE TB Figure 7 11 Serial Port Transmitter Command Register SPTC 0 ET Enable Transmitter Chip Reset or System Reset clears to 0 0 Disable transmitter 1 Enable transmitter 1 2 DME DMA Mode Interrupt Enable 00 DMA disabled TBR interrupt disabled 01 DMA disabled TBR interrupt enabled 10 DMA enabled serial port transmitter is DMA channel 2 destination 11 DMA enabled serial port transmi
253. Rs into the cache block without incurring the latency of a cache miss dcbtst is considered a load with respect to memory protection and cannot cause a protection exception Debugging Note This instruction is considered a read with respect to data address compare DAC debug exceptions See Chapter 9 for more information about PPC403GA on chip debug facilities Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture 10 54 PPC403GA User s Manual dcbz Data Cache Block Set to Zero dcbz RA RB 31 RA RB 1014 0 6 Ti 16 21 31 EA lt RA 0 RB DCBZ EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise If the data block at the effective address is in the data cache and the effective address is marked as cacheable in the DCCR the data in the cache block is set to 0 If the data block at the effective address is not in the data cache and the effective address is marked as cacheable in the DCCR a cache block is established and set to 0 Note that nothing is read from main storage as described in the following programming note If the effective address is marked as non cacheable in the DCCR an alignment exception occurs If instruction bit 31 contains 1 the contents of CR CRO are undefined Regis
254. RxReady is reported to the SPLS register Data characters that contain errors are discarded and the error condition framing parity overrun or line breaks is posted in the SPLS register For a complete bit description of these registers refer to Section 7 3 SPU Register Descriptions 7 2 SPU Operations 7 2 1 SPU Baud Rate Generator The frequency used to transmit and receive data through the SPU is derived from the Baud Rate Generator Clock input and the contents of the baud rate divisor registers The Baud Rate Generator Clock input can come from either the processor clock SysClk or an external clock source from the SerClk input pin To select SysClk as the Baud Rate Generator Clock input the serial port clock source SCS bit in the Input Output Configuration Register IOCR is set to 0 Setting the SCS bit to 1 forces the external clock source on the SerClk input pin to be selected as the Baud Rate Generator Clock Note that in this case the SerClk external clock source frequency must be less than one half of the SysClk frequency The baud rate generator divides the rate of the Baud Rate Generator Clock by the value obtained by the concatenated value of the two baud rate divisor registers BRDH and BRDL resulting in a clock frequency 16 times faster than the desired baud rate As shown in Figure 7 1 the output from the baud rate generator drives the transmitter and receiver baud rate inputs Those inputs are then divided by
255. S refresh operation RAR 0 results in RAS active time of 1 5 system cycles and RAR 1 results in RAS active time of 2 5 cycles This parameter allows flexibility in optimizing system performance The RR field bits 27 30 selects the CAS before RAS refresh rate DRAM refresh is transparent to the user Refresh rates are selectable from 64 SysClk cycles to 6144 SysClk cycles as shown in Table 3 4 A refresh completes in four clock cycles if RAR 0 or five clock cycles if RAR 1 If field ARM 1 Alternate Refresh Mode selected use Table 3 5 to define the RR field values used with the alternate refresh action See Section 3 7 3 on page 3 42 for a full discussion of Alternate Refresh Mode e The SD field bit 31 specifies the usage SRAM or DRAM of the bank register for bank registers BR4 BR7 which have dual usage For those registers SD 1 indicates SRAM and SD 0 indicates DRAM For BRO BR3 only SRAM usage is defined and field SD is reserved always 0 3 40 PPC403GA User s Manual Table 3 4 RR Field for Normal Refresh Mode Refresh Period Refresh Period Value Interval usec usec SysClk 33 MHz SysClk 25 MHz 0000 No refresh 0001 Reserved 0010 64 SysClk cycles 1 92 2 56 0011 96 SysClk cycles 2 88 3 84 0100 128 SysClk cycles 3 84 5 12 0101 192 SysClk cycles 5 76 7 68 0110 256 SysClk cycles 7 68 10 24 0111 384 SysClk cycles 11 52 15 36 1000 512 SysClk cycles 15
256. SR input has gone inactive of the SPHS 1 cs CTS Input Inactive Error To reset the CS bit the application software 0 CTS input is active must store a 1 in this bit location at the address 1 CTS input has gone inactive of the SPHS 27 reserved Register Summary 11 55 SPLS SPLS see also Section 7 3 4 on page 7 15 MMIO il ae 0 1 2 T T 7 5 TOR 3 de Pe Figure 11 38 Serial Port Line Status Register SPLS 0 RBR Receive Buffer Ready Reset by hardware when received data is read 0 Receive buffer is not full from the SPRB into a GPR using a load instruc 1 Receive buffer is full tion or during chip reset can be reset by soft ware 1 FE Framing Error Must be reset by software 0 No framing error detected 1 Framing error detected 2 OE Overrun Error Must be reset by software 0 No overrun error detected 1 Overrun error detected 3 PE Parity Error Must be reset by software 0 No parity error detected 1 Parity error detected 4 LB Line Break Must be reset by software 0 No line break detected 1 Line break detected 5 TBR Transmit Buffer Ready TBR is set to 1 whenever the SPTSR is loaded 0 Transmit buffer is full not ready with a character from the SPTB TBR is reset to 1 Transmit buffer is empty and ready 0 when a new character is stored in the SPTB 6 TSR Transmitter Shift Register Ready TSR is set to 1 whenever the SPTSR i
257. Software running with MSR ME disabled can sample the ESR to determine if IMCs have occurred during the disabled execution When MSR ME is re enabled if a new IMC exception occurs then its type will be recorded Programming Model 2 47 in the ESR and the Machine Check interrupt will be invoked However re enabling MSR ME will NOT cause a Machine Check interrupt to occur simply due to the presence of the ESR bit indicating the type of the IMC that occurred while MSR ME was disabled The IMC must occur while MSR ME is enabled for the Machine Check interrupt to be taken Software should in general clear the ESR bits prior to returning from a Machine Check interrupt to avoid any ambiguity when handling subsequent Machine Check or Program exceptions Finally if an Instruction Machine Check occurs while MSR ME is disabled and the instruction which had the IMC also has a flaw appropriate to a Program Exception for example an illegal instruction then both ESR bits will be set The Machine Check interrupt is disabled because MSR ME is off but there is no mechanism for disabling the Program Exception Therefore the Program Exception vector will be taken 2 13 1 4 Data Machine Check Handling When an external bus error timeout BIU non configured error or BIU protection error occurs while attempting data accesses a Data Machine Check DMC exception will occur When a data access causes the machine check the address which caused the ma
258. T Caches Disabled Disabled Watchdog Timer Reset Disabled Disabled Wait State Disabled Disabled Interrupts Disabled Disabled Protection Disabled Disabled Processor Mode Supervisor Mode Supervisor Mode Serial Port Receive Buffer Status Empty Unchanged Transmit Buffer Status Empty Unchanged Transmit Shifter Status Empty Unchanged Loopback Unchanged Unchanged Auto echo Disabled Unchanged Data Terminal Ready Inactive Unchanged Request to Send Inactive Unchanged Receiver Disabled Unchanged Transmitter Disabled Unchanged Serial Clock System Clock Unchanged Memory Bank 0 Bank Address OxFF Unchanged Bank Size 1MB Unchanged Bus Width Set by BootW signal during most recent System Reset Unchanged Ready Disabled Unchanged Transfer Wait 64 cycles Unchanged Chip Select 1 CycleTurn On Delay Unchanged Output Enable 1 Cycle Turn On Delay Unchanged Write Byte Enable 1 Cycle Turn On Delay Unchanged Write Byte Enable 1 Cycle Advance Turn off Unchanged Transfer Hold 7 Cycles Unchanged Line Fills Target Word First Unchanged Burst Mode Disabled Unchanged Bank Usage Read and Write Unchanged Memory Type SRAM Unchanged Memory Banks 1 7 Disabled Unchanged Timer Clock Source System Clock Unchanged 5 2 PPC403GA User s Manual 5 3 Register Contents After A Reset The initial processor state is a controlled by the register contents after a reset The initial register contents varies with the type of reset that has occu
259. T RA IM Subtract EXTS IM from RA 0 CR CRO 10 12 Place answer in RT Place carry out in XER CA Extended mnemonic for addic RT RA IM subis RT RA IM Subtract IM 160 from RA O 10 13 Place answer in RT Extended mnemonic for addis RT RA IM Alphabetical Instruction Summary A 35 Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed sync Synchronization All instructions that pre 10 161 cede sync complete before any instruc tions that follow sync begin When sync completes all storage accesses initiated prior to sync will have completed A 36 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed trap RA RB Trap unconditionally 10 162 Extended mnemonic for tw 31 RA RB tweq Trap if RA equal to RB Extended mnemonic for tw 4 RA RB twge Trap if RA greater than or equal to RB Extended mnemonic for tw 12 RA RB twgt Trap if RA greater than RB Extended mnemonic for tw 8 RA RB twle Trap if RA less than or equal to RB Extended mnemonic for tw 20 RA RB twige Trap if RA logically greater than or equal to RB Extended mnemonic for tw 5 RA RB twigt Trap if RA logically greater than RB Extended mnemonic for tw 1 RA RB
260. The only effect of this double mapping is to represent the external location in two different cacheability regions Those regions may be cacheable non cacheable in any combination controlled by the DCCR and ICCR bits Meaningful use of this may be made as in the example in Section 2 2 1 on page 2 2 It is tempting to refer to AO as the cacheability control bit but this is not accurate AO participates in selecting DCCR and ICCR bits It is the bits of the DCCR and ICCR which perform the cacheability control For example if all bits of the DCCR are zero then all regions are non cacheable for loads and stores regardless of the value of AO 3 8 PPC403GA User s Manual 3 5 2 SRAM DRAM OPB Addresses Access to external memory of the PPC403GA occurs via a Bus Interface Unit BIU The BIU is a memory controller providing numerous services examples include wait state generation and DRAM refresh The BIU also imposes some addressing restrictions All SRAM and devices such as PROM that use similar control signals must have address 1 3 b 111 All DRAM must have address 1 3 b 000 Any address for which address 1 3 is neither b 000 nor b 111 is reserved on the On Chip Peripheral Bus OPB To inform the BIU of the characteristics of the attached external devices one or more Bank Registers must be programmed The PPC403GA contains eight Bank Registers BRO BR7 Four of these BRO BR3 can control only SRAM
261. This instruction is part of the PowerPC User Instruction Set Architecture 10 98 PPC403GA User s Manual mfcr RT mfcr Move From Condition Register 31 RT RT lt CR The contents of the CR are placed into register RT 21 If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 31 10 99 This instruction is specific to the PowerPC Embedded Controller family mfdcr Move from Device Control Register mfder RT DCRN 31 RT DCRF 323 0 6 T1 21 31 DCRN lt DCRF DCRFo 4 RT lt DCR DCRN The contents of the DCR specified by the DCRF field are placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Programming Note The DCH number DCRN specified in the assembler language coding of the mfder instruction refers to an actual DCR number see Table 11 2 The assembler handles the unusual register number encoding to generate the DCRF field Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other Powe
262. V Instructions By Category B 37 Table B 6 Arithmetic and Logical Instructions cont Other Mnemonic Operands Function Registers Page Changed subfic RT RA IM Subtract RA from EXTS IM 10 158 RT lt RA EXTS IM 1 Place carry out in XER CA subme RT RA RB Subtract RA from 1 with carry in 10 159 RT lt RA 1 XER CA subme Place carry out in XER CA CR CRO submeo XER SO OV submeo CR CRO XER SO OV subfze RT RA RB Subtract RA from zero with carry in 10 160 RT lt RA XER CA subize Place carry out in XER CA CRICRO subfzeo XER SO OV subfzeo CR CRO XER SO OV xor RA RS RB XOR RB with RS 10 168 Place answer in RA xor CR CRO xori RA RS IM XOR RB with 160 IM 10 169 Place answer in RA xoris RA RS IM XOR RB with IM 180 10 170 Place answer in RA B 38 PPC403GA User s Manual B 7 Condition Register Logical Instructions Condition Register CR logical instructions allow the user to combine the results of several comparisons without incurring the overhead of conditional branching These instructions can significantly improve code performance if multiple conditions are tested prior to making a branch decision Table B 7 summarizes the CR logical instructions Table B 7 Condition Register Logical Instructions O
263. Width at the time of the most recent System Reset Unchanged OxFFO1 3FFE OxFFO1 3FFE f Full word Boot Width at the time of the most recent System Reset BR4 7 0 31 Unchanged OxFFOO 3FFF OxFFO0 3FFF f Byte Boot Width at the time of the most recent System Reset Unchanged OxFFOO BFFF OxFFOO BFFF f Half word Boot Width at the time of the most recent System Reset Unchanged OxFFO1 3FFF OxFFO1 3FFF f Full word Boot Width at the time of the most recent System Reset DMACR 0 0 0 0 DMA Channels Disabled 0 3 22 Unchanged 0 0 Configure EOT TC as EOT IOCR 26 Unchanged 0 0 Latch Data Bus on SysClk 29 Unchanged 0 0 Timer Clock Source SysClk 30 Unchanged 0 0 Serial Port Clock Source SysClk PPC403GA User s Manual 5 4 DRAM Controller Behavior During Reset If the Reset input to the chip is asserted with the SysClk input operating the chip will enter the system reset state While the Reset input is asserted the RAS signals will be HiZ and the CAS signals will go to the inactive state logic 1 After the Reset input is deasserted the CAS signals will remain inactive and the RAS signals will change from HiZ to Inactive logic 1 If the Reset input to the chip is asserted with the SysClk input in either the 1 or 0 state and not switching the RAS signals will switch from the previous state either logic 1 or 0 to the HiZ state The CAS signals will remain unchanged and will continue to drive
264. Write Example Figure 3 10 shows the timing of chip select output enable write byte enables the address bus and the data bus relative to the system clock SysClk for a write cycle to SRAM or peripheral device extended by Ready 7 ka ka ka gt Wait 00010 Sample Ready Last Cycle Hold 01 CSon 0 CSon 1 Bn A Le a CSon 0 CSon 1 0 CSon 1 WEon 0 WEon 0 1 WEon 1 WEoff 1 WEoff 0 WBEO WBE3 J CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon 1 Data Out Not Ready pe Sp t Ready Bank Register Settings Seq Line Ready Transfer CSon OEon Transfer Fills Enable Wait Hold Bits 15 16 Bits 18 23 Bits 28 30 XX 000010 001 Figure 3 10 Timing Diagram SRAM Write Extended with Ready 3 18 PPC403GA User s Manual 3 6 3 SRAM ROM Burst Mode SRAM ROM Burst Mode is controlled by the Burst Mode Enable bit of the SRAM bank registers When enabled this mode will activate bursting for all cache line fills and flushes bus master burst operations DMA flyby burst and DMA memory to memory line burst operations and all packing and unpacking operations Some important information about SRAM ROM Burst Mode Programmable First Wait up to 16 cycles and programmable Burst Wait up to 4 cycles CSon OEon WBEon parameters are valid for the first transfer only WBEoff is valid during Burst transfer if Burst WAIT is programmed for greater t
265. a0 mfdmadat1 mfdmada2 mfdmada3 mfdmasa0 mfdmasa1 mfdmasa2 mfdmasa3 mfdmasr mfexisr mfexier mfiocr Operands RT Function Move from device control register DORN Extended mnemonic for mfdcr RT DCRN Other Registers Changed Page 10 100 mfdcr RT DCRN Move from DCR to RT RT lt DCR DCRN 10 100 mfmsr RT Move from MSR to RT RT MSR 10 102 Alphabetical Instruction Summary A 25 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic mfcdbcr mfctr mfdac1 mfdac2 mfdbsr mfdcecr mfdear mfesr mfevpr mfiac1 mfiac2 mficcr mficdbdr mflr mfpbl1 mfpbl2 mfpbu1 mfpbu2 mfpit mfpvr mfsprgO mfsprg1 mfsprg2 mfsprg3 mfsrrO mfsrr1 mfsrr2 mfsrr3 mftbhi mftblo mftcr mftsr mfxer Operands RT Function Move from special purpose register SPRN Extended mnemonic for mfspr RT SPRN Other Registers Changed Page 10 103 mfspr RT SPRN Move from SPR to RT RT lt SPR SPRN 10 103 RT RS Move register RT RS Extended mnemonic for or RT RS RS Extended mnemonic for or RT RS RS CRI CRO 10 119 mtcr RS Move to Condition Register Extended mnemonic for mtcrf OxFF RS 10 105 A 26 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic mtcrf Operands FXM RS Function Move
266. aches zero 28 31 reserved To complete channel configuration the count register is loaded with the transfer count and the beginning address is loaded in the destination address register Full descriptions of the DMA channel control count and destination address registers are presented in Section Section 4 3 on page 4 29 Once the DMA channel is configured the peripheral initiates a transfer by placing a 0 on the DMAR pin for that channel The DMAR signal is double latched inside the PPC403GA for metastability protection For that reason the DMA read from memory begins two cycles after the request is placed on DMAR When the transfer is from a memory to a peripheral as shown in Figure 4 3a the PPC403GA first reads in a data item from memory Then the PPC403GA begins the peripheral transfer cycle by writing that data to the peripheral using the DMAA pin as the transfer strobe Figure 4 5 shows the best case timing for a buffered mode transfer from DRAM to a peripheral The R W signal is active throughout this cycle and because no hold time has been programmed for this peripheral so is DMAA Note that the address bus is placed in high impedance during the peripheral transfer cycle DMA Operations 4 7 Cycle SysClk DMAR DMAA A6 A29 DO 31 RASn CAS0 3 DRAMOE RW Memory Cycle Peripheral Cycle Figure 4 5 Buffered Mode Transfer from a 32 b
267. achines and programs programming or services that are not announced in your country Such ref erences or information must not be construed to mean that IBM intends to announce such IBM prod ucts programming or services in your country Any reference to an IBM licensed program in this publication is not intended to state or imply that you can use only IBM s licensed program You can use any functionally equivalent program instead No part of this publication may be reproduced or distributed in any form or by any means or stored ina data base or retrieval system without the written permission of IBM Requests for copies of this publication and for technical information about IBM products should be made to your IBM Authorized Dealer or your IBM Marketing Representative Address comments about this publication to IBM Corporation Department H83A P O Box 12195 Research Triangle Park NC 27709 IBM may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you Copyright International Business Machines Corporation 1993 1994 All rights reserved Printed in the United States of America 4321 Notice to U S Government Users Documentation Related to Restricted Rights Use duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corporation Patents and Trademarks IBM may have patents or pending patent applications
268. ad byte from EA RA O RB and pad left with zeroes RT e 40 MS EA 1 Update the base address RA lt EA Other Registers Changed Page 10 74 Ibzx RT RA RB Load byte from EA RA O RB and pad left with zeroes RT 40 MS EA 1 10 75 Iha RT D RA Load halfword from EA RA 0 EXTS D and sign extend RT EXTS MS EA 2 10 76 Ihau RT D RA Load halfword from EA RA 0 EXTS D and sign extend RT EXTS MS EA 2 Update the base address RA e EA 10 77 Ihaux RT RA RB Load halfword from EA RA O RB and sign extend RT EXTS MS EA 2 Update the base address RA e EA 10 78 Ihax RT RA RB Load halfword from EA RA 0 RB and sign extend RT lt EXTS MS EA 2 10 79 Ihbrx RT RA RB Load halfword from EA RA O RB then reverse byte order and pad left with zeroes RT 180 MS EA 1 1 MS EA 1 10 80 Ihz Ihzu RT D RA RT D RA Load halfword from EA RA O EXTS D and pad left with zeroes RT 160 MS EA 2 Load halfword from EA RA O EXTS D and pad left with zeroes RT 160 MS EA 2 Update the base address RA lt EA 10 81 10 82 A 22 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont
269. addc Place carry out in XER CA CRICRO addco XER SO OV addco CR CRO XER SO OV adde RT RA RB Add XER CA RA RB 10 9 Place answer in RT adde Place carry out in XER CA CR CRO addeo XER SO OV addeo CR CRO XER SO OV addi RT RA IM Add EXTS IM to RA 0 10 10 Place answer in RT addic RT RA IM Add EXTS IM to RA 0 10 11 Place answer in RT Place carry out in XER CA addic RT RA IM Add EXTS IM to RA 0 CR CRO 10 12 Place answer in RT Place carry out in XER CA B 34 PPC403GA User s Manual Table B 6 Arithmetic and Logical Instructions cont Other Mnemonic Operands Function Registers Page Changed addis RT RA IM Add IM 160 to RA O 10 13 Place answer in RT addme RT RA Add XER CA RA 1 10 14 Place answer in RT addme Place carry out in XER CA CR CRO addmeo XER SO OV addmeo CR CRO XER SO OV addze RT RA Add XER CA to RA 10 15 Place answer in RT addze Place carry out in XER CA CR CRO addzeo XER SO OV addzeo CR CRO XER SO OV and RA RS RB AND RS with RB 10 16 Place answer in RA and CR CRO andc RA RS RB AND RS with RB 10 17 Place answer in RA andc CR CRO andi RA RS IM AND RS with 80 IM CR CRO 10 18 Place answer in RA andis RA RS IM AND RS with IM 1680 CR CRO 10 19 Place answer in RA
270. after RAS becomes valid During page mode transfers CAS becomes active 1 2 cycle after the address becomes valid CAS becomes inactive when RAS becomes inactive on a single transfer or on the last transfer of a burst CAS becomes inactive when the address changes for burst transfers other than the last Memory and Peripheral Interface 3 27 e On DRAM read only the PPC403GA may be programmed to latch data from the data bus either on the rise of SysClk normal operation or on the rising edge of CAS Latching data on the rising edge of CAS DRAM Read on CAS provides more time for the memory to present the data to the PPC403GA The DRAM Read on CAS feature is under the control of IOCR bit 26 e DRAMOE DRAMWE and AMuxCAS are activated at the beginning of the cycle in which CAS is activated DRAMOE DRAMWE and AMuxCAS are deactivated coinci dent with the deactivation of RAS e RAS Precharge is the interval from the deassertion of RAS to the earliest time when RAS may be again asserted Precharge is selectable as either 1 5 or 2 5 cycles Note that using Early RAS Mode will reduce the available precharge time to less than 1 5 or 2 5 cycles If the PPC403GA is the bus master then the column address lines and RAW are main tained valid for either 1 or 2 cycles following the deassertion of RAS e Ifthe PPC403GA is bus master and the bus is idle then CS4 RAS3 CS7 RASO CASO CAS3 DRAMOE DRAMWE and AMuxCAS will be held ina
271. al LR 10 32 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bns bnsa bnsl bnsla Operands cr_field target Function Branch if not summary overflow Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 3 target Other Registers Changed Extended mnemonic for bca 4 4 cr_field 3 target Extended mnemonic for bel 4 4 cr_field 3 target LR Extended mnemonic for bcla 4 4 cr_field 3 target LR Page 10 21 bnsctr bnsctrl cr_field Branch if not summary overflow to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 3 Extended mnemonic for bectrl 4 4 cr_field 3 LR 10 28 bnslir bnslirl cr_field Branch if not summary overflow to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 3 Extended mnemonic for belrl 4 4 cr_field 3 LR 10 32 bnu bnua bnul bnula cr_field target Branch if not unordered Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 3 target Extended mnemonic for bca 4 4 cr_field 3 target Extended mnemonic for bel 4 4 cr_field 3 target LR Extended mnemonic for bcla 4 4 cr_field 3 target LR 10 21 Instructions By Category B 15 Table B 4 Extended Mnemonics for PPC403GA cont
272. al Addr Pin Name Pin Name During RAS During CAS A29 po a22 a31 A28 p1 a21 a30 A27 p2 a20 a29 A26 p3 a19 a28 A25 p4 a18 a27 A24 p5 a17 a26 A23 p6 a16 a25 A22 p7 a15 a24 A21 p8 a14 a23 A18 p9 a13 a12 A16 p10 a11 a10 XX for 2 meg A14 p11 a9 a8 XX for 8 meg A12 p12 a7 a6 XX for 32 meg XX This position is a DON T CARE since the DRAM will take only the ROW address for this pin 3 46 PPC403GA User s Manual Table 3 8 DRAM Multiplex for 16 bit Bus PPC403GA DRAM Addr Logical Addr Logical Addr Pin Name Pin Name During RAS During CAS a30 A27 p1 a20 a29 A26 p2 a19 a28 A25 p3 a18 a27 A24 p4 a17 a26 A23 p5 a16 a25 A22 p6 a15 a24 A21 p7 a14 a23 A20 p8 a13 a22 A17 p9 a12 all XX for 1 meg A15 p10 a10 a9 XX for 4 meg A13 p11 a8 a7 xx for 16 meg A11 p12 a6 XX for 64 meg XX This position is a DON T CARE since the DRAM will take only the ROW address for this pin Memory and Peripheral Interface 3 47 Table 3 9 DRAM Multiplex for 32 bit Bus PPC403GA DRAM Addr Logical Addr Logical Addr Pin Name Pin Name During RAS During CAS a29 A26 p1 a19 a28 A25 p2 a18 a27 A24 p3 a17 a26 A23 p4 a16 a25 A22 p5 a15 a24 A21 p6 a14 a23 A20 p7 a13 a22 A19 p8 a12 a21 A16 p9 aii a10 XX for 2 meg A14 p10 a9 a8 XX for 8 meg A12 p11 a7 a6 XX for 32 meg XX This position is a DON T CARE since the DRAM will tak
273. al interrupt and five general purpose individually maskable interrupts Chapter 2 Programming Model contains a general discussion of the exception handling in the PPC403GA See Section 2 13 beginning on page 2 43 for definitions of exception classes synchronous asynchronous precise imprecise for summary listing of exception types debug program alignment etc and for listing of exception vector offsets Section 2 13 contains a general description of exception handling both non critical and critical including some discussion of the critical interrupt pin Section 2 13 also contains considerable discussion of both instruction side and data side machine checks Chapter 6 first concentrates on the details of registers associated with exceptions Registers discussed include e Machine State Register MSR on page 6 2 e Save Restore Register 0 and 1 SRRO SRR1 on page 6 4 e Save Restore Register 2 and 3 SRR2 SRR3 on page 6 5 e Exception Vector Prefix Register EVPR on page 6 7 e External Interrupt Enable Register EXIER on page 6 8 e External Interrupt Status Register EXISR on page 6 9 e Input Output Configuration Register OCH on page 6 11 e Exception Syndrome Register ESR on page 6 13 e Bus Error Syndrome Register BESR on page 6 14 e Bus Error Address Register BEAR on page 6 15 e Data Exception Address Register DEAR on page 6 16 Chapter 6 next concentrates on detailed statements of
274. als for the memory and DMAA is used as the read write transfer strobe for the peripheral When EOT TC is programmed as an input an external device may terminate the DMA transfer at any time by putting an active level on this pin When programmed as an output the EOT TC pin is set to an active level by the PPC403GA to signify that the DMA transaction is in its last transfer cycle The DMA control register is used to program the direction of the EOT TC pins Software initiated memory to memory transfers are supported If the memory has burst capability this is supported by line burst memory to memory mode which transfers data in 16 byte bursts 1 3 4 Asynchronous Interrupt Controller The PPC403GA includes an on chip interrupt controller that is logically outside the RISC core This controller combines the asynchronous interrupt inputs and presents them to the core as a single interrupt signal The sources of asynchronous interrupts are external signals DMA channels the serial port and the JTAG debug unit Each of the five non critical external interrupt inputs is individually configurable as negative or positive polarity and as edge triggered or level sensitive This configuration is programmed in the input output configuration register OCH in the BIU An external critical interrupt pin is also provided This pin is always negative active and edge triggered The interrupt controller provides an enable register to allow system softwar
275. anch instruction so that the LR contents may be used as a return address for a subroutine which was entered via the branch In either case the register contents may be a target address for the branch to link register instruction This allows absolute addressed branching to anywhere in the 4 GB memory space In all cases where the contents of LR represent an instruction address LR3g 3 are ignored and assumed zero since all instructions must be word aligned However if LR is written using mtspr and then read using mfspr all 32 bits will be returned as written Figure 2 4 Link Register LR 0 31 Link Register Contents If LR represents an instruction address then LRgo 31 should be zero Programming Model 2 7 2 3 2 3 Processor Version Register PVR The PVR is a read only register which identifies the version of the processor Software may be written which has features that depend on the processor type Such software can select the proper features dynamically by examining the PVR The PVR is privileged See Section 2 11 Privileged Mode Operation on page 2 36 for further discussion 0 11412 15 16 19 20 23 24 27 28 31 me E S Figure 2 5 Processor Version Register PVR 0 11 FAM Processor Family FAM 0x002 for the 4xx family 12 15 MEM Family Member 0 16 19 CL Core Level 0 20 23 CFG Configuration 0 24 27 MAJ Major Change Level 1 28
276. ansfer cceeeeeeee 4 19 Tables xxi Table 4 5 Table 5 1 Table 5 2 Table 5 3 Table 5 4 Table 5 5 Table 6 1 Table 6 2 Table 6 3 Table 6 4 Table 6 5 Table 6 6 Table 6 7 Table 6 8 Table 6 9 Table 6 10 Table 6 11 Table 6 12 Table 6 13 Table 7 1 Table 7 2 Table 7 3 Table 7 4 Table 7 5 Table 7 6 Table 9 1 Table 9 2 Table 9 3 Table 9 4 Table 10 1 Table 10 2 Table 10 3 Table 10 4 Table 10 5 Table 10 6 Table 10 7 Table 10 8 Table 10 9 Table 10 10 Table 10 11 Packing Unpacking Support ccceeeeeeeeeeeeeeeeeeeneeseeeeeaeesaeeeeeseeeesieeeeaeesaeee 4 23 Processor Configuration After a Reset c eeseeseeeeeeeeereeeeeeeeeeseaeeteaeeeeeeteatens 5 2 Contents of Machine State Register After Reset cccecceeseeeeeteeeeeeeeeeneees 5 3 Contents of Special Purpose Registers After Reset cccsesreeeeeeeeeeeerees 5 3 Contents of Serial Port Registers After Reset ccceeseeseeeeeeeeeeeteeeeeeeeeetens 5 4 Contents of Device Configuration Registers After Reset eeeseeeeeeees 5 4 Register Settings during Core Reset cecceeeseeneeeeeeeereceaeeeeeeseeeetteeseaeenses 6 17 Register Settings during Critical Interrupt Exceptions ceeeseeeeeeeeeeees 6 18 Register Settings during Machine Check Exceptions eeseeseeeeeseeeeeeeee 6 19 Register Settings during Protection Violation Exceptions csceeeeee 6 20 Registe
277. are present in the PPC403GA Table 2 15 Instructions Specific to PowerPC Embedded Controller dccci mfdcr dcread mtdcr icbt rfci iccci wrtee icread wrteei 2 14 2 Data Movement Instructions The PPC403GA uses load and store instructions to transfer data between memory and the general purpose registers Load and store instructions operate on byte halfword and word data The data movement instructions also support loading or storing multiple registers character strings and byte reversed data Table 2 16 shows the data movement 2 50 PPC403GA User s Manual instructions available for use in the PPC403GA Table 2 16 Data Movement Instructions LOADS STORES Multiple Multiple Byte Haltworg Halfword and Word Byte Halfword and Word Algebraic 8 String String bz lha Ihbrx Imw lwarx stb sth stmw stw lbzu hau Ihz Iswi Iwbrx stbu sthbrx stswi stwbrx lbzux Ihaux Ihzu Iswx Iwz stbux sthu stswx stwu lbzx Ihax Ihzux lwzu stbx sthux stwux Ihzx lwzux sthx stwx lwzx stwex 2 14 3 Arithmetic and Logical Instructions Table 2 17 shows the set of arithmetic and logical instructions supported by the PPC403GA Arithmetic operations are performed on integer or ordinal operands stored in registers Instructions using two operands are defined in a three operand format where the operation is performed on the operands stored in two registers and the result is placed in a third register Instruct
278. ate 32 bit address buses from the ICU and DCU Line fills and flushes are handled as burst transfers of 16 bytes with four bytes transferred to or from the ICU or DCU per cycle If the external device is less than 32 bits wide data is packed or unpacked within the BIU so all data transfers between the BIU and the core are 32 bits wide unless the request is for a byte or half word It is selectable whether line fills occur target word first or occur sequentially Target word first line fill allows the ICU or DCU to receive the required instruction or data as quickly as possible and allows the instruction stream to move on The BIU reads words up to the end of the 16 byte line and then wraps back to the first word of the line continuing until the line is filled Sequential line fill reads words sequentially into the 16 byte line starting with the first word of the line regardless of where the target address was on the line Halfword and word transfer requests from the RISC core are address aligned on the operand size boundary Unaligned transfer requests from the executing program are detected and trapped in the RISC core to an alignment exception handler 1 3 2 3 DMA Interface The interface between the BIU and the DMA controller consists of a 32 bit address bus and related control signals The BIU handles data buffering if it is required during a DMA transfer 1 3 2 4 On Chip Peripheral Bus Interface The On chip Peripheral Bus OPB is
279. ation about PPC403GA on chip debug facilities Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture Instruction Set 10 53 dcbtst Data Cache Block Touch for Store dcbtst RA RB 31 RA RB 246 0 6 11 16 21 31 EA lt RA 0 RB DCBTST EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise If the data block at the effective address is not in the data cache and the effective address is marked as cacheable in the DCCR the data block is loaded into the data cache If the effective address is marked as non cacheable in the DCCR or if the data block at the effective address is in the data cache no operation is performed If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Notes The implementation of the debtst instruction on the PPC403GA is identical to the implementation of the debt instruction The debtst instruction is provided for compatibility with software platforms based on other implementations of the PowerPC Architecture The debtst instruction allows a program to begin a cache block fetch from main storage before the program needs the data The program can later store data from GP
280. be portable to other PowerPC implementations Instruction Set 10 57 This instruction is specific to the PowerPC Embedded Controller family dcread Data Cache Read dcread RT RA RB 31 RT RA RB 486 0 6 Ti 16 21 31 EA lt RB RA 0 CDBCR3 0 RT d cache data side A CDBCR3 1 then RT lt d cache data side B CDBCRo7 1 RT lt if CDBCRo7 1 RT lt CDBCR3 d cache tag side A A A if CDBCRo7 0 if 0 A CDBCR3 1 then d cache tag side B A f CDBCRo7 0 A A A SN An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise This instruction is a debugging tool for reading the data cache entries for the congruence class specified by EAs3 07 The cache information will be read into the General Purpose Register RT If CDBCRo7 0 the information will be one word of data cache data from the addressed line The word is specified by EA e za If CDBCR3 0 the data will be from the A side otherwise from the B side If CDBCRo97 1 the information will be the cache tag If CDBCR3 0 the tag will be from the A side otherwise from the B side Data cache tag information is represented as follows 0 22 TAG Cache Tag 23 25 reserved 26 D Cache Line Dirty 0 Not dirt
281. becomes active two SysClk cycles after RAS becomes active 19 ARM Alternate Refresh Mode 0 Normal refresh 1 Immediate or Self refresh Use alternate values of field RR 20 PM Page Mode 0 Single accesses only Page Mode not supported 1 Page Mode burst access supported 21 22 FAC First Access Timing First Access time is 2 FAC if RCT 0 00 First Wait 0 SysClk cycles First Access time is 3 FAC if RCT 1 01 First Wait 1 SysClk cycles 10 First Wait 2 SysClk cycles 11 First Wait 3 SysClk cycles 23 24 BAC Burst Access Timing Burst Access time is 1 BAC 00 Burst Wait 0 SysClk cycles 01 Burst Wait 1 SysClk cycles Note if FAC 0 BAC is ignored and 10 Burst Wait 2 SysClk cycles treated as 0 11 Burst Wait 3 SysClk cycles 25 PCC Precharge Cycles 0 One and one half SysClk cycles 1 Two and one half SysClk cycles 26 RAR RAS Active During Refresh 0 One and one half SysClk cycles 1 Two and one half SysClk cycles 27 30 RR Refresh Interval See Table 3 4 for bit values assigned to various refresh intervals If field ARM 1 use Table 3 5 31 SD SRAM DRAM Selection Must be 0 for DRAM configuration 0 DRAM usage 1 SRAM usage The BAS field bits 0 7 select the address for the DRAM bank These bits are com pared to bits 4 11 of an effective address in the DRAM address region Address bits A1 A3 must contain 0 for DRAM accesses Address bits A
282. bit Alphabetical Instruction Summary A 23 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic Iwbrx Operands RT RA RB Function Load word from EA RA 0 RB then reverse byte order RT MS EA 3 1 MS EA 2 1 MS EA 1 1 MS EA 1 Other Registers Changed Page 10 92 lwz RT D RA Load word from EA RA 0 EXTS D and place in RT RT MS EA 4 10 93 lwzu RT D RA Load word from EA RA O EXTS D and place in RT RT MS EA 4 Update the base address RA e EA 10 94 lwzux RT RA RB Load word from EA RA 0 RB and place in RT RT MS EA 4 Update the base address RA e EA 10 95 lwzx RT RA RB Load word from EA RA 0 RB and place in RT RT MS EA 4 10 96 merf BF BFA Move CR field CR CRn lt CR CRm where m BFA and n lt BF 10 97 merxr BF Move XER 0 3 into field CRn where n lt BF CR CRn XER SO OV CAJ XER SO OV CA lt 30 10 98 mfcr A 24 RT Move from CR to RT RT lt CR PPC403GA User s Manual 10 99 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic mfbear mfbesr mfbr0 mfbr1 mfbr2 mfbr3 mfbr4 mfbr5 mfbr6 mfbr7 mfdmaccO mfdmacc1 mfdmacc2 mfdmacc3 mfdmacr0 mfdmacr1 mfdmacr2 mfdmacr3 mfdmact0O mfdmact1 mfdmact2 mfdmact3 mfdmad
283. bit target Extended mnemonic for bca 2 cr_bit target Extended mnemonic for bel 2 cr_bit target LR Extended mnemonic for bcla 2 cr_bit target LR 10 21 bdzt bdzta bdztl bdztla cr_bit target Decrement CTR Branch if CTR 0 AND CRe pit 1 Extended mnemonic for be 10 cr_bit target Extended mnemonic for bca 10 cr_bit target Extended mnemonic for bcl 10 cr_bit target LR Extended mnemonic for bcla 10 cr_bit target LR 10 21 beq beqa beql beqla cr_field target Branch if equal Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 2 target Extended mnemonic for bca 12 4 cr_field 2 target Extended mnemonic for bcl 12 4 cr_field 2 target LR Extended mnemonic for bcla 12 4 cr_field 2 target LR 10 21 Instruction Set 10 23 bc Branch Conditional Table 10 6 Extended Mnemonics for bc bca bcl bcla cont Other Mnemonic Operands Function Registers Page Changed bf cr_bit target Branch if CRer pit 0 10 21 Extended mnemonic for be 4 cr_bit target bfa Extended mnemonic for bca 4 cr_bit target bfl Extended mnemonic for LR bcl 4 cr_bit target bfla Extended mnemonic for LR bcla 4 cr_bit target bge cr_field target Branch if greater than or equal 10 21 Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 0 tar
284. bits are set in the SPLS register Parity Framing Overrun errors or Line Break Detection The RTS output is driven active again once the condition that drove the RTS output inactive is removed Note that when receiver pause mode is enabled hardware control can be blocked by setting the RTS bit in the SPCTL register to a logic 0 thus forcing the value of the RTS handshaking output to be inactive If the serial port uses DTR RTS as a DTR signal SPC of IOCR logic 0 software will always have control over the output based on the value specified for the DTR bit in the SPCTL register 7 2 3 2 Receiver DMA Mode The DMA Mode Interrupt Enable DME field of the SPRC register controls the use of the serial port receiver as a DMA source as well as the enable masking of the RxReady RBR 7 10 PPC403GA User s Manual interrupt The following table describes what the bit settings represent Table 7 6 DMA Mode Interrupt Enable field representation DME Meaning 00 SPU receiver disabled as a DMA source RxReady RBR interrupt generation disabled 01 SPU receiver disabled as a DMA source RxReady RBR interrupt generation enabled 10 SPU receiver used as a source for DMA Channel 2 11 SPU receiver used as a source for DMA Channel 3 When the receiver is used as a source for DMA transfers requests are made to the appropriate DMA channel whenever RxReady in the SPLS register is a logic 1 The DMA responds to the re
285. ble In all modes except fly by and M2M line burst 0 Channel does not burst to memory must have BME 0 1 Channel will burst to memory 26 ECE EOT Chain Mode Enable ETD must be programmed for EOT 0 Channel will stop when EOT is active 1 If Chaining is enabled channel will chain when EOT is active 27 TCD TC Chain Mode Disable 0 If Chaining is enabled channel will chain when TC reaches zero 1 Channel will not chain when TC reaches zero 28 31 reserved DMA Operations 4 31 4 3 2 DMA Status Register DMASR The DMA Status Register is a 32 bit register which contains the status of terminal count EOT bus errors and internal or external DMA requests for all DMA channels The contents of the DMA Status Register may be loaded into a general purpose register by using a move from device control register mfdcr instruction Clearing the terminal count status end of transfer status chained transfer and DMA bus error bits in the DMA Status Register requires writing a 1 to those bits in the status register To do this requires loading a 1 in those bits of a general purpose register that are to be reset A 0 in any bit will not change the status of the bit in the DMASR Next the contents of the GPR must be stored into the DMASR using a move to device control register mtdcr instruction ae T Ss Ss ale J CTO IR1 IR3 ER1 ER3 CB1 CB3 CT2 ofa 4 E p EE 8 9 10 11 12 22
286. ble Internal A6 A29 118 Ext BusEnable Internal OE XSize1 RW SEH WBE0 3 Debugging 9 19 9 20 Table 9 4 Boundary Scan Chain cont Bit Signal Name Type Pin Signals Enabled 119 CS Enable4 Internal CS4 RAS3 TS0 6 HoldAck BusReq Error DRAMOE DRAMWE AMuxCAS CAS0 3 DMAAO 2 DMAA3 XACK XmitD DSR CTS DTR RTS 120 CS Enable5 Interna CS5 RAS2 121 CS Enable6 Interna CS6 RAS1 122 CS Enable7 Interna CS7 RASO 123 TC Enableo Interna EOTO TCO 124 TC Enable1 Interna EOT TC1 125 TC Enable2 Interna EOT2 TC2 126 TCEnable3 Interna EOT3 TC3 XSize0 127 XmitD O 87 128 DTR RTS O 88 129 SerClk l 26 130 RecvD l 27 131 DSR CTS l 28 PPC403GA User s Manual Instruction Set Descriptions of the PPC403GA instructions follow Each description contains these elements e Instruction names mnemonic and full e Instruction syntax e Instruction format diagram e Pseudocode description of the instruction operation e Prose description of the instruction operation e Registers altered e Architecture notes identifying the associated PowerPC Architecture component Where appropriate instruction descriptions list invalid instruction forms and provide programming notes 10 1 Instruction Formats 10 Instructions are four bytes long Instruction addresses are always word aligned Instruction bits 0 through 5 always contain the primary
287. but not mentioned in the description For many instructions this list comprises the Condition Register CR and the Fixed point Exception Register XER For discussion of CR see Section 2 3 3 on page 2 11 For discussion of XER see Section 2 3 2 5 on page 2 9 10 6 PPC403GA User s Manual add Add add RT RA RB OE 0 Rce 0 add RT RA RB OE 0 Re 1 addo RT RA RB OE 1 Rc 0 addo RT RA RB OE 1 Rc 1 31 RT RA RB OE 266 Re 0 6 11 16 21 22 31 RT lt RA RB The sum of the contents of register RA and the contents of register RB is placed into register RT Registers Altered e RT e CR CRO er a so H Re contains 1 e XER SO OV if OE contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 7 addc Add Carrying addc RT RA RB OE 0 Rc 0 addc RT RA RB OE 0 Rc 1 addco RT RA RB OE 1 Rc 0 addco RT RA RB OE 1 Re 1 31 RT RA RB OE 10 Re 6 RT lt RA RB if RA RB X 282 1 then XER CA lt 1 else XER CA lt 0 The sum of the contents of register RA and register RB is placed into register RT If a carry out occurs XER CA is set to 1 Registers Altered RT e XERI CA e CR CRO z cr a so H Re contains 1 e XER SO OV if OE contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 8 PPC403GA
288. by software The cause of a data side check is recorded in the Bus Error Syndrome Register BESR which does have to be cleared by software When a data access causes the machine check the address which caused the Machine Check is loaded into the Bus Error Address Register BEAR The first data side error locks its address into the BEAR if further data side errors occur before the first is handled their addresses are lost The BEAR remains locked until the BESR is cleared The MSR Machine Check Enable bit MSR ME is reset to 0 to disable another machine check from interrupting the machine check exception handling routine The other MSR bits are loaded with the values shown in Table 6 3 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0200 Exception processing begins at the new address in the program counter Executing the return from critical interrupt instruction rfci restores the contents of program counter and the MSR from SRR2 and SRR3 respectively Table 6 3 Register Settings during Machine Check Exceptions SRR2 Loaded with the address of the next instruction to be executed SRR2 is loaded with the address that caused the machine check on instruction access errors SRR3 Loaded with the contents of the MSR Interrupts Exceptions and Timers 6 19 Table 6 3 Register Settings during Machine Check Excepti
289. byte count is CNT NB A series of CNT consecutive bytes in main storage starting with the byte at the effective address are loaded into CEIL CNT 4 consecutive GPRs four bytes per GPR until the byte count is exhausted Bytes are placed into GPRs with the byte having the lowest address loaded into the most significant byte Bit positions to the right of the last byte loaded in the last GPR used are set to 0 The set of consecutive registers loaded starts at register RT continues through GPR 31 and wraps to register 0 loading until the byte count is exhausted which occurs in register ReinaL Register RA is not altered unless RA Bra which is an invalid form of this instruction Bytes which would have been loaded into register RA are discarded If instruction bit 31 contains 1 the contents of CR CRO are undefined 10 86 PPC403GA User s Manual Registers Altered e RT and subsequent GPRs as described above Invalid Instruction Forms e Reserved fields e RA is in the range of registers to be loaded e RA RT 0 Architecture Note Iswi Load String Word Immediate This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 87 Iswx Load String Word Indexed Iswx RT RA RB 31 RT RA RB 533 0 6 11 16 21 31 EA lt RB RA 0 CNT lt XER TBC n e CNT Reinat amp RT CEIL CNT 4 1 32 re RT 1 i lt 0 do while n gt 0 if i 0 then
290. c cror creqv crorc crnand crxor merf 2 14 7 Rotate and Shift Instructions Rotate and shift instructions rotate and shift operands which are stored in the general purpose registers Rotate instructions also include the capability to mask rotated operands Table 2 21 shows the rotate and shift instructions available for the PPC403GA Table 2 21 Rotate and Shift Instructions ROTATE SHIFT rlwimi slw rlwimi slw rlwinm sraw rlwinm sraw rlwnm srawi rlwnm srawi srw srw 2 14 8 Cache Control Instructions Cache control instructions allow the user to indirectly control the contents of the data and instruction caches The user may fill flush invalidate and zero blocks 16 byte lines in the data cache The user may also invalidate congruence classes in both caches and invalidate and fill individual lines in the instruction cache Table 2 22 Cache Control Instructions DCACHE ICACHE dcbf icbi dcbi icbt dcbst iccci dcbt icread dcbtst dcbz dccci dcread Programming Model 2 53 2 14 9 Interrupt Control Instructions The interrupt control instructions allow the user to move data between general purpose registers and the machine state register return from interrupts and enable or disable maskable external interrupts Table 2 23 shows the Interrupt control instruction set Table 2 23 Interrupt Control Instructions mfmsr mtmsr rfi rfci wrtee wrteei 2 14 10Pr
291. c for belr 12 4 cr_field 0 Extended mnemonic for belrl 12 4 cr_field 0 LR 10 32 B 12 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bne bnea bnel bnela Operands cr_field target Function Branch if not equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 2 target Other Registers Changed Extended mnemonic for bca 4 4 cr_field 2 target Extended mnemonic for bel 4 4 cr_field 2 target LR Extended mnemonic for bcla 4 4 cr_field 2 target LR Page 10 21 bnectr bnectrl cr_field Branch if not equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 2 Extended mnemonic for bectrl 4 4 cr_field 2 LR 10 28 bnelr bnelrl cr_field Branch if not equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 2 Extended mnemonic for belrl 4 4 cr_field 2 LR 10 32 bng bnga bngl bngla cr_field target Branch if not greater than Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 1 target Extended mnemonic for bca 4 4 cr_field 1 target Extended mnemonic for bel 4 4 cr_field 1 target LR Extended mnemonic for bcla 4 4 cr_field 1 target LR 10 21 Instru
292. c for mtspr SPRN RS Other Registers Changed Page 10 110 Instruction Set 10 111 mulhw Multiply High Word mulhw RT RA RB Rc 0 mulhw RT RA RB Rc 1 31 RT RA RB 75 Re 0 6 11 16 21 31 Droen lt RA x RB signed RT prodgs The 64 bit signed product of registers RA and RB is formed The most significant 32 bits of the result is placed into register RT Registers Altered e RT e CR CRO z ct a so if Re contains 1 Programming Note The most significant 32 bits of the product unlike the least significant 32 bits may differ depending on whether the registers RA and RB are interpreted as signed or unsigned quantities The mulhw instruction generates the correct result when these operands are interpreted as signed quantities The mulhwu instruction generates the correct result when these operands are interpreted as unsigned quantities Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 112 PPC403GA User s Manual mulhwu Multiply High Word Unsigned mulhwu RT RA RB Rc 0 mulhwu RT RA RB Rc 1 31 RT RA RB 11 Re 0 6 11 16 21 31 prodo s3 lt RA X RB unsigned RT lt prodo s The 64 bit unsigned product of registers RA and RB is formed The most significant 32 bits of the result are placed into register RT Registers Altered e RT e CR CRO ct a so if Re contai
293. c from a state in which the clocks are stopped Reset and Initialization 5 5 5 5 Initial Processor Sequencing After any type of reset the processor begins by fetching the word at address OxFFFF FFFC and attempting to execute it Since the only memory configured immediately after reset is the upper 1MB bank OxFFFO0000 OxFFFFFFFF the instruction at OXFFFFFFFC must be a branch instruction The branch must be to initialization code in the upper 1MB bank The system must provide memory in the upper 1MB bank region which must be either non volatile or initialized by some mechanism external to the processor prior to a reset The upper 1MB bank configuration after reset is 64 wait states one cycle of address to chip select delay one cycle of chip select to output enable delay and seven cycles of hold time The boot width 8 16 or 32 bit is controlled by the BootW signal There are no processor restrictions on when the initial bank configurations can be modified after the reset has occurred There may however be restrictions due to the memory devices in the system 5 6 Initialization Requirements When a reset is performed the processor is initialized to a minimum configuration to start executing initialization code Initialization code is necessary to complete the processor and system configuration The initialization code described in this section is the minimum recommended for configuring the processor to run application code I
294. cally switch Endian modes when entering an interrupt handler On leaving the interrupt handler using an rfi or rfci instruction as appropriate the original value of MSR LE will be restored from SRR1 or SRR3 Hence PPC403GA can also automatically switch Endian modes when leaving an interrupt handler This mode switching capability makes it reasonable for an operating system written in one Endian mode to support application programs written in the other mode The PPC403GA resets to Big Endian mode MSR LE 0 and MSRIILE 0 2 22 PPC403GA User s Manual 2 6 Instruction Queue ER Some of the discussion in this manual requires the definition of the elements of the PPC403GA instruction queue See Figure 2 10 Instructions reach the queue via the Instruction Cache unit regardless of cacheability Instructions immediately drop to the lowest available queue location If the queue was previously empty an entering instruction will drop directly to decode DCD By convention the passage of an instruction from DCD to one of the main execution units EXE is referred to as Dispatch Superscalar operation requires the presence of at least two instructions in the queue If superscalar operation takes place it occurs via the passage of the second instruction from the IQ1 stage to the limited function execution unit EXE This passage is conventionally referred to as Folding PPC403GA requires in order execution therefore it is required that Dispat
295. category CR Logical except for the merf instruction PPC403GA User s Manual Put one instruction between a CR setting instruction and a Branch instruction that uses the CR bit being set by the CR setting instruction For CR setting instructions merf and merxr Put one instruction between a CR setting instruction and a Branch instruction that uses a CR bit in the CR field being set by the CR setting instruction Put one instruction between a normal Condition Register updating instruction and a Condition Register Logical instruction C 2 7 Dependency Upon LR and CTR If a Branch instruction uses the contents of the Link Register or the Count Register as a target address e Ifthe branch is actually taken one instruction between CTR LR update and the Branch is sufficient to eliminate the wait state e Pre fetch will halt whenever there is a LR CTR update ahead of a branch to the LR CTR and the branch is predicted taken If the branch is actually not taken the absence of pre fetch will harm performance Put three instructions between a LR CTR updating instruction and a Branch that uses the Link Register or Count Register as a branch target address This allows pre fetch to continue Put one instruction between a Count Register updating instruction and a Branch that uses the Count Register as a branch condition note that any Branch which tests CTR also alters CTR by decrementing it C 2 8 Load Latency Put one instruction b
296. cc cscs cesses cas vecsccusecdensctedh Red EES ees ee ee 9 12 IEEE 1149 1 Test Access Port JTAG ecceecceeccesseeeeseeeeeeeeeeseaeeeaeeceaeeeaeessaeeseeseeeeeees 9 13 JTAG CONNECCION socera ie 2h csetdssleceevas deen ENEE ENEE dE dedi EA 9 13 Bag eg E ee 9 15 JTAG Boundary Scan Chain ccccccccccecceeeeseeeeseeeeeeeeeeescaeeeseeneeseeneeeseneeesseneeesseeess 9 16 Instruction Set EE 10 1 Instruction Formats EE 10 1 ege gei Ge EE 10 2 Pseudocode ege Deiere ai e ee cee ete Sa eres SE 10 4 Register Usage EE 10 6 fa le WEE EE 10 7 AOC EE 10 8 AOC EE 10 9 Add tient ees avin ene ata levi dni ein ee ee 10 10 le le 10 11 flo o O a E E A E EE A A E AEE eit 10 12 le EE 10 13 ele Tu 10 14 ele KE 10 15 le ME 10 16 ANG E A E T gage eecee acral TEE E A E decaze 10 17 UNG EEA E PET EE AEE E T E EETA 10 18 Tue eN EE ee ee en dens 10 19 EE 10 20 DCist aie ene iis eet ie ei ee ied eos ve 10 21 DOCU oie he act etal theists cates ta een ett clave ceeeaes aie th lie E ance Riel 10 28 Delt sect Eege ee aa 10 32 CID EE 10 37 EIDEL ed E E i eeh 10 38 Lee 10 39 CIPI ag caress iesse deer cee eee EE bel ee vee dE eae weve eee 10 40 CNT ZW EE 10 41 Contents xi xii ei ln EE 10 43 EC sien dein ct Seay es eee oe 10 44 Le dat ele EE 10 45 ei Ale 10 46 eil EE 10 47 CROCS itch Si S at ac is tk Se EE A EE ee AL eh Tt ie E ea E 10 48 ei de LEE 10 49 lo EE 10 50 o le 0 Reap oS i ee oe 10 51 CCDS EE EE 10 52 OCD tes sde en ee eels ha PR ee e
297. ccess where a data access bus error occurred The BEAR is loaded the first time a data access bus error occurs and its contents are locked until the Bus Error Syndrome Register BESR is cleared Figure 6 12 shows the BEAR bit definitions On data side errors bus errors on transactions involving the D cache the address of the error will be placed in the BEAR and the description of the error will be placed in the BESR assuming that these registers are not locked by the prior occurrence of a Data Machine Check This information will be locked cannot be overwritten by subsequent error events until BESR is cleared by software On instruction fetching errors and DMA errors the address of the error will be placed in the BEAR and the description of the error will be placed in the BESR assuming that these registers are not locked by the prior occurrence of a Data Machine Check How ever information placed in the BEAR and BESR because of errors during instruction fetching or during DMA transactions is not locked in those registers and will be over written if any subsequent error occurs The BEAR is a device control register and its contents can be loaded into a general purpose Interrupts Exceptions and Timers 6 15 register via the move from device control register mfder instruction 31 Figure 6 12 Bus Address Error Register BEAR Address of Bus Error asynchronous 6 6 1 11 Data Exception Address Register DEA
298. ch condition test If selected the condition is satisfied oranch can occur if CR BIJ BO 1 Conditional branch instructions may optionally decrement the Count Register CTR by one and after the decrement test the CTR value The option is selected if BO 2 0 If selected BO 8 specifies the condition that must be satisfied to allow a branch to occur If BO 3 0 2 26 PPC403GA User s Manual then CTR 0 is required for a branch to occur If BO 3 1 then CTR 0 is required for a branch to occur If BO 2 1 the contents of CTR are left unchanged and the CTR does not participate in the branch condition test Table 2 5 summarizes the usage of the bits of the BO field BO 4 will be further discussed in Section 2 8 5 Table 2 5 Bits of the BO Field BO Bit BO O Description Condition Register Test Control 0 test CR bit specified by BI field for value specified by BO 1 1 do not test CR Condition Register Test Value 0 if BO 0 0 test for CR BIJ 0 1 if BO O 0 test for CR BI 1 Counter Test Control 0 decrement CTR by one then test CTR for value specified by BO 3 1 do not change CTR do not test CTR DO Counter Test Value 0 if BO 2 0 test for CTR 0 1 if BO 2 0 test for CTR 0 BO 4 Branch Prediction Reversal 0 apply standard branch prediction 1 reverse the standard branch prediction Table 2 6 lists specific BO field contents and the resulting ac
299. ch of the predecessor instruction in DCD has occurred for Folding from IO to be permitted Memory Instruction Cache IQ3 IQ2 IQ1 DCD Folding Dispatch EXE EXE limited execute units main execute units Figure 2 10 PPC403GA Instruction Queue Programming Model 2 23 2 7 Data and Instruction Caches 2 7 1 Instruction Cache The Instruction Cache is used to minimize the access time of frequently executed instructions The cache holds 2K bytes of instructions organized as a 2 way set associative cache There are 64 sets of 2 blocks lines each Each line contains16 bytes or 4 instructions The Instruction Cache on the PPC403GA may be disabled for 128 megabyte regions via control bits in the Instruction Cache Cacheability register The performance of the PPC403GA will be significantly lower while executing in cache disabled regions Cache line fills will always run to completion and the filled line will always be placed in the Instruction Cache unless an external memory subsystem error occurs during the fill When a cache line is loaded the side of the cache that receives the instructions being loaded is determined by using a Least Recently Used LRU policy The initially requested instruction will be forwarded directly to the Instruction Dispatcher immediately upon receipt from the External Bus Subsequent requests to the same cache line will also be forwarded prior to completion
300. chine check is loaded into the Bus Error Address Register BEAR The first data side error locks its address into the BEAR if further data side errors occur before the first is handled their addresses are lost The cause of a data side check is recorded in the Bus Error Syndrome Register BESR The BEAR remains locked until the BESR is cleared The BESR must be cleared by software If enabled by MSR ME the processor will report the DMC by vectoring to the Machine Check handler offset 0x0200 Taking the vector automatically clears the MSR ME bit There is a significant difference between instruction side and data side error handling which must be appreciated in order to write a successful interrupt handler for data side machine checks On the instruction side a valid invalid flag accompanies the instruction which has been fetched from memory If an IMC occurred while obtaining that instruction then an erroneous instruction will enter the processor pre fetch queue but at all times it will be recognized as invalid On the data side there is no valid invalid flag associated with data items If a DMC occurs invalid data can enter the data cache and not be recognizable as invalid data For example a cacheable load from an address which is not present in the data cache will cause a data cache line fill to occur If there is no bank register configured for the address a data side machine check will occur but the line fill will also occur cont
301. context synchronization accomplishes consider an exception such as System Call for example which is a context synchronization operation Any exception causes the MSR to be updated with the old value saved in the SRR1 3 One bit in the MSR that is changed is the MSR PE bit which disables memory protection when reset The fact that the exception itself causes a context synch guarantees that all instructions prior to the exception complete using the old value of the MSR PE and that all instructions after the exception complete using the new value of the MSR PE The MSR is specifically part of the processor context In this manner code that wishes to perform a mtmsr to turn off memory protection and then wishes to guarantee that all memory accesses after the mtmsr don t cause protection exceptions must execute a context synch op such as isync after the mtmsr and before any new memory accesses are made So given the scenarios in 4 above how does software ensure that memory DCR con tents get synchronized in the instruction stream Through the use of the eieio or sync instructions These instructions guarantee storage ordering such that all subsequent memory accesses observe the results of all previous memory accesses Note that nei ther eieio nor sync guarantee that instruction prefetching is done after the eieio sync They do not cause the pre fetch queues to be purged and instructions to be re fetched See
302. controller of the BIU may need to perform refresh of a DRAM bank to maintain the validity of data there The BIU performs arbitration among such requests Memory and Peripheral Interface 3 3 The arbitration priority for access to BIU resources is from highest to lowest 1 DRAM Refresh Note that DRAM Refresh may overlap with any SRAM access and will occur with out any performance impact to the SRAM access Any DRAM access will wait for the Refresh to finish before gaining access to the bus External Bus Master high priority DMA high priority Cache inhibited DCU read cache inhibited DCU write DCU line fill Note that only one data side request may be presented to the BIU at any given time Cache inhibited ICU read ICU line fill Note that only one instruction side request may be presented to the BIU at any given time DCU line flush DMA low priority External Bus Master low priority 3 3 Memory Banks Supported The PPC403GA memory interface supports up to eight external RAM ROM banks and peripheral devices in non overlapping addresses Four of the banks have dedicated chip select logic SRAM interface Another four banks have multiplexed chip select row address select CS RAS lines these banks are shared by the SRAM and the DRAM controllers The minimum size of memory region which can be defined for a bank is 1MB The maximum size is 64MB Table 3 1 shows the possible combinations of supported devices Note
303. correct control signals to the source memory so that the memory can output data The PPC403GA buffers and then outputs the data to the destination memory address Note that as long as the controlling device places an active signal on DMAR transfers will continue To terminate a device paced memory to memory transfer the controlling device must deassert DMAR one SysClk cycle before the last cycle in the current transfer Packing and or unpacking of data is completed if the widths of the memory devices are not equal DMA Operations 4 21 4 2 6 Memory to Memory Line Burst Mode Memory to memory M2M burst allows the DMA channel to use the burst capability of a memory device In M2M Line Burst transfers 16 bytes of data starting at the source address are read into the PPC403GA buffer and then written out to the destination memory address The PPC403GA accesses the memory using the parameters in the BIU Bank Register corresponding to the memory address If the memory device has a bus width of a word 4 words will be accessed in burst mode If the memory device has a bus width of a halfword 8 halfwords will be accessed in burst mode If the memory device has a bus width of a byte 16 bytes will be accessed in burst mode The PPC403GA handles packing and or unpacking of data if the widths of the memory devices are not equal M2M Line Burst is only supported for M2M transfers initiated by software no Device Paced transfers The features of
304. covering the subject matter in this publication The furnishing of this publication does not give you any license to these patents You can send license inquiries in writing to the IBM Director of Licensing IBM Corporation 208 Harbor Drive Stamford CT 06904 United States of America The following terms are trademarks of IBM Corporation PPC403GA IBM PowerPC PowerPC Architecture PowerPC Embedded Controllers RISCWatch RISCTrace OS Open The following terms are trademarks of other companies UNIX is a registered trademark in the United States and other countries licensed exclusively through X Open Company Limited Windows is a trademark of Microsoft Corporation Other terms which are trademarks are the property of their respective owners Contents About LR E XXV KEREN A E E A A 1 1 BEGLEED Ee ee ed ae 1 1 PowerPC Architecture iion sce dey el ini AER nie elidel aia celts 1 2 The PPC403GA as a PowerPC Implementation cceeeceeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeneeeas 1 2 PPG403GA Features Zeene Eed iin Gig ee 1 3 leie Ee Goes ots ine S shat dec bien 1 4 Execution Unit EXU wc ita a a a aa ii gh dad adi deed ae ete 1 4 Instruction Cache Unit ICU ooo cece eseeeeseeeeeeeeaeeteeeeeaeesaaeeeaeeseaeeeseeeeaeeseeseaeeeeeesas 1 5 Data Cache Unit DOU eainiie va ae he bape eege degen nee 1 6 Bus Interface Unit BIW 2 caves cccnead chs e Taaa r cosdenduacseascdsciniscasadvaed sesgacdachereastaaetatiennace
305. cr DMACRO channel_control initialize channel control if channel 1 used if memory to memory mode mtdcr DMASA1 amp source_addr initialize source memory address mtdcr DMADA1 amp source_addr initialize destination address mtdcr DMACT1 transfer_count initialize transfer count else if buffered mode fly by mode amp amp chaining enabled mtdcr DMADA1 amp source_addr initialize memory address mtdcr DMACT1 transfer_count initialize transfer count mtdcr DMACR1 channel_control initialize channel control if channel 2 used Repeat steps in channel 1 for channel 2 if channel 3 used Repeat steps in channel 1 for channel 3 ee _ Initialize and configure external interrupts ee _ mtdcr EXISR OxFFFFFFFF clear external interrupt status register mtdcr EXIER external_interrupt_configuration enable external interrupts ee Zb set the exception vector prefix JE iiiI mtspr EVPR prefix_addr initialize exception vector prefix _ _ _ Wi initialize and configure timer facilties Ee Wi mtspr TBLO 0 reset time base low first to avoid ripple mtspr TBHI 0 reset time base high 5 12 PPC403GA User s Manual CT mtspr PIT 0 clear pit so no pit indication after TSR cleared mtspr TSR OxFFFFFFFF clear timer status register mtspr TCR timer_enable
306. cr_bit Extended mnemonic for bel 0 cr_bit LR 10 32 bdnztir bdnztirl cr_bit Decrement CTR Branch if CTR 0 AND CRer pit 1 to address in LR de Extended mnemonic for belr 8 cr_bit Extended mnemonic for bc 8 cr_bit LR 10 32 bdzir bdzirl Decrement CTR Branch if CTR 0 to address in LR Extended mnemonic for belr 18 0 Extended mnemonic for bell 18 0 LR 10 32 Instruction Set 10 33 bclr Branch Conditional to Link Register Table 10 8 Extended Mnemonics for belr bcirl cont Mnemonic bdzfir bdzfirl Operands cr_bit Function Decrement CTR Branch if CTR 0 AND CR pit 0 to address in LR Extended mnemonic for belr 2 cr_bit Other Registers Changed Extended mnemonic for belrl 2 cr_bit LR Page 10 32 bdztir bdztirl cr_bit Decrement CTR Branch if CTR 0 AND CR pit 1 to address in LR Extended mnemonic for belr 10 cr_bit Extended mnemonic for bel 10 cr_bit LR 10 32 beqir beqIrl cr_field Branch if equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 2 Extended mnemonic for belrl 12 4 cr_field 2 LR 10 32 bfir bfirl cr_bit Branch if CRey pit 0 to address in LR Extended mnemonic for belr 4 cr_bit Extended mnemonic for belrl 4 cr_bit LR 10 32 bge
307. cr_field 2 target Extended mnemonic for bel 12 4 cr_field 2 target LR Extended mnemonic for bcla 12 4 cr_field 2 target LR 10 21 Alphabetical Instruction Summary A 7 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic beqctr Operands cr_field beqctrl Function Branch if equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 2 Other Registers Changed Extended mnemonic for bectrl 12 4 cr_field 2 LR Page 10 28 beqir cr_field beaIrl Branch if equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 2 Extended mnemonic for belrl 12 4 cr_field 2 LR 10 32 bf cr_bit target bfa bfl bfla Branch if CH pit 0 Extended mnemonic for bc 4 cr_bit target Extended mnemonic for bca 4 cr_bit target Extended mnemonic for bcl 4 cr_bit target LR Extended mnemonic for bcla 4 cr_bit target LR 10 21 bfctr cr_bit bfctrl Branch if CRer pit 0 to address in CTR Extended mnemonic for becht 4 cr_bit Extended mnemonic for bech 4 cr_bit LR 10 28 bflr cr_bit bfirl A 8 Branch if CRer pit 0 to address in LR Extended mnemonic for bclr 4 cr_bit Extended mnemonic for belrl 4 cr_bit PPC403GA User s Manual LR
308. ctions By Category B 13 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bngctr Operands cr_field bngctrl Function Branch if not greater than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 1 Other Registers Changed Extended mnemonic for bectrl 4 4 cr_field 1 LR Page 10 28 bnglr cr_field bnglrl Branch if not greater than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 1 Extended mnemonic for belrl 4 4 cr_field 1 LR 10 32 bni cr_field target bnla bnili bnila Branch if not less than Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 0 target Extended mnemonic for bca 4 4 cr_field 0 target Extended mnemonic for bel 4 4 cr_field 0 target LR Extended mnemonic for bcla 4 4 cr_field 0 target LR 10 21 bnictr cr_field bnictrl Branch if not less than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 0 Extended mnemonic for bectrl 4 4 cr_field 0 LR 10 28 bnilr cr_field bnilrl B 14 Branch if not less than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 0 Extended mnemonic for belrl 4 4 cr_field 0 PPC403GA User s Manu
309. ctive The relationship of these control signals and the parameters controlling them are illustrated in Figure 3 14 SysClk HM H H H H H E H H H HM H HM H HM H A11 A29 RW First Access d Burst Access d Burst Access Precharge 1 BAC 0 lt BAC lt 3 1 BAC 0 lt BAC lt 3 2 RCT FAC 0 lt FAC lt 3 RASn NL J NT TAA RCT FAC BAC BAC ng 0 3 0 3 0 3 CAS0 3 NM Ae N Si DRAMOE DRAMWE ae AMuxCAS __ TTT Th Figure 3 14 Parameter Definitions DRAM 3 28 PPC403GA User s Manual 3 7 1 1 DRAM Read Example The following figure illustrates the timing of a single non burst DRAM read Note that the Early RAS Mode and DRAM Read on CAS features are illustrated here DRAM Read on CAS only applies to DRAM read operations Cycle SysClk Prechg A11 29 Row RW ET TTT Early RAS Mode bit 14 RASn T early 0 normal CAS0 3 N a N DRAMOE N f S DRAMWE N DRAM Read on CAS IOCR 26 Din _ gt SSS 0 SysClk 1 CAS AMuxCAS e Nea Bank Register Settings Seq Line Bus External RAS CAS Page First Burst Refresh Refresh Fills Width Mux Timing Mode Access Access RAS Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit 20 Bit 21 22 Bit 23 24 Bit26 Bits 27 30 Figure 3 15 DRAM Single Transfer Read Memory and
310. ctly without going through the processor As a specific example suppose that it is desired to have a memory mapped hardware device at address 00 in the Little Endian system of our structure storage example The expected result would be 00 01 02 03 04 05 06 07 Programming Model 2 21 The actual result would be 00 01 02 03 04 05 06 07 If the device were physically connected at memory address 00 a word store to address 00 would miss the device entirely If the device were connected at memory address 04 then it would be accessed by a word store to address 00 but the bytes would be in the wrong order Anyone connecting directly to the memory system of a PowerPC processor in Little Endian mode not accessing the data via the processor must keep such effects in mind 2 5 2 Control of Endian Mode The selection of Endian mode in which the PPC403GA operates is controlled by two bits in the Machine State Register MSR LE and MSR ILE The current operational mode of the processor is described by MSR LE If MSR LE 1 the processor is executing in Little Endian mode otherwise it is in Big Endian mode When the processor takes an interrupt the MSR value prior to the interrupt is saved in either SRR1 or SRR3 depending on the type of interrupt Then the contents of the Interrupt Little Endian bit MSR ILE replaces the contents of the Little Endian mode bit MSR LE Therefore the PPC403GA can automati
311. d EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged PC EVPR 0 15 0x0500 6 2 6 Alignment Error Alignment Error exceptions are caused by misaligned data accesses or by attempting to execute a data cache block zero instruction against a non cacheable area Also if the processor is in Little Endian mode the execution of any string multiple instruction will cause an Alignment Error exception When an alignment error is detected the PPC403GA suppresses the instruction causing the alignment error and uses its address as the address of the next sequential instruction NSI This NSI value is stored in SRRO The Data Error Address register is loaded with the address that caused the alignment error and the current contents of the MSR are loaded into SRR1 The MSR bits are loaded with the values shown in Table 6 6 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0600 Exception processing begins at the new address in the program counter Executing the return from interrupt instruction rfi restores the contents of the program counter and the MSR from SRRO and SRR1 respectively and the PPC403GA begins execution at the address contained in the program counter Table 6 6 Register Settings during Alignment Error Exceptions SRRO Loaded with the address of the instruction causing the alignment exception SR
312. d control signals for the memory and DMAA is used as the read write transfer strobe for the peripheral When HoldAck is not active the signal DMADXFER is defined DMADXFER controls burst mode fly by DMA transfers between memory and peripherals DMADXFER is not meaningful unless a DMA Acknowledge signal DMAA0 DMAAS3 is active For transfer rates slower than one transfer per cycle DMADXFER is active for one cycle when one transfer is complete and the next one starts For transfer rates of one transfer per cycle DMADXFER remains active throughout the transfer 4 2 2 Buffered Mode Transfers In buffered mode transfers from memory to a peripheral the PPC403GA reads data from memory in one bus operation and writes the data to a peripheral in a subsequent operation Data Data Memory Bi Peripheral DMAR Address 403GA DMAA a Memory to Peripheral Transfer Memory E Peripheral Address 403GA b Peripheral to Memory Transfer Figure 4 3 Overview of Buffered Mode Transfers 4 4 PPC403GA User s Manual For buffered mode transfers from a peripheral to memory the PPC403GA reads data from the peripheral and writes the data to memory In either direction the data is temporarily buffered inside the PPC403GA If the peripheral and the memory use data words of different widths the PPC403GA performs the necessary packing and u
313. d complete before the chained transfer could be set up Start a normal DMA operation 1 Status register has been cleared 2 Load the DMADA with the memory address of the transfer 3 Load the DMACT with the transfer count 4 Enable the channel by mtdcr DMACR The Chaining Enable in the DMACR does not need to be and should not be set 5 Load the DMASA with the chained memory address 4 24 PPC403GA User s Manual 9 4 2 8 2 Load the DMACC with the chained transfer count This will set the Chaining Enable in the DMACR When a Chaining Condition is detected the DMACT is loaded with the DMACC and the DMADA is loaded with the DMASA The Chaining Status bit is set in the DMASR The Chaining Status bit will cause an interrupt if interrupts are enabled If the software wants to continue the chain the Chain Status bit in the DMASR must be reset The sequence can then be repeated starting at step 5 above Chaining Example No Setup Race In this example both the first and second transfers are set up before the first transfer begins This guarantees proper function regardless of the length of the first block at the cost of slightly longer time before any data moves Status register has been cleared Load the DMADA with the memory address of the transfer Load the DMACT with the transfer count Load the DMASA with the chained memory address Load the DMACC with the chained transfer count Enable the channel by mtdcr D
314. d is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The effective address is placed into register RA The halfword at the effective address is extended to 32 bits by concatenating 16 0 bits to its left The result is placed into register RT Registers Altered e RA e RT Invalid Instruction Forms e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 82 PPC403GA User s Manual Ihzux Load Halfword and Zero with Update Indexed Ihzux RT RA RB 31 RT RA RB 311 0 6 11 16 21 31 EA lt RB RA O RA lt EA RT lt 160 MS EA 2 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The effective address is placed into register RA The halfword at the effective address is extended to 32 bits by concatenating 16 0 bits to its left The result placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA e RT Invalid Instruction Forms e Reserved fields e RA RT e RA 0 Architecture Note This instruction is part of t
315. d re fetched In addition to the self modifying code sequence use of isync in 6 here is an example involving debug exceptions mtdber setup IAC event isync wait for new dbcr context to be established XYZ this instruction is at the IAC address isyne was necessary to allow the IAC event to happen at the execution of this instruction 2 12 2 Execution Synchronization For completeness consider the definition of execution synchronizing as it relates to context synchronization as this concept is related to these scenarios Execution Synchronization is architecturally a subset of Context Synchronization Execution synch specifically guarantees the rule described in 2A but not the rule described in 2B above Execution synch ensures all prior instructions execute in the old context but subsequent instructions may execute in the new or old context indeterminate There are three execution synch ops in PPC403GA mtmsr sync eieio Since mtmsr is itself execution synchronizing it guarantees that prior instructions complete Programming Model 2 41 using the old MSR value consider the example given in the second paragraph of 5 above However to guarantee that subsequent instructions use the new MSR value we have to insert a Context synch op such as isync Note that the architecture makes a special requirement that the MSR EE bit be in effect context synchronizing This means that if a mtmsr turns on the EE
316. d without regard to cacheability status in the DCCR This is a privileged mode instruction dcbst data cache block store Cache Operations 8 9 This instruction causes a line if found in the cache and marked as modified to be stored to external memory If the line is not marked as modified the instruction is a no op Lines in the cache are not invalidated by this instruction This operation is performed regardless of whether the address is marked as cacheable in the DCCR e debt data cache block touch This instruction causes a cacheable line to be filled into the cache if not already there If the line is noncacheable this instruction is a no op e dcbtst data cache block touch for store This instruction functions identically to the debt instruction on the PPC403GA and is provided for compatibility with compilers and other tools e dcbz data cache block set to zero This instruction causes a line in the cache to be filled with zeros and marked as modi fied If the line is not currently in the cache the line is established filled with zeros and marked as modified without fetching the line from external memory e decci data cache congruence class invalidate A congruence class of two lines is invalidated by issuing this instruction e dcread data cache read This is a debugging instruction which reads either a data cache tag entry or a data word from a data cache line The behavior of the instruction is controlled
317. ddc 10 8 addco 10 8 addco 10 8 adde 10 9 adde 10 9 addeo 10 9 addeo 10 9 addi 10 10 addic 10 11 addic 10 12 addis 10 13 addme 10 14 addme 10 14 addmeo 10 14 addmeo 10 14 addo 10 7 addo 10 7 address bit usage 3 7 address bits bank registers 3 7 addressing 2 2 double mapping 2 2 DRAM 2 3 DRAM banks 2 3 SRAM 2 3 SRAM banks 2 3 addze 10 15 addze 10 15 addzeo 10 15 addzeo 10 15 alignment 2 15 alignment error 6 22 alternate refresh mode 3 42 immediate refresh 3 42 self refresh 3 42 and 10 16 and 10 16 andc 10 17 andc 10 17 andi 10 18 andis 10 19 arbitration 3 3 architecture PowerPC 1 2 arithmetic compare 2 12 B b 10 20 ba 10 20 Bank Register Initialization 5 7 bank registers DRAM 3 36 ROM 3 22 SRAM 3 22 be 10 21 bca 10 21 bectr 10 28 bectrl 10 28 bel 10 21 bcla 10 21 belr 10 32 belrl 10 32 BEAR 6 15 11 7 BESR 6 14 11 8 big endian 2 17 mode control 2 22 bl 10 20 bla 10 20 BRO BR3 SRAM 3 22 BRO BR7 SRAM _ 11 9 BR4 BR7 DRAM 3 36 11 11 BR4 BR7 SRAM 3 22 branch folding C 2 branch prediction 2 28 A 1 B 5 branching control AA field on conditional branches 2 26 AA field on unconditional branches 2 26 BI field on conditional branches 2 26 BO field on conditional branches 2 26 branch prediction 2 28 BRDH 7 12 11 13 BRDL 7 12 11 14 burst DMA fly by 4 14 Index Li i e memory to peripheral 4 16 peripheral to memory 4 18 bus timeout error 3 16
318. ddress The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise If the data block at the effective address is in the data cache the cache block is marked invalid If the data block at the effective address is not in the data cache no operation is performed Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Notes If data has been modified in the data cache by a store instruction and if the modified data has not yet been copied to memory copy will not happen until the cache line is needed for another address or until appropriate dcache instructions have been executed then the debi instruction can destroy the results of the store instruction Subseqent loads would retrieve the pre store data from memory This behavior can be used to defeat an operating system s attempt to hide one task s data from another task by zeroing the data area between tasks Therefore debi is a privileged instruction The instruction is treated as a store with respect to memory protection and can cause a protection exception Debugging Note This instruction is considered a write with respect to data address compare DAC debug exceptions See Chapter 9 for more information about PPC403GA on chip debug facilities Architecture Note This instruction is part of the PowerPC Operating Environment Architecture Instruction
319. de Operation eege e iced sedensd ENEE EE Een 2 36 Background and Terminology ceesceeesseeeeseeeeeneeeeseaeeeeeeneeseneeeeeeaeeeesaaeesenaeeeeeneeeeeaes 2 36 MSR Bits and Exception Handling ccecccceseeeeeeeeeeseeeeeeeeeneeeeeeesneeeeeeeeeeeeeeseeeeneeeeas 2 36 Privileged Eed 2 37 Privileged ESIa m A E elenk EES 2 37 Privil ged DORS isseire tires oree endea ite ae cts he eee deen dee aE aera baiiia 2 38 Operation with an External Debugger 2 38 Context Execution and Storage Synchronization ceeeceeeceeeeeeeeeeeeeeeseeeeeneeseeeseeeeeaeens 2 38 Context Synchronization wise sreci teri i e E O Sa 2 39 PPC403GA User s Manual Execution Synchronization ccccscccecesceeseseeeeseeeeeeseeeeeeneeeeseaeeeseeeeeseaeeescneeesseeeesseeess 2 41 Storage Synchronization ccscccccsscecssneceeeneeeseneeeeeeneceseeeeeseneeeescaeeecsaeeeseneeeeesneeesseeess 2 42 Interrupts ang Exception kV anen eeina a airaa iaaii ep e Eet daia iritarea aii 2 43 Exception Handlings ne a a a Ltda inl E E ster 2 46 Synchronous Exception Handling cecceeeceeseeeeeeeeeeeeeeeeeeeeeeeeeeeeseaeeeaeeseeeseneeaes 2 46 Critical Interrupt Handling AAA 2 46 Instruction Machine Check Handling cceeceeeeeeeeeeeeeeeeeeeeeeeseeeeeeeeeaeesieeeeeeenees 2 46 Data Machine Check Handling ccceeecceeeeeeeeeeeeeeeeeeeaeeceeeeeeeeseeeeeeeeeaeeseeseeeseees 2 48 Instruction Set SUMMA veces etre A cies Atee deere od ae eis Bi
320. development Internal Debug Mode supports ROM monitors External Debug Mode supports emulators Real time Trace Debug Mode supports cache reconstruction tools and Bus Status Debug Mode supports logic Debugging 9 1 analyzers Multiple modes can be enabled simultaneously except for Real time Trace Debug Mode and Bus Status Mode Internal and External Debug Modes are controlled by the Debug Control Register DBCR Real time Trace and Bus Status Debug Modes are controlled by the Input Output Configuration Register IOCR 9 2 1 Internal Debug Mode Internal Debug Mode supports accessing all architected processor resources setting hardware and software breakpoints and monitoring processor status While in this mode debug events can generate debug exceptions which can interrupt normal program flow so that monitor software can collect processor status and alter processor resources Internal Debug Mode relies on exception handling software running in the processor and an external communications path to debug software problems It is used while the processor is executing instructions and enables debugging of application or operating system related problems Access to debugger software executing in the processor while in internal debug mode is through a communications port on the processor board such as a serial port 9 2 2 External Debug Mode External Debug Mode supports stopping and starting the processor accessing all architected proc
321. diction cinei te gi hop ie ee ath eh ie ein ee eh el C 5 lie lun C 6 Jee ei n Le EE C 7 General RUES 25 cecscsecee e ys cece pen arte eee ENEE eee EEN C 7 Branch and CH Logical Opcodes A C 7 Branch Prediction TEE C 8 SIINO oleole CE E EET C 8 Data Cache Loads and Stores 0 eeceesceeeceeeeeeseeeeeeeeceeeeeaeeseeeeaeeseeeeeseeseaeeeeeseeeteeeeeaees C 9 Instruction Cache Misses i2e u scncats pata inte iva lvlnie ce ETE C 9 Detailed Folding RUGS cect cerita aces Meare eee have eaten area C 10 Instruction Classifications for Folding cccceeeceseeeeeeeeeeeeeceeeeeaeeeeeeeeaeeseeeeeaeeseaeeeeeteas C 10 Instructions That Can Be Folded AAA C 11 Fold Blocking Rules For CR Logical and mert Instructions ccccessceeeeeteeeeeteees C 11 Fold Blocking Rules For Branch Instructions escceeesceeeeeneeeeeneeeeeneeeeseneeeeenneeeenaeees C 11 Fold Blocking During Debug A C 13 ING OX iaria iaaa arara aeaa EAR a ida aN dab ee ENEE EdEEEENEENEEEen l 1 Contents XV xvi PPC403GA User s Manual Figures Figure 1 1 Figure 2 1 Figure 2 2 Figure 2 3 Figure 2 4 Figure 2 5 Figure 2 6 Figure 2 7 Figure 2 8 Figure 2 9 Figure 2 10 Figure 2 11 Figure 2 12 Figure 3 1 Figure 3 2 Figure 3 3 Figure 3 4 Figure 3 5 Figure 3 6 Figure 3 7 Figure 3 8 Figure 3 9 Figure 3 10 Figure 3 11 Figure 3 12 Figure 3 13 Figure 3 14 Figure 3 15 Figure 3 16 Figure 3 17 Figure 3 18 Figure 3 19
322. ditional with decrement Register Summary 11 17 DAC1 DAC2 DAC1 DAC2 see also Section 9 7 3 on page 9 10 SPR Figure 11 10 Data Address Compare Registers DAC1 DAC2 0 31 Data Address Compare Byte Address Data Address Compare Size fields of DBCR determine byte halfword or word usage 11 18 PPC403GA User s Manual DBCR DBCR see also Section 9 7 1 on page 9 6 SPR EDM RST BT TDE FT IA2 DIW Dap D2S SBT STD SDA JI H po poy LL 4 l 4 4 4 4 4 HEEN ele 7 8 12 13 ha 15 16 17 18 19 f0 21 22 2a 2a 25 27 28 29 30 31 he ee EE Figure 11 11 Debug Control Register DBCR 0 EDM External Debug Mode 0 Disable 1 Enable WARNING Enabling this mode can cause unexpected results 1 IDM Internal Debug Mode 0 Disable 1 Enable WARNING Enabling this mode can cause unexpected results 2 3 RST Reset 00 No Action 01 Core Reset 10 Chip Reset 11 System Reset WARNING Writng 01 10 or 11 to these bits will cause a processor reset to occur 4 IC Instruction Completion Debug Event 0 Disable 1 Enable 5 BT Branch Taken Debug Event 0 Disable 1 Enable 6 EDE Exception Debug Event Includes critical class of exceptions only while in 0 Disable External Debug Mode 1 Enable 7 TDE TRAP Debug Event 0 Disable 1 Enable 8 12 FER First Ev
323. e 0 Clock source is the SysClk pin 1 Clock source is the TimerClk pin 30 SCS Serial Port Clock Source 0 Clock source is the SysClk pin 1 Clock source is the SerClk pin 31 SPC Serial Port Configuration 0 DSR DTR 1 CTS RTS The IOCR is a device control register and its contents can be loaded into a general purpose register via the move from device control register mfder instruction The contents of a general purpose register can be written to the IOCR via a move to device control register mtdcr instruction 6 1 8 Exception Syndrome Register ESR The ESR is a 32 bit register whose bits identify the cause of both Instruction Machine Checks and Program Exceptions See Section 2 13 on page 2 43 and Section 2 13 1 3 on page 2 46 and for a discussion of Instruction Machine Checks See Section 2 13 1 1 on page 2 46 for a discussion of Program Exceptions As discussed there the ESR does not need to be reset by exception handling software The contents of the ESR can be loaded into a general purpose register via the move from special purpose register mfspr instruction Figure 6 10 shows the ESR bit definitions IMCP IMCB de PET olilelalals el7 31 ee IMCT vs Figure 6 10 Exception Syndrome Register ESR 0 IMCP Instruction Machine Check Protection 0 BIU Bank Protection Error did not occur 1 BIU Bank Protection Error occurred 1 IMCN Instruction Machine Check
324. e Word Address omit 2 lo order bits of complete address 30 31 reserved 9 8 Debug Interfaces The PPC403GA processor has three debug interfaces that can be used to support both hardware and software development Trace Status Port The Trace Status port provides real time trace information and bus status information This port is designed to support logic ana lyzers and development tools Serial Port The serial port can be used for applications and it can also be used to support ROM monitor debuggers For more information on the serial port see Chapter 7 JTAG Debug Port The JTAG debug port complies with the IEEE 1149 1 Test Access Port standard It also includes enhancements to support debug The enhancements comply with the IEEE 1149 1 specification for vendor specific extensions and are therefore compatible with standard JTAG hardware for boundary scan system testing 9 8 1 Trace Status Port The PPC403GA implements a Trace Status interface to support the tracing of code running in real time This interface is designed to be connected to a high speed data collection device such as a logic analyzer A software tool such as RISCWatch with trace capability such as RISCTrace can use the data collected from this port to trace code running on the processor The result is a trace of the code executed including code that was executed out of the instruction cache if it was enabled Debugging 9 11 9 8 1 1 Trace Statu
325. e 6 11 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x1020 Exception processing begins with this program counter address To clear the WDT interrupt the exception handling routine must clear the WDT interrupt bit TSR 1 by writing a 1 to that bit position in the Timer Status Register Executing the return from critical interrupt instruction rfci restores the contents of the program counter and the MSR from SRR2 and SRR3 respectively and the PPC403GA begins execution at the contents of the program counter Table 6 11 Register Settings during Watchdog Timer Exceptions SRR2 Loaded with the address of the next instruction to be executed SRR3 Loaded with the contents of the MSR MSR WE 0 PR 0 CE 0 EE 0 ME Unchanged DE 0 PE 0 PX Unchanged PC EVPR O0 15 0x1020 TSR Set to indicate type of timer event 6 2 12 Debug Exception Seven different operations can invoke a debug exception instruction address compares IAC data address compares DAC trap instructions TRAP branch taken BRT completion of an instruction IC unconditional debug events UDE and exceptions EXC Each of these conditions is discussed in Section 9 5 Debug Events on page 9 4 When IAC DAC TRAP and BRT debug interrupts are taken the PPC403GA stores the address of the instruction in SRR2 When IC and UDE debug
326. e Cacheability Register ICCR 0 So 0 noncacheable 1 cacheable 0x0000 0000 0x07FF FFFF 1 S1 0 noncacheable 1 cacheable 0x0800 0000 OxOFFF FFFF 2 S2 0 noncacheable 1 cacheable 0x1000 0000 0x17FF FFFF 3 3 0 noncacheable 1 cacheable 0x1800 0000 Ox1FFF FFFF 4 S4 0 noncacheable 1 cacheable 0x2000 0000 0x27FF FFFF 5 S5 0 noncacheable 1 cacheable 0x2800 0000 Ox2FFF FFFF 6 S6 0 noncacheable 1 cacheable 0x3000 0000 0x37FF FFFF 7 S7 0 noncacheable 1 cacheable 0x3800 0000 Ox3FFF FFFF 8 S8 0 noncacheable 1 cacheable 0x4000 0000 0x47FF FFFF 9 EI 0 noncacheable 1 cacheable 0x4800 0000 Ox4FFF FFFF 10 S10 0 noncacheable 1 cacheable 0x5000 0000 0x57FF FFFF 11 S11 0 noncacheable 1 cacheable 0x5800 0000 OxSFFF FFFF 12 12 0 noncacheable 1 cacheable 0x6000 0000 Ox67FF FFFF 13 13 0 noncacheable 1 cacheable 0x6800 0000 Ox6FFF FFFF 14 S14 0 noncacheable 1 cacheable 0x7000 0000 0x77FF FFFF 15 S15 0 noncacheable 1 cacheable 0x7800 0000 Ox7FFF FFFF 8 4 PPC403GA User s Manual 16 S16 0 noncacheable 1 cacheable 0x8000 0000 0x87FF FFFF 17 S17 0 noncacheable 1 cacheable 0x8800 0000 Ox8FFF FFFF 18 S18 0 noncacheable 1 cacheable 0x9000 0000 0x97FF FFFF 19 S19 0 noncacheable 1 cacheable 0x9800 0000 Ox9
327. e Exception Cause ESR 4 Program Exception Illegal ESR 5 Program Exception Privileged ESR 6 Program Exception Trap 2 13 1 2 Critical Interrupt Handling An external source requests a Critical Interrupt by placing a logic 0 on the Critical Interrupt pin CINT for at least one SysClk cycle Before another interrupt can be requested from this pin CINT must be returned to logic 1 for at least one SysClk cycle When the processor detects that a logic 0 has occurred on CINT the bit EXISR CIS is set The critical interrupt handler must explicitly clear EXISR CIS prior to re enabling MSR CE Having the critical interrupt pin in the EXISR and thus under control of the EXIER gives the ability to disable the critical interrupt pin temporarily via EXIER without disabling the Watchdog Interrupt Only privileged operating system code can change the EXIER so the application code would not be allowed to disable any interrupts including the critical interrupt Having the critical interrupt pin in an architected location makes it software readable and thus pollable Any critical class exception handler code ie handlers that run with MSR CE disabled namely machine check watchdog debug and the critical interrupt handler itself can sample the bit in the EXISR while temporarily running disabled to see if an event has occurred 2 13 1 3 Instruction Machine Check Handling When an external bus error timeout BIU non conf
328. e Input Output Configuration Register IOCR prior to using a logic analyzer inverse assembler for debug Otherwise keep Bus Status Mode disabled to reduce chip I O power To enable Bus Status Mode the Real Time Debug Mode bits IOCR RDM must be set to b 01 To debug boot code using a logic analyzer the very first lines of the boot code must set IOCR RDM b 01 9 3 Processor Control This section describes the debug facilities available for controlling the processor Not all of these facilities are available in all debug modes Block Folding Instruction Step Instruction Stuff Halt Stop Reset Freeze Timers Debug Events The folding dual dispatch of instructions in the instruction queue can be blocked using the JTAG debug port The processor can be stepped one instruction at a time while it is stopped using the JTAG debug port While the processor is stopped instructions can be stuffed into the processor and executed using the JTAG debug port The processor can be stopped by activating the external HALT signal This signal can be used to stop the processor on an exter nal event such as a logic analyzer trigger Activating this signal causes the processor to become architecturally frozen While fro zen normal instruction execution stops and all architected resources of the processor can be accessed and altered Normal execution continues after this signal is deactivated The processor can be st
329. e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 45 crnor Condition Register NOR crnor BT BA BB 0 6 11 16 21 31 Chor ZC CRea WM Che The CR bit specified by the BA field is ORed with the CR bit specified by the BB field the ones complement of the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 14 Extended Mnemonics for crnor Other Mnemonic Operands Function Registers Page Changed crnot bx by Condition register not 10 46 Extended mnemonic for crnor bx by by 10 46 PPC403GA User s Manual cror BT BA BB cror Condition Register OR BT BA 449 6 Chor lt Con v CRep The CR bit specified by the BA field is ORed with the CR bit specified by the BB field the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note 21 This instruction is part of the PowerPC User Instruction Set Architecture Table 10 15 Extended Mnemonics for cror 31 Other Mnemonic Operands Function Registers Page Changed crmove bx by Condition regis
330. e SPTB are transmitted least significant bit first While the transmitter is shifting out the current piece of data the SPTB may be loaded with the next piece of data When transmission of the current piece of data completes and assuming the DSR CTS input has not gone inactive during that character s transmission the next piece of data will be transferred to the SPTSR and the process repeats Note that TxEmpty stays at a value of logic 0 until either a handshaking error is flagged or no more characters are loaded into the SPTB 7 2 2 1 Pattern Generation Mode Pattern Generation Mode PGM is enabled by the PGM bit in the SPTC SPTC PGM 1 When PGM is enabled the serial port transmitter will operate basically the same as when PGM is disabled except that the generation of start and stop bits during character transmissions are suppressed Thus the SPU will essentially become a pattern generator where only the 7 or 8 data bits and parity bit if enabled will be transmitted This allows the serial port transmitter to be used for pulse width modulation with duty cycle variation controlled by frame size baud rate and data pattern 7 2 2 2 Transmitter Stop Pause Mode How the SPU responds to the DSR CTS handshaking input depends on which input it functionally represents and the value of the Stop Pause Enable SPE bit of the SPTC register Recall that the function of the DSR CTS input is selected via the SPC bit of the IOCR Assume that the
331. e WE bit 14 CE Critical Interrupt Enable CE controls these interrupts 0 Critical exceptions are disabled critical interrupt pin 1 Critical exceptions are enabled watchdog timer first time out 15 ILE Interrupt Little Endian MSR ILE is copied to MSR LE when an 0 Interrupt handlers execute interrupt is taken in Big Endian mode 1 Interrupt handlers execute in Little Endian mode 16 EE External Interrupt Enable EE controls these interrupts 0 Asynchronous exceptions are disabled non critical external DMA 1 Asynchronous exceptions are enabled serial port JTAG serial port programmable interval timer fixed interval timer 17 PR Problem State 0 Supervisor State all instructions allowed 1 Problem State limited instructions available 18 reserved 19 ME Machine Check Enable 0 Machine check exceptions are disabled 1 Machine check exceptions are enabled 20 21 reserved 22 DE Debug Exception Enable 0 Debug exceptions are disabled 1 Debug exceptions are enabled 23 27 reserved 28 PE Protection Enable 0 Protection exceptions are disabled 1 Protection exceptions are enabled 29 PX Protection Exclusive Mode 0 Protection mode is inclusive as defined in Section 2 10 on page 2 33 1 Protection mode is exclusive as defined in Section 2 10 on page 2 33 MSR cont 30 reserved 31 LE Little Endian 0 Processor executes in Big Endian mode 1 Processor executes in Little Endian mode
332. e ae tee 2 49 Instructions Specific to PowerPC Embedded Controller A 2 50 Data Movement INStructionS 0 eescceeesceeeseneeeeeeeeeeeneeeeeeaeeeeeeaeeeenaeeeseeeeseeaeeeenaeeeeeneeeees 2 50 Arithmetic and Logical Instructions 200 0 eeccceeeseeeeseeeeeeneeeeeeneeeeeaeeeeeeeeeeneeeeseeeeeenneereaas 2 51 Comparison INStrUCtONS ea s a a EES dE eege ee 2 52 Giel uge EE 2 52 Condition Register Logical Instructions ccceeeceeeeeeeeeeeeeeteneeeeeeseaeeseeeenaeessaeeneesneeeeas 2 52 Rotate and Shift INStructionSs eecceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaeeseaeesaeeseaeeseeeseeeseaeeeeetsaee 2 53 Cache Control INStructions AA 2 53 Interrupt Control Instructions 2 eeeeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeeeeaeeseaeeeaeeseaeeseeeseeeseaeeeeetsaes 2 54 Processor Management Instructions eeeceeeeeeeeeneeeeeneeeeeeneetenaeeeeeeeeeeeaeeesnaeeeeeaeees 2 54 Memory and Peripheral Interface csssssecsssseeeessseeeeesseeeeeenes 3 1 ue due 3 2 ACCESS le TEE 3 3 Memory Banks Supported AAA 3 4 Attachment to the Bus 2s scien i etitee nets cena mali EES rae e a ea eevee ate Een 3 5 Bus Width after Reset te cite dia edie eh onl eh ee a 3 5 Alternative Bus Attachment asdf deer de atts edd en sianeteeeeandh aie ete 3 6 Address Bit Usage EE 3 7 Cacheability ts caticnstahsee al hens AG hte Badin Oh Waal alist die end Eer iets 3 8 SRAM DRAM OPB Addresses AA 3 9 External Memory Location EE 3 10 The SRAM ROM Interface eelere
333. e are defined in Table C 1 and Table C 2 Table C 1 CTR and LR Updating Instructions CTR Updating LR Updating with BO 2 0 bl with BO 2 0 bla with BO 2 0 bel bela with BO 2 0 bcla belr with BO 2 0 belrl belrl with BO 2 0 bectrl Table C 2 CR Updating Instructions Processor Management merxr mtcrf CR Logical crand cror crxor crnand crnor creqv crandc crore merf Arithmetic add mullw addo mullwo addic mulhw addc mulhwu addco neg adde nego addeo subf addme subfo addmeo subfc addze subfco addzeo subfe divw subfeo divwo subfme divwu subfmeo divwuo subfze subfzeo Logical Data g Movement and stwcx andi andis cntlzw extsb extsh or xor nand nor eqv andc orc Rotate and Shift rlwinm rlwnm rlwimi slw srw srawi sraw Compare cmp cmpi cmpl cmpli NOTE merxr and the CR Logical instructions are able to produce their results while in EXE such that the instruction in DCD can use the results bypass thereby avoiding inserting a bubble idle cycle C 10 PPC403GA User s Manual C 4 2 Instructions That Can Be Folded e Only instructions in IQ1 can be folded e No instructions can be folded onto a mtmsr isync sc rfi rfci wrtee or wrteei instruction e Only the next sequential instruction can be folded i e the folded instruction always has an address of
334. e asynchronous serial port on the on chip peripheral bus OPB of the PPC403GA The following sections discuss the serial port hardware elements operations and operating modes and details of registers and buffers 7 1 Overview The serial port unit SPU runs at speeds up to one sixteenth of the processor SysClk clock rate and provides features typically found on advanced serial communications controllers including DMA peripheral support internal loopback mode automatic echo mode and automatic handshaking capability on both receive and transmit operations The SPU comprises three main elements receiver transmitter and baud rate generator as shown in Figure 7 1 Data RecvD To OPB i DTR Serial Port DTR RTS Receiver Baud Rate Clock x 16 Baud Rate d SEH Automatic Generator Wee SerClk Internal Loopback Data Serial Port gt XmitD From OPB Transmitter DSR CTS Figure 7 1 Serial Port Functional Block Diagram Serial Port Operation 7 1 7 1 1 SPU Operating Mode Selection The SPU can be configured to operate in normal loopback or automatic echo mode by setting the Loopback Mode LM bits in the Serial Port Control SPCTL register as indicated in Table 7 1 Table 7 1 SPU Operating Mode Selection Mode SPCTL Register Bit Settings Normal LM 00 Internal Loopback LM 01 Automatic Echo LM 10 7 1 1 1 Normal Mode In Normal Mode the SPU performs like
335. e driven coincident with the chip select If 1 the data bus will be driven 1 bus cycle after the chip select is activated The WBN field bit 26 specifies the write enable turn on delay WBEon which is when the write byte enables should be asserted relative to the chip select signal If 0 then the WBE signal will turn on coincident with the chip select If 1 then the WBE sig nal will be delayed 1 bus cycle from the chip select The WBF field bit 27 specifies the write enable turn off time WBEoff which is when the write byte enables are deasserted relative to the deassertion of the chip select sig nal If the bit is 0 then WBE will turn off coincident with the chip select signal If the bit is 1 then WBE will turn off one cycle before the turn off of the chip select signal It is invalid to set the WBF 1 if the Wait parameter is equal to 0 The TH field bits 28 30 specify the number of SysClk cycles 0 through 7 that the bus is held after the deassertion of CS During these cycles the address bus and data bus are active and R W is valid during the Hold time chip select output enable and write byte enables are inactive The SD field bit 31 specifies the usage SRAM or DRAM of the bank register for bank registers BR4 BR7 which have dual usage For those registers SD 1 indicates SRAM and SD 0 indicates DRAM For BRO BR3 only SRAM usage is defined and field SD is reserved always 0 PPC403GA User s Manua
336. e number of wait states to be taken by the first access to the SRAM bank during a burst transfer field BME 1 The number of cycles from address valid to address invalid on the first access is 1 FWT where 0 lt FWT lt 15 See Section 3 6 3 on page 3 19 for further discussion of SRAM ROM burst mode The BWT field bits 22 23 specifies the number of wait states to be taken by accesses beyond the first to the SRAM bank during a burst transfer field BME 1 On burst accesses except for the last the number of cycles from address valid to the next valid address on each burst access is 1 BWT where 0 lt BWT lt 3 On the last burst access the number of cycles from address valid to the deassertion of CS is 1 BWT where 0 lt BWT lt 3 See Section 3 6 3 on page 3 19 for further discussion of SRAM ROM burst mode The CSN field bit 24 specifies the chip select turn on delay CSon The chip select signal may turn on coincident with the address or be delayed by 1 bus cycle Memory and Peripheral Interface 3 25 3 26 The OEN field bit 25 specifies the output enable turn on delay OEon which is when the output enable signal should be asserted for read operations relative to the chip select signal If 0 the signal will be asserted coincident with the chip select If 1 the OE signal will be delayed by 1 bus cycle This signal is also used on write operations to control the turn on of the data bus If 0 the data bus will b
337. e only the ROW address for this pin 3 8 The On Chip Peripheral Bus Interface The PPC403GA OPB is a synchronous device paced bus that attaches on chip peripherals to the processor core The OPB comprises a 32 bit data bus a 32 bit address bus and control signals The bus can support single cycle data transfers between on chip peripherals and the core The OPB is connected to the BIU which is always the bus master of the OPB Requests for data transfers on the OPB can originate from the instruction cache the data cache or DMA and are arbitrated by the BIU The BIU controls all handshaking and data movement required to complete a transfer accepted by the BIU 3 48 PPC403GA User s Manual 3 9 External Bus Master Interface The PPC403GA supports a shared bus protocol which allows external bus masters to take control of the PPC403GA external buses and SRAM control signals Furthermore the PPC403GA provides support for external bus masters to access the local DRAM using the DRAM controller internal to the PPC403GA Figure 3 24 shows a sample interconnection among a PPC403GA one DRAM bank and one external bus master Only one DRAM bank is shown but the bus master could access as many as four DRAM banks local to the PPC403GA Also with the appropriate arbitration logic multiple bus masters may be used in a PPC403GA system The internal external multiplexer bit bit 17 in the bank register for this DRAM bank must be set for an ex
338. e to enable or disable interrupts from each source whether on or off chip Each input from an interrupt source is latched into a status register and ANDed with the corresponding bit of the enable register The results are ORed together and sent to the RISC core as a single interrupt input The interrupt mechanism within the core then prioritizes this asynchronous interrupt input with all other exception sources such as timer interrupts or program exceptions 1 3 5 Serial Port The PPC403GA serial port is capable of supporting RS232 standard serial communication as well as high speed execution bit speed at a maximum of one sixteenth of the SysClk processor clock rate The clock which drives the serial port can be derived from SysClk or from an external clock source at the TimerClk pin maximum of one half the SysClk rate The PPC403GA serial port contains many features found only on advanced communications controllers including the capability of being a peripheral for DMA transfers An internal loopback mode supports diagnostic testing without requiring external hardware An auto echo mode is included to retransmit received bits to the external device Auto Overview 1 9 resynchronization after a line break and false start bit detection are also provided as well as operating modes that allow the serial port to react to handshaking line inputs or control handshaking line outputs without software interaction 1 3 6 Debug Port Debug is sup
339. ebug Event 0 Event Didn t Occur 1 Event Occurred 10 DW2 Data Address Write Compare 2 Debug Event 0 Event Didn t Occur 1 Event Occurred 11 IDE Imprecise Debug Event 0 Event Didn t Occur 1 Debug Event Occurred While Debug Exceptions were disabled by MSR DE 0 Debugging 9 9 12 21 reserved 22 23 MRR Most Recent Reset These two bits are set to one of three values 00 No Reset Occurred Since Power Up when a reset occurs 01 Core Reset These two bits are cleared to 00 at power up 10 Chip Reset 11 System Reset 24 28 reserved 29 JIF JTAG Serial Inbound Buffer Full This bit is set to 1 when the JSIB is written 0 Empty This bit is cleared to 0 when the JSIB is read 1 Full WARNING Unexpected results can occur if this bit is altered by application software 30 JIO JTAG Serial Inbound Buffer Overrun This bit is set to 1 when a second write to the 0 No Overrun JSIB is done without an intervening read 1 Overrun Occurred This bit is cleared to 0 by a write to the DBSR with a 1 in this bit position 31 JOE JTAG Serial Outbound Buffer Empty This bit is set to 1 when the JSOB is read 0 Full This bit is cleared to 0 by writing to the JSOB 1 Empty WARNING Unexpected results can occur if this bit is altered by application software 9 7 3 Data Address Compare Registers DAC1 DAC2 The PPC403GA has the capability to take a debug event upon e
340. eceeeeeeeeeeseeeeeesneneseneeseseeeeensaeeeeeneeseseeeneneneeens 6 24 Fixed Interval Un 6 25 Watchdog TIME EE 6 26 Debug ee EE 6 26 t Eed 6 28 Timer Clocks a 2c aie eed ei Ha I i ee ee 6 28 Time Base TBHland TBO sis ese ag onset hee esti te seen ener olen tens aden ewe te atin 6 29 Comparison with PowerPC Architecture Time Base 0 eecee eee eeeeeeeeetes 6 30 Programmable Interval Timer PIT ceeesceeeeeeeeeeeeeeeeeneeeeeeaeeeesaeeeseaeeensaeeessnneeeenaeeees 6 31 Fixed Interval Timer FUT stearic tive eatin ee ee fate EES Eeer 6 33 Watch Dog Timer WD lt aara ae aaa aee a e E E ei e aaa a aaa 6 33 Timer Status Register TSR ceccceseseseeeseeseseeeeeeseaeeceeeseanecaeesaeeeneeseaaeesaeeeeesseateeees 6 35 Timer Control Register TCR A 6 36 Contents ix Serial Port Operation win siciacsciceesasessscrsesesencucucwersranasensneceaneseatuawmecsansde 7 1 MEET cee what Gite ete ected a tei DEE deele eed secs 7 1 SPU Operating Mode Selection A 7 2 Normal Mod sadnih ccein o tea aniaui iaai ei eaaa a imei a aR 7 2 Internal Loopback d EE 7 2 Automatic Echo Mod EE 7 2 SPU Handshaking I O Pair Selection ce eeeececeeeeeeeeeeeeeeeeeeeeeseeeeeaeeteaeeeaeeteaeeseeeeeaeens 7 2 SPU REGIStEIS ugik oiae aaa enen a o a eaa hier ici hesitated 7 3 e W Mel UE 7 5 SPU Baud Rate Generator EEN 7 5 SPU Transmitteb EE 7 6 Pattern Generation Mode AAA 7 7 Transmitter Stop Pause Mode ceeceeceese
341. eceneeeeeeteeeeeeeseaeeseeenaeeseeeeaeesseeesieeseeeeenees 7 7 Transmitter Line Break Generation cccecceeseeeeeteneeeeeeseeeceeeneeeseeeeeaeeeseeetieeeneeeenees 7 8 Transmitter DMA de 7 8 Transmitter Interrupts ue tee awe eel eas 7 8 e W BEE 7 9 Receiver Control of RIS cc0 ccninecads acca iden nitrites 7 10 Receiver DMA Mode eege enticed choi ENEE hee dee 7 10 Receiver Interrupts 2 2 cocoa ia ted iste ds eet deine iss 7 11 SPU Register Descriptions iriser e aee a E 7 11 Baud Rate Divisor Registers AAA 7 12 Serial Port Control Register SPOTL eceeceeeeeeeeeeeeeeeeeeeeeeeeaeeeneeeeaeesneeeeneeeeaeeeneeteas 7 13 Serial Port Handshake Status Register SPHS e ceecceseseeeeeeeseeeeeeeeeeeeeneeeeeeeeneeeeas 7 14 Serial Port Line Status Register SPLS ecceecceeseeeeeeeeeeeeeeeeeeeeeeeeeaeeeneeeeeeeeaeeeneeeeas 7 15 Serial Port Receive Buffer SPRB ceccceesceseeeceeeeeeeeseeeeeeeeeeaeeeneeeeaeeseeeeeeeeeaeeeeeeeas 7 16 Serial Port Receiver Command Register SPRO ceeccecsseeseeeeeeeneeeeeeeeneeeeeeeeeeeas 7 16 Serial Port Transmit Buffer PID 7 16 Serial Port Transmit Command Register SPTO cceseesseeeeeeeeeeeteeeeseeeeneeseaeeeeeeeas 7 18 Kaphetipetratgopg otesebeepCegesesgueesbtekees ege gege 8 1 Cache Debugging Eeatttee u rg 2eee Ze g eeude ZOE NEE EENS a aun dds 8 1 Instruction Cache Unit ture NEESS Se dE AEN EE ENNESCH 8 1 Instruction Cache Operations
342. ect the RTS CTS UO pair a 1 must be written to the SPC bit 7 2 PPC403GA User s Manual 7 1 3 SPU Registers Serial Port registers are memory mapped and thus are accessed via load store instructions at the address of the register Since the SPU is a byte device its registers are eight bits and are usually accessed using load byte and store byte instructions Load store half word and word instructions can also access the serial port registers When these instructions are used the bus interface unit BIU breaks register accesses into discrete byte operations Table 7 2 shows the memory mapped addresses for the user accessible registers in the serial port Note that although logically the SPRB and SPTB are separate registers they are mapped to the same physical address Table 7 2 Serial Port Register Addresses Names and Access Modes Metier appar Name Mnemonic Access Modes 0x4000 0000 Serial Port Line Status Register SPLS Read Write 0x4000 0001 Reserved 0x4000 0002 Serial Port Handshake Status Register SPHS Read Write 0x4000 0003 Reserved 0x4000 0004 Baud Rate Divisor High Register BRDH Read Write 0x4000 0005 Baud Rate Divisor Low Register BRDL Read Write 0x4000 0006 Serial Port Control Register SPCTL Read Write 0x4000 0007 Serial Port Receiver Command Register SPRC Read Write 0x4000 0008 Serial Port Transmitter Command Register SPTC Read Write 0x4000 0009 Serial Port Receive Transmit Buffer SPR
343. ed and enabled This is accomplished via a move to device control register mtdcr instruction The contents of the DMA Channel Control Register may also be loaded into a general purpose register by using a move from device control register mfdcr instruction The DMA channels are enabled and the transfer mode direction width and the peripheral location internal or external are all programmed via the Channel Control Register Also transfer parameters such as peripheral set up wait and hold times are programmed in the Channel Control Register Figure 4 17 shows the DMACR bit definitions PW SAI TM PWC Ge TCE BME TCD sl slel7 s 9 10 11 12 13 18 19 21 23 24 25 26 27 28 31 22 cle de DAI CP ek ek a D Figure 4 17 DMA Channel Control Registers DMACRO DMACR3 0 CE Channel Enable 0 Channel is disabled 1 Channel is enabled for DMA operation 1 CIE Channel Interrupt Enable 0 Disable DMA interrupts from this channel to the processor 1 All DMA interrupts from this channel end of transfer terminal count reached are enabled 2 TD Transfer Direction Valid only for buffered mode and fly by mode don t care in memory to memory mode 0 Transfers are from memory to peripheral 1 Transfers are from peripheral to memory 3 PL Peripheral Location 0 Peripheral is external to the PPC403GA 1 Peripheral is internal to PPC403GA internal peripherals a
344. ed either as source or destination for DMA transfers DMA transfers to or from the SPU are discussed in the chapter on serial port operations 4 2 1 DMA Signals Figure 4 2 shows the DMA channels and their associated signals Note that the Channel 3 signals have multiplexed function and their function depends on whether the PPC403GA or another device is the bus master When the PPC403GA is the bus master the three signals DMAR DMAA and EOT TC are used with each DMA channel An external device or internal peripheral may request a DMA transaction by placing a 0 on a channel s DMA request pin DMAR If the DMA channel is enabled via the channel control register the PPC403GA responds to the DMA request by asserting an active level on the DMAA pin when the DMA transfer begins The PPC403GA DMA controller holds an active level on the DMAA pin while the transfer is in progress When programmed as the terminal count output the EOT TC pin will be lowered to a 0 by the PPC403GA to signify that the DMA transaction transfer count has reached 0 When the EOT TC is programmed as an end of transfer input an external device may terminate the DMA transfer at any time by placing an active level on the EOT TC pin The direction of the DMA Operations 4 3 DMA channel s end of transfer terminal count EOT TC pin is programmable via the DMA Channel Control Register If the DMA channel is operating in fly by mode the PPC403GA provides the address an
345. ed mnemonic for bectrl 4 4 cr_field 1 LR 10 28 Instruction Set 10 29 bcectr Branch Conditional to Count Register Table 10 7 Extended Mnemonics for bcctr bcctrl cont bitctr Mnemonic Operands cr_field bitctrl Function Branch if less than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 0 Other Registers Changed Extended mnemonic for bectrl 12 4 cr_field 0 LR Page 10 28 bnectr cr_field bnectrl Branch if not equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 2 Extended mnemonic for bectrl 4 4 cr_field 2 LR 10 28 bngctr cr_field bngctrl Branch if not greater than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 1 Extended mnemonic for bectrl 4 4 cr_field 1 LR 10 28 bnictr cr_field bnictrl Branch if not less than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 0 Extended mnemonic for bectrl 4 4 cr_field 0 LR 10 28 bnsctr cr_field bnsctrl Branch if not summary overflow to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 3 Extended mnemonic for bectrl 4 4 cr_field 3 LR 10 28 bnuctr cr_field b
346. ee description of A22 AMuxCAS 139 O DRAM External Address Multiplexer Select AMuxCAS controls the select logic on an external multiplexer If AMuxCAS is low the multiplexer should select the row address for the DRAM and when AMuxCAS is 1 the multiplexer should select the column address BootW 11 l Boot up ROM Width Select BootW is sampled while the Reset pin is active and again after Reset becomes inactive to determine the width of the boot up ROM If this pin is tied to logic 0 when sampled on reset an 8 bit boot width is assumed If BootW is tied to 1 a 32 bit boot width is assumed For 16 bit boot widths this pin should be tied to the Reset pin BusError 12 l Bus Error Input A logic 0 input to the BusError pin by an external device sig nals to the PPC403GA that an error occurred on the bus transaction BusError is only sampled during the data transfer cycle or the last wait cycle of the trans fer BusReq 135 O Bus Request While HoldAck is active BusReq is active when the DMADXFER PPC403GA has a bus operation pending and needs to regain control of the bus DMA Data Transfer When HoldAck is not active DMADXFER indicates a valid data transfer cycle For DMA use DMADXFER controls burst mode fly by DMA transfers between memory and peripherals DMADXFER is not meaningful unless a DMA Acknowledge signal DMAA0 DMAA3 is active For transfer rates slower than one transfer per cycle DMADXFER is active for one cycle when one transfer i
347. eeeeeeeeeeeeeaeeseaeeeaeeeeeeeseeeeaeeraees 4 25 DMA Transfer Priorities es iced tes ie tinea divs eee E E eeetee severe 4 26 INTO pis steers niio Pn thee each nei aa hades aha taba ate ea Eaa aeai 4 27 Errors 2icicadaiiist ania oil adic divin eat a a aie ec 4 28 DMA E AEE ETAT scstaes ihsaveyacasatedscasudl shade ahetddcpasscnead 4 29 DMA Channel Control Register DMACRO DMACR3 ceeseeeereeeeeeeeeeeeteteeeeeneenaees 4 29 DMA Status Register DMASR A 4 32 DMA Destination Address Register MADA0 DMADA3 AA 4 34 DMA Source Chained Address Register DMASA0 DMASAS ccescceeteeeteeeteetees 4 34 DMA Count Register DMACTO DMACT3 ssesseeseesseeeeeeeiesreeererrstnnsinstrtrnsrnnrnerneen 4 35 DMA Chained Count Register DMACCO DMACC3 oe eeceeceeeteeeeeeeeeeeeeeeteeeeeetaees 4 36 Reset and Initialization cccccseseeeeeeeeeeeeseeeeeeeeeenseeeeeeeeeeseneeeees 5 1 Core Chip and System Resets AE 5 1 viii PPC403GA User s Manual Processor State After Reset eine ee ee ele EE on 5 2 Register Contents After A Reset AAA 5 3 DRAM Controller Behavior During Reset ccecceesceeeeeeeeeeeeeeeeneeseneeeeeseaeeeaeeteaeeseeeeneeeaaes 5 5 Initial Processor Sequencing ecrsinssisiorrtsn dinie i nE sini iii i einen 5 6 initialization Requirements iiir cies iian oaae e pnia eai aia aala Senat 5 6 Notes on Bank Register Initialization 5 7 Initialization Code Example AA 5 7 Interrupts Exceptions and Timers
348. eeeeeseeeeneneeeeeaaes 10 40 Extended Mnemonics for CreQy cccescceeesneeeesseeeeeneeeeesaeeessaeeeeeneeeeseeeeseaaes 10 44 Extended Mnemonics fOr Crnor cccccceccceceeeceseeeeeeseseeseeeceensnsaeaeaeeeeeeeeeeeeess 10 46 Extended Mnemonics fOr Cror cccccccccccccecececeseeseseseeeeseeesensenaeeeeeeeeeeeeeeeeess 10 47 Extended Mnemonics fOr Crxor cccccccecccecececeeeeeesesecseseseeecnsnsaeaeaeeeeeeeeeeeeess 10 49 Extended Mnemonics for mfdcr cccccceccceceseeeeseeeesesesesnensasaaaeeeeeeeeeeeeess 10 101 Extended Mnemonics for mtept esceesseeesneeeeneeeeeneeeeeeneeeeeeeeeeneeereaes 10 104 Extended Mnemonics for mtcrf cccccccccccccceeeeeeeeeseeseseesssensneaaaeeeeeeeeeeeeess 10 106 Extended Mnemonics for mtdcr ccccccccccceceeeeeeeeeessessssessnsaaeaeaeeeeeeeeeeees 10 108 Extended Mnemonics for Mtspr cescceeseeeeeeneeeeeneeeeeneeeeeeneeeseneeeeeneeeeeaes 10 111 Extended Mnemonics for nor NOF cccccccccccssssssececeeeceeteeeessnseseeeeeeeereneaaes 10 118 Extended Mnemonics for or or 10 119 Extended Mnemonics for Ori cccccccccccecscececceeseeseseseeesseseeesnsneaaaeeeeeeeeseeeess 10 121 Extended Mnemonics for rlwimi rlWiMi 00 0ccccccececeeeeeessseeeeeeeeeeneeeeees 10 125 Extended Mnemonics for rlwinm rIWINM cccccccceeeceeessesseeeeeeeeereneeees 10 126 Extended Mnemonics for rlwnm rIWNM 000 sccccccececeeceesseseseeeeeeeeneeeee
349. eft The result is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note 10 This instruction is part of the PowerPC User Instruction Set Architecture 10 80 PPC403GA User s Manual Ihz Load Halfword and Zero Ihz RT D RA 40 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RT 80 MS EA 2 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The halfword at the effective address is extended to 32 bits by concatenating 16 0 bits to its left The result is placed into register RT Registers Altered e RT Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 81 Ihzu Load Halfword and Zero with Update Ihzu RT D RA 41 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RA EA RT lt 160 MS EA 2 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA fiel
350. either a 1 or 0 as defined by the bank control register If the SysClk remains off and the Reset input is deasserted the RAS signals will switch from the HiZ state back to the previous state before the Reset input was activated The CAS signals will remain unchanged and will continue to drive the either logic 0 or 1 as defined by the bank control register The assertion of Reset with the SysClk off will put all of the I O s in the state defined on page 29 of the PPC403GA data sheet As long as the SysClk remains off the chip will not enter the system reset state with the exception of the JTAG interface logic which will go the reset or idle state even though the SysClk remains off By turning off the SysClk input and activating the Reset input the chip will dissipate the minimum amount of power If it is desired to continue to keep the DRAM device in the Self Refresh mode while in this state a pull down will be required on the RAS output for the DRAM bank This will hold the RAS signal active logic 0 while the Reset input is active Note that this will also activate the RAS signal during normal system reset and therefore an active pull down may be required by the system Caution for users of Early RAS Mode e Ifa DRAM bank is programmed to use the Early RAS Mode feature DRAM bank register bit 14 is set to 1 no access to this bank can occur within 700 nsec from the deactivation of Reset or 700 nse
351. eload PIT except that there are fewer selections of interrupt period available The FIT exception occurs on 0 1 transitions of selected bits from the time base per the following table m Period Period Tal EECH Time Base clocks 33 Mhz clock 0 0 23 29 clocks 15 52 USEC 0 1 19 213 clocks 248 2 USEC 1 0 15 217 clocks 3 972 MSEC 11 11 221 clocks 63 55 MSEC The FIT exception is logged by TSR 5 as a pending interrupt A FIT Interrupt will occur if TCR 8 and MSR EE are enabled See Section 6 2 10 for details of register behavior under the FIT interrupt The interrupt handler will be expected to reset TSR 5 via software This is done by writing a word to TSR using mtspr with a 1 in bit 5 and any other bits that are to be cleared and 0 in all other bits The write data to the status register is not direct data but a mask A 1 causes the bit to be cleared and a 0 has no effect 6 3 5 Watch Dog Timer WDT The Watchdog Timer is a facility intended to aid system recovery from hung software Like the FIT the Watchdog exception occurs on 0 gt 1 transitions of selected bits from the time base per the following table TCR O 1 0 0 TBLO Bit Period Time Base clocks 217 clocks Period 33 Mhz clock 3 972 MSEC Interrupts Exceptions and Timers 6 33 Period 33 Mhz clock Period TCR 0 1 ee Time Base clocks 0 1 11 221 clocks 63 55 MSEC
352. ements once for each period of the time base clock as discussed above Software access to the Time Base is via mtspr and mfspr instructions All access to the time base is privileged The period of the 56 bit Time Base is many years The Time Base does not generate any interrupts even when it wraps It is assumed for most applications that the Time Base will be set once at system reset and only read thereafter Note that the Fixed Interval Timer and the Watchdog Timer discussed below are driven by 0 1 transitions of selected bits of TBLO Transitions caused by software alteration of TBLO using mtspr will have the same effect as would transitions caused by normal incrementing Figure 6 15 illustrates TBHI and Figure 6 16 illustrates TBLO Figure 6 15 Time Base High Register TBHI 0 7 reserved 8 31 Time High Current count high order Interrupts Exceptions and Timers 6 29 31 Figure 6 16 Time Base Low Register TBLO 0 31 Time Low Current count lo order 6 3 2 1 Comparison with PowerPC Architecture Time Base The Time Base of the PPC403GA has essentially the same functionality as the Time Base defined in the PowerPC Architecture but the two are not the same This section will highlight the differences as an aid to porting code For the PowerPC Architecture The PowerPC Architecture defines a 64 bit time base which may be accessed as a pair of 32
353. emonics for addi cccccceceeeececeeeeeeeeneeeeeeseeeneeeeeeeeeeneeeeetees 10 10 Extended Mnemonics for addi 10 11 Extended Mnemonics for addi 10 12 Extended Mnemonics for addis ccccceeeeeceeeeeeeeeneeeeeeseecneeeeeeeeenaeeeeetees 10 13 Extended Mnemonics for bc bca bel bela eee eeeeseeeeneeeeesneeteeneeeteneees 10 22 Extended Mnemonics for bech bech cc ceeeessseeceeeeeeeeeeeeeessseeeeeeeeeeeeaes 10 29 Extended Mnemonics for bclr belrl ccccccccessssssseceeeeeeceeeeeeeseseseceeeeeeeeaes 10 33 Extended Mnemonics for CMP eeescceeesseeeeeneeeeeneeeeesneeeeseeeesaneeeeseeeseaeees 10 37 Extended Mnemonics for emp escceeeseeeeesneeeeenneeeesneeeeseeeeenaeeteeneeeeeeees 10 38 Extended Mnemonics for CM escceesseeeeeneeeeeneeeeeneeeteaeeeessaeeeeeeeeseeess 10 39 xxii PPC403GA User s Manual Table 10 12 Table 10 13 Table 10 14 Table 10 15 Table 10 16 Table 10 17 Table 10 18 Table 10 19 Table 10 20 Table 10 21 Table 10 22 Table 10 23 Table 10 24 Table 10 25 Table 10 26 Table 10 27 Table 10 28 Table 10 29 Table 10 30 Table 10 31 Table 11 1 Table 11 2 Table 11 3 Table 11 4 Table 12 1 Table 12 2 Table A 1 Table B 1 Table B 2 Table B 3 Table B 4 Table B 5 Table B 6 Table B 7 Table B 8 Table B 9 Table B 10 Table B 11 Table B 12 Table B 13 Extended Mnemonics for CMpli escceeesseeeeeeeeeseneeeeeeeeessa
354. ended mnemonics are isolated in a single table Table B 4 on page B 5 Table 2 14 PPC403GA Instruction Set Summary Instruction Category Base Instructions Data Movement load store Arithmetic Logical add subtract negate multiply divide and or xor nand nor xnor sign exten sion count leading zeros andc orc Comparison compare algebraic compare logical compare immediate Programming Model 2 49 Table 2 14 PPC403GA Instruction Set Summary cont Instruction Category Base Instructions Branch branch branch conditional branch to LR branch to CTR CR Logical crand crnor crxnor crxor crandc crorc crnand cror cr move Rotate Shift rotate rotate and mask shift left shift right Cache Control invalidate touch zero flush store dcread icread Interrupt Control write to external interrupt enable bit move to from machine state register return from interrupt return from critical interrupt Processor Manage system call synchronize eieio move to from device control registers move ment to from special purpose registers mtcrf mfcr mtmsr mfmsr 2 14 1 Instructions Specific to PowerPC Embedded Controller In order to facilitate functions required of processors used in embedded real time applications the PowerPC Embedded Controller family defines instructions beyond those found in the PowerPC Architecture Table 2 15 summarizes all such instructions which
355. eneeeeeeeeeeeeeeeeeaeeeseeeeeesaeeesenaeeseneeeeneeeeees B 34 Condition Register Logical Instructions eccceeceeeeeeeeeeeeeeeneeeeeeeeeeeeeeeseeeeeeeseaeeeeeeteaeens B 39 Silent IC B 40 Comparison Ed ele TEE B 41 Rotate and Shift INStructions a edel B 42 Cache Control Instructions nnen Sal ah ine i aie anh evi tied Metal eel anand B 44 Interrupt Control Instructions 0 ccc eeceeeeeeeeeeeeeeneeeeaeeeeeeeeaeeseeeeeaeeseaeeeaeetaeeeeeseaeesieesearenaees B 45 Processor Management Instructions eeseeeseeeeeneeeeeeneeeseaeeeeeeeeeeseaeeeseaeeeeenaeeeseneeereaaees B 46 xiv PPC403GA User s Manual Instruction Timing and Optimization cccccssssseeeeeeeeeeeeeeeeeeeees C 1 Background Miri e EE C 1 Superscalar Operation 291 sane honoir eare AE SEO ADe EE C 1 Folding Defined ea ssec tests cies T a a aa a e ies tae cat nas lav idee adevste dbase se E aT aaas C 1 Gilels EE C 2 eroro ARENE E aE E E aneres ced ee ae sarausteseasebedectanjeatasaacdea T C 3 Condition Register Bits for Boolean Variables cccceeceeeeceesceeeeeeeeeeteeeeeeeseeeseeeeneenaas C 3 CR Logical Instructions for Compound Branches A C 3 Floating Points Emulation ege a deeg Eben EE EES Ee C 3 Data Cache Usage eu ee sein eekE Eed vd nie dE CA Instruction Cache USage resmidir e e SEENEN CA Dependency Upon CR ected indeed ete wile EENEG CA Dependency Upon LR and CTR seENENEENERNENEERE NENNEN NENNEN C 5 Load Latency EE C 5 Branch Pre
356. ents Remaining Action on Debug Events is enabled when FER 0 If FER 0 a Debug Event causes FER to decrement 13 FT Freeze Timers On Debug Event 0 Free run Timers 1 Freeze Timers Register Summary 11 19 DBCR cont IA1 Instruction Address Compare 1 Enable 0 Disable 1 Enable IA2 Instruction Address Compare 2 Enable 0 Disable 1 Enable DIR Data Address Compare 1 Read Enable 0 Disable 1 Enable DIW Data Address Compare 1 Write Enable 0 Disable 1 Enable DiS Data Address Compare 1 Size 00 Compare All Bits 01 Ignore1 LSB 10 Ignore 2 LSBs 11 Ignore 4 LSBs 20 D2R Data Address Compare 2 Read Enable 0 Disable 1 Enable 21 D2W Data Address Compare 2 Write Enable 0 Disable 1 Enable 24 22 23 D2S Data Address Compare 2 Size 00 Compare All Bits 01 Ignore1 LSB 10 Ignore 2 LSBs 11 Ignore 4 LSBs reserved 25 SBT Second Branch Taken Debug Event 0 Disable 1 Enable 26 SED Second Exception Debug Event 0 Disable 1 Enable 27 STD Second TRAP Debug Event 0 Disable 1 Enable 28 SIA Second Instruction Address Compare Enable 0 Disable 1 Enable Uses address register AC2 29 SDA Second Data Address Compare Enable 0 Disable 1 Enable Uses DBCR fields D2R D2W and D2S and address register DAC2 11 20
357. ependent of alignment issues The method of calculating the effective address EA for each of the Data Movement and Cache Control instructions is detailed in the description of those instructions See Chapter 10 Instruction Set byte 0 byte 1 byte 2 byte 3 WORD bit 0 31 byte 0 byte 1 HALF WORD 0 15 byte 0 BYTE bit 0 7 bit Figure 2 9 PPC403GA Data types Programming Model 2 15 2 4 1 Alignment for Data Movement Instructions Data is moved to and from storage by the Data Movement instructions see page 2 50 All data operands referenced by the Data Movement instructions loads stores must be aligned on a corresponding operand size boundary In addition the effective address calculated by each load store instruction must also reference the corresponding operand size boundary The data targets of instructions are of type and alignment that depend upon the instruction Load word and store word instructions have word targets word aligned Load multiple word and store multiple word instructions may have multiple consecutive targets each of which is a word and word aligned Load halfword and store halfword instructions have halfword targets halfword aligned Load byte and store byte instructions have byte targets byte aligned that is any alignment Load string and store string instructions may have multiple consecutive targets each of which is a byte An alignment exception is taken for a Data Move
358. eption handling When a non critical exception is taken Save Restore Register 0 SRRO is loaded with the address of the excepting instruction most synchronous exceptions or the next sequential instruction to be processed asynchronous exceptions and system call If the PPC403GA was executing a multi cycle instruction load store multiple load store string multiply or divide the instruction is terminated and its address stored in SRRO When load store multiple and load store string instructions are terminated the addressing registers are not updated this is to ensure that the instructions can be restarted Save Restore Register 1 SRR1 is loaded with the contents of the Machine State Register MSR The MSR is then updated to reflect the new context of the machine The new MSR contents take effect beginning with the first instruction of the exception handling routine 2 44 PPC403GA User s Manual Exception handling routine instructions are fetched at an address determined by the exception type The address of the exception handling routine is formed from the concatenation of the high order 16 bits of the Exception Vector Prefix Register EVPR and the exception vector offset The contents of the EVPR are indeterminate on power up and must be initialized by the user via the move to special purpose register mtspr instruction Table 2 11 shows the exception vector offsets Note that multiple exceptions may be mapped to the same exception vec
359. eption prioritization logic in the EXU combines and prioritizes exception sources When an enabled exception is detected an interrupt occurs and the processor suspends the current instruction stream and begins executing an exception handling routine Exceptions are categorized as either critical or noncritical Noncritical exceptions include those caused by instruction execution asynchronous external exceptions and programmable and fixed interval timer exceptions Critical exceptions include debug exceptions machine checks a critical external exception input and the watchdog timer exception Critical exceptions have higher priority and are not automatically disabled when an interrupt due to a noncritical exception occurs Debug facilities in the PPC403GA are divided between the RISC core and the JTAG debug unit external to the core The JTAG debug unit contains a standard JTAG state machine together with boundary scan logic and other resources accessible through the external JTAG interface 1 3 1 2 Instruction Cache Unit ICU The instruction cache is used to minimize access latency for frequently executed instructions Instruction lines from cacheable memory regions can be prefetched into the ICU The ICU buffers a full four word line from the bus interface unit prior to placing the line Overview 1 5 into the cache during each fill The ICU contains a two way set associative 2KB cache memory Each of the two sets is organized as 64
360. eptions include system resets and machine checks Synchronous precise exceptions include most debug exceptions program exceptions protection violations system calls and alignment error exceptions Asynchronous precise exceptions include the critical interrupt exception external interrupts internal peripherals internal timer facility exceptions and some debug events Instruction Machine Checks an error while attempting to pre fetch an instruction from external memory require further explanation If the error occurs on an address accessed for an l cache line fill but not an address specifically requested by the fetcher the word is simply discarded and no exception is possible If the error occurs on an address specifically requested by the fetcher the instruction fetched under the error condition is tagged as erroneous and bypassed around the instruction cache into the pre fetch queue It would be improper to declare an exception at this time because the address is possibly the result of an incorrect speculation by the fetcher It is quite possible that no attempt will actually be made to execute an instruction from the erroneous address If execution is attempted an exception will occur at that time The exception will be a machine check but it will be precise Programming Model 2 43 with respect to the attempted execution The execution will be suppressed SRR2 will contain the erroneous address and the ESR will indicate the t
361. equired for the PPC403GA Note the following for every Branch Conditional mnemonic Bit 4 of the BO field provides a hint about the most likely outcome of a conditional branch see Section 2 8 5 for a full discussion of Branch Prediction Assemblers should set BO 0 unless a specific reason exists otherwise In the BO field values specified in the table below BO 0 has always been assumed The assembler must allow the programmer to specify Branch Prediction To do this the assembler will support a suffix to every conditional branch mnemonic as follows Predict branch to be taken Predict branch not to be taken As specific examples be also could be coded as bc or bc and bne also could be coded bne or bne These alternate codings set BO 1 only if the requested prediction differs from the Standard Prediction see Section 2 8 5 Table B 4 Extended Mnemonics for PPC403GA Mnemonic betr bet Operands Function Branch unconditionally to address in CTR Extended mnemonic for bcctr 20 0 Extended mnemonic for bcctrl 20 0 LR Other Registers Changed Page 10 28 bdnz bdnza bdnzl bdnzla target Decrement CTR Branch if CTR 0 Extended mnemonic for bc 16 0 target Extended mnemonic for bca 16 0 target Extended mnemonic for bcl 16 0 target Extended mnemonic for bcla 16 0 target LR LR 10 21 Instructions By Catego
362. er Registers Changed Page 10 68 icread RA RB Read either tag or data information from the instruction cache congruence class associ ated with the effective address RA O RB Place the results in ICDBDR 10 69 inslwi inslwi RA RS n b Insert from left immediate n gt 0 RA p ben 1 lt RS o n 1 Extended mnemonic for rlwimi RA RS 32 b b b n 1 Extended mnemonic for rlwimi RA RS 32 b b b n 1 CRICRO 10 125 insrwi insrwi RA RS n b Insert from right immediate n gt 0 RA bbin 1 lt lt RS 32 n 31 Extended mnemonic for rlwimi RA RS 32 b n b b n 1 Extended mnemonic for rlwimi RA RS 32 b n b b n 1 CRICRO 10 125 isync Synchronize execution context by flushing the prefetch queue 10 71 la Ibz RT D RA RT D RA Load address RA 0 D is an offset from a base address that is assumed to be RA RT lt RA EXTS D Extended mnemonic for addi RT RA D Load byte from EA RA O EXTS D and pad left with zeroes RT 240 MS EA 1 10 10 10 72 Ibzu RT D RA Load byte from EA RA O EXTS D and pad left with zeroes RT e 40 MS EA 1 Update the base address RA lt EA 10 73 Alphabetical Instruction Summary A 21 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic Ibzux Operands RT RA RB Function Lo
363. er is going to return to the instruction following the sc which can t be a branch hang Instead software could put a mtctr just before the sc putting a non sensitive address in the CTR to be used as the prediction address prior to the sc executing An alternative would be to put a mfctr mtctr between the sc and the betr with the mtctr again preventing the fetcher from speculatively accessing the address contained in the CTR prior to initialization 2 9 2 4 Fetching Past tw or twi Instructions The interrupt causing instructions tw and twi do not require the special handling described in Section 2 9 2 3 These instructions are typically used by debuggers which implement software breakpoints by substituting a trap instruction for whatever instruction was originally at the breakpoint address In a code sequence mtir followed by blr or mtctr followed by betr replacement of mtir mtctr by tw or twi would leave LR CTR uninitialized so it would not be appropriate to fetch from the blir betr target address This situation is common and the fetcher is designed to prevent the problem No fetching to LR or CTR targets will occur while tw or twi is in the queue or in the EXE stage Programming Model 2 31 2 9 2 5 Fetching Past an Unconditional Branch When an unconditional branch is in the pre fetch queue the fetcher will recognize that the sequential instructions following the branch are unnecessary These sequential addresses will not be acce
364. er which allows the user to program some external multifunction pins in the PPC403GA The IOCR contains two bits for each of the non critical interrupt pins These bits allow the user to program the polarity of each interrupt pin as positive or negative active and as either edge or level sensitive Figure 6 9 shows the IOCR bit definitions Note that the critical interrupt pin is not defined in the IOCR The critical interrupt pin is always negative active and edge triggered To invoke a critical interrupt the system must provide a negative active pulse on the critical interrupt pin The width of this pulse must be greater than one clock cycle Interrupts Exceptions and Timers 6 11 ei au ed Sg S iri SS ollslsllelel lelahe 25 26 27 28 29 30 31 Am ch ch cht eh DRC tts stc Figure 6 9 Input Output Configuration Register IOCR 0 EOT External Interrupt 0 Triggering 0 External Interrupt 0 pin is level sensitive 1 External Interrupt 0 pin is edge triggered 1 EOL External Interrupt 0 Active Level 0 External Interrupt 0 pin is negative level edge triggered 1 External Interrupt 0 pin is positive level edge triggered 2 EIT External Interrupt 1 Triggering 0 The External Interrupt 1 pin is level sensitive 1 The External Interrupt 1 pin is edge triggered 3 E1L External Interrupt 1 Active Level 0 External Interrupt 1 pin is negative level edge triggered 1 Exter
365. eresneeereneeeessaeeteeneeeeeaees 11 53 Serial Port Control Register SPCTL ccceeceesceeseeeeeeeeneeeeeeeeeeeeneeeeeeeeneees 11 54 Serial Port Handshake Register PH 11 55 Serial Port Line Status Register GPL 11 56 Serial Port Receive Buffer GPP 11 57 Serial Port Receiver Command Register SPRO ccesceeeeeeteeeereeeneees 11 58 Special Purpose Register General SGPRGO SPRG3 assesseer 11 59 Serial Port Transmit Buffer SPTB eceeeceeeseeeeeeeeeeeeeeeeeeeeeeeeeeseeeeeaeee 11 60 Serial Port Transmitter Command Register SPTO sses 11 61 Save Restore Register 0 SRRO ccceeceeeseeseeeeeeeeneeeeeeseeeeeneeteeeeeaeees 11 62 Save Restore Register 1 SRR1 ccecceeeceseeeeeeeeeeeeeneeeeaeeeeeeeeeeteeeeeeees 11 63 Save Restore Register 2 SRR2 0 0 esceeeceseeeeeeeeeeeeeneeseaeeeneeeeeeteeeeeaeees 11 65 Save Restore Register 3 SRR amp cccceesceseeeeneeeeeeeeeeeeeaeeeeeeseaeeteeeeeaeees 11 66 Time Base High Register TBHI AA 11 68 Time Base Low Register TBLO eecceeseeseeeeeteeseeeeeeeeteaeeeeeeseaeeseaeeeaeenaaes 11 69 Timer Control Register TCR cceescesecceeseeeeeeeneeseeeeeneeseaeeeeeeseaeeseaeeeeensaes 11 70 Timer Status Register TSR A 11 71 Fixed Point Exception Register XER AAA 11 72 XX PPC403GA User s Manual Tables Table 2 1 Table 2 2 Table 2 3 Table 2 4 Table 2 5 Table 2 6 Table 2 7 Table 2 8 Table 2 9 Table 2 10 Table 2 11
366. errupt PC SRR2 MSR lt SRR3 10 123 wrtee RS Write value of RS46 to the External Enable bit MSR EE 10 166 wrteei Write value of E to the External Enable bit MSR EE 10 167 B 2 PPC403GA User s Manual B 3 Privileged Instructions The following instructions are under control of the MSR PR bit and are not allowed to be executed when MSR PR b 1 Table B 3 Privileged Instructions Mnemonic dch Operands RA RB Function Invalidate the data cache block which contains the effective address RA O RB Other Registers Changed Page 10 51 dccci RA RB Invalidate the data cache congruence class associated with the effective address RA O RB 10 57 dcread RT RA RB Read either tag or data information from the data cache congruence class associated with the effective address RA 0 RB Place the results in RT 10 58 icbt RA RB Load the instruction cache block which contains the effective address RA O RB 10 67 iccci RA RB Invalidate instruction cache congruence class associated with the effective address RA O RB 10 68 icread mfdcr RA RB RT DCRN Read either tag or data information from the instruction cache congruence class associated with the effective address RA O RB Place the results in ICDBDR Move from DCR to RT RT lt
367. erved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 130 PPC403GA User s Manual slw Shift Left Word slw RA RS RB Rc 0 slw RA RS RB Rc 1 31 RS RA RB 24 Re 0 6 11 16 21 31 n lt RB z7 34 r lt ROTL RS n if D I D then m lt MASK 0 31 n else m lt 320 RA eram The contents of register RS are shifted left by the number of bits specified by bits 27 through 31 of register RB Bits shifted left out of the most significant bit are lost and 0 bits are supplied to fill vacated bit positions on the right The result is placed into register RA If bit 26 of register RB contains a one register RA is set to zero Registers Altered e RA e CR CRO z ecr a so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 131 sraw Shift Right Algebraic Word sraw RA RS RB Rc 0 sraw RA RS RB Rc 1 31 RS RA RB 792 Re 0 6 11 16 21 31 n lt RB 2731 r lt ROTL RS 32 n if RB 0 then m lt MASK n 31 else m lt 270 s amp RS RA lt r A m v s A m XER CA s A r A m 0 The contents of register RS are shifted right by the number of bits specified by bits 27 through 31 of register RB Bits shifted out of the least significant bit are lost Bit 0 of register RS is replicated to fill the vacated positions on
368. es 0 lt Wait lt 15 on the first transfer of the burst and 0 lt Wait lt 3 on all transfers beyond the first Wait CSon OEon WBEon and WBEoff are not independent Let DLYon 1 if OEon 1 or WBEon 1 otherwise DLYon 0 Then it is required that Wait gt CSon DLYon WBEoff CSon OEon and WBEon parameters are valid only on non burst transfers and on the first access of burst transfers On burst accesses beyond the first consider these parameters to be zero in the above computation of Wait The WBEoff parameter is valid in all transfers regardless of burst mode Memory and Peripheral Interface 3 11 e The address may remain valid Hold from 0 to 7 clock cycles after CS becomes inac tive e If the PPC403GA is bus master and the bus is idle then SRAM control signals CS OE EX and WBE will be held inactive The relationship of these control signals and the parameters controlling them are illustrated in Figure 3 5 for single transfers and in Figure 3 6 for burst transfers SysClk se ef ef A6 A29 WBE2 A30 WBE3 A31 Ka 1 Wait 0 lt TWT lt 63 R W CSon Hold 0 lt TH lt 7 0 1 0 7 CSn k gt Valid Addr OE WBEon kiai 0 1 1 0 WBE0 3 OEon 0 1 Do D31 9 Notes 1 WBE 2 3 are address bits 30 31 if the Bus Width is programmed as Byte or Halfword 2 See Table 3 3 for WBEn signal definition based on Bus Width 3 Da
369. es 10 129 Extended Mnemonics for subf subf subfo subfo 10 155 Extended Mnemonics for subfc subfc subfco subfco eeee 10 156 Extended Mnemonics fOr tw ccccccccccccseccceceecceseeseeesesscsesseeessneasaeeeeeeeeeeeeees 10 163 Extended Mnemonics fOr ti ccccccccccccccceceeecececseeeseeseseeeessnsnasaeseeeeeeeeeeees 10 165 PPC403GA General Purpose Registers ecceesceeeeeeeeeeeneeeeeeeneeeeeeeeeeeeaes 11 2 PPC403GA Device Control Registers A 11 2 PPC403GA Special Purpose Registers cescceeseeseeeeeeecseeeeaeeeeeeeeeeeeeeeeaes 11 4 PPC403GA Memory Mapped I O Registers A 11 6 PPC403GA Signal Descriptions 12 1 Signals Ordered by Pin Number A 12 10 PPC403GA Instruction Syntax SUMMALY eeeeeeeeeeeeeeeeeeeteeeeaeeeneeeeaeeteeeeeaees A 2 PPC403GA Instruction Set SUMMALY 0 0 eee eeceeeeeeeeeeeeeeeteeeeeaeeeeeeteaeeteeeeeaees B 1 Instructions Specific to PowerPC Embedded Controllers ccceeseeeeees B 2 Privileged INStrUCtIONS a a a e e a eA aaa naaa E aea Ea e Eai B 3 Extended Mnemonics for PPC403GA ccccecessccceeessseeceeessseeeceeessseeeeeeenees B 5 Data Movement Instructions cccccccccccccccccceceeeeeeeeeseeseeeeseseseseseenseseeeeeeeeeeees B 29 Arithmetic and Logical Instructions AA B 34 Condition Register Logical Instructions ceecceeeeeeeeeeeeeeeeeeeeeeeteaeeeeeereeten B 39 Scheller te TEE B 40 Comparison INStructiOns 22 0 diencenihieninie de dd
370. es necessary to achieve this configuration PPC403GA BR7 as RASY gt Byte P Glo gt Byte e 32 bit J SE 2 BR6 as RAS 1 Byte 8 bit gt BRS as AS 1 Byte ve 16 bit CAS0 H SS CAS 1 CAS 2 CAS 3 d0 d7 d8 d15 d16 d23 d24 d31 DATA BUS Figure 3 23 Example of DRAM Connection 3 7 4 1 Note about SIMMs It is common for DRAM to be supplied in SIMM packages which may be either one sided or two sided Comment is required about two sided SIMMs An 8MB SIMM will be used for illustration A SIMM carrying 8MB of DRAM will be labelled as an 8MB SIMM regardless of whether it is one sided or two sided However the two sided SIMM will actually be two nearly separate 4MB memories While the two sides will share many bus pins for simplicity of connection each side will have a separate RAS pin The separate RAS pin forces each side to be connected to a separate PPC403GA DRAM bank at 4MB per bank just as if the sides were entirely separate packages The one sided SIMM will have only one RAS pin so that all 8MB can be accessed using only one bank instead of two 3 44 PPC403GA User s Manual 3 7 5 Address Bus Multiplex for DRAM Addresses are presented to DRAM in two sequential transfers The first portion of the address is presented with the RAS strobe then the second portion with the CAS strobe It i
371. es to the cacheable area of this example instruction fetching data reads or writes with access to the non cacheable area data reads or writes with zero time devoted to switching of the cacheability attributes The access mode is determined soley by the address used 2 2 2 Supported Memory Up to 256 megabytes MB of external SRAM may be attached ROM and MMIO are treated as SRAM Simultaneously up to 256 MB of DRAM may be attached As shown in Figure 2 1 PPC403GA Address Map and as explained in Section 2 2 1 and in Section 3 5 Address Bit Usage on page 3 7 a 256 MB SRAM region and a 256 MB DRAM region are each double mapped into the 4 GB memory space consuming a total of 1 GB The remaining 3 0 GB is reserved for the use of on chip peripherals This processor family is intended to support custom ASICs which may make use of this large internal memory space For the PPC403GA the Serial Port controller is the only peripheral within this address space 2 2 3 Memory Map Cacheability Regions The memory map of the PPC403GA is divided into 32 cacheability regions Each region is 128 megabytes defined by address bits AO A4 The controllable cacheability attributes are Cacheable or not for instruction access fetching Cacheable or not for data access loads and stores Everywhere within a given 128 megabyte region the cacheability attributes are the same The attributes in each different 128 megabyte region are set independe
372. es two BIU bank registers and leaves six more BIU bank registers to select I O devices in Region 1 If the system is setup in this way addresses in Region 1 should only be used by load store instructions accessing the I O devices so no speculative fetches should occur Accesses in Region 2 would be for code and program data speculative fetches in Region 2 can never hit addresses in Region 1 2 9 3 Summary In summary software needs to take the following actions to prevent speculative fetches from being made into sensitive data areas 2 32 PPC403GA User s Manual Protect against random accesses to bad values in the LR CTR on blr betr branches coming after rfi rfci sc instructions putting an appropriate instruction s after the rfi rfci sce instruction See 2 9 2 3 above Protect against running past the end of memory into a bordering I O device by putting an unconditional branch at the end of the memory area See 2 9 2 5 above Recognize that a maximum of 7 words 28 bytes can be prefetched past an unresolved conditional branch either down the target path or the sequential path See 2 9 2 1 above Of course software should not code branches with known unsafe targets either instruction counter relative or LR CTR based on the assumption that they are pro tected by always guaranteeing that their direction is not taken The pre fetcher is allowed to assume that if the branch might be taken then
373. ess Registers Altered e None Architecture Note 10 This instruction is part of the PowerPC User Instruction Set Architecture 10 144 PPC403GA User s Manual stswi RS RA NB Store String Word Immediate stswi 31 RS RA NB 725 EA lt RA O if NB 0 then n lt 32 else nc NB r RS 1 i 0 do while n gt 0 if i 0 then rer i if r 32 then re o0 MS EA 1 lt GPP ic i 8 if i 32 then i 0 EA lt EA 1 nen 1 21 31 An effective address is determined by the RA field If the RA field contains 0 the effective address is 0 otherwise the effective address is the contents of register RA A byte count is determined by the NB field If the NB field contains 0 the byte count is 32 otherwise the byte count is the NB field The contents of a series of consecutive GPRs starting with register RS continuing through GPR 31 wrapping to GPR 0 and continuing to the final byte count are stored into main storage starting at the effective address The bytes in each GPR are accessed starting with the most significant byte The byte count determines the number of transferred bytes If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 145 stswx Store String Word Indexed stswx RS RA RB
374. ess than or equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 1 Extended mnemonic for bectrl 4 4 cr_field 1 LR 10 28 blelr blei cr_field Branch if less than or equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 1 Extended mnemonic for belrl 4 4 cr_field 1 LR Instructions By Category 10 32 B 11 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bir Operands birl Function Branch unconditionally to address in LR Extended mnemonic for bclr 20 0 Other Registers Changed Extended mnemonic for belrl 20 0 LR Page 10 32 bit cr_field target bita bitl bitla Branch if less than Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 0 target Extended mnemonic for bca 12 4 cr_field 0 target Extended mnemonic for bel 12 4 cr_field 0 target LR Extended mnemonic for bcla 12 4 cr_field 0 target LR 10 21 bltctr cr_field blitctrl Branch if less than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 0 Extended mnemonic for bectrl 12 4 cr_field 0 LR 10 28 bitir cr_field bitirl Branch if less than to address in LR Use CRO if cr_field is omitted Extended mnemoni
375. esseeeeaeesaees 6 13 Bus Error Syndrome Register BESR eecceesceeeeeeeeeeteeeeeeeseeeesseeeeaeensees 6 15 Bus Address Error Register BEAR AAA 6 16 Data Exception Address Register DEAR AAA 6 16 PPC403GA Timer Block Diagram eecceeceeeeeeeneeseeeeeareteaeeeeeeseeeetieeeeaeensees 6 28 Time Base High Register TBHI A 6 29 Time Base Low Register TBLO esceeecceeseeeeeeeeeeeeeeeeeaeeeeeeeeaeeeeeeeaeeeeeeeeas 6 30 PPC403GA User s Manual Figure 6 17 Figure 6 18 Figure 6 19 Figure 7 1 Figure 7 2 Figure 7 3 Figure 7 4 Figure 7 5 Figure 7 6 Figure 7 7 Figure 7 8 Figure 7 9 Figure 7 10 Figure 7 11 Figure 8 1 Figure 8 2 Figure 8 3 Figure 8 4 Figure 8 5 Figure 8 6 Figure 8 7 Figure 9 1 Figure 9 2 Figure 9 3 Figure 9 4 Figure 9 5 Figure 9 6 Figure 11 1 Figure 11 2 Figure 11 3 Figure 11 4 Figure 11 5 Figure 11 6 Figure 11 7 Figure 11 8 Figure 11 9 Figure 11 10 Figure 11 11 Figure 11 12 Figure 11 13 Programmable Interval Timer PIT 00 eessceeeseeeeseneeeeeeeeeeneeeeeeeeeeenneeeeeneeees 6 33 Timer Status Register TSR A 6 35 Timer Control Register TCR ecceesceseseeseeeseeeeeeeeeeeeeeeeeeeseaeeseeeeeeeseeeeeeenea 6 36 Serial Port Functional Block Diagram ccceeceeeeeeteseeeeeeeeteeeeeeeseaeeseaeeeaeesaaes 7 1 SPU Registers and Buffers AAA 7 4 Baud Rate Divisor High Register BRDH AAA 7 12 Baud Rate Divisor Low Register BRDL AA 7 1
376. esses to sensitive memory or I O devices 2 9 1 Architectural Overview of Speculative Accesses PowerPC Architecture permits implementations to perform speculative accesses to memory either for instruction fetching or for data loads A speculative access is defined as an access which is not required by a sequential execution model For example pre fetching instructions beyond an unresolved conditional branch is a speculative fetch if the actual branch direction is in the opposite direction from the prediction the actual program execution never needed the instructions from the predicted path The same would be true for a super scalar implementation that performs out of order execution if it attempts to speculatively execute a load instruction that is past an unresolved branch PowerPC Architecture also defines the concept of guarded storage from which speculative accesses are not allowed actually they are only allowed under certain circumstances such as the storage is a hit in the cache The processor must determine the branch path that will be taken prior to accessing guarded instructions or data beyond the branch The specification of the guarded attribute of storage is typically controlled via the virtual memory mechanism eg a page table entry There are several situations in which it is necessary to protect the system from the processor making speculative accesses The simplest example can be illustrated b
377. essor resources setting hardware and software breakpoints and monitoring processor status While in this mode debug events can be used to cause the processor to become architecturally frozen While the processor is frozen normal instruction execution stops and all architected resources of the processor can be accessed and altered DMA operations if active will continue while in external debug mode External Debug Mode only relies on internal processor resources and therefore can be used to debug both system hardware and software problems It can also be used for software development on systems without a control program or to debug control program problems Access to the processor while in external debug mode is through the JTAG port 9 2 3 Real time Trace Debug Mode Real time Trace Debug Mode supports tracing the instruction stream being executed out of the instruction cache in real time While in this mode debug events can be used to start the broadcast of trace information This mode does not alter the performance of the processor The Trace Status signals provide trace information while in Real time Trace Debug Mode 9 2 4 Bus Status Debug Mode Bus Status Debug Mode supports logic analyzers attached to the processor While in this mode bus activity qualifiers are provided using the Trace Status signals This mode does not alter the performance of the processor 9 2 PPC403GA User s Manual Bus Status Mode must be enabled in th
378. et 7 3 SPU Register Descriptions The following sections provide a complete bit description of the 9 addressable SPU registers Serial Port Operation 7 11 7 3 1 Baud Rate Divisor Registers The BRDH and BRDL registers store a divisor for reducing the rate of the input clock source to a convenient baud rate The contents of the BRDH are concatenated with the contents of the BRDL to form a 12 bit divisor The baud rate calculation using the 12 bit divisor is described in Section 7 2 1 SPU Baud Rate Generator Figure 7 3 shows the BRDH fields Figure 7 3 Baud Rate Divisor High Register BRDH 0 3 reserved 4 7 Divisor High Bits The four most significant bits of the baud rate 7 divisor concatenated with the contents of the BRDL Figure 7 4 shows the BRDL field fo Figure 7 4 Baud Rate Divisor Low Register BRDL 0 7 Divisor Low Bits The eight least significant bits of the baud rate divisor concatenated with the contents of the BRDH 7 12 PPC403GA User s Manual 7 3 2 Serial Port Control Register SPCTL The SPCTL configures the serial port for normal mode internal loopback mode and automatic echo mode This register also controls the activity of the DTR RTS signal and the frame format of the serial transfers Figure 7 5 shows the SPCTL fields LM 4 RTS i SB 0 1 2 3 4 5 6 7 D R DB pty Figure 7 5 Serial Port Contro
379. et LR Extended mnemonic for bcla 0 cr_bit target LR 10 21 bdnzfir bdnzfirl cr_bit Decrement CTR Branch if CTR 0 AND CR pit 0 to address in LR 8 Extended mnemonic for bclr 0 cr_bit Extended mnemonic for belrl 0 cr_bit LR 10 32 bdnzt bdnzta bdnztl bdnztla cr_bit target Decrement CTR Branch if CTR 0 AND CRe pit 1 Extended mnemonic for bc 8 cr_bit target Extended mnemonic for bca 8 cr_bit target Extended mnemonic for bcl 8 cr_bit target LR Extended mnemonic for bcla 8 cr_bit target LR 10 21 Alphabetical Instruction Summary A 5 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bdnztir Operands cr_bit bdnztirl Function Decrement CTR Branch if CTR 0 AND Ca pit 1 to address in LR T Extended mnemonic for bclr 8 cr_bit Other Registers Changed Extended mnemonic for belrl 8 cr_bit LR Page 10 32 bdz target bdza bdzl bdzla Decrement CTR Branch if CTR 0 Extended mnemonic for bc 18 0 target Extended mnemonic for bca 18 0 target Extended mnemonic for bcl 18 0 target LR Extended mnemonic for bcla 18 0 target LR 10 21 bdzir bdzirl Decrement CTR Branch if CTR 0 to address in LR Extended mnemonic for bclr 18 0 Extended mnemonic for belrl 18 0 LR 10 32
380. etcher s decision called a branch prediction is made and how software may alter the prediction process The standard branch prediction is defined as follows Predict the branch to be taken if BO 0 amp BO 2 s 1 where s is bit 16 of the instruction the sign bit of the displacement for all be forms and zero for all belr and bectr forms BO 0 amp BO 2 1 only when the conditional branch is in fact testing nothing branch always condition Obviously the branch should be predicted taken for this case If the branch is testing anything then BO 0 amp BO 2 0 and the standard prediction is controlled entirely by s The standard prediction for this case derives from considering the relative form of bc used at the end of a loop to control the number of times that the loop is executed The branch is taken on all passes through the loop except the last one so it is best if the branch is predicted taken The branch target is the beginning of the loop so the branch displacement is negative and s 1 Because this situation is so common the standard prediction is that the branch is taken if s 1 If branch displacements are positive then s 0 and the branch is predicted not taken If the branch instruction is any form of belr or bectr except the branch always form then s 0 and the branch is predicted not taken There is a peculiar consequence of this prediction algorithm for the absolute fo
381. etic and logical comparisons between two operands and set one of the eight condition code register fields based on the outcome of the comparison Table B 9 shows the comparison instructions supported by the PPC403GA Table B 9 Comparison Instructions Other Mnemonic Operands Function Registers Page Changed cmp BF 0 RA RB Compare RA to RB signed 10 37 Results in CR CRn where n BF cmpi BF 0 RA IM Compare RA to EXTS IM signed 10 38 Results in CR CRn where n BF cmpl BF 0 RA RB Compare RA to RB unsigned 10 39 Results in CR CRn where n BF cmpli BF 0 RA IM Compare RA to 180 IM unsigned 10 40 Results in CR CRn where n BF Instructions By Category B 41 B 10 Rotate and Shift Instructions Rotate and shift instructions rotate and shift operands which are stored in the general purpose registers Rotate instructions can also mask rotated operands Table B 10 shows the PPC403GA rotate and shift instructions Table B 10 Rotate and Shift Instructions Mnemonic rlwimi Operands RA RS SH rlwimi MB ME Function Rotate left word immediate then insert according to mask r lt ROTL RS SH m lt MASK MB ME RA e ra m v RA A m Other Registers Changed CRI CRO Page 10 125 rlwinm RA RS SH rlwinm MB ME Rotate left word immediate then AND with mask r lt ROTL RS S
382. etween a Load instruction and an instruction that uses the data from the Load instruction Registers loaded via any of the byte halfword or fullword load instructions on the PPC403GA are not available for use until one clock cycle after the load instruction com pletes If the instruction immediately following the load uses the register which is the tar get of the load then a wait state will be added If the instruction following the load does not use the register which is the load target the PPC403GA will execute the instruction without a wait state C 2 9 Branch Prediction Use the Y bit in branch instructions to force the prediction whether the conditional branch will be taken or not properly if there is known to be a more likely prediction than the standard prediction See Section 2 8 5 on page 2 28 for a thorough discussion of Branch Prediction Instruction Timing and Optimization C 5 C 2 C 6 10 Alignment Keep all accesses aligned on the operand size boundary i e load store word should be word aligned etc Use the string instructions to handle byte strings or any unaligned accesses Align branch targets that are not likely to be hit by fall through code for example the beginning of subroutines like strcpy on cache line boundaries to minimize the number of instruction cache line fills PPC403GA User s Manual C 3 Instruction Timings This section provides information about the instruction timings of t
383. ever that the exception will only be processed if the Serial Port Transmitter Interrupt Enable STIE bit of the External Interrupt Enable Register EXIER and the External Interrupt Enable EE bit of the Machine State Register MSR are also set 7 2 3 SPU Receiver The main components of the SPU receiver are an eight bit receive buffer SPRB a serial to parallel shift register SPRSR and a command register SPRC To enable the receiver the ER bit of the SPRC must be set to one When the serial port receiver is enabled data received from the RecvD pin is input to the SPRSR If a character is received without errors the character is transferred from the SPRSR to the SPRB and the RxReady RBR bit in the SPLS is set Note that if the data frame is configured for seven bits the most significant bit of the byte loaded from the SPRB is set to 0 and the received data occupies the rest of the byte The RBR bit of the SPLS register is reset to 0 when the data byte in the SPRB is read by the processor If errors are detected during the reception of a character then the error condition Parity Error Framing Error Overrun Error or Line Break Detect is posted in the SPLS register and the data byte discarded Parity Errors are detected when the received parity of a data frame does not match the expected parity of the data frame This causes the Parity Error PE bit of the SPLS register to be set Framing errors imply that one or both of the stop bits
384. execution at the address contained in the program counter Table 6 9 Register Settings during Programmable Interval Timer Exceptions SRRO Loaded with the address of the next instruction to be executed SRR1 Loaded with the contents of the MSR 6 24 PPC403GA User s Manual Table 6 9 Register Settings during Programmable Interval Timer Exceptions cont MSR PC WE 0 PR O CE Unchanged EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged EVPR 0 15 0x1000 TSR Set to indicate type of timer event 6 2 10 Fixed Interval Timer The PPC403GA initiates a Fixed Interval Timer FIT interrupt after detecting a time out from the FIT if the exception is enabled via TCR FIE and MSR EE Time out is considered to be detected when at the beginning of a cycle TSR FIS 1 for the FIT exception this will be the second cycle after the 0 1 transition of the appropriate time base bit The instruction in the execute stage at that cycle is flushed blocked from completing and its address is stored as the next sequential instruction in SRRO Simultaneously the current contents of the MSR are loaded into SRR1 and the MSR is loaded with the values shown in Table 6 10 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x1010 Exception processing begins with this program counter
385. f BESR DMES 0 then the error is an Unaligned Address error posted by the DMA controller e If BESR DMES 1 then a bus error has occurred The bus error is more fully specified by the RWS and ET fields of the BESR The address of the bus error is recorded in the BEAR If an additional bus error occurs following the DMA error but prior to the examination of the BESR by the DMA error handling routine it may not be possible to identify the cause of the original error Any error which is posted to the BESR clears all bits set by previous errors The first Data Machine Check error which is an error on a D cache transaction will lock the BESR and BEAR to preserve information about that error However Instruction Machine Check errors which are errors on I cache transactions and DMA errors do not lock the BESR Therefore information which details the cause of a DMA error can be overwritten 4 28 PPC403GA User s Manual 4 3 DMA Registers All DMA registers are device control registers and are accessed via move to from device control register mtdcr mfdcr instructions The detailed functions of each register are discussed in the following subsections 4 3 1 DMA Channel Control Register DMACRO DMACR3 ER The DMA Channel Control Registers DMACRO 3 are four 32 bit registers one for each DMA channel which set up and enable their respective DMA channels Prior to executing DMA transfers each Channel Control Register must be initializ
386. f a Compare instruction In addition to the field oriented instructions discussed above instructions are provided to perform logical operations upon individual CR bits the CR logical instructions and to test individual CR bits the branch conditional instructions If any of the fields CRO CR7 are set as the result of a Compare instruction then the interpretation of the bits in that field will be as discussed in Section 2 3 3 1 Field CRO is altered implicitly by numerous instructions hence the interpretation of CRO is discussed further in Section 2 3 3 2 below Sie CR1 siti li Gr SE Ss e 0 3 7 8 11 12 15 16 19 20 23 24 27 28 31 Figure 2 8 Condition Register CR 0 3 CRO Condition Register Field 0 4 7 CR1 Condition Register Field 1 8 11 CR2 Condition Register Field 2 12 15 CR3 Condition Register Field 3 16 19 CR4 Condition Register Field 4 20 23 CR5 Condition Register Field 5 24 27 CR6 Condition Register Field 6 28 31 CR7 Condition Register Field 7 Programming Model 2 11 2 3 3 1 CR Fields after Compare Instructions Compare instructions are used to compare the values of two 32 bit numbers There are two types of compare instructions arithmetic and logical which are distinguished by the interpretation given to the 32 bit numbers For arithmetic compares the numbers are considered to be two s complement 31 bits are significant hi order bit is a sign bit
387. f the bus HoldReq 14 l Hold Request External bus masters can request the PPC403GA bus by placing a logic1 on this pin The external bus master relinquishes the bus to the PPC403GA by deasserting HoldReq INTO 31 l Interrupt 0 INTO is an interrupt input to the PPC403GA and users may pro gram the pin to be either edge triggered or level triggered and may also pro gram the polarity to be active high or active low The IOCR contains the bits necessary to program the trigger type and polarity INT1 32 l Interrupt 1 See description of INTO INT2 33 l Interrupt 2 See description of INTO INT3 34 l Interrupt 3 See description of INTO INT4 35 l Interrupt 4 See description of INTO 12 6 PPC403GA User s Manual Table 12 1 PPC403GA Signal Descriptions cont Signal Name IVR Pin 39 UO Type Function Interface voltage reference When connected to 3 3V supply allows the device to interface to an exclusively 3V system When connected to 5V supply allows the device to interface to 5V or mixed 3V 5V system If any input or out put connects to 5V system this pin must be connected to 5V supply OE XSize1 126 O I Output Enable External Master Transfer Size 1 When the PPC403GA is bus master OE enables the selected SRAMs to drive the data bus The timing parameters of OE relative to the chip select CS are programmable via bits in the PPC403GA bank registers When the PPC403GA is not bus master
388. f the starting point of the mask is at a higher bit position than the ending point the ones portion of the mask wraps from the highest bit position back around to the lowest The rotated data is ANDed with the generated mask and the result is placed into register RA Registers Altered e RA e CR CRO z ecr a so H Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 27 Extended Mnemonics for rlwnm rlwnm Other Mnemonic Operands Function Registers Page Changed rotlw RA RS RB Rotate left 10 129 RA lt ROTL RS RB 27 31 Extended mnemonic for rlwnm RA RS RB 0 31 rotlw Extended mnemonic for CR CRO rlwnm RA RS RB 0 31 Instruction Set 10 129 sc System Call sc 17 1 0 6 30 31 SRR1 lt MSR SRRO PC PC EVPRo 15 x 0C00 MSR WE EE PR PE lt 0 A system call exception is generated The contents of the MSR are placed into SRR1 and the current value of the program counter PC is placed into SRRO The PC is then loaded with the exception vector address EVA The EVA is calculated by concatenating the high halfword of the exception vector prefix register EVPR to the left of x 0C00 The MSR WE EE PR PE is set to 0 Program execution continues at the new address in the PC Registers Altered e SRRO e SRR1 e MSR WE EE PR PE Invalid Instruction Forms e Res
389. first time out 15 ILE Interrupt Little Endian MSR ILE is copied to MSR LE when an 0 Interrupt handlers execute interrupt is taken in Big Endian mode 1 Interrupt handlers execute in Little Endian mode 16 EE External Interrupt Enable EE controls these interrupts 0 Asynchronous exceptions are disabled non critical external DMA 1 Asynchronous exceptions are enabled serial port JTAG serial port programmable interval timer fixed interval timer 17 PR Problem State 0 Supervisor State all instructions allowed 1 Problem State limited instructions available 18 reserved 19 ME Machine Check Enable 0 Machine check exceptions are disabled 1 Machine check exceptions are enabled 20 21 reserved 22 DE Debug Exception Enable 0 Debug exceptions are disabled 1 Debug exceptions are enabled 23 27 reserved 28 PE Protection Enable 0 Protection exceptions are disabled 1 Protection exceptions are enabled 29 PX Protection Exclusive Mode 0 Protection mode is inclusive as defined in Section 2 10 on page 2 33 1 Protection mode is exclusive as defined in Section 2 10 on page 2 33 Interrupts Exceptions and Timers 6 3 30 reserved 31 LE Little Endian 0 Processor executes in Big Endian mode 1 Processor executes in Little Endian mode 6 1 2 Save Restore Register 0 and 1 SRRO SRR1 Save Restore Registers 0 and 1 are two 32 bit registers which hold the interrupted context of t
390. from a DRAM bank This sig nal enables the selected DRAM bank to drive the data bus DRAMWE 138 O DRAM Write Enable DRAMWE has an active level when either the PPC403GA or an external bus master is writing to a DRAM bank DSR CTS 28 l Data Set Ready Clear to Send The function of this pin as either DSR or CTS is selectable via the Serial Port Configuration bit in the IOCR DTR RTS 88 O Data Terminal Ready Request to Send The function of this pin as either DTR or RTS is selectable via the Serial Port Configuration bit in the IOCR EOTO0 TCO 128 VO End of Transfer 0 Terminal Count 0 The function of the EOTO TCO is con trolled via the EOT TC bit in the DMA Channel 0 Control Register When EOTO0 TCO is configured as an End of Transfer pin external users may stop a DMA transfer by placing a logic 0 on this input pin When configured as a Terminal Count pin the PPC403GA signals the completion of a DMA transfer by placing a logic 0 on this pin EOT1 TC1 131 VO End of Transfert Terminal Count 1 See description of EOTO TCO EOT2 TC2 132 VO End of Transfer 2 Terminal Count 2 See description of EOT0 TCO EOT3 TC3 133 VO End of Transfer 3 Terminal Count 3 External Master Transfer Size 0 XSize0 When the PPC403GA is bus master this pin has the same function as EOTO TCO When the PPC403GA is not bus master EOT3 TC3 XSize0 is used as one of two external transfer size input bits XSize0 1 Error 136 O System Error Error goes to a logic
391. fword RS 16 3 in memory at EA RA 0 RB 10 143 stmw RS D RA Store consecutive words from RS through GPR 31 in memory starting at EA RA O EXTS D 10 144 stswi RS RA NB Store consecutive bytes in memory starting at EA RA 0 Number of bytes n 32 if NB 0 else n NB Bytes are unstacked from CEIL n 4 consecutive registers starting with RS GPR 0 is consecutive to GPR 31 10 145 stswx RS RA RB Store consecutive bytes in memory starting at EA RA 0 RB Number of bytes n XER TBC Bytes are unstacked from CEIL n 4 consecutive registers starting with RS GPR 0 is consecutive to GPR 31 10 146 stw RS D RA Store word RS in memory at EA RA 0 EXTS D 10 148 stwbrx RS RA RB Store word RS byte reversed in memory at EA RA O RB MS EA 4 RS o4 31 Il RS 46 23 I RS g 15 Il RS o 7 10 149 B 32 PPC403GA User s Manual Table B 5 Data Movement Instructions cont Mnemonic stwex Operands RS RA RB Function Store word RS in memory at EA RA O RB only if reservation bit is set if RESERVE 1 then MS EA 4 RS RESERVE lt 0 CR CRO lt 70 1 XERgo else CR CRO lt 70 0 I XERgo Other Registers Changed Page 10 150 stwu RS D RA Store word RS in memory at EA RA O EXTS D Update the base address RA e EA
392. g the LR AND the IO branch direction is TAKEN or UNKNOWN If the instruction in IQ1 is a branch using the CTR as a target address bctr AND the instruction in DCD is updating the CTR AND the IQ1 branch direction is TAKEN or UNKNOWN If the instruction in IQ1 is a branch using the CTR as a condition AND the instruction in DCD is updating the CTR If the instruction in IQ1 is a branch using CR AND the instruction in DCD is a CR updating instruction that is updating the same CR field that is being used by the IQ1 branch C 4 5 Fold Blocking During Debug e The blocking of folding can be controlled by a debug tool such as RISCWatch via the JTAG port e Folding is blocked for all instructions if the IC debug event is enabled and the Debug Mode is set to either Internal or External Mode e The instruction at the IAC1 compare address is blocked from folding if the IAC1 debug event is enabled and the Debug Mode is set to either Internal or External Mode The instruction following the instruction at the compare address is not blocked from folding The same is true for IAC2 Instruction Timing and Optimization C 13 e Folding is blocked for all branch taken instructions if the BRT debug is enabled and the Debug Mode is set to either Internal or External Mode e Folding is blocked while instruction stuffing is being done via the JTAG port C 14 PPC403GA User s Manual Index A access priority 3 3 add 10 7 add 10 7 addc 10 8 a
393. get bgea Extended mnemonic for bca 4 4 cr_field 0 target bgel Extended mnemonic for LR bcl 4 4 cr_field 0 target bgela Extended mnemonic for LR bcla 4 4 cr_field 0 target bgt cr_field target Branch if greater than 10 21 Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 1 target bgta Extended mnemonic for bca 12 4 cr_field 1 target bgil Extended mnemonic for LR bel 12 4 cr_field 1 target bgtla Extended mnemonic for LR bcla 12 4 cr_field 1 target ble cr_field target Branch if less than or equal 10 21 Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 1 target blea Extended mnemonic for bca 4 4 cr_field 1 target blel Extended mnemonic for LR bel 4 4 cr_field 1 target blela Extended mnemonic for LR bcla 4 4 cr_field 1 target 10 24 PPC403GA User s Manual bc Branch Conditional Table 10 6 Extended Mnemonics for bc bca bcl bcla cont Mnemonic bit blita biti bitla Operands cr_field target Function Branch if less than Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 0 target Other Registers Changed Extended mnemonic for bca 12 4 cr_field 0 target Extended mnemonic for bel 12 4 cr_field 0 target LR Extended mnemonic for bcla 12 4 cr_field 0 target LR Page 10 21
394. haining is enabled channel will chain when TC reaches zero 28 31 reserved Cycle SysClk DMAR DMAA A6 A29 D0 31 RASn CAS0 3 DRAMOE DRAMWE RW DMADXFER Column Column Figure 4 11 DMA Fly by Burst 2 1 1 1 DRAM 2 Transfers DMA Operations 4 17 4 2 4 2 Fly By Burst Peripheral to Memory The following example is a DMA Fly By Burst from the peripheral to the memory This is the opposite transfer direction from the previous example hence DMACR TD 1 for this example All other DMACR fields are unchanged For this example the memory speed is 3 2 2 2 instead of the 2 1 1 1 of the previous example The difference of memory speeds is handled entirely in BIU bank register settings not in DMA controls Cycle SysClk DMAR DMAA A6 A29 Row D0 31 WE i RASn CAS0 3 DRAMOE DRAMWE R W DMADXFER Figure 4 12 DMA Fly by Burst 3 2 2 2 DRAM Single Transfers 4 18 PPC403GA User s Manual 4 2 5 Memory to Memory Mode Transfers Memory to memory mode DMA operations require the PPC403GA to buffer the transferred data and to provide the memory control signals Figure 4 14 shows the data flow for software initiated and hardware initiated device paced memory to memory transfers 4 2 5 1 Memory to Memory Transfers Initiated by Software The DMA channel must be configured for memory
395. han 2 cycles If WBEoff is programmed as 1 then the WBE signals will turn off in the last cycle of each transfer including the first transfer and the Burst transfers Hold time may be programmed from 0 to 7 cycles During Hold time the address bus is driven and all control signals are inactive The data bus is driven for the Hold time if the operation is a write Non Burst transfers with burst mode enabled will use the First Wait parameter and will follow each transfer with the programmed Hold time Burst Write operations are possible using the same wait timing parameters as a Burst Read For the first transfer of a write operation the databus is driven based on the parameters CSon and OEon After the First transfer the data bus is immedi ately driven with the next data to be bursted Bursting of back to back sequential BIU requests treating sequential requests as one request for which continual bursting is possible is not supported Ready Enable is valid with Burst Enable and the Ready signal will be sampled when either the WAIT counter or the Burst WAIT counter have expired Both the WAIT and Burst WAIT parameters must be greater than or equal to 1 Memory and Peripheral Interface 3 19 3 6 3 1 SRAM Burst Read Example An example of SRAM ROM burst mode read is shown in Figure 3 11 Cycle SysClk A6 A29 WBE2 A30 WBE3 A31 CSon 0 CSon 1 CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon
396. hannel will not chain when TC reaches zero 28 31 reserved Register Summary 11 29 DMACT0 DMACT3 DMACT0O DMACTS3 see also Section 4 3 5 on page 4 35 DCR 15 16 Figure 11 17 DMA Count Registers DMACT0 DMACTS3 0 15 reserved 16 31 Number of Transfers remaining 11 30 PPC403GA User s Manual DMADA0 DMADA3 DMADAO DMADAS see also Section 4 3 3 on page 4 34 DCR 0 31 Figure 11 18 DMA Destination Address Registers DMADA0 DMADA3 0 31 Memory address for transfers between memory and peripheral Destination address for memory to memory transfers Register Summary 11 31 DMASA0 DMASA3 DMASA0 DMASAS see also Section 4 3 4 on page 4 34 DCR Figure 11 19 DMA Source Address Registers DMASA0 DMASA3 0 31 Source address for memory to memory transferes Replacement contents for Destination Address for chained transfers 11 32 PPC403GA User s Manual DMASR DMASR see also Section 4 3 2 on page 4 32 DCR epo T e big Ge iG aly T dp St T SE T vil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 31 ehi za ch sa d d G b cho ae ahs R D ele Figure 11 20 DMA Status Register DMASR 0 3 cso Channel 0 3 Terminal Count Status TC will be set
397. hat is input to the PPC403GA See the PPC403GA Data Sheet for the pertinent setup and hold times 3 50 PPC403GA User s Manual Figure 3 25 shows the timing for the HoldReq HoldAck signals Cycle SysClk HoldReq HoldPri HoldAck 4 BusReq XREQ XACK DMADXFER Output DMAR3 Input 7 DMARS Output Valid HoldPri Intput Se eeng a ae X Valid BusReg Output X DMADXFER Xai XREQ input DMAR3 Input DMAA3 Output A6 29 D0 31 803 129 CS4 7 RAS3 0 DAN II EOT3 TC3 xSize0 O m tei WBE0 A4 WBE1 A5 WBE2 A30 WBE3 A31 Valid 403 Master A d Valid Ext Master 403 7 X Valid Ext Master 403 Valid 403 Master 7 Valid Ext Master 4 403 Valid 403 Master Notes 1 CS0 3 and CS4 7 RAS3 0 which are programmed as ROM SRAM or I O require an external pull up to hold the signals inactive during cycles 6 and 8 2 CS4 7 RAS3 0 will continue to be driven by the processor during the HoldAck state if that bank control register is programmed as DRAM 3 These signals are driven inactive by the processor one cycle before HoldAck is activated and one cycle after HoldAck is deactivated 4 If HoldPri 0 HoldAck is activated by the processor when HoldRegq is active and the previous processor bus access has been completed If HoldPri 1 HoldAck is activated by the processor when HoldRegq is active and no other request is
398. hax Load Halfword Algebraic Indexed 31 RT RA RB 343 0 6 EA lt RB RA O RT lt EXTS MS EA 2 21 31 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The halfword at the effective address is sign extended to 32 bits and placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 79 Ihbrx Load Halfword Byte Reverse Indexed Ihbrx RT RA RB 31 RT RA RB 790 0 6 11 16 21 31 EA lt RB RA O RT lt 160 MS EA 1 1 MS EA 1 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The halfword at the effective address is byte reversed The resulting halfword is extended to 32 bits by concatenating 16 0 bits to its l
399. he PPC403GA then writes the data to a 32 bit 2 1 1 1 access DRAM bank and the PPC403GA provides the necessary signals to the DRAM bank Note that the address bus is placed in high impedance during the peripheral cycle of the transfer To prevent a second transfer from taking place the peripheral must deassert the DMAR pin as shown in Figure 4 6 Cycle SysClk DMAR DMAA A6 A29 D0 31 RASn CAS0 3 DRAMWE R W Peripheral Cycle Memory Cycle Figure 4 6 Buffered Mode Transfer from a 32 bit Peripheral to a 32 bit DRAM DMA Operations 4 9 4 2 3 Fly By Mode Transfers Unlike buffered mode DMA transfers fly by mode DMA transfers do not require the PPC403GA to buffer the transferred data Figure 4 7 shows that the PPC403GA does not buffer the data in fly by mode transferring data between memory and a peripheral As for buffered transfers the DMA channel must be configured for fly by mode via programming the DMA Channel Control Register Also the DMA Count and the DMA Destination Address Registers must be initialized with the transfer count and beginning memory address The DMA Chained Count Register and the DMA Source Chained Address Register must be loaded with their respective values if DMA chaining is enabled for the channel The PPC403GA accesses memory using the parameters in the Bank Register associated with the DMA memory address Memory gt Per
400. he PPC403GA These timings only take into account first order affects of cache misses on the I side and D side They give the number of extra cycles associated with getting the target word data or instruction into the processor The timings do NOT give a complete indication of the performance penalty associated with cache misses as they do not take into account bus contention between I side and D side nor the time associated with finishing line fills or flushes Unless specifically stated otherwise these numbers all assume a single cycle memory access C 3 1 General Rules e Instructions are executed in order e All instructions assuming cache hits take 1 cycle to execute except e Folded branches take 0 clock cycles e Folded Condition Register Logical instructions CR Logicals take O clock cycles e Multiply takes 4 clock cycles e Divide takes 33 clock cycles e Load Store String Multiple takes 1 cycle word C 3 2 Branch and CR Logical Opcodes This section discusses the timings associated with the folding of Branch and CR Logical instructions For a thorough discussion of the dependency rules which govern folding see Section C 4 on page C 10 All Branches and CR Logicals take 0 cycles except under the following conditions e CR Logicals that immediately follow any type of CR setting operation will take 1 cycle e A CR dependent Branch where the CR was altered by a long CR updating instruction arithmetic log
401. he PPC403GA to perform DRAM refresh with the time of refresh occurrence determined by software rather than determined automatically by the BIU In Alternate Refresh mode refresh will not occur at all unless activated by software Once the Immediate Refresh mode is activated refreshes will continue until the Alternate Refresh Mode bit is reset by software Immediate Refresh behaves according to the following rules e Each cycle that the Alternate Refresh Mode bit is set and the Refresh Rate field is programmed to 0001 the DRAM control register will continue to set the refresh request latch in the DRAM controller Thus if this bit is set for at least one cycle the DRAM controller will guarantee that at least one refresh occurs If the mode is set for more than one cycle then one or more refreshes may occur and will continue to occur until the Alternate Refresh Mode bit is reset Since the Immediate Refresh mode is setting the refresh request latch in the DRAM controller there may be one additional refresh done after exiting the Alternate Refresh mode e f more than one refresh request is active BR7 has the highest priority fol lowed by BR6 then BRS and finally BR4 If BR7 s Immediate Refresh mode remains active for a long period of time then no other bank will be refreshed during this time To avoid this problem the bank which requires Immediate Refresh mode should be programmed on one of the lower priority banks so that the other bank
402. he PowerPC User Instruction Set Architecture Instruction Set 10 83 Ihzx Load Halfword and Zero Indexed Ihzx RT RA RB 31 RT RA RB 279 0 6 11 16 21 31 EA lt RB RA O RT lt 160 MS EA 2 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The halfword at the effective address is extended to 32 bits by concatenating 16 0 bits to its left The result is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 84 PPC403GA User s Manual Imw Load Multiple Word Imw RT D RA 46 RT RA D 0 6 11 16 31 EA lt EXTS D RA 0 r RT do while r lt 31 if r RA v r 31 then GPR r MS EA 4 rer i EA lt EA 4 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field in the instruction to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned
403. he PowerPC cmpli Compare Logical Immediate instruction use of the extended mnemonic cmplwi BF RA IM is recommended Table 10 12 Extended Mnemonics for cmpli Other Mnemonic Operands Function Registers Page Changed cmplwi BF RA IM Compare Logical Word Immediate 10 40 Use CRO if BF is omitted Extended mnemonic for cmpli BF 0 RA IM 10 40 PPC403GA User s Manual cntlzw Count Leading Zeros Word entizw RA RS Rc 0 cntlzw RA RS Rc 1 31 RS RA 26 Rc 0 6 T 16 27 31 ne D do while n lt 32 if RS 1 then leave The consecutive leading 0 bits in register RS are counted the count is placed into register RA The count ranges from 0 through 32 inclusive Registers Altered e RA e CR CRO r cr a so if Re contains 1 Invalid Instruction Forms e Reserved fields Instruction Set 10 41 crand Condition Register AND crand BT BA BB 0 6 11 16 21 31 The CR bit specified by the BA field is ANDed with the CR bit specified by the BB field the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 42 PPC403GA User s Manual crandc Condition Register AND with Complement crandc BT BA BB 0 6 11 16 21 31 Chor lt Con A
404. he corresponding DRAM bank register If the width of the memory is smaller than the width of the peripheral the PPC403GA will read the necessary bytes from the memory pack them into one peripheral sized data item and transfer that item to the peripheral The DMA channel control register determines the buffered operation to be performed width and direction of the transfer and other configuration settings Figure 4 4 presents the bit settings for a buffered read from a 32 bit memory followed by a write to a 32 bit peripheral with no setup hold or wait cycle requirements CE TD PW SA TM PWC PHC TCE BME TCD DEE EE iy H 4 1 1 0 O 10 O x 1 00 oo 00 0000 000 1 1 olofo 0 28 31 de h a pde ch ch ete Figure 4 4 DMACR Setting for Buffered DRAM Read Peripheral Write Reserved Table 4 1 describes the bit settings used in this example of a buffered transfer Table 4 1 Sample DMACR Settings for Buffered Transfer Bit Name Description 0 CE Channel Enable 1 Channel is enabled for DMA operation 1 CIE Channel Interrupt Enable 1 All DMA interrupts from this channel end of transfer terminal count reached are enabled 2 TD Transfer Direction Valid only for buffered mode and fly by mode don t care in memory to memory mode 0 Transfers are from memory to peripheral 3 PL Peripheral Location 0 Peripheral is external to the PPC403GA 4 5 PW
405. he machine when a non critical interrupt is processed Save Restore Register 0 SRRO is loaded with the 32 bit effective address of the instruction which was to be executed next at the time the exception occurred Save Restore Register 1 SRR1 is loaded with the contents of the Machine State Register At the end of the exception processing routine executing a return from interrupt rfi instruction restores the program counter and the machine state register from SRRO and SRR1 respectively Figure 6 2 shows the bit definitions for SRRO 0 29 30 31 Figure 6 2 Save Restore Register 0 SRRO 0 29 Next Instruction Address 30 31 reserved Figure 6 3 shows the bit definitions for SRR1 WE ILE PR ME DE PX LE a eee 4 4 0 12 13 14 15 116 17 18 19 20 21 22 23 27 28 29 30 31 d de PE Figure 6 3 Save Restore Register 1 SRR1 0 12 reserved 13 WE Wait State Enable 0 The processor is not in the wait state and continues processing 1 The processor enters the wait state and remains in the wait state until an exception is taken or the PPC403GA is reset or an external debug tool clears the WE bit 6 4 PPC403GA User s Manual CE Critical Interrupt Enable 0 Critical exceptions are disabled 1 Critical exceptions are enabled CE controls these interrupts critical interrupt pin watchdog timer first time ou
406. heral Interface 3 53 The following figure illustrates an external master single transfer read data flows from DRAM to the external master Cycle SysClk Ext Bus Master HoldReq XREQ BSEL HoldAck DMAR3 XREQ R W EOT3 TC3 xSize0 OE XSizel as H DMAA3 XACK 7 A WBEO A4 WBE1 A5 aen GH E WBE2 A30 WBE3 A31 D0 31 e DRAM control AMuxCAS RASn CAS0 3 DRAMOE DRAMWE Notes 1 For multiple transfers the next valid request is cycle 9 Bank Register Settings Seq Line Bus External RAS CAS First Burst Refresh Refresh Fills Width Mux Timing Access Access RAS Rate Bit 13 Bits 15 16 Bit 17 Bit 18 Bit 21 22 Bit 23 24 Bit 26 Bits 27 30 x 10 1 0 01 XX x XXXX Figure 3 26 External Bus Master Read Using the Internal DRAM Controller 3 54 PPC403GA User s Manual 3 9 2 2 External Master Burst Transfers To request the first transfer of the burst the external bus master places an active level on the PPC403GA transfer request XREQ input and provides the full address A4 31 of the memory location on the address bus the direction of the transfer R W and XSize0 1 The burst transfer is indicated XSize0 1 b 11 which conveys no information about the transfer size For burst transfers the transfer size is required to be the same as the bus width defined in the bank register associated with
407. hronization and the 10 isync in Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture Instruction Set 10 71 bz Load Byte and Zero Ibz RT D RA 34 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RT lt 240 MS EA 1 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The byte at the effective address is extended to 32 bits by concatenating 24 0 bits to its left The result is placed into register RT Registers Altered e RT Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 72 PPC403GA User s Manual Ibzu Load Byte and Zero with Update Ibzu RT D RA 35 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RA EA RT lt 740 MS EA 1 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The effective address is placed into register RA The byte at the effective address is extended to 32 bits by concatenating 24 0 bits to its left The result is placed into register RT Registers Altered e RA e RT
408. hs attached to the data bus are left justified toward the byte 0 side of the bus Byte devices always are attached to byte 0 halfword devices to byte 0 and byte 1 while word devices use the entire data bus 3 4 1 Bus Width after Reset In general the configuration of bank registers to allow the PPC403GA to support various device widths is a software task At reset however enough configuration must be defined by hardware to allow boot code to run normally from a small ROM in high memory A default configuration is defined for bank register BRO which supports slowest possible ROM SRAM The device width for this default configuration is determined at reset by the BootW input signal BootW is sampled while the Reset signal is active and again after Reset is deactivated to determine the width of the boot ROM For an 8 bit boot ROM width the BootW pin should be tied to 0 For a 32 bit boot ROM width this pin should be tied to 1 For a 16 bit boot ROM width the BootW pin should be tied to the Reset pin Memory and Peripheral Interface 3 5 Halfword Device Halfword Device D08 D15 Fullword Device Fullword Device o 2 gt Q p O Si E 5 I D16 D23 D24 D31 Figure 3 3 Attachment of Devices of Various Widths to the PPC403GA Data Bus 3 4 2 Alternative Bus Attachment Devices are left justified on the bus under the assumption that the PPC4
409. i stb SPRC_addr 0 clear Serial Port receiver command register stb SPTC_addr 0 clear Serial Port transmitter command register sto BRDH_addr baud_rate_high program desired baud rate divisor high i stob BRDL_addr baud_rate_low program desired baud rate divisor low sto SPCTL_addr serial_port_config configure serial port W transmitter and receiver may be W enabled any time after a interrupt service W routine is available ZE Je EE Initialize and configure DMA facilities ZE a a a SO i a ZE mtdcr DMASR 0xFFFFFFFF clear DMA status register if channel 0 used if memory to memory mode mtdcr DMASAO amp source_addr initialize source memory address mtdcr DMADAO amp source_addr initialize destination address mtdcr DMACTO transfer_count initialize transfer count a else if buffered mode fly by mode amp amp chaining enabled mtdcr DMASAO amp count_addr initialize chaining terminal count address mtdcr DMACCO chained_count initialize chained transfer count mtdcr DMADAO amp source_addr initialize memory transfer address s mtdcr DMACTO transfer_count initialize transfer count else if buffered mode fly by mode amp amp chaining enabled mtdcr DMADAO amp source_addr initialize memory address 0 mtdcr DMACTO transfer_count initialize transfer count Reset and Initialization 5 11 mtd
410. i order result in RT Drone lt RA x RB signed RT lt prodg 31 CRI CRO 10 112 mulhwu mulhwu A 28 RT RA RB Multiply RA and RB unsigned Place hi order result in RT Drone lt RA x RB unsigned RT prodg 31 PPC403GA User s Manual CRI CRO 10 113 Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed mulli RT RA IM Multiply RA and IM signed 10 114 Place lo order result in RT prodo 47 lt RA x IM signed RT lt prody 47 mullw RT RA RB Multiply RA and RB signed 10 115 Place lo order result in RT mullw prodo s3 lt RA x RB signed CRICRO mullwo RT prod32 63 XER SO OV mullwo CR CRO XER SO OV nand RA RS RB NAND RS with RB 10 116 Place answer in RA nand CR CRO neg RT RA Negative twos complement of RA 10 117 RT lt RA 1 neg CR CRO nego XER SO OV nego CR CRO XER SO OV nop Preferred no op 10 121 triggers optimizations based on no ops Extended mnemonic for ori 0 0 0 nor RA RS RB NOR RS with RB 10 118 Place answer in RA nor CR CRO not RA RS Compement register 10 118 RA lt RS Extended mnemonic for nor RA RS RS not Extended mnemonic for CR CRO nor RA RS RS or RA RS RB OR RS w
411. ic for belrl 4 4 cr_field 0 LR 10 32 bgt cr_field target bgta bgtl bgtla Branch if greater than Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 1 target Extended mnemonic for bea 12 4 cr_field 1 target Extended mnemonic for bel 12 4 cr_field 1 target LR Extended mnemonic for bcla 12 4 cr_field 1 target LR 10 21 B 10 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bgtctr bgtctrl Operands cr_field Function Branch if greater than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 1 Other Registers Changed Extended mnemonic for bectrl 12 4 cr_field 1 LR Page 10 28 bgtir bgtirl cr_field Branch if greater than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 1 Extended mnemonic for belrl 12 4 cr_field 1 LR 10 32 ble blea blel blela cr_field target Branch if less than or equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 1 target Extended mnemonic for bca 4 4 cr_field 1 target Extended mnemonic for bel 4 4 cr_field 1 target LR Extended mnemonic for bcla 4 4 cr_field 1 target LR 10 21 blectr blectrl cr_field Branch if l
412. ical compare and mterf takes e 2 cycles if the instruction that sets the CR immediately precedes the Branch instruction e 1 cycle if the instruction that sets the CR is separated from the Branch instruc tion by one instruction that does not effect the CR bit used by the Branch instruction Instruction Timing and Optimization C 7 C 3 3 A CR dependent Branch where the CR was altered by a short CR updating instruction CR Logical merxr merf takes e 1 cycle if the instruction that sets the CR immediately precedes the Branch instruction e Ocycle if the instruction that sets the CR is separated from the Branch instruc tion by one instruction that does not effect the CR bit used by the Branch instruction A Branch instruction that is dependent upon and immediately follows the setting of the Link Register LR or the Count Register CTR takes 1 cycle The Branch instructions that depend on the LR or CTR are Branch to LR Branch to CTR and any Branch instruction that is dependent on the condition of the Count Register that is any Branch with Decrement Branch Prediction This section discusses the timings associated with branch prediction See Section 2 8 5 on page 2 28 for a thorough discussion of the prediction of branch direction and of programmer control of prediction direction C 3 4 C 8 A correctly predicted branch predicted to be taken and it is taken or predicted to be not taken and it is not
413. ieio and sync instructions are implemented identically on the PPC403GA the architectural requirements of the instructions differ See Section 2 12 for a discussion of the architectural differences 10 Instruction Set 10 161 tw Trap Word tw TO RA RB 31 TO RA RB 4 0 6 11 16 21 31 if RA lt RB ATO 1 then TRAP if RA gt RB ATO 1 then TRAP if RA RB ATO 1 then TRAP if RA lt RB ATO 1 then TRAP if RA D RB ATO 1 then TRAP Register RA is compared with register RB If any comparison condition indicated by the TO field is true a TRAP occurs If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Note This instruction is inserted into the execution stream by a debugger to implement breakpoints and is not typically used by application code Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 162 PPC403GA User s Manual tw Trap Word Table 10 30 Extended Mnemonics for tw Other Mnemonic Operands Function Registers Page Changed trap RA RB Trap unconditionally 10 162 Extended mnemonic for tw 31 RA RB tweq Trap if RA equal to RB Extended mnemonic for tw 4 RA RB twge Trap if RA greater than or equal to RB Extended
414. if BF is omitted Extended mnemonic for cmp BF 0 RA RB 10 37 cmpwi BF RA IM Compare Word Immediate Use CRO if BF is omitted Extended mnemonic for cmpi BF 0 RA IM 10 38 cntlzw RA RS cntlzw Count leading zeros in RS Place result in RA CRICRO 10 41 crand BT BA BB AND bit CRga with CRgp Place answer in CRpr 10 42 crandc crelr BT BA BB bx AND bit CRga with CRpp Place answer in CRpr Condition register clear Extended mnemonic for crxor bx bx bx 10 43 10 49 creqv BT BA BB Equivalence of bit CRga with CRep CRet g CRga CRepp 10 44 crmove bx by Condition register move Extended mnemonic for cror bx by by 10 47 crnand crnor BT BA BB BT BA BB NAND bit CRga with CRgp Place answer in CRpr Place answer in CRpr 10 45 10 46 crnot bx by Condition register not Extended mnemonic for crnor bx by by 10 46 A 18 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed cror BT BA BB OR bit CRga with CRgp 10 47 Place answer in Che crorc BT BA BB OR bit CRga with Ces 10 48 Place answer in CRpr crset bx Condition register set 10 44 Extended mnemonic for creqv bx bx
415. ight banks of devices are supported the total of DRAM and SRAM banks may not exceed eight Each SRAM bank supports direct attachment of devices up to 64 MB Each bank can be configured for 8 16 or 32 bit devices For each SRAM bank the bank size the bank starting address number of wait states and timings of the chip selects write enables and output enables are all user programmable Writing to the DRAM and SRAM bank registers allows the user to change the characteristics of individual memory banks Reading the contents of the SRAM and DRAM bank registers allows the user to examine the current configuration of each bank The contents and use of the SRAM and DRAM bank registers are discussed in Chapter 3 Addresses for which A1 A3 are neither 0b000 nor 0b111 are either internal to the PPC403GA on the On chip Peripheral Bus or they are reserved Twenty four regions 2 13 and 18 29 are in this category Figure 2 1 shows the memory map for the PPC403GA and the device types supported in each region Each region in the figure is a cacheability region as described above ADDRESS CACHEABILITY REGION FUNCTION Ge Ee SRAM ROMIPIA Access 0xF000 0000 Eanes double mapping of 14 15 OxEFFF FFFF Regions 18 29 Reserved 0x9000 0000 Ox8FFF FFFF DRAM Access 0x8000 0000 Regions 16 17 double mapping of 0 1 Ox7FFF FFFF i SRAM ROM PIA Access Regions 14 15 double mapping of 30 31 0x7000 0000 Ox6FFF FFFF Regions 9
416. igured error or BIU protection error occurs on an instruction fetch and execution of that instruction is subsequently attempted 2 46 PPC403GA User s Manual an Instruction Machine Check IMC exception will occur If enabled by MSR ME the processor will report the IMC by vectoring to the Machine Check handler offset 0x0200 and setting a bit in the Exception Syndrome Register ESR to indicate the type of IMC that occurred Taking the vector automatically clears the MSR ME bit The address of the error will be placed in the BEAR and the description of the error will be placed in the BESR assuming that these registers are not locked by the prior occurrence of a Data Machine Check However information placed in the BEAR and BESR because of errors during instruction fetching is not locked in those registers and will be overwritten if any subsequent error occurs Note that it would be improper to declare an Instruction Machine Check exception at the time of occurrence of the error at the BIU because the address is possibly the result of an incorrect speculation by the fetcher It is possible that no attempt will actually be made to execute an instruction from the erroneous address If execution is attempted an exception will occur at that time When an error occurs on an instruction fetch the erroneous instruction is never written to the l cache If the address was explicitly requested by the fetcher then the instruction along with a
417. ined by reading the register The status bits are normally set by debug events by one of three types of reset and by writing and reading the JTAG Serial Buffers Individual bits can be cleared to 0 by a write to this register with a 1 in the bit positions to be 9 8 PPC403GA User s Manual cleared and a 0 in the bit positions that are to remain unaltered EXC UDE IA2 DW1 DW2 yoy 4 4 4 WEI JIO 4 os 2 3 4 5 6 7 8 10 11 12 21 22 23l24 1 SS de D Figure 9 2 Debug Status Register DBSR 1 T BT d dh D 28 e 30 cb J 31 de 0 IC Instruction Completion Debug Event 0 Event Didn t Occur 1 Event Occurred 1 BT Branch Taken Debug Event 0 Event Didn t Occur 1 Event Occurred 2 EXC Exception Debug Event 0 Event Didn t Occur 1 Event Occurred 3 TIE TRAP Instruction Debug Event 0 Event Didn t Occur 1 Event Occurred 4 UDE Unconditional Debug Event 0 Event Didn t Occur 1 Event Occurred 5 IA1 Instruction Address Compare 1 Debug Event 0 Event Didn t Occur 1 Event Occurred 6 IA2 Instruction Address Compare 2 Debug Event 0 Event Didn t Occur 1 Event Occurred 7 D I Data Address Read Compare 1 Debug Event 0 Event Didn t Occur 1 Event Occurred 8 DW1 Data Address Write Compare 1 Debug Event 0 Event Didn t Occur 1 Event Occurred 9 DR2 Data Address Read Compare 2 D
418. ing the JTAG debug port Most Recent Reset The type of the most recent reset can be determined using the JTAG debug port or the DBSR 9 5 Debug Events Debug events are used to trigger a debug operation to take place While in Internal Debug Mode the processor generates a debug exception when a debug event occurs In External Debug Mode the processor stops when a debug event occurs In Real Time Trace Debug Mode the processor begins broadcasting trace information on the Trace Status signals when a debug event occurs Debug events have no effect on the Trace Status signals during Bus Status Debug Mode Debug events are controlled by the Debug Control Register Branch Taken The Branch Taken debug event will occur prior to the execution of a branch instruction where the branch direction is determined to be taken Data Address The Data Address Compare debug event will occur prior to the Compare execution of an instruction that accesses a data address that matches the contents of one of the two Data Address Compare Registers Via the DBCR the data address compare can be set up to occur on reads and or writes from byte addresses or from any byte within halfword word or quad word addresses Exception The Exception debug event occurs after an exception is taken Exception debug events include the critical class of exceptions unless in Internal Debug Mode 9 4 PPC403GA User s Manual Instruction Address The Instruction Address Compare
419. ins 0 the CTR is decremented The BI field specifies a bit in the CR to be used as the condition of the branch The next instruction address NIA is the target address of the branch The NIA is formed by concatenating the 30 most significant bits of the LR with two 0 bits on the right The BO field controls options that determine when program flow is transferred to the NIA The BO field also controls Branch Prediction a performance improvement feature See Section 2 8 4 and Section 2 8 5 for a complete discussion If the LK field contains 1 then CIA 4 is placed into the LR Registers Altered e CTR if BO contains 0 e LR if LK contains 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 32 PPC403GA User s Manual belr Branch Conditional to Link Register Table 10 8 Extended Mnemonics for bclr bclirl Mnemonic blr birl Operands Function Branch unconditionally to address in LR Extended mnemonic for bcir 20 0 Other Registers Changed Extended mnemonic for belrl 20 0 LR Page 10 32 bdnzir bdnzirl Decrement CTR Branch if CTR 0 to address in LR Extended mnemonic for belr 16 0 Extended mnemonic for belrl 16 0 10 32 bdnzfir bdnzfirl cr_bit Decrement CTR Branch if CTR 0 AND CR pit 9 to address in LR KR Extended mnemonic for belr 0
420. instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 157 subfic Subtract From Immediate Carrying subfic RT RA IM 0 6 11 16 31 RT RA EXTS IM 1 if RA EXTS IM 1 282 1 then XER CA lt 1 else XER CA lt 0 The sum of the ones complement of RA the IM field sign extended to 32 bits and 1 is placed into register RT If a carry out occurs XER CA is set to 1 Registers Altered e RT e XER CA Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 158 PPC403GA User s Manual subfme Subtract from Minus One Extended subfme RT RA OE 0 Rc 0 subfme RT RA OE 0 Rc 1 subfmeo RT RA OE 1 Rc 0 subfmeo RT RA OE 1 Rc 1 31 RT RA OE 232 Re 0 6 11 16 21 22 31 RT RA 1 XER CA if RA 1 XER CA E 232 1 then XER CA lt 1 else XER CA lt 0 The sum of the ones complement of register RA 1 and XER CA is placed into register RT XER CA is set to a value determined by the unsigned magnitude of the result of the subtraction operation Registers Altered e RT e CRI CRO cr eo so if Re contains 1 e XER SO OV if OE contains 1 e XER CA Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 159 subfze Subtract from Zero E
421. inuing to completion The data in this cache line will be meaningless old data from a BIU data register but the data cache will be unaware and will flag the cache line as valid If the interrupt handler for the DMC takes no corrective action such as invalidating the cache line then subsequent loads from the erroneous address will be satisfied from the data cache with garbage data without warning The BESR is a 32 bit register whose bits identify DMC errors See Section 6 1 9 on page 6 14 for details BESR 0 is the actual source of the DMC therefore software must clear it before executing the return from critical interrupt rfci or before otherwise re enabling MSR ME 2 48 PPC403GA User s Manual The BEAR is a 32 bit register which contains the target address of the access which caused the DMC exception The BEAR is loaded the first time a data access bus error occurs and its contents are locked until the Bus Error Syndrome Register BESR is cleared See Section 6 2 3 Machine Check Exceptions on page 6 19 for further discussion on Data Machine Checks 2 14 Instruction Set Summary Table 2 14 summarizes the instruction categories in the PPC403GA instruction set The instructions within each category are discussed in the subsequent sections The Register Transfer Language descriptions of each instruction are contained in Chapter 10 Appendix A contains an alphabetical listing of all instructions with short form descriptions of
422. ion and Addressing 2 2 1 Double Mapping The processor core of the PPC403GA has a 32 bit address bus hence a 4 gigabyte GB address space The processor interfaces to external memory and on chip peripherals via a Bus Interface Unit BIU The BIU imposes addressing restrictions Perhaps the most fundamental of these restrictions the high order address bit AO is not presented to external memory and also not decoded by the BIU for determining chip select usage for SRAM or RAS usage for DRAM Therefore a given block of external memory can be addressed with bit AO 0 or AO 1 there are two addresses available for every external memory location AO does participate in determining the cacheability of any address via the Cacheability Registers DCCR and ICCR For the PPC403GA a given external memory location will always have two addresses one with AO 0 and one with AO 1 It is possible to program the DCCR and or the ICCR so that one of these addresses is cacheable and the other is not An example use of double mapping with separate cacheability control 2 2 Cacheability regions are on 128 megabyte boundaries For this example assume the region from 0x7000 0000 to 0x77FF FFFF which would be external SRAM This region would also be addressed as 0xF000 0000 to OxF7FF FFFF The same external memory would be the target but the cacheability need not be the same Assume that the DCCR and the ICCR have been set up such that data accesse
423. ion of A6 A11 97 VO Address Bus Bit 11 See description of A6 A12 98 O Address Bus Bit 12 When the PPC403GA is bus master this is an address output from the PPC403GA A13 99 O Address Bus Bit 13 See description of A12 A14 103 O Address Bus Bit 14 See description of A12 A15 104 O Address Bus Bit 15 See description of A12 A16 105 O Address Bus Bit 16 See description of A12 A17 106 O Address Bus Bit 17 See description of A12 A18 107 O Address Bus Bit 18 See description of A12 A19 108 O Address Bus Bit 19 See description of A12 A20 109 O Address Bus Bit 20 See description of A12 A21 110 O Address Bus Bit 21 See description of A12 Signal Descriptions 12 1 Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function A22 112 VO Address Bus Bit 22 When the PPC403GA is bus master this is an address output from the PPC403GA When the PPC403GA is not bus master this is an address input from the external bus master to determine page crossings A23 113 VO Address Bus Bit 23 See description of A22 A24 114 VO Address Bus Bit 24 See description of A22 A25 115 VO Address Bus Bit 25 See description of A22 A26 116 VO Address Bus Bit 26 See description of A22 A27 117 VO Address Bus Bit 27 See description of A22 A28 118 VO Address Bus Bit 28 See description of A22 A29 119 VO Address Bus Bit 29 S
424. ions are controlled by the CDBCR special purpose register 0 26 27 28 30 31 cls CSS Figure 8 1 Cache Debug Control Register CDBCR 0 26 reserved 27 CIS Cache Information Select 0 Information is cache Data 1 Information is cache Tag 28 30 reserved 31 css Cache Side Select 0 Cache side is A 1 Cache side is B 8 2 Instruction Cache Unit The ICU contains a two way set associative 2KB cache memory Each of the two sets is Cache Operations 8 1 organized as 64 lines of 16 bytes each As shown in Figure 8 2 tag sets A and B store address bits A0 21 for each instruction line in cache sets A and B The next six bits of each instruction address A22 27 serve as the index to the cache array into which the ICU writes a line as it is filled Two cache lines that correspond to the same line index one in each set are referred to as a congruence class Tag Set A Tag Set B Instruction Cache Set A Instruction Cache Set B A0 21 Line 0A A0 21 Line 0B Line OA 4 words line Line OB 4 words line A0 21 Line 1A A0 21 Line 1B Line1A 4 words line Line 1B 4 words line A0 21 Line 62A A0 21 Line 62B Line 62A 4 words line Line 62B 4 words line A0 21 Line 63A A0 21 Line 63B Line 63A 4 words line Line 63B 4 words line Figure 8 2 Instruction Cache Organization Within a congruence class the line which was accessed most recently is retained and the other
425. ions using one operand are defined in a two operand format where the operation is performed on the operand in one register and the result is placed in another register Several instructions also have immediate formats in which one operand is coded as part of the instruction itself Most arithmetic and logical Instructions offer the programmer the ability to optionally set the condition code register based on the outcome of the instruction The instructions whose mnemonics end in for example add are the forms which will set the condition register Table 2 17 Arithmetic and Logical Instructions ARITHMETIC LOGICAL add addi divw mulhw subf subfic and eqv nor add addic divw mulhw subf subme and SON nor addo addic divwo mulhwu subfo subme andc addo addis divwo mulhwu subfo submeo_ andc extsb or addc addme divwu mulli subfc submeo andi extsb or addc addme divwu mullw subfc subfze andis orc addco addmeo divwuo mullw subfco subfze extsh orc addco addmeo divwuo mullwo subfco subfzeo cntlzw extsh ori adde addze mullwo subfe subfzeo cntlzw oris adde addze subfe nand addeo addzeo neg subfeo nand xor addeo addzeo neg subfeo xor nego xori nego xoris Programming Model 2 51 2 14 4 Comparison Instructions Comparison instructions perform arithmetic or logical comparisons between two operands and set one of the eight condition code register fields see Section 2 3 3 on page
426. ipheral DMAR ra 403GA DMAA Address a Memory to Peripheral Transfer Data Memory ra Peripheral DMAR 403GA DMAA Address b Peripheral to Memory Transfer Figure 4 7 Overview of Fly by Mode DMA Transfer In this example the PPC403GA performs a DMA Fly By transfer from a 32 bit 3 cycle DRAM memory to a 32 bit peripheral Figure 4 10 shows the channel control register 4 10 PPC403GA User s Manual settings for this transfer CE TD PW SAI TM PWC PHC TCE BME TCD 4 4 4 4 H H re DE 1 1 00 10 O x 1 01 00 XX XXXX XXX 1 1 0 0 0 0 28 31 de d DAI dp ae eh ch Ge Figure 4 8 DMACR Setting for Fly By Memory Read Peripheral Write LI Reserved Table 4 2 describes the bit settings for each field in this DMACR Table 4 2 Sample DMACR Settings for Fly By Transfer Bit Name Description 0 CE Channel Enable 1 Channel is enabled for DMA operation 1 CIE Channel Interrupt Enable 1 All DMA interrupts from this channel end of transfer terminal count reached are enabled 2 TD Transfer Direction Valid only for buffered mode and fly by mode don t care in memory to memory mode 0 Transfers are from memory to peripheral 3 PE Peripheral Location 0 Peripheral is external to the PPC403GA 4 5 PW Peripheral Width Tra
427. ipheral set up cycles wait cycles and hold cycles can be programmed into each DMA channel control register The DMA channels also support DMA chaining so chained count reisters are provided for each channel The DMA status register holds the status of all four channels Each DMA channel uses three signals DMAR DMAA and EOT TC An external peripheral may request a DMA transaction by putting an active level on a channel s DMAR pin If the DMA channel is enabled the PPC403GA responds to the DMA request by asserting an active level on the DMAA pin when the DMA transfer begins The PPC403GA DMA controller holds an active level on the DMAA pin while the transfer is in progress The signal DMADXFER is available to support burst mode fly by transfers between memory and peripheral DMADXFER is active in the last cycle of each transfer hence it is active continuously during single cycle transfers DMADXFER when ORed with the processor input clock SysClk yields an appropriate signal to indicate that data has been latched on 1 8 PPC403GA User s Manual writes to memory or that data is available to be latched on reads from memory If the DMA channel is operating in buffered mode the PPC403GA reads data from a memory location or peripheral device buffers the data and then transfers the data to a peripheral device or memory location If the DMA channel is operating in fly by mode the PPC403GA provides the address and control sign
428. ipherals e 32 bit data bus e Addressing for 512MB of external memory and MMIO e Support for a wide range of memory timing parameters Overview 1 1 e Support for direct connection of byte halfword and fullword devices e Separate instruction cache and write back data cache both two way set associative e Minimized interrupt latency e Individually programmable on chip controllers for e Four DMA channels e DRAM SRAM and ROM banks e Peripherals e Serial port e External interrupts e Flexible interface to external bus masters 1 2 PowerPC Architecture The PowerPC Architecture comprises three levels of standards e PowerPC User Instruction Set Architecture including the base user level instruction set user level registers programming model data types and addressing modes e PowerPC Virtual Environment Architecture describing the memory model cache model cache control instructions address aliasing and related issues While accessible from the user level these features are intended to be accessed from within library routines provided by the system software e PowerPC Operating Environment Architecture including the memory management model supervisor level registers and the exception model The first two levels of standards represent the instruction set and facilities available to the application programmer The third level includes features such as system level instructions which are not directly accessible by user ap
429. iplex for DRAM A 3 45 The On Chip Peripheral Bus Interface A 3 48 External Bus Master Interface ceccceeecceceseeeeeeseeeeeeeeeeeseeeneseeeeseeeeseseeeeeneneesseeeeeteeeens 3 49 External B s Arbitration 23 tec teen eh AE es ST Da 3 50 DRAM Accesses by the External Bus Master 3 52 External Master Single Transfers A 3 53 External Master Burst Transfers AA 3 55 DMA Operations EN 4 1 Ove Vie W bt Se oi ated see ak Ee a ce clad ned ea Se takes Gd ed eed dd ies 4 1 DMA Mere LTE 4 3 RO le E TEEN 4 3 Buffered Mode Transfers edd anp E eee 4 4 Buffered Transfer from Memory to Peripheral AAA 4 6 Buffered Transfer from Peripheral to Memory eeeeceeeeseeeseneeeeeneeeeeeeeeeeneeeeenaeeene 4 9 Fly By Mode Transfers aea ioe Savage el ae 4 10 Fly By Burst geen n ne es verti ee et 4 14 Fly By Burst Memory to Peripheral AAA 4 16 Fly By Burst Peripheral to Memory 0 ceeesceeeeseeeeeneeeeeeneeeeeaneeeeeaeeeeeeeeesnneeeeeaeees 4 18 Memory to Memory Mode Transfers AAA 4 19 Memory to Memory Transfers Initiated by Software 0 0 ceeeeeeeeeeeeeeeeteneeeeeeteees 4 19 Device Paced Memory to Memory Transfers AA 4 21 Memory to Memory Line Burst Mode AAA 4 22 Packing and Unpacking of Data 0 eceeeeeeeeeneeeeeeeeeeeeeeeseeeeeeeaeeeesaeesenaeeeneeeereaes 4 23 EE ee Kee TE 4 23 Chaining Example Quick Start of Transfer cceeceesceeeeeeeereeeeeeeeeeseeeeeseeeeaeetaees 4 24 Chaining Example No Setup Race eecceeeceeeseeee
430. irst transfer cycle First Wait FWT applies during the first transfer of the burst while Burst Wait BWT applies during all remaining transfers of the burst If Burst Wait is programmed 1 cycle then it is valid to program Write Byte Enable Off WBF to one If WBF 1 then the Write Byte Enable signals will turn off during the last cycle of each transfer first transfer as well as each burst transfer The BW field bits 15 16 controls the width of bank accesses If the BW field is b 00 the bank is assumed to have an 8 bit data bus b 01 indicates a 16 bit data bus b 10 indicates a 32 bit data bus Figure 3 3 shows how devices of various widths are attached to the PPC403GA data bus The RE field bit 17 controls the use of the Ready input signal If the field is 0 the Ready input is ignored no additional wait states are inserted into bus transactions If the field is 1 the Ready input is examined after the wait period expires additional wait states are inserted if the Ready input is 0 The number of wait states in each transaction is determined by the TW field in the register and activation of the Ready input The TWT field bits 18 23 specifies the number of wait states to be taken by each transfer to the SRAM bank The number of cycles from address valid to the deassertion of CS is 1 TWT where 0 lt TWT lt 63 This field is used for non burst transfers field BME 0 The FWT field bits 18 21 specifies th
431. is not it will cause an alignment exception The least significant halfword of register RS is stored into the halfword at the effective address in main storage The effective address is placed into register RA Registers Altered e RA Invalid Instruction Forms e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 141 sthux Store Halfword with Update Indexed sthux RS RA RB 31 RS RA RB 439 EA lt RB RA O MS EA 2 lt RS j6 31 RA EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The least significant halfword of register RS is stored into the halfword at the effective address in main storage The effective address is placed into register RA If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA Invalid Instruction Forms e Reserved fields e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 142 PPC403GA User s Manual sthx RS RA RB sthx Store Halfword Indexed 31 RS RA RB 407 0 6 EA lt RB RA O MS E
432. is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations Instruction Set 10 167 xor XOR xor RA RS RB Rc 0 xor RA RS RB Re 1 31 RS RA RB 316 Rc 0 6 T 16 21 31 RA lt RS RB The contents of register RS are XORed with the contents of register RB the result is placed into register RA Registers Altered e CR CRO r ecr ca so if Re contains 1 e RA Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 168 PPC403GA User s Manual xori XOR Immediate xori RA RS IM 26 RS RA IM 0 6 11 16 31 RA RS Dep IM The IM field is extended to 32 bits by concatenating 16 0 bits on the left The contents of register RS are XORed with the extended IM field the result is placed into register RA Registers Altered e RA Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 169 xoris XOR Immediate Shifted xoris RA RS IM 27 RS RA IM 0 6 11 16 31 RA lt RS IM 180 The IM field is extended to 32 bits by concatenating 16 0 bits on the right The contents of register RS are XORed with the extended IM field the result is placed into register RA Registers Altered e RA Architecture Note
433. it 2 1 1 1 DRAM to a 32 bit Peripheral To prevent a second transfer from taking place the peripheral must deassert the DMAR pin during the DMAA cycle The timing for removing the DMAR signal is governed by the programming of the wait and transfer hold bits in the DMA Control Register In Buffered Memory to Peripheral transfers if the Wait and Hold times are zero one Hold cycle is added to give the peripheral time to deactivate DMAR 4 8 PPC403GA User s Manual 4 2 2 2 Buffered Transfer from Peripheral to Memory To set up a transfer from peripheral to memory assuming the same device widths and timings the TD field must be set to 1 in the channel control register Other bit settings remain unchanged and the DMACR is loaded with the revised configuration Again the count and destination address registers must be loaded with the transfer count and the beginning memory address respectively Figure 4 6 shows the timing for a buffered mode transfer from a peripheral to DRAM The peripheral initiates the transfer by placing a0 on DMAR The PPC403GA places a 0 on the DMAA pin to request data from the peripheral The peripheral responds by placing data on the data bus In this example no hold or wait cycles have been programmed into the peripheral so the peripheral must remove the data after one SysClk cycle The R W is active throughout this cycle and since no hold time has been programmed for this peripheral so is DMAA T
434. it corresponding to this debug event 4 ls any Second debug event enabled in DBCR 25 29 e No perform a debug operation as specified in Section 9 5 then go to 1 e Yes go to 5 Debugging 9 5 5 Is this debug event an enabled Second debug event in DBCR 25 29 e No goto 1 e Yes perform a debug operation as specified in Section 9 5 then go to 1 9 7 Debug Registers This section describes debug related registers that are accessible to code running on the processor Use of these registers may cause unexpected results Debug events are controlled by debug tools such as RISCWatch 400 OS Open and OpenBlOS from IBM Such debug tools are designed assuming that they have complete ownership of the PPC403GA debug resources Application code which also uses the debug resources may render the debug tools non functional 9 7 1 Debug Control Register DBCR This register is designed to be used by development tools not application software It is strongly recommended that this register not be used by application software Using this register can cause unexpected results such as program hangs and processor resets The Debug Control Register DBCR is used to enable debug events reset the processor control timer operation during debug events and set the debug mode of the processor EDM RST BT TDE FT IA2 DiW D2R D2S SBT STD SDA JII ooe od eee ee a ee ee 011 2 3 sl 7 18 12113 15116 17 18 19 20 21 22 23 24 25 2
435. it result is 0 SO bit 3 Summary overflow a copy of XER SO at instruction completion The CR CRO er eq subfields are set as the result of an algebraic comparison of the instruction result to 0 regardless of the type of instruction that sets CR CRO If the instruction result is 0 the EQ subfield is set to 1 If the result is not 0 whether the LT subfield or the GT subfield is set depends on the value of the high order bit of the instruction result With respect to the updating of CR CRO the high order bit of an instruction result is considered a sign bit even for instructions that produce results that are not usually thought of as signed For example logical instructions such as and or and nor update CR CRO e eq Via this arithmetic comparison to 0 although the result of such a logical operation is often not actually an arithmetic result Note that if an arithmetic overflow occurs the sign of an instruction result indicated by 2 12 PPC403GA User s Manual CR CRO ct eq May not represent the true infinitely precise algebraic result of the instruction that set CRO For example if an add instruction adds two large positive numbers and the magnitude of the result cannot be represented as a two s complement number in a 32 bit register an overflow occurs and CR CRO so are set although the infinitely precise result of the add is positive Adding the largest 32 bit twos complement negative number x 8
436. it3 229 clocks l bit 23 29 clocks bit 19 21 clocks _ bit 15 21 clocks L bit11 221 clocks Auto Reload PIT OD 0 Figure 6 14 PPC403GA Timer Block Diagram 6 3 1 Timer Clocks The PPC403GA provides four timer facilities as illustrated in Figure 6 14 These facilities all utilize the same frequency as a base clock That frequency may be selected to be either the system clock or a separate timer clock Selection is controlled by bit 29 of the OCH If the separate timer clock is used its frequency must be no more than half of the system clock frequency Further both the low portion and the high portion of the timer clock must be at least as long as the entire period of the system clock 6 28 PPC403GA User s Manual PPC403GA does not provide a separate CLOCK OUTPUT pin While some processors provide such an output the primary motivation for including it is for supporting bus frequencies that are sub multiples of the processor frequency PPC403GA has no such 0 IOCR 29 Selected Time Base Clock SysClk 1 TimerClk capability All processor input output setup hold delay times will be specified relative to the system INPUT clock SysClk and system hardware will use the INPUT clock to synchronize with the processor s signals 6 3 2 Time Base TBHI and TBLO The PPC403GA implements a 56 bit time base accessed via two 32 bit registers TBHI and TBLO The Time Base incr
437. ith RB 10 119 Place answer in RA or CR CRO orc RA RS RB OR RS with RB 10 120 Place answer in RA orc CR CRO Alphabetical Instruction Summary A 29 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic ori Operands RA RS IM Function OR RS with 160 IM Place answer in RA Other Registers Changed Page 10 121 oris RA RS IM OR RS with IM 160 Place answer in RA 10 122 rfci Return from critical interrupt PC SRR2 MSR SRR3 10 123 rfi Return from interrupt PC SRRO MSR SRR1 10 124 rlwimi RA RS SH rlwimi MB ME Rotate left word immediate then insert according to mask r lt ROTL RS SH m lt MASK MB ME RA e ra m v RA a m CR CR0 10 125 rlwinm RA RS SH rlwinm MB ME Rotate left word immediate then AND with mask r lt ROTL RS SH m lt MASK MB ME RA e ra m CRI CRO 10 126 rlwnm RA RS RB rlwnm MB ME Rotate left word then AND with mask r lt ROTL RS RB 27 31 m lt MASK MB ME RA e ra m CR CR0 10 129 rotlw rotlw RA RS RB Rotate left RA ROTL RS RB 27 31 Extended mnemonic for riwnm RA RS RB 0 31 Extended mnemonic for rlwnm RA RS RB 0 31 CR CR0 10 129 rotlwi RA RS n rotlwi Rotate left immediate
438. ith peripherals on the On Chip Peripheral Bus OPB are Memory Mapped I O MMIO registers The serial port on the PPC403GA is such a peripheral Load and store instructions are used to access all MMIO registers Table 11 4 on page 11 6 shows the mnemonic name and number address for each Memory Mapped I O Register Table 2 3 Memory Mapped I O MMIO List SPLS SPHS BRDH BRDL see Chapter 7 SPCTL see Chapter 7 SPRC SPTC SPRB SPTB see Chapter 7 2 3 7 JTAG Accessible Registers The PPC403GA implements the IEEE JTAG Standard Test Access Port and Boundary Scan Architecture The mandatory resources of the standard bypass and boundary scan registers are made available as are PPC403GA specific registers See Chapter 9 Debugging and IEEE Std 1149 1 for details 2 14 PPC403GA User s Manual 2 4 Data Types and Alignment ER PPC403GA operands are bytes halfwords or words Figure 2 9 shows the data types and their bit and byte definitions The address of an operand is the address of its highest order byte byte 0 and byte numbering is Big Endian see Section 2 5 Little Endian Mode on page 2 17 for definition of Big and Little Endian and discussion of the related behavior of PowerPC processors All instructions are word objects and are word aligned the byte address is divisible by 4 Data at an operand location may be represented in two s complement notation or in unsigned integer format This is ind
439. ither loads or stores to either of two addresses The addresses are defined in the DAC1 and DAC2 registers The fields D1R and D1W of the DBCR control the Data Address 1 debug event and D2R and D2W control the Data Address 2 debug event The address in DAC1 specifies an exact byte address for the Data Address 1 event however it may be desired to take a debug event on any byte within a half word that is ignore one LSB of DAC1 or to take a debug event on any byte within a word that is ignore two LSBs of DAC1 or to take a debug event on any byte within a quad word that is ignore four LSBs of DAC1 These options are controlled by the D1S field DBCR Similarly the D2S field of DBCR controls these options for DAC2 Figure 9 3 Data Address Compare Registers DAC1 DAC2 0 31 Data Address Compare Byte Address Data Address Compare Size fields of DBCR determine byte halfword or word usage 9 10 PPC403GA User s Manual 9 7 4 Instruction Address Compare IAC1 IAC2 The PPC403GA has the capability to take a debug event upon an attempt to execute an instruction from either of two addresses The addresses which must be word aligned are defined in the IAC1 and IAC2 registers The IA1 field of the DBCR controls the Instruction Address 1 debug event and IA2 controls the Instruction Address 2 debug event 0 29 30 31 Figure 9 4 Instruction Address Compare IAC1 IAC2 0 29 Instruction Address Compar
440. itted Extended mnemonic for belr 4 4 cr_field 1 Extended mnemonic for bel 4 4 cr_field 1 LR 10 32 bnilr bnilrl cr_field Branch if not less than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 0 Extended mnemonic for belrl 4 4 cr_field 0 LR 10 32 bnsir bnsirl cr_field Branch if not summary overflow to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 3 Extended mnemonic for belrl 4 4 cr_field 3 LR 10 32 Instruction Set 10 35 bclr Branch Conditional to Link Register Table 10 8 Extended Mnemonics for belr bcirl cont Mnemonic bnulr bnulrl Operands cr_field Function Branch if not unordered to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 3 Other Registers Changed Extended mnemonic for belrl 4 4 cr_field 3 LR Page 10 32 bsolr bsolrl cr_field Branch if summary overflow to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 3 Extended mnemonic for belrl 12 4 cr_field 3 LR 10 32 btir btirl cr_bit Branch if CRer pit 1 to address in LR Extended mnemonic for belr 12 cr_bit Extended mnemonic for belrl 12 cr_bit LR 10 32 bunir bunirl
441. l 3 7 The DRAM Interface 3 7 1 Signals Five sets of signals are dedicated to the DRAM interface RASO RAS3 Row address selects for each DRAM bank CAS0 CAS3 Column address selects for bytes 0 through 3 of all DRAM banks DRAMOE DRAM output enable for all DRAM banks DRAMWE DRAM write enable for all DRAM banks AMuxCAS An output used to control column address selection by an external mux Many of the timing parameters associated with these signals are programmable The following discussion details the relations among these signals and the programmable options that are available e RAS becomes active approximately 1 2 clock cycle after the address becomes valid Early RAS Mode activates the RAS line slightly earlier than normal approximately 1 4 cycle after the address becomes valid under control of bank register bit 14 Using Early RAS Mode will reduce the available address setup time but will allow more DRAM access time Early RAS Mode applies to both read and write opera tions and in page mode as well as non page mode Early RAS Mode is illustrated in Figure 3 15 and Figure 3 16 e Caution for users of Early RAS Mode If a DRAM bank is programmed to use the Early RAS Mode feature no access to this bank can occur within 700 nsec from the deactivation of Reset or 700 nsec from a state in which the clocks are stopped e CAS activation is programmable CAS may be activated either 1 or 2 clock cycles
442. l Conirol DMARO Channel 0 Register F Destination Address Count Register Register DMAAO SS Ze Chained Source Chained Count Register Address Register EOT0 TCO DMARI DMAA1 EOT1 TC1 Channel 1 DMAR2 DMAA2 EOT2 TC2 Status Register Channel 2 DMAR3 XReq Channel 3 DMAA3 XAck EOT3 TC3 XSize0 Figure 4 2 DMA Controller Block Diagram Each DMA Channel Control Register is used to initialize the DMA channel and enable DMA transfers and interrupts The DMA Count Register is initialized with the number of transfers in the DMA transaction The DMA Destination Address Register is used to specify the address of the memory in buffered and fly by mode DMA transfers Each PPC403GA DMA channel is programmable via its channel control register Once the channel control register is configured and the channel is enabled the DMA channel may begin transferring data 4 2 PPC403GA User s Manual 4 2 DMA Operations The DMA controller operates in three modes buffered fly by and memory to memory In buffered mode each channel supports data transfers between memory and peripherals where the peripherals may be internal or external to the PPC403GA In fly by mode each channel supports transfers between memory and external peripherals During memory to memory moves each channel supports data transfers between memory locations which may be located in different memory banks In fly by mode transfers from memory
443. l Register SPCTL 0 1 LM Loopback Modes 00 Normal Operation 01 Internal Loopback Mode 10 Automatic Echo Mode 11 Reserved 2 DTR Data Terminal Ready 0 DTR signal is inactive 1 DTR signal is active 3 RTS Request To Send 0 RTS signal is inactive 1 RTS is active 4 DB Data Bits When DB 0 a data frame contains the least 0 7 Data bits significant seven bits bits 1 7 in the SPTB or 1 8 Data bits the SPRB 5 PE Parity Enable When PE 0 parity detection and generation 0 No parity are disabled for the serial port receiver and 1 Parity enabled transmitter 6 PTY Parity When PTY 0 even parity is used in parity 0 Even parity detection and generation When PTY 1 odd 1 Odd parity parity is used 7 SB Stop Bits When SB 0 one stop bit is used to detect the 0 One stop bit end of a received frame and one stop bit is 1 Two stop bits transmitted at the end of each data frame When SB 1 two stop bits are used Serial Port Operation 7 13 7 3 3 Serial Port Handshake Status Register SPHS The SPHS reports the status of the DSR or CTS signal while the serial port transmitter is enabled Figure 7 6 shows the SPHS bits DIS 0 1 2 7 ds Figure 7 6 Serial Port Handshake Register SPHS 0 DIS DSR Input Inactive Error To reset the DIS bit the application software 0 DSR input is active must store a 1 in this bit location at the address 1 DSR inpu
444. l architecture of the PPC403GA is defined by the PowerPC Embedded Virtual Environment and Embedded Operating Environment Architecture specifications together with the common PowerPC User Instruction Set Architecture The primary differences between the standard PowerPC Architecture and the embedded variation of it are the following e A simplified memory management mechanism e An enhanced dual level interrupt structure e An architected Device Control Register DCR address space for integrated system control functions such as the DMA controller e The addition of several instructions to support these modified and extended resources Finally some of the specific implementation features of the PPC403GA are beyond the scope of the architecture These features are included to enhance performance integrate functionality and or reduce system complexity in embedded control applications Some of the details of these implementation features are discussed in Section 1 3 PPC403GA Features 1 3 PPC403GA Features The PPC403GA consists of a highly pipelined processor core and several peripheral interface units the BIU the DMA controller the serial port the on chip peripheral bus OPB the asynchronous interrupt controller and the JTAG debug port The PowerPC User Instruction Set Architecture device control registers and special purpose registers provide a high degree of user control over configuration and operation of the functional uni
445. l request will use The address 3 52 PPC403GA User s Manual is always assumed to be in the DRAM region so bits 0 3 are unnecessary When a burst transfer is in progress address bits 22 31 are used to detect a page crossing Bits 30 31 are used to select the proper CAS signals While HoldAck is active XACK the DMAA3 XACK output indicates to the external bus master that this cycle is a data transfer cycle In the case of a read operation this indicates that data is available for the external bus master to latch In the case of a write operation this indicates that the data will be written into the DRAM at the end of the current cycle 3 9 2 1 External Master Single Transfers To request a transfer the external bus master places an active level on the PPC403GA transfer request XREQ input and provides the full address A4 31 of the memory location on the address bus the direction of the transfer R W and the transfer size XSize0 1 The PPC403GA receives the address from the external bus master and compares the address to the contents of the bank registers to determine which bank will be accessed With this information and the direction of the transfer the PPC403GA can begin the DRAM transfer The PPC403GA responds with XACK during the last cycle of the transfer to indicate that the data is available to be latched in the case of a read or that the DRAM has captured the data in the case of a write Memory and Perip
446. ld is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The effective address is placed into register RA The halfword at the effective address is sign extended to 32 bits and placed into register RT Registers Altered e RA e RT Invalid Instruction Forms e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 77 Ihaux Load Halfword Algebraic with Update Indexed Ihaux RT RA RB 31 RT RA RB 375 0 6 11 16 21 31 EA lt RB RA 0 RA lt EA RT lt EXTS MS EA 2 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The effective address is placed into register RA The halfword at the effective address is sign extended to 32 bits and placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA e RT Invalid Instruction Forms e Reserved fields e RA RT e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 78 PPC403GA User s Manual Ihax RT RA RB I
447. le 0x0000 0000 OxO7FF FFFF 1 S1 0 noncacheable 1 cacheable 0x0800 0000 OxOFFF FFFF 2 S2 0 noncacheable 1 cacheable 0x1000 0000 0x17FF FFFF 3 S3 0 noncacheable 1 cacheable 0x1800 0000 0x1FFF FFFF 4 S4 0 noncacheable 1 cacheable 0x2000 0000 0x27FF FFFF 5 S5 0 noncacheable 1 cacheable 0x2800 0000 Ox2FFF FFFF 6 S6 0 noncacheable 1 cacheable 0x3000 0000 0x37FF FFFF 7 S7 0 noncacheable 1 cacheable 0x3800 0000 Ox8FFF FFFF 8 EI 0 noncacheable 1 cacheable 0x4000 0000 0x47FF FFFF 9 EI 0 noncacheable 1 cacheable 0x4800 0000 Ox4FFF FFFF 10 10 0 noncacheable 1 cacheable 0x5000 0000 0x57FF FFFF 11 S11 0 noncacheable 1 cacheable 0x5800 0000 OxSFFF FFFF 12 12 0 noncacheable 1 cacheable 0x6000 0000 Ox67FF FFFF 13 13 0 noncacheable 1 cacheable 0x6800 0000 Ox6FFF FFFF 14 S14 0 noncacheable 1 cacheable 0x7000 0000 0x77FF FFFF 15 S15 0 noncacheable 1 cacheable 0x7800 0000 Ox7FFF FFFF 16 S16 0 noncacheable 1 cacheable 0x8000 0000 0x87FF FFFF 17 S17 0 noncacheable 1 cacheable 0x8800 0000 Ox8FFF FFFF 18 18 0 noncacheable 1 cacheable 0x9000 0000 Ox97FF FFFF 19 19 0 noncacheable 1 cacheable 0x9800 0000 Ox9FFF FFFF 20 20 0 noncacheable 1 cacheable 0xA000 0000 OxA7FF FFFF 21 21 0 noncacheable 1 cacheable 0xA800 0000 OxAFFF FFFF 22 22 0 noncacheable 1 cacheable 0xB000 0000 0xB7FF FFFF 23 S23
448. le if DMAA is still active ER e DMADXFER can remain active to indicate a new transfer every cycle e Transfers from Memory to Peripheral e Peripheral is selected when DMAA is active DMAA can remain active for multiple transfers e DMADXFER ORed with SysClk is active during one cycle to indicate to the peripheral when one transfer is complete and the next one starts The peripheral latches data when at the end of the cycle when DMADXFER ORed with SysClk is active e DMADXFER can remain active to indicate a new transfer every cycle DMA Operations 4 15 4 2 4 1 Fly By Burst Memory to Peripheral CE TD PW SAI TM PWC PHC TCE BME TCD yoy 4 Ff of L L yoy 4 1 1 0 0 10 O x 1 01 00 XX XXXX XXX 1 1 0 1 0 0 28 31 ole A DAI de ple ct D A le Figure 4 10 DMACR Setting for Fly By Burst Peripheral Write Reserved Table 4 2 describes the bit settings for each field in this DMACR Table 4 3 Sample DMACR Settings for Fly By Burst Bit Name Description 0 CE Channel Enable 1 Channel is enabled for DMA operation 1 CIE Channel Interrupt Enable 1 All DMA interrupts from this channel end of transfer terminal count reached are enabled 2 TD Transfer Direction Valid only for buffered mode and fly by mode don t care in memory to memory mode 0 Transfers are from memory to peripheral 3 PL Peri
449. legal instructions TRAP instruction privileged instruction in problem state DCO0 System Call Execution of the system call sc instruction 1000 Programmable Interval Timer Posting of an enabled Programmable Interval Timer interrupt in the Timer Status Register TSR 1010 Fixed Interval Timer Posting of an enabled Fixed Interval Timer interrupt in the TSR 1020 Watchdog Timer Posting of an enabled first time out of the watchdog timer in the TSR 2000 Debug Exception Debug Events when in Internal Debug Mode Programming Model 2 45 2 13 1 Exception Handling 2 13 1 1 Synchronous Exception Handling By definition synchronous exceptions are caused by the execution of an instruction Since that is known in advance there are no status registers which an interrupt handler for a synchronous exception is expected to reset For the Program Exception several different exception causing situations may be reported to the same Program Exception interrupt handler These situations are differentiated by bits in the Exception Syndrome Register ESR See Section 6 1 8 on page 6 13 and Table 2 12 below Note that ESR bits 4 6 are mutually exclusive when a Program Exception occurs the appropriate bit is set and the others are cleared These exceptions are not maskable The ESR does not need to be reset by the Program Exception interrupt handler Table 2 12 ESR Usage for Program Exceptions Bit Exception Typ
450. like devices The other four BR4 BR7 can control either SRAM or DRAM devices Let BRn refer to the particular Bank Register programmed for an address range The following must be true 1 If the bank register is any of BRO BR3 only SRAM is supported It must be true that address 1 3 b 111 For BRO BR3 BRn 31 is Reserved If read it will return O regardless of what value was written to it If the bank register is any of BR4 BR7 the following apply A If address 1 3 b 111 the SRAM case then must have BRn 31 1 B If address 1 3 b 000 the DRAM case then must have BRn 31 0 If address 1 3 is neither b 000 nor b 111 then it is not appropriate to program a Bank Register for this address This address is reserved for internal use and Bank Registers are only for external addresses Neither the SRAM nor the DRAM controller will be activated by this address and a machine check exception will be generated by the timeout error if there is no device on the OPB at that address In Figure 3 4 the field B depicts the dependence of BRn 31 on address 1 3 for BR4 BR7 Memory and Peripheral Interface 3 9 3 5 3 External Memory Location Each Bank Register controls the characteristics of one contiguous block of external memory where only address bits 1 31 are considered Address 0 only influences cacheability see Section 3 5 1 Address 1 3 will be b 000 or b 111 and for
451. lines of 16 bytes each The ICU can send two instructions eight bytes per cycle to the execution unit enabling the prediction and folding of branch instructions When a branch instruction is folded out of the instruction queue the branch can execute in the same cycle with the nonbranch instruction A separate bypass path is available to handle cache inhibited instructions and to improve performance during line fill operations 1 3 1 3 Data Cache Unit DCU The data cache unit is used to minimize access latency for frequently used data in external memory The cache features byte writeability to improve the performance of byte and halfword store operations The DCU contains a two way set associative 1KB copy back cache memory Each of the two cache sets is organized as 32 lines of 16 bytes each The DCU manages data transfers between external memory and the general purpose registers in the execution unit DCU operations employ a copy back store in strategy to update cached data and maintain coherency with external memory A copy back cache updates only the data cache not external memory during store operations Only data lines that have been modified are flushed to external memory whenever it is necessary to free up locations for incoming lines A separate bypass path is available to handle non cacheable loads and to improve performance during line fill operations 1 3 2 Bus Interface Unit BIU The BIU integrates the controls for
452. lowing example addis RT 0 high 16 bits of value ori RT RT low 16 bits of value Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 5 Extended Mnemonics for addis Other Mnemonic Operands Function Registers Page Changed lis RT IM Load immediate shifted 10 13 RT lt IM o Extended mnemonic for addis RT 0 IM subis RT RA IM Subtract IM 160 from RA O 10 13 Place answer in RT Extended mnemonic for addis RT RA IM Instruction Set 10 13 addme Add to Minus One Extended addme RT RA OE 0 Rc 0 addme RT RA OE 0 Re 1 addmeo RT RA OE 1 Rc 0 addmeo RT RA OE 1 Rc 1 31 RT RA OE 234 Re 0 6 11 16 21 22 31 RT lt RA XER CA GA if RA XER CA 1 282 1 then XER CA lt 1 else XER CA lt 0 The sum of the contents of register RA XER CA and 1 is placed into register RT XER CA is set to a value determined by the unsigned magnitude of the result of the add operation Registers Altered e RT e XER CA e CRI CRO cr eo so if Re contains 1 e XER SO OV if OE contains 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 14 PPC403GA User s Manual addze Add to Zero Extended addze RT RA 0 Rc 0 addze RT RA 0 Re 1 addzeo
453. lr bgelrl bgtir bgtirl cr_field cr_field Branch if greater than or equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 0 Extended mnemonic for belrl 4 4 cr_field 0 Branch if greater than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 1 LR Extended mnemonic for belrl 12 4 cr_field 1 LR 10 32 10 32 10 34 PPC403GA User s Manual belr Branch Conditional to Link Register Table 10 8 Extended Mnemonics for belr bcirl cont Mnemonic blelr blei Operands cr_field Function Branch if less than or equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 1 Other Registers Changed Extended mnemonic for belrl 4 4 cr_field 1 LR Page 10 32 bitir bitirl cr_field Branch if less than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 0 Extended mnemonic for belrl 12 4 cr_field 0 LR 10 32 bnelr bnelrl cr_field Branch if not equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 2 Extended mnemonic for bel 4 4 cr_field 2 LR 10 32 bnglr bnglirl cr_field Branch if not greater than to address in LR Use CRO if cr_field is om
454. lso could be coded bne or bne These alternate codings set BO 1 only if the requested prediction differs from the Standard Prediction see Section 2 8 5 Alphabetical Instruction Summary A 1 Table A 1 PPC403GA Instruction Syntax Summary Other Mnemonic Operands Function Registers Page Changed add RT RA RB Add RA to RB 10 7 Place answer in RT add CR CRO addo XER SO OV addo CR CRO XER SO OV addc RT RA RB Add RA to RB 10 8 Place answer in RT addc Place carry out in XER CA CR CRO addco XER SO OV addco CR CRO XER SO OV adde RT RA RB Add XER CA RA RB 10 9 Place answer in RT adde Place carry out in XER CA CR CRO addeo XER SO OV addeo CR CRO XER SO OV addi RT RA IM Add EXTS IM to RA 0 10 10 Place answer in RT addic RT RA IM Add EXTS IM to RA 0 10 11 Place answer in RT Place carry out in XER CA addic RT RA IM Add EXTS IM to RA 0 CR CRO 10 12 Place answer in RT Place carry out in XER CA addis RT RA IM Add IM 180 to RA O 10 13 Place answer in RT addme RT RA Add XER CA RA 1 10 14 Place answer in RT addme Place carry out in XER CA CRICRO addmeo XER SO OV addmeo CR CRO XER SO OV A 2 PPC403GA User s Manual Table A 1 PPC403GA Instruction Syntax Summary cont
455. m the polarity negative or positive active and activation type edge or level triggered by setting the appropriate bits in the IOCR When an external interrupt pin receives an active signal and the interrupt is enabled in the EXIER and the MSR EE bit is 1 the External Interrupt exception is taken Note that with the exception of the External Interrupt pins all interrupt sources may be disabled by their respective control registers as well as by the External Interrupt Enable Register Interrupts generated by active signals on the External Interrupt pins may only be disabled via the EXIER Note the MSR EE bit also controls the occurrence of Programmable Interval Timer PIT and Fixed Interval Timer FIT interrupts However after the occurrence of these timer interrupts control is passed to different exception vectors than for the interrupts discussed in the preceding paragraph Therefore these timer exceptions are discussed separately See Section 6 2 9 Programmable Interval Timer on page 6 24 and Section 6 2 10 Fixed Interval Timer on page 6 25 After detecting an External Interrupt and if the External Interrupt Exception is the highest priority exception condition present the PPC403GA immediately takes the External Interrupt Exception and stores the address of the next sequential instruction in SRRO Simultaneously the current contents of the MSR are saved in SRR1 The MSR External Interrupt Enable bit MSR EE is then reset to 0 This
456. m the top of memory 2 8 2 AA Field on Conditional Branches The conditional branches bc bea bel bcla carry the displacement to the branch target address as a 16 bit value the 14 bit BD field right extended with two zeroes This displacement is always regarded as a signed 16 bit number hence it covers a range of 32 kilobytes For the relative AA 0 forms be bel the target address is the Current Instruction Address the address of the branch instruction plus the signed displacement For the absolute AA 1 forms bea bcla the target address is Zero plus the signed displacement If the sign bit BD 0 is zero the displacement is naturally interpreted as the actual target address If the sign bit is one the address is below zero wraps to high memory For example if the displacement is OxFFFC the 16 bit representation of negative four the target address is OxFFFF FFFC zero minus four bytes or four bytes from the top of memory 2 8 3 BI Field on Conditional Branches Conditional branch instructions may optionally test one bit of the Condition Register The bit to be tested bit 0 31 is specified by the value of the BI field The content of the BI field is meaningless unless bit 0 of field BO is zero 2 8 4 BO Field on Conditional Branches Conditional branch instructions may optionally test one bit of the Condition Register The option is selected if BO 0 0 if BO 0 1 the CR does not participate in the bran
457. main storage and peripherals and the OPB interface to internal peripherals are discussed in this chapter Together the structure of the BIU and the manner in which the caches are controlled by the DCCR and ICCR determine the nature of the memory map of the PPC403GA See Section 2 2 Memory Organization and Addressing on page 2 2 for a discussion of the memory map DMA Controls Ext Master Controls External gt ch Controller Interface Master BIU SRAM Controls ch Interf Instruction Data nterface Cache DRAM Controls Memory s Interface and Address Memory e Data mapped Cache Data gt Data Peripherals Register Interface BRO BR3 BESR DCR Bus SRAM only error status Processor e gt BR4 BR7 BEAR SRAM DRAM error address Figure 3 1 BIU Interfaces Memory and Peripheral Interface 3 1 3 1 Memory Interface Signals Figure 3 2 shows that external signals from the PPC403GA can be grouped within categories Because the physical interface to static random access memory SRAM read only memory ROM and memory mapped I O are similar one group of BIU signals attaches these devices to the PPC403GA the SRAM interface Another group of signals supports direct attachment of dynamic random access memory DRAM devices The groups share several common signals Some signals have different meanings depending on whether the PPC403GA is the bu
458. med by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The contents of register RS are stored into the word at the effective address The effective address is placed into register RA If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RA Invalid Instruction Forms e Reserved fields e RA 0 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 153 stwx Store Word Indexed stwx RS RA RB 31 RS RA RB 151 0 6 11 16 21 31 EA lt RB RA MS EA 4 lt RS An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The contents of register RS are stored into the word at the effective address If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture
459. ment instruction whenever the calculated EA does not match the required data alignment for that instruction indicating either a coding error involving improper data alignment and or address calculation or the need for software emulation of the unaligned access in the exception handler 2 4 2 Alignment for Cache Control Instructions The Cache Control instructions see page 2 53 also have EA s calculated during their execution These instructions operate on cache lines which are four words in length For these instructions the last four bits of the EA are ignored so no alignment restrictions exist An alignment exception is taken when attempting to execute the dcbz instruction to a non cacheable area in order to allow software to emulate the dcbz instruction semantics in the exception handler This exception results from the non cacheability not from the EA alignment 2 16 PPC403GA User s Manual 2 5 Little Endian Mode Objects may be loaded from or stored to memory in byte halfword word or for implementations that include hardware for double precision floating point or for 64 bit instructions but not PPC403GA doubleword units For a particular data length the loading and storing operations are symmetric a store followed by a load of the same data object will yield an unchanged value There is no information in the process about the order in which the bytes which comprise the multi byte data object are stored in memory If a st
460. mer Facility Clock Through the Timer Clock Source bit in the Input Output Configuration register OCH users may choose the clock source for the Timer facility from either the input on the TimerClk pin or processor SysClk The max imum input frequency into TimerClk is half the SysClk frequency TMS T l Test Mode Select The TMS pin is sampled by the TAP on the rising edge of TCK The TAP state machine uses the TMS pin to determine the mode in which the TAP operates TSO 17 O Trace Status 0 TS1 18 O Trace Status 1 TS2 19 O Trace Status 2 TS3 86 O Trace Status 3 TS4 85 O Trace Status 4 TS5 84 O Trace Status 5 TS6 83 O Trace Status 6 Vpp 20 Power All power pins must be connected to 3 3V supply 21 Power All power pins must be connected to 3 3V supply 40 Power All power pins must be connected to 3 3V supply 49 Power All power pins must be connected to 3 3V supply 61 Power All power pins must be connected to 3 3V supply 69 Power All power pins must be connected to 3 3V supply 80 Power All power pins must be connected to 3 3V supply 89 Power All power pins must be connected to 3 3V supply 100 Power All power pins must be connected to 3 3V supply 120 Power All power pins must be connected to 3 3V supply 129 Power All power pins must be connected to 3 3V supply 140 Power All power pins must be connected to 3 3V supply 149 Power All power pins must be connected to 3 3V supply 160 Power All power pins must be connected t
461. mfesr mfevpr mfiac1 mfiac2 mficcr mficdbdr mflr mfpbl1 mfpbl2 mfpbu1 mfpbu2 mfpit mfpvr mfsprgO mfsprg1 mfsprg2 mfsprg3 mfsrrO mfsrr1 mfsrr2 mfsrr3 mftbhi mftblo mftcr mftsr mfxer Operands RT Function Move from special purpose register SPRN Extended mnemonic for mfspr RT SPRN Other Registers Changed Page 10 103 mr RT RS Move register RT RS Extended mnemonic for or RT RS RS Extended mnemonic for or RT RS RS CRICRO 10 119 mtcr B 22 RS Move to Condition Register Extended mnemonic for mtcrf OxFF RS PPC403GA User s Manual 10 105 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic mtbear mtbesr mtbr0 mtbr1 mtbr2 mtbr3 mtbr4 mtbr5 mtbr6 mtbr7 mtdmaccO mtdmacc1 mtdmacc2 mtdmacc3 mtdmacr0 mtdmacr1 mtdmacr2 mtdmacr3 mtdmact0O mtdmact1 mtdmact2 mtdmact3 mtdmada0 mtdmada1 mtdmada2 mtdmada3 mtdmasa0 mtdmasa1 mtdmasa2 mtdmasa3 mtdmasr mtexisr mtexier mtiocr Operands RS Function Move to device control register DCRN Extended mnemonic for mtdcr DCRN RS Other Registers Changed Page 10 107 Instructions By Category B 23 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic mtcdbcr mictr mtdac1 mtdac2 mtdbsr mtdcecr mtesr mtevpr mtiac1 mtiac2 mticcr mticdbdr mtlr mtpbl1 mtpbl2 mtpbu1 mtpbu2 mtpit mipvr mtsprgO mtsprg1
462. mmediate n gt 0 10 125 RA b bs n 1 lt RS 32 n 31 Extended mnemonic for rlwimi RA RS 32 b n b b n 1 insrwi Extended mnemonic for CR CRO rlwimi RA RS 32 b n b b n 1 Instruction Set 10 125 rlwinm Rotate Left Word Immediate then AND with Mask rlwinm RA RS SH MB ME Rce 0 rlwinm RA RS SH MB ME Rc 1 21 RS RA SH MB ME Rc 0 6 T 16 21 26 31 r lt ROTL RS SH m lt MASK MB ME RA ram The contents of register RS is rotated left by the number of bit positions specified in the SH field A mask is generated having 1 bits starting at the bit position specified in the MB field and ending in the bit position specified by the ME field with 0 bits elsewhere If the starting point of the mask is at a higher bit position than the ending point the 1 bits portion of the mask wraps from the highest bit position back around to the lowest The rotated data is ANDed with the generated mask the result is placed into register RA Registers Altered e RA e CR CRO r ecr ca so H Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 26 Extended Mnemonics for rlwinm rlwinm Other Mnemonic Operands Function Registers Page Changed clriwi RA RS n Clear left immediate n lt 32 10 126 RA on1 lt 0 Extended mnemonic for rlwinm RA RS 0 n 31 clrlwi Extended mnemonic for C
463. mory icbi addr1 the previous value at addr1 might already be in the instruction cache invalidate in the cache isync the previous value at addr1 might already have been pre fetched into the queue invalidate the queue so that the instruction must be re fetched 2 24 PPC403GA User s Manual 2 7 2 Data Cache The Data Cache is used to minimize the access time of frequently used data items in memory The cache holds 1K bytes of data organized as a 2 way set associative cache There are 32 sets of 2 blocks lines each Each line contains 16 bytes of data The cache features byte writeability to improve the performance of byte and halfword operations Cache operations are performed using a copy back strategy Copy back caches only update the memory which corresponds to changed locations in the cache when the changed data needs to be removed from the cache in order to make room for other data This is contrasted with a write thru strategy in which stores are written simultaneously to the cache and to the memory The copy back strategy used by the PPC403GA minimizes the amount of external bus activity and avoids unnecessary contention for the external bus between the Instruction Cache and the Data Cache The Data Cache on the PPC403GA may be disabled for 128 megabyte regions via control bits in the Data Cache Cacheability Register Because of the double mapping which the BIU provides for external memory addresses a given region of memory ma
464. mory The DCU manages data transfers between external cacheable memory and the general purpose registers in the execution unit Each of the two cache sets is organized as 32 lines of 16 bytes each as Figure 8 6 shows 8 6 PPC403GA User s Manual Tag sets A and B store address bits A0 22 for each instruction line in cache sets A and B The next five bits of each instruction address A23 27 serve as the index to the cache array into which the DCU writes a line as it fills Two cache lines that correspond to the same line index one in each set are referred to as a congruence class Each data line is written to the cache location selected by its index and the LRU status of that congruence class A separate bypass path is available to handle cache inhibited data operations and to improve performance during line fill operations Tag Set A Tag Set B Data Cache Set A Data Cache Set B A0 22 Line 0A A0 22 Line 0B Line OA 4 words line Line OB 4 words line A0 22 Line 1A A0 22 Line 1B Line1A 4 words line Line 1B 4 words line A0 22 Line 30A A0 22 Line 30B Line 30A 4 words line Line 30B 4 words line A0 22 Line 31A A0 22 Line 31B Line 31A 4 words line Line 31B 4 words line Figure 8 6 Data Cache Organization 8 3 1 Data Cache Operations The data cache unit is used to minimize access latency for frequently used data in external memory The DCU supports by
465. mory to Memory Line Burst 2 1 1 1 DRAM c ccceecceeceeeeeeeeeteeeeeetees 4 22 DMA Transfer Priorities ccceeeceesseeeeeseeeteseneeeeeneeecseeeeeneneeeeseneeseseenenensenees 4 26 DMA Channel Control Registers DMACRO DMACR3 ssec 4 29 DMA Status Register DMASR eccceecceeseeeeceteeeeseeeeeeeseaeeeeeseeeeseeeeaeensees 4 32 DMA Destination Address Registers DMADA0 DMADA3 ossec 4 34 DMA Source Address Registers DMASA0 DMASAS ecceeceeeteeeeeeteees 4 35 DMA Count Registers DMACTO DMACTS3 escceeseesreteeeeeeeetetetteeeeeeraees 4 35 DMA Chained Count Registers DMACCO DMACC3 cceeeeeeeteeeteeeeeeteees 4 36 Machine State Register MP 6 3 Save Restore Register O SRRO cecceesceeseeseeeeeeeeeeeeeeeeeeeaeeeeeseaeeeeeeeeaeen 6 4 Save Restore Register 1 SRR1 ceeceeescesseeseeeeeeeeeeeeeeneeseaeeeeeseaeeseeeeeaten 6 4 Save Restore Register 2 SRR2 cceescesscesseeeeeeeeneeeeeeeeeeeeeaeeeeeseaeeeeeeteaeen 6 6 Save Restore Register 3 SRR amp c eeeceeeseeeeeseeeeeeeeeeeeeeneeseaeeeeeteaeeseeeseatens 6 6 Exception Vector Prefix Register EVPR A 6 7 External Interrupt Enable Register EXIER AA 6 8 External Interrupt Status Register EXISR eccceeseeeeeseeeeeeeeseeeeeeeeeeneeesees 6 10 Input Output Configuration Register OCH ceseeesesseeeeeeeeeteneeeeeereneee 6 12 Exception Syndrome Register ESR cesceeeceeeseeeeeeeeeeeeeaeeeeeeseee
466. mparison INStructlons a a aa a esd tadeee cht agd ead E aa ea a e 2 52 Silent IEN 2 52 Condition Register Logical Instructions cceeeceeeeeeeeeeneeteeeeeeeeteeeseeeeneeeee 2 53 Rotate and Shift Instructions eceeceeseeeeeeeeeeeeeeeeeeseeeeeeeseaeesneeseaeeeeeeeeaes 2 53 Cache Control Instructions 00 cecceeeceeeseeeeeeeeeeeeeeeeeeeseeeeeaeeteaeeeieeteaeeseeeenaeenea 2 53 Interrupt Control INStrUCtiIONS 2 54 Processor Management Instructions eee eeeeeeeeneeeeeeeeeeeneeeeeeeeesenneeeenaeeees 2 54 SRAM And DRAM Banks Supported A 3 4 Restrictions on Bank Starting Address AA 3 10 Usage of WBEO WBES vs Bus Width AAA 3 16 RR Field for Normal Refresh Mode AAA 3 41 RR Field for Alternate Refresh Mode AAA 3 41 Multiplexed Address Outputs ecceseceeeseeeeeeeeeeeeeeeeceeeseeeeeaeeseaeeeeeseaeeeeneeeaes 3 45 DRAM Multiplex for 8 bit BUS 0 eeceeeeeeeeeneeeeeeneeeeeaneeeeeeeeseeeeeenaeeesnaeeees 3 46 DRAM Multiplex for 16 bit BUS ooo eee eeeeeeeeneeeeeeeeeeeneeeeaeeeeeneeeeenneeeenaeeees 3 47 DRAM Multiplex for 32 bit BUS ooo eee eeeeeeeeneeeeeeneeeeeaeeeeaeeeeeeeesenneeeenaeeees 3 48 Xsizeda Bit Dernier d et Ee ENER dE gedd E 3 52 Sample DMACR Settings for Buffered Transfer enesesse 4 6 Sample DMACR Settings for Fly By Transfer ccecceeseeeseeeeeeeeeeeeeeeneeeeee 4 11 Sample DMACR Settings for Fly By Burst c cccceeceeseeeeeeeeeeeeeneeteeeeneeeee 4 16 Sample DMACR Settings for Memory to Memory Tr
467. n rfi restores the contents of the program counter and the MSR from SRRO and SRR1 respectively and the PPC403GA begins execution at the address contained in the program counter Table 6 7 Register Settings during Program Exceptions SRRO Loaded with the address of the instruction causing the program exception SRR1 Loaded with the contents of the MSR MSR WE 0 PR 0 CE Unchanged EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged PC EVPR 0 15 0x0700 ESR Loaded with the type of the Program Exception 6 2 8 System Call System call interrupts are caused when executing a system call instruction When a system call instruction is executed the PPC403GA stores the address of the next instruction to be executed in SRRO The current contents of the MSR are loaded into SRR1 The MSR bits are loaded with the values shown in Table 6 8 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0C00 Exception processing begins at the new address in the program counter Executing the return from interrupt instruction rfi restores the Interrupts Exceptions and Timers 6 23 contents of the program counter and the MSR from SRRO and SRR1 respectively and the PPC403GA begins execution at the address contained in the program counter Table 6 8 Register Settings during System Call Exceptions
468. n 31 e O Extended mnemonic for rlwinm RA RS n 0 31 n Extended mnemonic for rlwinm RA RS n 0 31 n Shift right immediate n lt 32 RA n 31 e RS o 31 n RA o n 1 e 0 Extended mnemonic for rlwinm RA RS 32 n n 31 CR CR0 Extended mnemonic for rlwinm RA RS 32 n n 31 CR CR0 10 126 10 126 Instructions By Category B 25 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic sub Operands RT RA RB sub subo subo Function Subtract RB from RA RT lt RB RA 1 Extended mnemonic for subf RT RB RA Other Registers Changed Extended mnemonic for subf RT RB RA CRICRO Extended mnemonic for subfo RT RB RA XER SO OV Extended mnemonic for subfo RT RB RA CRICRO XER SO OV Page 10 155 subc RT RA RB subc subco subco Subtract RB from RA RT lt RB RA 1 Place carry out in XER CA Extended mnemonic for subfc RT RB RA Extended mnemonic for subfc RT RB RA CRICRO Extended mnemonic for subfco RT RB RA XER SO OV Extended mnemonic for subfco RT RB RA CRICRO XER SO OV 10 156 subi RT RA IM Subtract EXTS IM from RA 0 Place answer in RT Extended mnemonic for addi RT RA IM 10 10 subic RT RA IM Subtract EXTS IM from RA 0 Place answer in RT Place carry out in XER CA Extended mnem
469. n 6 2 7 and thus vector to offset 0x0700 The Exception Syndrome Register ESR distinguishes different types of Program Exceptions Bit 5 of that register is set when the exception was caused by a Privileged violation Software is not required to clear this ESR bit 2 11 3 Privileged Instructions The following instructions are under control of the MSR PR bit and are not allowed to be executed when MSR PR b 1 Table 2 9 Privileged Instructions debi dccci dcread icbt iccci icread mfdcr mfmsr mfspr For all SPRs except LR CTR and XER See Section 2 11 4 mtdcr mtmsr mtspr For all SPRs except LR CTR and XER See Section 2 11 4 rfci rfi wrtee wrteei 2 11 4 Privileged SPRs The only SPRs that are not privileged are the Link Register LR Count Register CTR and the Fixed point Exception Register XER All other SPRs are privileged for both read and write Programming Model 2 37 The PPC403GA follows a convention that SPR numbers with the high order bit of the 10 bit SPR number field being a b 1 are privileged Because of the unusual coding of the SPR field in the machine code of the mtspr mfspr instructions this statement leaves room for confusion The following example is intended to clarify the situation SPR number 26 decimal b 00000 11010 x 01A Assembler coding for this SPR mtspr r5 26 The
470. n effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise The cache is indexed by a field of the effective address Both lines in the associated congruence class are invalidated whether or not they match the effective address The operation specified by this instruction is performed whether or not the effective address is marked cacheable in the ICCR If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Notes Execution of this instruction is privileged This instruction is used in the power on reset routine to invalidate the entire cache tag array before enabling the cache using the ICCR A series of iccci instructions should be executed one for each congruence class Then cacheability can be enabled in the ICCR Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations 10 68 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family icread Instruction Cache Read icread RA RB 31 RA RB 998 0 6 T 16 21 31 EA lt RA 0 RB if CDBCR37 0
471. n error code will be bypassed around the I cache and placed directly in the pre fetch queue If the address was the result of an I cache line fill but not an address explicitly requested by the fetcher the instruction will be discarded If any word in an I cache line fill contains an error then the entire line is discarded by the I cache though explicitly requested addresses will be bypassed around the I cache to the pre fetch queue The Exception Syndrome Register ESR distinguishes the type of Instruction Machine Check that has occurred as shown in Table 2 13 below The ESR does not need to be reset by the IMC interrupt handler but it is recommended to reset the ESR to avoid confusion This is discussed further below Table 2 13 ESR Usage for Instruction Machine Checks Bit Exception Type Exception Cause ESR 0 Instruction Machine Check Protection ESR 1 Instruction Machine Check Non configured ESR 2 Instruction Machine Check Bus Error ESR 3 Instruction Machine Check Timeout The Instruction Machine Check bits in the ESR will be set even if the MSR ME bit is off This means that if Instruction Machine Checks are occurring while running in code that has MSR ME disabled presumably just the machine check handler itself which means that the processor is not even fetching the handler properly then the type of IMC will be recorded in the ESR but no interrupt will occur because MSR ME is disabled
472. n if The branch is known to be NOT TAKEN in which case the target address is known to be the next sequential address The branch does not use the LR or CTR as the target address The branch uses the LR as the target address and the the instruction in DCD is not a LR Updating Instruction The branch uses the CTR as the target address and the the instruction in DCD is not a CTR Updating Instruction e Blocking Examples 1 C 12 IO Blocking PPC403GA User s Manual The instruction in IQ1 is not the CORRECT next instruction after a branch This could be either not the correct next instruction if a DCD branch is NOT TAKEN or not the target of a DCD branch that is taken 2 EXE Blocking The instruction in IQ1 is a branch that is using CR field 0 BO 0 0 and Bl 000xx AND the instruction in EXE is updating CR field 0 via RC 1 The instruction in IQ1 is a branch that is using CR BO 0 0 AND the instruc tion in EXE is a compare instruction updating updating the same CR field being used by the branch instruction in decode BF BI lt 0 2 gt The instruction in IO is a branch using CR BO 0 0 AND the instruction in EXE is a mterf instruction 3 DCD Blocking If the instruction in DCD is being held from moving to EXE then an instruction in IO will not be folded into EXE until the DCD instruction moves to EXE If the instruction in IQ1 is a branch using the LR as the target AND the instruc tion in DCD is updatin
473. n page 2 46 and Section 2 13 1 4 Data Machine Check Handling on page 2 48 If the error occurred during a DMA access an External Interrupt may result See Section 4 2 11 Errors on page 4 28 e The BS field bits 8 10 sets the number of bytes which the bank may access begin ning with the base address set in the BAS field Fields BS and BAS are not indepen dent See Section 3 5 3 on page 3 10 including Table 3 2 Restrictions on Bank Starting Address e The BU field bits 11 12 specify unused chip selects and protect banks of physical devices from read or write accesses This differs from the form of protection discussed in Chapter 2 Programming Model where regions of memory are protected using the Protection Bound Upper Registers PBU1 PBU2 and Protection Bound Lower Regis ters PBL1 PBL2 When any access is attempted to an address within the range of the BAS field and the bank is designated as invalid a Non configured Error occurs When a write access is attempted to an address within the range of the BAS field and the bank is designated as Read Only a BIU protection error occurs Also when a read access is attempted to an address within the range of the BAS field and the bank is designated as Write Only a BIU protection error occurs If the transaction is an instruction fetch an Instruction Machine Check exception may occur see Section 2 13 1 3 Instruction Machine Check Handling on page 2 46 If the transaction is a
474. n the following subsections 6 2 1 1 Core Reset Core reset exceptions occur when activated by the Debug Control Register the JTAG Control Register or at the second expiration of the watchdog timer if it is enabled in the timer control register After a core reset registers within the PPC403GA core are reset however registers in the PPC403GA but outside the core are unaffected Unaffected registers include the DMA registers the BIU bank registers and the serial port registers Section 5 3 Register Contents After A Reset on page 5 3 contains an listing of the state of each PPC403GA register whose value is affected by core reset The PPC403GA begins processing at address OxFFFF FFFC and the contents of the save restore registers are indeterminate All enable bits in the machine state register are reset to 0 to disable exceptions during the reset exception handler Table 6 1 shows the contents of the MSR after a core reset exception Table 6 1 Register Settings during Core Reset SRRO 3 Indeterminate MSR WE PR CE EE ME DE PE PX SSC ODOC OOS PC OxFFFF FFFC 6 2 1 2 Chip Reset Chip reset exceptions occur when activated by the Debug Control Register the JTAG Control Register or at the second expiration of the watchdog timer if it is enabled in the timer control register After a chip reset registers within the PPC403GA are reset but the reset pin does not output an active level Section 5 3
475. n the program counter Executing the return from interrupt instruction rfi restores the contents of the program counter and the MSR from SRRO and SRR1 respectively and the PPC403GA resumes execution at the new program counter address Table 6 4 Register Settings during Protection Violation Exceptions SRRO Loaded with the address of the instruction causing the protection violation exception SRR1 Loaded with the contents of the MSR MSR WE 0 PR 0 CE Unchanged EE 0 ME Unchanged DE Unchanged PE 0 PX Unchanged PC EVPR 0 15 0x0300 6 20 PPC403GA User s Manual Table 6 4 Register Settings during Protection Violation Exceptions cont DEAR Loaded with the address that caused the protection exception 6 2 5 External Interrupt Exception Four groups of events trigger external interrupt exceptions serial port interrupts JTAG serial port interrupts DMA interrupts and active signals on the external interrupt pins Two interrupts are generated from the serial port one for receive and one for transmit Two interrupts are also generated by the receiver and transmitter sections of the JTAG serial port Each of the four DMA channels may be programmed to generate an interrupt at the end of the transfer count or when DMA transfers are terminated by an external device via the EOT pin The last group of interrupts is generated by the five external interrupt pins The user must progra
476. nal Interrupt 1 pin is positive level edge triggered 4 E2T External Interrupt 2 Triggering 0 The External Interrupt 2 pin is level sensitive 1 The External Interrupt 2 pin is edge triggered 5 E2L External Interrupt 2 Active Level 0 External Interrupt 2 pin is negative level edge triggered 1 External Interrupt 2 pin is positive level edge triggered 6 E3T External Interrupt 3 Triggering 0 The External Interrupt 3 pin is level sensitive 1 The External Interrupt 3 pin is edge triggered 7 E3L External Interrupt 3 Active Level 0 External Interrupt 3 pin is negative level edge triggered 1 External Interrupt 3 pin is positive level edge triggered 8 E4T External Interrupt 4 Triggering 0 The External Interrupt 4 pin is level sensitive 1 The External Interrupt 4 pin is edge triggered 9 EAL External Interrupt 4 Active Level 0 External Interrupt 4 pin is negative level edge triggered 1 External Interrupt 4 pin is positive level edge triggered 10 25 reserved 26 DRC DRAM Read on CAS For DRAM read operations only 0 Latch data bus on rising edge of SysClk 1 Latch data bus on rising edge of CAS on the deactivation of CAS provides more time for data to arrive 6 12 PPC403GA User s Manual 27 28 RDM Real Time Debug Mode 00 Trace Status Outputs Disabled 01 Program Status and Bus Status 10 Program Status and Trace Output 11 reserved 29 TCS Timer Clock Sourc
477. nemonic Operands Function Registers Page Changed mr RT RS Move register 10 119 RT lt RS Extended mnemonic for or RT RS RS mr Extended mnemonic for CR CRO or RT RS RS Instruction Set 10 119 orc OR with Complement orc RA RS RB Rc 0 orc RA RS RB Re 1 31 RS RA RB 412 Rc 0 6 T 16 21 31 RA lt RS v RB The contents of register RS is ORed with the ones complement of the contents of register RB the result is placed into register RA Registers Altered e RA e CR CRO z ecr a so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 120 PPC403GA User s Manual ori OR Immediate ori RA RS IM 24 RS RA IM 0 6 11 16 31 RA RS v 60 IM The IM field is extended to 32 bits by concatenating 16 0 bits on the left Register RS is ORed with the extended IM field the result is placed into register RA Registers Altered e RA Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 24 Extended Mnemonics for ori Other Mnemonic Operands Function Registers Page Changed nop Preferred no op 10 121 triggers optimizations based on no ops Extended mnemonic for ori 0 0 0 Instruction Set 10 121 oris OR Immediate Shifted oris DA DG IM 25 RS RA IM 0 6 11 16 31
478. ng an integer only processor will not recognize these floating point opcodes and will respond to their presence by taking an illegal instruction interrupt The interrupt handler can be written to determine which opcode was used and to provide equivalent function by executing appropriate integer based library routines This method is not preferred since it adds the execution time of the interrupt context switching to the Instruction Timing and Optimization C 3 execution time of the same library routines which would have been called directly in the first method However the interrupt based technique does allow the PPC403GA to execute code that assumes the existence of the standard PowerPC floating point operations C 2 A Data Cache Usage Recognize the size and structure of the data cache so that data may be organized to minimize cache misses For the data cache any two addresses which are the same in address bits 23 27 but which differ in address bits 0 22 are called congruent Address bits 28 31 define the 16 bytes within a line which is the minimum size object which is brought into the cache Two congruent lines may be present in the cache simultaneously accessing a third congruent line will cause the removal from the cache of one of the two lines previously there Continually moving data into and out of the cache is time consuming since it occurs at the speed of external memory Much faster execution occurs if data can be acces
479. ng paragraph Therefore this timer exception is discussed separately See Section 6 2 11 Watchdog Timer on page 6 26 After detecting a Critical Interrupt and if no synchronous precise exceptions are outstanding the PPC403GA immediately takes the Critical Interrupt Exception and stores the address of the next instruction to be executed in SRR2 Simultaneously the current contents of the MSR are saved in SRR3 The MSR Critical Interrupt Enable bit MSR CE is reset to 0 to disable another Critical interrupt or the Watchdog Timer first time out from interrupting the critical interrupt exception handler before SRR2 and SRR3 have been saved The MSR Debug Exception Enable bit MSR DE is reset to 0 to disable debug exceptions during the critical interrupt exception handler The MSR is also loaded with the other values shown in Table 6 2 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0100 Exception processing begins at the address in the program counter The latch internal to the PPC403GA which contains the status of the Critical Interrupt pin is reset when the exception is taken Therefore subsequent negative levels on the critical interrupt pin will be reported when MSR CE is enabled Once inside the exception handling routine and after saving the contents of SRR2 SRR3 Critical Interrupts may be re enabled by setting the MSR Critical In
480. nitialization code should configure the following processor resources e Program all memory and I O bank configuration registers e Invalidate the i cache and d cache e Enable cacheability for appropriate memory regions e Initialize system memory as required by the operating system or application code e Initialize processor registers as needed by the system e Initialize off chip system facilities e Dispatch the operating system or application code e Enable Bus Status Mode if logic analyzer debug is required See Section 9 2 4 Bus Status Debug Mode on page 9 2 for more detail 5 6 PPC403GA User s Manual 5 6 1 Notes on Bank Register Initialization As shown in Table 5 1 hardware initializes Bank Register 0 for slow memory and initializes the other bank registers in a disabled state Typically initialization software must alter the bank register settings Since the initialization software may be running from the memory which is being reconfigured situations can arise where special precautions are required If software is reprogramming between valid states of a given bank register for example if the hardware is fast ROM on BR1 both slow and fast bank register settings are valid then no special precautions are required An example where special precautions are required Suppose that the processor is running from one memory say slow PROM from BRO and that it is desired to switch to an entirely separate memory that covers
481. not provide user mode access to the time base The PPC403GA provides privileged mode read access via mfspr instructions with SPR numbers 0x3DD and 0x3DC The PPC403GA does not implement the mftb instruction an attempt to use it will result in a Program Exception for illegal opcode e The PPC403GA provides privileged mode write access to the time base using mtspr instructions with SPR numbers 0x3DD and 0x3DC These differences are detailed in the following table Table 6 13 Time Base Comparison PowerPC Architecture PPC403GA Access Reg Access Access Reg Access Instructions Number Restrictions Instructions Number Restrictions mftbu RT 0x10D Read Only User mode Extended mnemonic Read Not for mftb RT TBU Supported mttbu RS 0x11D_ Privileged mftbhi RT 0x3DC Privileged Upper Extended mnemonic Write Only Extended mnemonic Read 32 bits for Tor mtspr TBU RS mfspr RT TBHI mttbhi RS Privileged Extended mnemonic Write for mtspr TBHI RS mftb RT 0x10C Read Only User mode Extended mnemonic Read Not for mftb RT TBL Supported mttbl 0x11C Privileged mftblo RT Ox3DD_ Privileged Lower Extended mnemonic Write Only Extended mnemonic Read 32 bits fr for mtspr TBL RS mfspr RT TBLO mttblo RS Privileged Extended mnemonic Write for mtspr TBLO RS 6 3 3 Programmable Interval Timer PIT The PIT is a 32 bit register that decrements at the same rate as the time base The PIT is read written via mf
482. npacking of data for the memory side of the transaction during a buffered transfer The transfer size must be equal to the size of the peripheral width Packing and unpacking is only done on the memory side of the transfer All four channels support buffered mode transfers and chained transfers in this mode Figure 4 3a shows that in buffered mode the PPC403GA buffers the data during transfers between memory and a peripheral The PPC403GA accesses memory using the parameters in the Bank Register associated with the DMA memory address Prior to transferring any data the DMA channel must be configured and enabled for buffered mode and the transfer characteristics of the peripheral must be programmed in the DMA Channel Control Register Also the DMA count register must be initialized with the number of transfers in the DMA transaction and the DMA Destination Address register for the channel must be loaded with the address where the data will be transferred If chaining is desired for a channel there are optional methods for programming the DMA Chained Count Register and the DMA Source Chained Address Register see Section 4 2 8 Chained Operations on page 4 23 DMA Operations 4 5 4 2 2 1 Buffered Transfer from Memory to Peripheral In this example the memory access is from a 32 bit wide 2 1 1 1 access DRAM bank and the PPC403GA provides the necessary signals to the DRAM bank The timing parameters used for the DRAM bank are programmed in t
483. ns 1 Registers Altered e RT e CRI CRO cr eo so if Re contains 1 e XER OV SO if OE contains 1 Programming Note The 32 bit remainder can be calculated using the following sequence of instructions divwu RT RA RB RT quotient mullwu RT RT RB RT quotient x divisor subf RT RT RA RT remainder This sequence does not calculate the correct result if the divisor is zero Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 61 eieio Enforce In Order Execution of I O eieio 31 854 0 6 21 31 The eieio instruction ensures that all loads and stores preceding an eieio instruction complete with respect to main storage before any loads and stores following the eieio instruction access main storage For the PPC403GA the implementation of the eieio instruction is identical to the implementation of the sync instruction which is more restrictive than eieio If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture Although the eieio and sync instructions are implemented identically on the PPC403GA the architectural requirements of the instructions differ See Section 2 12 for a discussion of the architectural differences 10 62 PPC403GA User s Manual
484. ns 1 Programming Note The most significant 32 bits of the product unlike the least significant 32 bits may differ depending on whether the registers RA and RB are interpreted as signed or unsigned quantities The mulhw instruction generates the correct result when these operands are interpreted as signed quantities The mulhwu instruction generates the correct result when these operands are interpreted as unsigned quantities Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 113 mulli Multiply Low Immediate mulli RT RA IM 0 6 11 16 31 prodo 47 lt RA x IM RT lt prody 47 The 48 bit product of register RA and the IM field is formed Both register RA and the IM field are interpreted as signed quantities The least significant 32 bits of the product are placed into register RT Registers Altered e RT Programming Note The least significant 16 bits of the product are correct regardless of whether register RA and field IM are interpreted as signed or unsigned numbers Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 114 PPC403GA User s Manual mullw Multiply Low Word mullw RT RA RB OE 0 Rc 0 mullw RT RA RB OE 0 Re 1 mullwo RT RA RB OE 1 Rc 0 mullwo RT RA RB OE 1 Rce 1 31 RT RA RB OE 235 Re 0 6 11 16 21 22 31 prodo s3 amp
485. ns set XER OV differently The specific behavior is indicated in the instruction descriptions e Move instructions merxr mtspr XER e Multiply and divide instructions mullwo mullwo divwo divwo divwuo divwuo Carry set to indicate whether or not an instruction that updates XER CA produces a result that has a carry out of the high order bit XER CA 1 indicates a carry The following instructions set XER CA differently The specific behavior is indicated in the instruction descriptions e Move instructions merxr mtspr XER e Shift algebraic operations sraw srawi Transfer Byte Count This field provides a byte count for the Iswx and stswx instructions This field is updated by mtspr XER PPC403GA User s Manual 2 3 3 Condition Register CR The Condition Register CR is a 32 bit register that is broken into eight 4 bit fields as shown in Figure 2 8 The CR reflects the results of some operations as indicated in the instruction descriptions in Chapter 10 The CR provides a mechanism for testing and conditional branching Fields of the CR can be set in one of the following ways Specified fields can be set by a move to the CR from a GPR mterf instruction A specified field can be set by a move to the CR from another CR field merf instruc tion or from the XER merxr instruction CR field 0 can be set as the implicit result of various fixed point instructions A specified field can be set as the result o
486. nsfer Width is the same as Peripheral Width 10 Word 32 bits 6 DAI Destination Address Increment 0 Hold the destination address do not increment 7 SAI Source Address Increment valid only during memory to memory moves don t care in other modes 8 CP Channel Priority 1 Channel has high priority for the external or internal bus 9 10 TM Transfer Mode 01 Fly by mode DMA 11 12 PSC Peripheral Setup Cycles in this example zero 13 18 PWC Peripheral Wait Cycles don t care not used in fly by mode 19 21 PHC Peripheral Hold Cycles don t care not used in fly by mode 22 ETD End of Transfer Terminal Count EOT TC Pin Direction _ is 1 The EOT TC pin is programmed as a terminal count TC output When programmed as TC and the terminal count is reached this signal will go active the cycle after DMAA goes inactive DMA Operations 4 11 Table 4 2 Sample DMACR Settings for Fly By Transfer Bit Name Description 23 TCE Terminal Count Enable 1 Channel stops when terminal count reached 24 CH Chaining Enable 0 DMA Chaining is disabled 25 BME Burst Mode Enable In all modes except fly by and M2M line burst 0 Channel does not burst to memory must have BME 0 26 ECE EOT Chain Mode Enable ETD must be programmed for EOT 0 Channel will stop when EOT is active 27 TCD TC Chain Mode Disable 0 If Chaining is enabled channel will chain when TC reaches zero 28 31 reserved
487. nsmit Buffer Ready TBR is set to 1 whenever the SPTSR is loaded 0 Transmit buffer is full not ready with a character from the SPTB TBR is reset to 1 Transmit buffer is empty and ready 0 when a new character is stored in the SPTB 6 TSR Transmitter Shift Register Ready TSR is set to 1 whenever the SPTSR is empty 0 Transmitter Shift Register is full TSR is reset to 0 when a new character is trans 1 Transmitter Shift Register is empty ferred from the SPTB into the SPTSR and remains reset as characters are transmitted 7 reserved Serial Port Operation 7 15 7 3 5 Serial Port Receive Buffer SPRB Figure 7 8 shows the SPRB field Figure 7 8 Serial Port Receive Buffer SPRB 0 7 Received Data 7 3 6 Serial Port Receiver Command Register SPRC The SPRC controls the serial port receiver Figure 7 9 shows the fields in the SPRC ER EJE A Figure 7 9 Serial Port Receiver Command Register SPRC 0 ER Enable Receiver For the serial port receiver to operate ER must 0 Disable receiver be set to 1 If ER is reset to 0 the serial port 1 Enable receiver receiver is disabled no data is shifted into the SPRSR and no serial port receiver interrupts are active 1 2 DME DMA Mode Interrupt Enable 00 DMA is disabled RBR interrupt is disabled 01 DMA is disabled RBR interrupt is enabled 10 DMA is enabled Receiver is source for DMA channel 2 11 DMA is enabled
488. ntly A region s cacheability with respect to the instruction cache or the data cache is programmed via the Instruction or Data Cache Cacheability Registers ICCR or DCCR respectively The memory map of the PPC403GA is also divided by the type of memory accessible This is defined by address bits A1 A3 If A1 A3 0b000 the attached memory must be external DRAM If A1 A3 0b111 the attached memory must be external SRAM or equivalent like ROM or memory mapped hardware As described in Section 2 2 1 each of these memory type regions appears twice in the memory map Figure 2 1 shows that two pairs of DRAM regions 0 1 and 16 17 physically overlap and that two pairs of SRAM regions 14 15 and 30 31 physically overlap Four regions 0 1 and 16 17 have been reserved for external DRAM devices Within the DRAM regions a total of four banks of devices are supported the total of DRAM and SRAM banks may not exceed eight Each DRAM bank supports direct attachment of devices up to 64 MB Each bank can be configured for 8 16 or 32 bit devices For individual DRAM banks the bank size the bank starting address the number of wait states the RAS to CAS timing RAS precharge cycles the use of an external address multiplexer required for external bus masters and the refresh rate are user programmable Four regions 14 15 and 30 31 have been reserved for external SRAM devices Within the Programming Model 2 3 SRAM regions a total of e
489. ntrol SRAM like devices Section 3 7 2 will describe the usage of BR4 BR7 for DRAM devices Bits 0 13 15 16 of the bank register have the same usage whether for SRAM or DRAM For BR4 BR7 bit 31 controls the interpretation of bits 14 17 30 If bit 31 has value 1 then the SRAM definition is used If bit 31 has value 0 then the DRAM definition is used On power up BRO is initialized for valid SRAM devices at addresses OxFFFO 0000 OxFFFF FFFF equivalent to Ox7FFO 0000 Ox7FFF FFFF see Section 2 2 1 Double Mapping on page 2 2 BR1 BR7 are initialized to invalid SRAM devices so they must be further set up by software before use The system then attempts to boot from a ROM at address OxFFFF FFFC Chapter 5 Reset and Initialization contains detailed information about register parameters at reset and at power up BAS BU BME RE e Si SE TH 0 7 8 10 11 12 13 1415 16 17 18 21 22 23 zl 26 27 28 30 31 d Je dr GE ob E mia SD Figure 3 13 Bank Registers SRAM Configuration BR0 BR7 0 7 BAS Base Address Select Specifies the starting address of the SRAM bank 8 10 BS Bank Size 000 1 MB bank 001 2 MB bank 010 4 MB bank 011 8 MB bank 100 16 MB bank 101 32 MB bank 110 64 MB bank 111 Reserved 11 12 BU Bank Usage 00 Disabled invalid or unused bank 01 Bank is valid for read only RO 10 Bank is valid for write only WO 11 Bank is valid for read wri
490. nuctrl Branch if not unordered to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 3 Extended mnemonic for bectrl 4 4 cr_field 3 LR 10 28 10 30 PPC403GA User s Manual bectr Branch Conditional to Count Register Table 10 7 Extended Mnemonics for bcctr bcctrl cont Mnemonic bsoctr bsoctrl Operands cr_field Function Branch if summary overflow to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 3 Other Registers Changed Extended mnemonic for bectrl 12 4 cr_field 3 LR Page 10 28 btctr btctrl bunctr bunctrl cr_bit cr_field Branch if CRer pit 1 to address in CTR Extended mnemonic for bectr 12 cr_bit Extended mnemonic for bectrl 12 cr_bit Branch if unordered to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 3 LR Extended mnemonic for bectrl 12 4 cr_field 3 LR 10 28 10 28 Instruction Set 10 31 bclr Branch Conditional to Link Register belr BO BI LK 0 belrl BO BI LK 1 19 BO BI 16 LK 0 6 11 16 21 31 if BO 0 then CTR lt CTR 1 if BO 1 v CTR 0 BOS A BO 1 v Chez BO then NIA lt LRo 29 20 if LK 1 then LR lt CIA 4 If bit 2 of the BO field conta
491. o 3 3V supply 12 8 PPC403GA User s Manual Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function WBEO A4 122 O I Write Byte Enable 0 Address Bus Bit 4 When the PPC403GA is bus master the write byte enable outputs WBE0 3 select the active byte s in a memory write access For 8 bit memory regions WBE2 and WBE3 become address bits 30 and 31 and WBE is the write enable line For 16 bit memory regions WBE2 WBE3 are address bits A30 A31 and WBEO and WBE1 are the high byte and low write enables respectively For 32 bit memory regions WBE0 3 are write byte enables for bytes 0 3 on the data bus respectively When the PPC403GA is not bus master WBEO 1 are used as the A4 5 inputs for bank register selection and WBE2 3 are used as the A30 31 inputs for byte selection and page crossing detection WBE A5 123 O I Write Byte Enable 1 Address Bus Bit 5 See description of WBEO A4 WBE2 A30 124 O I Write Byte Enable 2 Address Bus Bit 30 See description of WBEO A4 WBE3 A31 125 O I Write Byte Enable 3 Address Bus Bit 31 See description of WBEO A4 XmitD 87 O Serial port transmit data Signal Descriptions 12 9 Table 12 2 Signals Ordered by Pin Number Pin Signal Names Pin S cher Pin Siche
492. o Section 7 1 3 on page 7 3 and Section 7 2 1 on page 7 5 MMIO Figure 11 6 Baud Rate Divisor Low Register BRDL 0 7 Divisor Low Bits The eight least significant bits of the baud rate divisor concatenated with the contents of the BRDH 11 14 PPC403GA User s Manual CDBCR see also Section 8 1 on page 8 1 CDBCR SPR 0 26 27 28 30 31 dls obs Figure 11 7 Cache Debug Control Register CDBCR 0 26 reserved 27 CIS Cache Information Select 0 Information is cache Data 1 Information is cache Tag 28 30 reserved 31 css Cache Side Select 0 Cache side is A 1 Cache side is B Register Summary 11 15 CR CR see also Section 2 3 3 on page 2 11 SI CR1 CR2 me Er E Se Se 0 3 7 8 11 12 15 16 19 20 23 24 27 28 31 Figure 11 8 Condition Register CR 0 3 CRO Condition Register Field 0 4 7 CR1 Condition Register Field 1 8 11 CR2 Condition Register Field 2 12 15 CR3 Condition Register Field 3 16 19 CR4 Condition Register Field 4 20 23 CR5 Condition Register Field 5 24 27 CR6 Condition Register Field 6 28 31 CR7 Condition Register Field 7 11 16 PPC403GA User s Manual CTR Address for branch to counter instructions CTR see also Section 2 3 2 1 on page 2 6 SPR 0 31 Figure 11 9 Count Register CTR 0 31 Count Count for branch con
493. o clear Status registers are normally considered to be set via hardware and read and cleared via software Reading TSR is done using the mfspr instruction Clearing is done by writing a word to TSR using mtspr with a 1 in any bit position that is to be cleared and 0 in all other bit positions The write data to the status register is not direct data but a mask A 1 causes the bit to be cleared and a 0 has no effect Figure 6 18 Timer Status Register TSR Enable Next Watchdog See Section 6 3 5 on page 6 33 0 Action on next Watchdog event is to set TSR 0 1 Action on next Watchdog event is governed by TSR 1 Interrupts Exceptions and Timers 6 35 WIS Watchdog Interrupt Status 0 No Watchdog interrupt is pending 1 Watchdog interrupt is pending 2 3 WRS Watchdog Reset Status 00 No Watchdog reset has occurred 01 Core reset has been forced by the Watchdog 10 Chip reset has been forced by the Watchdog 11 System reset has been forced by the Watchdog PIS PIT Interrupt Status 0 No PIT interrupt is pending 1 PIT interrupt is pending FIS FIT Interrupt Status 0 No FIT interrupt is pending 1 FIT interrupt is pending 6 31 reserved 6 3 7 Timer Control Register TCR The TCR controls PIT FIT and WDT options TCR bits 2 and 3 are cleared to zero by all forms of processor reset These bits are set only by softwa
494. ocessor Management Instructions The processor management instructions are used to move data between the general purpose registers and special control registers in the PPC403GA and also provide traps system calls and synchronization controls to the user Table 2 24 Processor Management Instructions mtcrf mtdcr mtspr SC tw twi 2 54 PPC403GA User s Manual Memory and Peripheral Interface EN The PPC403GA memory and peripheral interface provides direct processor bus attachments for most memory and peripheral devices The interface minimizes the amount of external glue logic needed to communicate with memory and peripheral devices reducing the embedded system device count circuit board area and cost For example to eliminate off chip address decoding for chip selects the PPC403GA provides eight programmable chip selects that enable system designers to relocate memory and peripherals in the PPC403GA memory map Chip select timing and associated control signals are programmable as are setup wait and hold times The Bus Interface Unit BIU is the internal structure controlling the interface between the PPC403GA and memory and peripherals The BIU controls the interfaces between storage both addresses which are external to the PPC403GA and addresses which are internal on the On chip Peripheral Bus and user s of that storage the processor core the internal DMA controller an external bus master The BIU interfaces to
495. of 4 If it is not it will cause an alignment exception If the reservation bit contains 1 when the instruction is executed the contents of register RS are stored into the word at the effective address and the reservation bit is cleared If the reservation bit contains 0 when the instruction is executed no store operation is performed CR CRO is set as follows e CR CRO gr are cleared e CR CRO _g is set to the state of the reservation bit at the start of the instruction e CR CRO lt is set to the contents of the XER SO bit Programming Note The reservation bit can be set to 1 only by the execution of the Iwarx instruction When execution of the stwex instruction completes the reservation bit will be 0 independent of whether or not the stwex instruction sent RS to memory CR CRO eq must be examined to determine if RS was sent to memory It is intended that lwarx and stwex be used in pairs in a loop to create the effect of an atomic operation to a memory area which is a semaphore between asynchronous processes loop war read the semaphore from memory set reservation alter change the semaphore bits in register as required stwcex attempt to store semaphore reset reservation bne loop an asynchronous process has intervened try again All usage of lwarx and stwex including usage within asynchronous processes should be paired as shown in this example If the asynchronous process in this example had paired
496. of XER SO is placed into the same CR field If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e CR CRn where nis specified by the BF field Invalid Instruction Forms e Reserved fields 10 Programming Notes Since the PPC403GA supports only the 32 bit version of the PowerPC empl Compare Logical instruction use of the extended mnemonic cmplw BF RA RB is recommended Table 10 11 Extended Mnemonics for cmpl Other Mnemonic Operands Function Registers Page Changed cmplw BF RA RB Compare Logical Word 10 39 Use CRO if BF is omitted Extended mnemonic for cmpl BF 0 RA RB Instruction Set 10 39 cmpli Compare Logical Immediate cmpli BF 0 RA IM 10 BF RA IM 0 6 9 11 16 31 Co 3 40 if RA lt 160 IM then co lt 1 if RA gt 160 IM then c4 lt 1 if RA t60 IM then cp 1 c3 amp XER SO n amp BF CRI CRn lt coz The IM field is extended to 32 bits by concatenating 16 0 bits to its left The contents of register RA are compared with IM using a 32 bit unsigned compare The CR field specified by the BF field is updated to reflect the results of the compare and the value of XER SO is placed into the same CR field Registers Altered e CR CRn where nis specified by the BF field Invalid Instruction Forms e Reserved fields Programming Note Since the PPC403GA supports only the 32 bit version of t
497. of the cache line fill if the requested instruction is received from the external bus after the request is made to the Instruction Cache Cache lines are loaded either target word first or sequentially controlled by bit 13 of the bank register Target word first fills start at the requested fullword continue to the end of the block and then wrap around to fill the remaining fullwords at the beginning of the block Sequential fills start at the first word of the cache block and proceed sequentially to the last word of the block Transfers between the instruction cache and the instruction fetcher will always consist of either a single instruction or an aligned doubleword containing two instructions Writes into the cache will always consist of an entire cache line being written in one cycle reload dump The Instruction Cache does not perform any snooping of external memory or the Data Cache therefore it will be necessary for the programmer to follow a set of special procedures for Instruction Cache synchronization if either self modifying code is used or if storage containing instructions gets updated by a peripheral device A code example illustrates the necessary steps for self modifying code This example assumes that addr1 is both data and instruction cacheable stw regN addr the data in regN is to become an instruction at addr1 dcbst addr forces data from the data cache to memory sync wait until the data actually reaches the me
498. ompare 2 Debug Event 0 Event Didn t Occur 1 Event Occurred 11 22 PPC403GA User s Manual DBSR cont 11 IDE Imprecise Debug Event 0 Event Didn t Occur 1 Debug Event Occurred While Debug Exceptions were disabled by MSR DE 0 12 21 reserved 22 23 MRR Most Recent Reset These two bits are set to one of three values 00 No Reset Occurred Since Power Up when a reset occurs 01 Core Reset These two bits are cleared to 00 at power up 10 Chip Reset 11 System Reset 24 28 reserved 29 JIF JTAG Serial Inbound Buffer Full This bit is set to 1 when the JSIB is written 0 Empty This bit is cleared to 0 when the JSIB is read 1 Full WARNING Unexpected results can occur if this bit is altered by application software 30 JIO JTAG Serial Inbound Buffer Overrun This bit is set to 1 when a second write to the 0 No Overrun JSIB is done without an intervening read 1 Overrun Occurred This bit is cleared to 0 by a write to the DBSR with a 1 in this bit position 31 JOE JTAG Serial Outbound Buffer Empty This bit is set to 1 when the JSOB is read 0 Full This bit is cleared to 0 by writing to the JSOB 1 Empty WARNING Unexpected results can occur if this bit is altered by application software Register Summary 11 23 DCCR
499. on formats 10 1 instruction queue 2 23 instruction timings C 7 branch prediction C 8 branches and cr logicals C 7 general rules C 7 instruction cache misses C 9 loads and stores C 9 strings C 8 instruction brief summaries by category 2 49 instructions alphabetical including extended mnemonics A 2 arithmetic and logical B 34 branch B 40 cache control B 44 categories B 1 classifications for folding C 10 comparison B 41 condition register logical B 39 data movement B 29 extended mnemonics B 5 interrupt control B 45 privileged B 3 processor management B 46 rotate and shift B 42 specific to PowerPC Embedded Controllers B 1 that can be folded C 11 instructions privileged 2 37 interrupts critical 6 11 external 6 11 internal 6 11 interrupts and exceptions 2 43 alignment error 6 22 asynchronous defined 2 43 critical 2 44 2 45 critical interrupt 2 46 critical interrupt pin 6 18 data machine check 2 48 debug 6 26 exception causes and machine state 6 16 exception defined 2 43 6 1 external interrupts 6 21 fixed interval timer 6 25 imprecise defined 2 43 instruction machine check 2 43 2 46 interrupt defined 2 43 6 1 non critical 2 44 precise defined 2 43 program 6 23 program exception 2 46 programmable interval timer 6 24 protection 6 20 synchronous exceptions 2 46 synchronous defined 2 43 system call 6 23 watchdog timer 6 26 IOCR 6 11 11 45 isync 10 71 J JTAG registers 2 14 L loz 10 72 lozu 10 73
500. on is part of the PowerPC User Instruction Set Architecture Instruction Set 10 17 andi AND Immediate andi RA RS IM 28 RS RA IM 0 6 11 16 31 RA RS A 60 IM The IM field is extended to 32 bits by concatenating 16 0 bits on its left The contents of register RS is ANDed with the extended IM field the result is placed into register RA Registers Altered e RA CR CRO et Eo so Programming Note The andi instruction can test whether any of the 16 least significant bits in a GPR are 1 bits andi is one of three instructions that implicitly update CR CRO without having an Rc field The other instructions are addic and andis Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 18 PPC403GA User s Manual andis RA RS IM andis AND Immediate Shifted 29 RS RA 0 6 RA lt RS A IM em 31 The IM field is extended to 32 bits by concatenating 16 0 bits on its right The contents of register RS are ANDed with the extended IM field the result is placed into register RA Registers Altered e RA e CRICRO z ct ca so Programming Note The andis instruction can test whether any of the 16 most significant bits in a GPR are 1 bits andis is one of three instructions that implicitly update CR CRO without having an Rc field The other instructions are addic and andi Architecture Note This instr
501. onic cmpwi Operands BF RA IM Function Compare Word Immediate Use CRO if BF is omitted Extended mnemonic for cmpi BF 0 RA IM Other Registers Changed Page 10 38 crelr bx Condition register clear Extended mnemonic for crxor bx bx bx 10 49 crmove bx by Condition register move Extended mnemonic for cror bx by by 10 47 crnot bx by Condition register not Extended mnemonic for crnor bx by by 10 46 crset bx Condition register set Extended mnemonic for creqv bx bx bx 10 44 extlwi extlwi RA RS n b Extract and left justify immediate n gt 0 RA o n 1 lt RS p b4 nt RA n 31 e o Extended mnemonic for rlwinm RA RS b 0 n 1 Extended mnemonic for rlwinm RA RS b 0 n 1 CRICRO 10 126 extrwi extrwi RA RS n b Extract and right justify immediate n gt 0 RA 32 n 31 lt _ RS p bin t RA o 31 n lt 27 0 Extended mnemonic for rlwinm RA RS b n 32 n 31 Extended mnemonic for rlwinm RA RS b n 32 n 31 CRI CRO 10 126 inslwi inslwi RA RS n b Insert from left immediate n gt 0 RA b bin 1 RS o n 1 Extended mnemonic for rlwimi RA RS 32 b b b n 1 Extended mnemonic for rlwimi RA RS 32 b b b n 1 CRICRO 10 125 Instructions By Category B 19 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic insrwi
502. onic for addic RT RA IM 10 11 subic RT RA IM Subtract EXTS IM from RA 0 Place answer in RT Place carry out in XER CA Extended mnemonic for addic RT RA IM CRICRO 10 12 subis RT RA IM Subtract IM 160 from RA 0 Place answer in RT Extended mnemonic for addis RT RA IM 10 13 B 26 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Other Mnemonic Operands Function Registers Page Changed trap RA RB Trap unconditionally 10 162 Extended mnemonic for tw 31 RA RB tweq Trap if RA equal to RB Extended mnemonic for tw 4 RA RB twge Trap if RA greater than or equal to RB Extended mnemonic for tw 12 RA RB twgt Trap if RA greater than RB Extended mnemonic for tw 8 RA RB twle Trap if RA less than or equal to RB Extended mnemonic for tw 20 RA RB twige Trap if RA logically greater than or equal to RB Extended mnemonic for tw 5 RA RB twigt Trap if RA logically greater than RB Extended mnemonic for tw 1 RA RB twlle Trap if RA logically less than or equal to RB Extended mnemonic for tw 6 RA RB twllt Trap if RA logically less than RB Extended mnemonic for tw 2 RA RB twing Trap if RA logically not greater than RB Extended mnemonic for tw 6 RA RB twinl Trap if RA logically not less than RB
503. ons cont MSR WE PR CE EE ME DE PE PX Unchanged DO oO OO e PC EVPR 0 15 0x0200 BEAR Loaded with the address that caused the Machine Check for data access errors BESR For data side machine check loaded with type of machine check ESR For instruction side machine check loaded with type of machine check 6 2 4 Protection Exception Protection Violation exceptions occur when a write access store instruction is attempted to an address in a protected region and include storage operations invoked by data cache block zero dcbz and data cache block invalidate debi Protected regions are defined by the two pairs of Protect Bound Upper and Lower registers and the Protection Exclusive Mode bit in the MSR MSR PX Protection is enabled by the MSR PE bit When a protection violation is detected the PPC403GA suppresses the instruction causing the protection violation and writes the instruction address in SRRO The Data Error Address Register is loaded with the data address that caused the protection violation and the current contents of the MSR are loaded into SRR1 The MSR Protection Enable bit MSR PE is reset to 0 and the other MSR bits are loaded with the values shown in Table 6 4 The high order 16 bits of the program counter are then loaded with the contents of the EVPR and the low order 16 bits of the program counter are loaded with 0x0300 Exception processing begins at the new address i
504. opcode Many instructions have a extended opcode in another field The remaining instruction bits contain additional fields All instruction fields belong to one of the following categories e Defined These instructions contain values such as opcodes that cannot be altered The instruction format diagrams specify the values of defined fields e Variable These fields contain operands such as general purpose registers GPRs and immediate values that may vary from execution to execution The instruction format diagrams specify the operands in variable fields e Reserved Bits in a reserved field should be set to 0 In the instruction format diagrams reserved fields are shaded Instruction Set 10 1 If any bit in a defined field does not contain the expected value the instruction is illegal and an illegal instruction exception occurs If any bit in a reserved field does not contain 0 the instruction form is invalid and its result is architecturally undefined The PPC403GA executes all invalid instruction forms without causing an illegal instruction exception 10 2 Instruction Fields PPC403GA instructions contain various combinations of the following fields as indicated in the instruction format diagrams The numbers enclosed in parentheses that follow the field names indicate the bit positions bit fields are indicated by starting and stopping bit positions separated by colons AA 30 BA 11 15 BB 16 20 BD 16 29
505. opped using the JTAG debug port Acti vating a stop causes the processor to become architecturally fro zen While frozen normal instruction execution stops and all architected resources of the processor can be accessed and altered Normal execution continues after this bit is reset The processor can be reset either using the external reset pin or using the JTAG debug port There are three different resets that can be done using the JTAG debug port core chip and system reset The timer resources can be controlled using the JTAG debug port and the DBCR The timers can either be allowed to run frozen always or frozen when a debug event occurs Debug events are used to trigger a debug operation to take place For more information and a list of debug events see Section 9 5 Debugging 9 3 Trap Instructions There are two trap instructions tw and twi included in the instruc tion set These instructions along with debug events can be used to implement software breakpoints 9 4 Processor Status The processor execution status exception status and most recent reset can be monitored Execution Status The execution status of the processor can be monitored using the Trace Status signals when the processor is in Bus Status Mode or using the JTAG debug port Either of these resources can be used to determine if the processor is stopped waiting or running Exception Status The status of pending synchronous exceptions can be monitored us
506. ord RS in memory at EA RA 0 RB only if reservation bit is set if RESERVE 1 then MS EA 4 lt RS RESERVE lt 0 CR CRO lt 70 1 XERgo else CR CRO lt 70 0 XERgo 10 150 stwu RS D RA Store word RS in memory at EA RA O EXTS D Update the base address RA e EA 10 152 stwux RS RA RB Store word RS in memory at EA RA O RB Update the base address RA e EA 10 153 Alphabetical Instruction Summary A 33 Table A 1 PPC403GA Instruction Syntax Summary cont Other Mnemonic Operands Function Registers Page Changed stwx RS RA RB Store word RS in memory at 10 154 EA RA O RB sub RT RA RB Subtract RB from RA 10 155 RT lt RB RA 1 Extended mnemonic for subf RT RB RA sub Extended mnemonic for CR CRO subf RT RB RA subo Extended mnemonic for XER SO OV subfo RT RB RA subo Extended mnemonic for CR CRO subfo RT RB RA XER SO OV subc RT RA RB Subtract RB from RA 10 156 RT lt RB RA 1 Place carry out in XER CA Extended mnemonic for subfc RT RB RA subc Extended mnemonic for CR CRO subfc RT RB RA subco Extended mnemonic for XER SO OV subfco RT RB RA subco Extended mnemonic for CR CRO subfco RT RB RA XER SO OV subf RT RA RB Subtract RA from RB 10 155 RT RA
507. ored multi byte object is probed by reading its component bytes one at a time using load byte instructions then the storage order may be perceived If such probing shows that the lowest memory address contains the highest order byte of the multi byte scalar the next higher sequential address the next least significant byte and so on then the multi byte object is stored in Big Endian form Alternatively if the probing shows that the lowest memory address contains the lowest order byte of the multi byte scalar the next higher sequential address the next most significant byte and so on then the multi byte object is stored in Little Endian form To understand Endian handling in a PowerPC system it is very important to keep in mind the probing concept discussed above In PowerPC the objective is for a processor to be able to run an Endian sensitive program one that tests its long data objects by probing them with shorter data objects and have that program obtain its expected results This is a processor centric view Memory as perceived by the processor using its various load and store instructions can be set to behave as either Little Endian or Big Endian under control of MSR bits that will be discussed in Section 2 5 2 If the PowerPC system is configured as Little Endian and the memory is probed by an external means for example a logic analyzer directly examining the memory it will be seen that the memory is NOT organized as Little Endian
508. ow order write byte enables and eight ES chip selects can address 512MB of main storage Figure 3 4 illustrates the relationship between portions of the 32 bit address and several memory controlling registers ICCR 0 0 i 31 DCCR ES 0 A 31 A address bits 0 31 uw a a 3 DE 2 S54 A Goi So 9 Hee on eae 1 e c for BR4 BR7 BRn ii 0 7 8 10 31 Figure 3 4 Usage of Address Bits Memory and Peripheral Interface 3 7 3 5 1 Cacheability The 4 gigabyte total address space 32 bits is divided into 32 regions of 128 megabytes each for purposes of cacheability control The 32 values 0 31 of address bits 0 4 labelled A in Figure 3 4 are the region numbers Each value of A has associated with it one bit in the Data Cache Cacheability Register DCCR and one bit in the Instruction Cache Cacheability Register ICCR The region is cacheable for data access loads and stores if the bit in the DCCR has value 1 and is non cacheable if the bit has value O The region is cacheable for instruction accesses fetches if the bit in the ICCR has value 1 and is non cacheable if the bit has value 0 It is completely permissible for the DCCR and ICCR values for a particular region to be different Address bit 0 A0 does not participate in selecting external memory Therefore the same location in external memory may be accessed with AO 0 and with AO 1
509. pecified by the FXM field Each bit in the FXM field controls the copying of 4 bits in register RS into the corresponding bits in the CR The correspondence between the bits in the FXM field and the bit copying operation is shown in the following table FXM Bit Number 0 Bits Controlled 0 3 1 4 7 8 11 12 15 16 19 20 23 24 27 N ol ol BY Go N 28 31 If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 105 micrf Move to Condition Register Fields Table 10 19 Extended Mnemonics for mtcrf Extended mnemonic for mtcrf OxFF RS Other Mnemonic Operands Function Registers Page Changed mtcr RS Move to Condition Register 10 105 10 106 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family mtdcr Move To Device Control Register mtdcr DCRN RS 31 RS DCRF 451 0 6 11 21 31 DCRN lt DCRF DCRFo4 DCR DCRN lt RS The contents of register RS are placed into the DCR specified by the DCRF field If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e DCR DCRN Invalid Instruction Forms e Reserved fields Programming Note The DCR n
510. pheral Hold Cycles don t care 22 ETD End of Transfer Terminal Count EOT TC Pin Direction 23 TCE Terminal Count Enable 24 CH Chaining Enable 0 DMA Chaining is disabled 25 BME Burst Mode Enable In all modes except fly by and M2M line burst 0 Channel does not burst to memory must have BME 0 26 ECE EOT Chain Mode Enable ETD must be programmed for EOT 0 Channel will stop when EOT is active 27 TCD TC Chain Mode Disable 0 If Chaining is enabled channel will chain when TC reaches zero 28 31 reserved 4 2 5 2 Device Paced Memory to Memory Transfers A device paced transfer between memories is performed at the request of an external processor or bus master This transfer mode is similar to the software initiated memory to memory transfer except for the TM field setting TM 11 The transfer count destination address and source address registers must also be initialized DMACRr PW b 11 transfer width is a line which is permissible for software initiated memory to memory transfers is not allowed for Device Paced Memory to Memory transfers Device Paced Memory to Memory is specifically designed to transfer data between a memory mapped peripheral and memory Therefore only word halfword or byte transfers are allowed Once the DMA channel is configured for this mode the external device initiates a transfer by placing a 0 on the PPC403GA DMAR pin The PPC403GA outputs the
511. pheral Location 0 Peripheral is external to the PPC403GA 4 5 PW Peripheral Width Transfer Width is the same as Peripheral Width 10 Word 32 bits 6 DAI Destination Address Increment 0 Hold the destination address do not increment 7 SAI Source Address Increment valid only during memory to memory moves don t care in other modes 8 CP Channel Priority 1 Channel has high priority for the external or internal bus 9 10 TM Transfer Mode 01 Fly by mode DMA 11 12 PSC Peripheral Setup Cycles in this example zero 13 18 PWC Peripheral Wait Cycles don t care not used in fly by mode 19 21 PHC Peripheral Hold Cycles don t care not used in fly by mode 22 ETD End of Transfer Terminal Count EOT TC Pin Direction _ 1 The EOT TC pin is programmed as a terminal count TC output When programmed as TC and the terminal count is reached this signal will go active the cycle after DMAA goes inactive 4 16 PPC403GA User s Manual Table 4 3 Sample DMACR Settings for Fly By Burst Bit Name Description 23 TCE Terminal Count Enable 1 Channel stops when terminal count reached 24 CH Chaining Enable 0 DMA Chaining is disabled 25 BME Burst Mode Enable In all modes except fly by and M2M line burst 1 Channel will burst to memory must have BME 0 26 ECE EOT Chain Mode Enable ETD must be programmed for EOT 0 Channel will stop when EOT is active 27 TCD TC Chain Mode Disable 0 If C
512. plications The PowerPC Architecture helps to maximize cross platform portability of applications developed for PowerPC processors by guaranteeing application code compatibility across all PowerPC implementations This is accomplished via compliance with the first level of architectural standard the PowerPC User Instruction Set Architecture which is common for all PowerPC implementations 1 2 1 The PPC403GA as a PowerPC Implementation The PPC403GA implements the PowerPC User Instruction Set Architecture user level registers programming model data types and addressing modes for 32 bit fixed point operations This PowerPC architectural standard specifies the instruction set and registers 1 2 PPC403GA User s Manual that should be provided to support user level programs The PPC403GA is fully compliant with specifications for 32 bit implementations of the PowerPC User Instruction Set Architecture The 64 bit operations are not supported nor are the floating point operations Both of these kinds of operations are trapped and can be emulated in software Most of the architected features of the PPC403GA are compatible with the specifications for the PowerPC Virtual Environment and Operating Environment Architectures as specified for compute processors such as the 600 family of PowerPC processors In addition to these standard features the PPC403GA provides a number of optimizations and extensions to these levels of the architecture The ful
513. pond to any architected register Next instruction address the 32 bit address of the next instruction to be executed In pseudocode a successful branch is indicated by assigning a value to NIA For instructions that do not branch the NIA is CIA 4 Instruction Set 10 5 MS addr n EA ROTL RS n MASK MB ME instruction EA The number of bytes represented by n at the location in main storage represented by adar Effective address the 32 bit address derived by applying indexing or indirect addressing rules to the specified operand that specifies an location in main storage Rotate left the contents of RS are shifted left the number of bits specified by n Mask having 1 s in positions MB through ME wrapping if MB gt ME and 0 s elsewhere An instruction operating on a data or instruction cache block associated with an effective address The following table lists the pseudocode operators and their associativity in descending order of precedence Table 10 1 Operator Precedence REGp REG FLD function evaluation Operators Associativity Left to right b Right to left unary minus Right to left x Left to right P Left to right II Left to right lt gt lt gt Left to right A OI Left to right v Left to right yam None 10 4 Register Usage Each instruction description lists the registers altered by the instruction
514. ported by the JTAG port The IEEE 1149 1 Test Access Port commonly called JTAG Joint Test Action Group is an architectural standard which is described in IEEE standards document 1149 1 The standard provides a method for accessing internal facilities on a chip using a four or five signal interface The JTAG port was originally designed to support scan based board testing The JTAG boundary scan register allows testing of circuitry external to the chip primarily the board interconnect Alternatively the JTAG bypass register can be selected when no other test data register needs to be accessed during a board level test operation The PPC403GA JTAG port has been enhanced to allow for the attachment of a debug tool such as the RISCWatch 400 product from IBM Microelectronics Through the JTAG test access port a debug workstation can single step the processor and interrogate internal processor state to facilitate software debugging The enhancements comply with the IEEE 1149 1 specification for vendor specific extensions and are therefore compatible with standard JTAG hardware for boundary scan system testing 1 3 7 Data Types PPC403GA operands are bytes halfwords or words Multiple words or strings of bytes can be transferred using the load store multiple string instructions Data is represented in twos complement notation or in unsigned fixed point format Byte ordering may be selected to be either Big Endian the address of an operand is the
515. ptimization for faster running code is supported by the rules given in Section C 2 Coding Guidelines on page C 3 3 Guidelines for estimating the number of clock cycles required for the execution of a program is given in Section C 3 Instruction Timings on page C 7 C 1 Background Information C 1 1 Superscalar Operation The PPC403GA is a scalar processor its instructions operate on individual data items not on arrays It is under some circumstances able to execute more than one instruction at a time hence the term superscalar If appropriate dependency rules are satisfied the PPC403GA can execute Branches and Condition Register Logical instructions simultaneous with other instructions Section C 4 on page C 10 defines the necessary dependency rules These rules must be understood if it is desired to precisely predict code performance See Section 2 6 on page 2 23 for a brief introduction to the Instruction Queue of the PPC403GA That discussion will define terminology used in this chapter C 1 2 Folding Defined Superscalar operation requires the presence of at least two instructions in the queue If superscalar operation takes place it occurs via the passage of the second instruction from the IQ1 stage to the limited function execution unit EXE This passage is conventionally referred to as Folding PPC403GA requires in order execution therefore it is required that Instruction Timing and Optimization C 1 Dispatch of the
516. ption handlers into memory fia The example assumes that the system and or application code is loaded immediately after the cache is initialized while not_done repeat until all code has been loaded Imw 4 amp code load 4 word into 4 registers stmw 4 amp new_location store 4 words to d cache dcbst amp new_location store cache block to physical memory inc amp code increment the code addressby 4 words inc amp new_location increment the new_location addr by 4 words E aaMIiIi Ki Store the last block may have been unaligned F i of dcbst amp new_location store cache block to physical memory sync allow store to complete Establish machine state and on chip facilities This order MUST be followed vig Configure watchdog timer serial port clocks external interrupt polarity external interrupt edge level sensitivity e serial port pin assignments mtdcr lIOCR io_configuration configure I O 5 10 PPC403GA User s Manual Im ee E Initialize and configure the Serial Port ee eege Wi stb BRDH_adadr 0 clear Serial Port baud rate divisor high stob BRDL_addr 0 clearSerial Port baud rate divisor low Si stb SPLS_ addr 0x78 clear error bits in Serial Port line status stb SPHS_addr Oxff clear error bits in Serial Port handshake status stb SPCTL_addr 0 clear Serial Port control register K
517. quest by reading the data from the SPRB To operate in this mode the appropriate DMA Channel Control Register DMACRn must be configured to accept DMA requests from an internal source Setting the Peripheral Location PL bit of the DMACRnh to 1 configures the DMA channel to accept DMA requests from the serial port 7 2 3 3 Receiver Interrupts The serial port receiver interrupts are generated based on two conditions RxReady RBR or any of the receiver errors PE FE OE LB being active in the SPLS register Both of these conditions have separate interrupt enables in the SPRC register As mentioned in Table 7 5 above setting the DME field in the SPRC register to a value of 0b01 enables RxReady interrupt generation Thus an interrupt request will be sent to the asynchronous interrupt control unit whenever the SPRB has received a new character Similarly the Error Interrupt Enable EIE bit of the SPRC register enables an interrupt request whenever a framing parity overrun error or line break is detected When a receiver interrupt request to the asynchronous interrupt controller occurs the Serial Port Receiver Interrupt Status SRIS bit of the External Interrupt Status Register EXISR is set Note however that the exception will only be processed if the Serial Port Receiver Interrupt Enable SRIE bit of the External Interrupt Enable Register EXIER and the External Interrupt Enable EE bit of the Machine State Register MSR are also s
518. r decrementing which was in progress at the instant of the mtspr instruction may cause the appearance of an interrupt To eliminate the PIT as a source of interrupts write a O to TCR 5 PIT Interrupt Enable bit If it is desired to eliminate all PIT activity the procedure is Write 0 to TCR 5 PIT Interruput Enable bit This will prevent PIT activity from causing interrupts Write 0 to TCR 9 to disable the PIT auto reload feature Write 0 to PIT This will halt PIT decrementing While this action will not cause a PIT interrupt to become pending a near simultaneous decrement may have done so Write 1 to TSR 4 PIT Interrupt Status bit This action will clear TSR 4 to 0 see Section 6 3 6 This will clear any PIT interrupt which may be pending Because the PIT is frozen at zero no further PIT events are possible If the auto reload feature is disabled TCR 9 0 then once the PIT decrements to zero it will stay there until software reloads it using the mtspr instruction On any reset TCR 9 is cleared to zero This disables the auto reload feature 6 32 PPC403GA User s Manual Figure 6 17 illustrates the PIT Figure 6 17 Programmable Interval Timer PIT 0 31 Programmed Interval Remaining The number of clocks until the PIT event 6 3 4 Fixed Interval Timer FIT The FIT is a mechanism for providing timer interrupts with a repeatable period It is similar in function to an auto r
519. r s Manual 2 12 1 Context Synchronization 1 2 Context Synchronization Operations in the PPC403GA include sc rfi rfci exceptions in general interrupts isync Context synchronization requires that A All instructions prior to the context synch op complete in the context that existed prior to the context synch op and B All instructions after the context synch op complete in the context that exists after the context synch op Context as referred to above includes all processor context that is defined in the Pow erPC Architecture This includes the context of all architected registers both GPRs and SPRs However context specifically does not include memory contents A context synch op does not guarantee that subsequent instructions observe the memory context estab lished by previous instructions To provide memory synchronization one must use either the eieio instruction to guarantee internal memory ordering on the processor issuing the eieio or the sync instruction to guarantee system memory ordering to all processors in a multiprocessor configuration Note that on PPC403GA eieio and sync are implemented identically For PPC403GA and the PowerPC Embedded Controller family in general the contents of DCRs Device Control Registers such as the DMA Control Registers and the Bank Configuration Registers are not considered part of the processor context that is man aged by a context
520. r Instruction Set Architecture Instruction Set 10 139 sthbrx Store Halfword Byte Reverse Indexed sthbrx RS RA RB 31 RS RA RB 918 0 6 11 16 21 31 EA lt RB RA O MS EA 2 lt RS o4 31 I RS 16 23 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The least significant halfword of register RS is byte reversed The result is stored into the halfword at the effective address in main storage If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note 10 This instruction is part of the PowerPC User Instruction Set Architecture 10 140 PPC403GA User s Manual sthu RS D RA sthu Store Halfword with Update 45 RS RA EA lt EXTS D RA O 6 MS EA 2 lt RS 16 31 RA lt EA An effective address is formed by adding a displacement to a base address The 31 displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it
521. r Settings during External Interrupt Exceptions 6 22 Register Settings during Alignment Error Exceptions cccccseseeeeeseeeees 6 22 Register Settings during Program Exceptions esceesceeeceeeeeeeeteeseeeeneeeees 6 23 Register Settings during System Call Exceptions 6 24 Register Settings during Programmable Interval Timer Exceptions 6 24 Register Settings during Fixed Interval Timer Exceptions s ssseeeseeeeeeeeee 6 25 Register Settings during Watchdog Timer Exceptions cccesceeesreeees 6 26 Register Settings during Debug Exceptions 0 ceeceeseeeeeeeeeeeeeeeeteeeeeeeenees 6 27 Time Base COmpariSOn ceecceecceeseeeeeeeseeteaeeeaeeseaeeseeeaeessaeseaeeseeseaeeneeeeas 6 31 SPU Operating Mode Selection eecceeeceeeeeeeeeeeeeeeeeeeeeeeeeeeeseaeseeeeseaeeseeeeeatens 7 2 Serial Port Register Addresses Names and Access Modes s ssssseeseeseeen 7 3 Baud Rate Divisor Selection ccccccceseeceeeeseeeeeeeeeseeeeeeneeeeeseeeseneeeesneeeseaes 7 6 TxReady TxEmpty status representation 0 0 eeesceeeeeeeeeeseeeeeeneeeseneeeneaeees 7 6 DMA Mode Interrupt Enable field representation A 7 8 DMA Mode Interrupt Enable field representation s es 7 11 JTAG Port Summaty oder Aun tik at Ais Hee abt et 9 13 JTAG Connector Signals AAA 9 14 JTAG HE et EE 9 15 Boundary Scan Chain 2ic ccheiil lin areca 9 16 Operator Precedente yiurai ie et teenie eee a 10 6 Extended Mn
522. r instruction is privileged and execution synchronizing Architecture Note This instruction is part of the PowerPC Operating Environment Architecture Instruction Set 10 109 mispr Move To Special Purpose Register mtspr SPRN RS 31 RS SPRF 467 0 6 11 21 31 SPRN lt SPRF SPRFo SPR SPRN lt RS The contents of register RS are placed into the SPR specified by the SPRF field If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e SPR SPRN Invalid Instruction Forms e Reserved fields Programming Note The SPR number SPRN specified in the assembler language coding of the mtspr instruction refers to an actual SPR number see Table 11 3 The assembler handles the unusual register number encoding to generate the SPRF field Also see Section 2 11 4 fora discussion of the encoding of Privileged SPRs Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 110 PPC403GA User s Manual mtspr Move To Special Purpose Register Table 10 21 Extended Mnemonics for mtspr Mnemonic mtcdbcr mtctr mtdac1 mtdac2 mtdbsr mtdecr mtesr mtevpr mtiac1 mtiac2 mticcr mticdbdr mtir mtpbl1 mtpbl2 mtpbu1 mtpbu2 mtpit mtpvr mtsprgO mtsprg1 mtsprg2 mtsprg3 mier mtsrr1 mtsrr2 mtsrr3 mttbhi mttblo mttcr mttsr mtxer RS Operands Function Move to special purpose register SPRN Extended mnemoni
523. r of cycles equal to the FAC field The access time is 2 FAC if field RCT 0 or 3 FAC if field RCT 1 The BAC field bits 23 24 specifies burst access wait time This parameter is in effect on any access in which the row address is not specified transfers other than the first while in page mode field PM 1 The period where CAS is active will be extended by a number of cycles equal to the BAC field The access time is 1 BAC Memory and Peripheral Interface 3 39 ACCESS CYCLE RESTRICTIONS If the first access field FAC b 00 then the burst access field BAC will be ignored and treated as b 00 This prevents the use of DRAM specifications where the first access time is 2 cycles and the burst access times are gt 2 cycles For example 2 1 1 1 DRAM specification is allowed but 2 2 2 2 and 2 3 3 3 are not e The PCC field bit 25 controls RAS pre charge which is the minimum time which must be allowed between the deactivation of RAS on one access and the activation of RAS on the next access to the DRAM device When the pre charge parameter is set to 0 the pre charge time is 1 5 cycle and when set to 1 the pre charge will be 2 5 cycles These times are measured from the deassertion of RAS until the earliest time when RAS may be reasserted Note that using Early RAS Mode ERM 1 will reduce the pre charge time by 1 4 cycle e The RAR field bit 26 controls the RAS active time during CAS before RA
524. r respective control registers Asserting an interrupt input on the PPC403GA causes the corresponding bit in the EXISR to be set The contents of the EXISR can be loaded into a general purpose register via the move from device control register mfder instruction The contents of a general purpose register can be written to the EXISR via the move to device control register mtdcr instruction The external interrupt pins may be programmed via the Input Output Configuration Register IOCR as either edge or level triggered and as positive or negative polarity To clear external interrupts that have been programmed as edge triggered the exception handling routine must write a 1 to the corresponding bit in the EXISR using the mtdcr instruction with the reset address For example to clear external interrupt 4 which has been programmed as edge triggered the exception handler must write a 1 to bit 31 of the EXISR using 0x40 as the device control register number To clear external interrupts that have been programmed as level sensitive the exception handling routine must clear the interrupt at the interrupting device All interrupts posted from internal sources are level sensitive Therefore to clear interrupts from the DMA channels the serial port and the JTAG serial port the exception handling routine must clear the corresponding bit in the corresponding status register 6 1 7 Input Output Configuration Register OCH The IOCR is a 32 bit regist
525. rPC implementations 10 100 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family mfdcr Move from Device Control Register Table 10 17 Extended Mnemonics for mfdcr Mnemonic mfbear mfbesr mfbrO mfbr1 mfbr2 mfbr3 mfbr4 mfbr5 mfbr6 mfbr7 mfdmaccO mfdmacc1 mfdmacc2 mfdmacc3 mfdmacr0O mfdmacr1 mfdmacr2 mfdmacr3 mfdmact0 mfdmact1 mfdmact2 mfdmact3 mfdmada0 mfdmada1 mfdmada2 mfdmada3 mfdmasa0 mfdmasa1 mfdmasa2 mfdmasa3 mfdmasr mfexisr mfexier mfiocr RT Operands Function Move from device control register DCRN Extended mnemonic for mfdcr RT DCRN Other Registers Changed Page 10 100 Instruction Set 10 101 mfmsr Move From Machine State Register mfmsr RT 31 RT 83 0 6 Ti 21 RT lt MSR The contents of the MSR are placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC Operating Environment Architecture 10 102 PPC403GA User s Manual 31 mfspr RT SPRN mfspr Move From Special Purpose Register 31 RT SPRF 339 0 6 SPRN lt SPRF SPRFo 4 RT lt SPR SPRN 21 The contents of the SPR specified by the SPRF field are placed into register RT
526. ramming Model Memory and Peripheral Interface DMA Operations Reset and Initialization Interrupts Exceptions and Timers Serial Port Operation Cache Operations Debugging Instruction Set Register Summary Signal Descriptions Alphabetical Instruction Summary Instructions By Category Instruction Timing and Optimization Index HUGE EELELELELCL FH BERBER EEE Overview Programming Model Memory and Peripheral Interface DMA Operations Reset and Initialization Interrupts Exceptions and Timers Serial Port Operation Cache Operations Debugging Instruction Set Register Summary Signal Descriptions Alphabetical Instruction Summary Instructions By Category Instruction Timing and Optimization Index
527. ransfers at the width of the memory device Page crossing is detected internally and the BIU adds the appropriate precharge time and RAS cycle necessay to cross into the next page Page crossing is detected only as the page boudary is approached sequentially from below in steps of byte half word or word size that match the programmed bus width The BIU also handles DRAM refresh holding off external master burst transfers until refresh is completed While an external master has control of the bus the BIU does not monitor for requests to the SRAM that is controlled by the SRAM controller internal to the BIU The BIU places the SRAM control lines in a high impedance state so that external logic or the external master may drive those control lines 1 3 3 DMA Controller The DMA controller provides four independent channels to perform four types of data transfers Buffered DMA transfers data between memory and a peripheral passing the data to a buffer in the BIU and then back out Fly by DMA passes data between memory and a peripheral without passing through the BIU data buffer Memory to memory transfers use the BIU data buffer with the option of device paced memory to memory DMA to interface between memories of varying access times Fly by and memory to memory transfers can operate in burst mode A control register a source address register a destination address register and a transfer count register are associated with each DMA channel Per
528. rd first or sequentially controlled by bit 13 8 2 PPC403GA User s Manual Instructions from BIU Address to BIU Instruction Bypass Path Arrays Address from Fetcher Q3 Q2 Instruction Queue Q1 QO Decode Exe Folded Figure 8 3 Instruction Flow Exe Normal of the bank register Target word first fills start at the requested fullword continue to the end of the block and then wrap around to fill the remaining fullwords at the beginning of the block Sequential fills start at the first word of the cache block and proceed sequentially to the last word of the block The ICU buffers a full four word line from the bus interface unit prior to placing the line into the cache during each fill While the line buffer is filling the ICU may service requests for additional instructions that hit in the cache As the requested instructions are received from the BIU they will be forwarded to the execution unit before the line is filled in the cache if they are currently being requested by the fetcher Once initiated an ICU line fill runs to completion even if the instruction stream branches away from the rest of the line During one clock cycle the cache can send either a single instruction or an aligned doubleword containing two instructions to the execution unit Cache hits are sent as doublewords while instructions arriving by the bypass path are sent as single words The maximum execution rate is two instructions per
529. re however hardware allows software to write to these bits only once Once software has written a 1 to one of these bits that bit remains a 1 until a reset of any type occurs This is to prevent errant code run away code from disabling the Watchdog Reset function Figure 6 19 Timer Control Register TCR 0 1 2 3 WP WRC Watchdog Period 00 217 clocks 01 221 clocks 10 275 clocks 11 229 clocks Watchdog Reset Control 00 No Watchdog reset will occur 01 Core reset will be forced by the Watchdog 10 Chip reset will be forced by the Watchdog 11 System reset will be forced by the Watchdog TCR 2 3 resets to 00 This field may be set by software but only once prior to reset This field cannot be cleared by software 6 36 PPC403GA User s Manual WIE Watchdog Interrupt Enable 0 DisableWDT interrput 1 Enable WDT interrupt PIE PIT Interrupt Enable 0 Disable PIT interrput 1 Enable PIT interrupt 6 7 FP FIT Period 00 29 clocks 01 213 clocks 10 217 clocks 11 221 clocks FIE FIT Interrupt Enable 0 Disable FIT interrput 1 Enable FIT interrupt ARE Auto Reload Enable disables on reset 0 Disable auto reload 1 Enable auto reload 10 31 reserved Interrupts Exceptions and Timers 6 37 6 38 PPC403GA User s Manual l Serial Port Operation This chapter describes th
530. re those on the OPB DMA Operations 4 29 4 55 PW Peripheral Width Transfer Width is the same as Peripheral Width 00 Byte 8 bits 01 Halfword 16 bits 10 Word 32 bits 11 M2M line 16 bytes MeM transfer initiated by software only 6 DAI Destination Address Increment 0 Hold the destination address do not increment 1 Increment the destination address by 1 if the transfer width is one byte 8 bits 2 if the transfer width is a halfword 16 bits or 4 if the transfer width is a word 32 bits after each transfer in the transaction 7 SAI Source Address Increment valid only during memory to memory moves don t care in other modes 0 Hold the source address do not increment 1 Increment the source address by 1 if the transfer width is one byte 8 bits 2 if the transfer width is a halfword 16 bits or 4 if the transfer width is a word 32 bits after each transfer in the transaction 8 CP Channel Priority 0 Channel has low priority for the external or internal bus 1 Channel has high priority for the external or internal bus 9 10 TM Transfer Mode 00 Buffered mode DMA 01 Fly by mode DMA 10 Software initiated memory to memory mode DMA 11 Hardware initiated device paced memory to memory mode DMA 11 12 PSC Peripheral Setup Cycles 00 No cycles for setup time will be inserted during DMA transfers 01 One SysClk cycle of setup
531. reak character generation 1 Enable break character generation PGM Pattern Generation Mode Chip Reset or System Reset clears to 0 0 Disable pattern generation 1 Enable pattern generation Register Summary 11 61 SRRO SRRO see also Section 6 1 2 on page 6 4 SPR 0 29 30 31 Figure 11 44 Save Restore Register 0 SRRO 0 29 Next Instruction Address 30 31 reserved 11 62 PPC403GA User s Manual SRR1 SRR1 see also Section 6 1 2 on page 6 4 SPR ls e T T GR de SS 0 12 13 14 he 17 18 19 20 21 22 23 27 28 29 30 31 CE EE PE Figure 11 45 Save Restore Register 1 SRR1 0 12 reserved 13 WE Wait State Enable 0 The processor is not in the wait state and continues processing 1 The processor enters the wait state and remains in the wait state until an exception is taken or the PPC403GA is reset or an external debug tool clears the WE bit 14 CE Critical Interrupt Enable CE controls these interrupts 0 Critical exceptions are disabled critical interrupt pin 1 Critical exceptions are enabled watchdog timer first time out 15 ILE Interrupt Little Endian MSR ILE is copied to MSR LE when an 0 Interrupt handlers execute interrupt is taken in Big Endian mode 1 Interrupt handlers execute in Little Endian mode 16 EE External Interrupt Enable EE controls these inte
532. red In general the contents of SPRs are undefined after a core chip or system reset The contents of DCRs and MMIO Registers are unchanged after a core reset and undefined after a chip or system reset The exceptions to these rules are shown in the following tables Table 5 2 Contents of Machine State Register After Reset Register Bits Core Reset Chip Reset System Comment Reset MSR 13 0 0 0 Wait State Disabled 14 0 0 0 Critical Interrupts Disabled 15 0 0 0 Interrupt Little Endian 16 0 0 0 External Interrupts Disabled 17 0 0 0 Supervisor Mode 19 0 0 0 Machine Check Interrupt Disabled 28 0 0 0 Protection Disabled 29 0 0 0 Protection Inclusive 31 0 0 0 Little Endian Table 5 3 Contents of Special Purpose Registers After Reset Register Bits Core Reset Chip Reset System Comment Reset DBCR 0 31 0 0 0 DBSR 22 23 01 10 11 Most recent reset DCCR 0 31 0x00000000 0x00000000 0x00000000 Data Cache disabled ESR 0 31 0x00000000 0x00000000 0x00000000 No exception syndromes ICCR 0 31 0x00000000 0x00000000 0x00000000 Instruction Cache disabled PVR 0 31 0x00200011 0x00200011 0x00200011 Processor version The Minor Change Level field last hex digit of the PVR value may change due to minor processor updates Except for the value of this field such changes do not impact this document TCR 203 00 00 00 Watchdog Timer reset disabled TSR 273 Copy of TCR Copy of TCR Copy of TCR
533. register RT Registers Altered e RT e CR CRO ecr a so if Re contains 1 e XER CA SO OV if OE 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 117 nor NOR nor RA RS RB Rc 0 nor RA RS RB Re 1 31 RS RA RB 124 Re 0 6 T 16 21 31 RA lt RS v RB The contents of register RS is ORed with the contents of register RB the ones complement of the result is placed into register RA Registers Altered e RA e CR CRO r cr a so H Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 22 Extended Mnemonics for nor nor Other Mnemonic Operands Function Registers Page Changed not RA RS Compement register 10 118 RA lt RS Extended mnemonic for nor RA RS RS not Extended mnemonic for CR CRO nor RA RS RS 10 118 PPC403GA User s Manual or OR or RA RS RB Rc 0 or RA RS RB Re 1 31 RS RA RB 444 Re 0 6 T 16 21 31 RA lt RS v RB The contents of register RS is ORed with the contents of register RB the result is placed into register RA Registers Altered e RA e CRICRO cr a so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 23 Extended Mnemonics for or or Other M
534. rer i if r 32 then re o0 if r RA A r RB v r Reynaz then GPR r lt 0 if r RA A r RB v r Reynaz then UPP lt MS EA 1 ic i 8 if i 32 then i 0 EA amp EA 1 neon 1 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise A byte count CNT is obtained from XER TBC A series of CNT consecutive bytes in main storage starting with the byte at the effective address are loaded into CEIL CNT 4 consecutive GPRs four bytes per GPR until the byte count is exhausted Bytes are placed into GPRs with the byte having the lowest address loaded into the most significant byte Bit positions to the right of the last byte loaded in the last register used are set to 0 The set of consecutive GPRs loaded starts at register RT continues through GPR 381 and wraps to register 0 loading until the byte count is exhausted which occurs in register ReinaL Register RA is not altered unless RA Rpa which is an invalid form of this instruction Register RB is not altered unless RB Reynay which is an invalid form of this instruction Bytes which would have been loaded into registers RA or RB are discarded If XER TBC is 0 the byte count is 0 and the contents of register RT are undefined If instruction bit 31 contains 1 the contents of CR CRO are undefined 1
535. reset 0110 This code will cause the RAS signal for that bank of DRAM to be acti vated as well as all 4 CAS signals These signals will remain active until either the Refresh Rate field is changed or the Alternate refresh mode bit is reset These three operations will activate the RAS or CAS signals regardless of any DRAM access that are in progress or pending It is up to the code to ensure that no DRAM accesses occur to any DRAM bank if any one bank is in the self refresh mode If a DRAM access does occur while in the Alternate Refresh mode then a Non Configured error will occur Other DRAM banks that are active while one bank is in Self Refresh mode may be attempting to perform refresh cycles These refresh attempts will occur nor mally except that the RAS and CAS signals that are being held active for Self Refresh will continue to be held active without regard for the refresh attempt by the other DRAM bank For a discussion of the behavior of the DRAM control signals during reset and the effect of Self Refresh during reset see Section 5 4 on page 5 5 Memory and Peripheral Interface 3 43 3 7 4 Example of DRAM Connection The following example shows the connections for three banks of DRAM In the example BR7 has been configured as a 32 bit DRAM composed of byte devices BR6 has been configured as 8 bit DRAM BR5 has been configured as 16 bit DRAM composed of byte devices Figure 3 23 illustrates the use of RAS CAS and Data Bus lin
536. rget Extended mnemonic for bcl 10 cr_bit target LR Extended mnemonic for bcla 10 cr_bit target LR 10 21 bdztir cr_bit bdztirl Decrement CTR Branch if CTR 0 AND CRer pit 1 to address in LR E Extended mnemonic for belr 10 cr_bit Extended mnemonic for belrl 10 cr_bit LR 10 32 beq cr_field target beqa beql beqla Branch if equal Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 2 target Extended mnemonic for bca 12 4 cr_field 2 target Extended mnemonic for bel 12 4 cr_field 2 target LR Extended mnemonic for bcla 12 4 cr_field 2 target LR 10 21 B 8 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic beqctr beqctrl Operands cr_field Function Branch if equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 2 Other Registers Changed Extended mnemonic for bectrl 12 4 cr_field 2 LR Page 10 28 beqIr beaIrl cr_field Branch if equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 2 Extended mnemonic for belrl 12 4 cr_field 2 LR 10 32 bf bfa bfl bfla cr_bit target Branch if CH pit 0 Extended mnemonic for bc 4 cr_bit target Extended mnemonic for
537. rms of be As discussed in Section 2 8 2 if s 1 the branch target is in high memory If s 0 the branch target is in low memory Since these are absolute addressing forms there is no reason to treat high and low memory differently Nevertheless for the high memory case the standard prediction is taken and for the low memory case the standard prediction is not taken BO 4 is the prediction reversal bit If BO 4 0 then the standard prediction will be applied If BO 4 1 then the reverse of the standard prediction will be applied For those cases in Table 2 6 where BO 4 y it is permissible for software to reverse the standard prediction This should only be done when the standard prediction is likely to be wrong Note that for the branch always condition reversal of the standard prediction is not allowed PowerPC Architecture specifies that PowerPC assemblers will provide a means for the programmer to conveniently control branch prediction For any conditional branch mnemonic a suffix may be added to the mnemonic to control prediction as follows Predict branch to be taken 2 28 PPC403GA User s Manual Predict branch to be not taken For example bectr will cause BO 4 to be selected appropriately to force the branch to be predicted taken 2 9 Speculative Fetching The following is an explanation of the PPC403GA pre fetching mechanism and the situations which software needs to be aware of to protect against errant acc
538. rocess in this example had paired Iwarx with any store other than stwex then the reservation bit would not have been cleared in the asynchronous process and the code above would have overwritten the semaphore 10 90 PPC403GA User s Manual lwarx Load Word and Reserve Indexed Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 91 Iwbrx Load Word Byte Reverse Indexed Iwbrx RT RA RB 31 RT RA RB 534 0 6 11 16 21 31 EA lt RB RA O RT lt MS EA 3 1 MS EA 2 1 MS EA 1 1 MS EA 1 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The word at the effective address is byte reversed the least significant byte becomes the most significant byte the next least significant byte becomes the next most significant byte and so on The resulting word is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields 10 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 92 PPC403GA User s Manual lwz Load Word and Zero Iwz RT
539. rrupts 0 Asynchronous exceptions are disabled non critical external DMA 1 Asynchronous exceptions are enabled serial port JTAG serial port programmable interval timer fixed interval timer 17 PR Problem State 0 Supervisor State all instructions allowed 1 Problem State limited instructions available 18 reserved 19 ME Machine Check Enable 0 Machine check exceptions are disabled 1 Machine check exceptions are enabled 20 21 reserved 22 DE Debug Exception Enable 0 Debug exceptions are disabled 1 Debug exceptions are enabled 23 27 reserved 28 PE Protection Enable 0 Protection exceptions are disabled 1 Protection exceptions are enabled 29 PX Protection Exclusive Mode 0 Protection mode is inclusive as defined in Section 2 10 on page 2 33 1 Protection mode is exclusive as defined in Section 2 10 on page 2 33 Register Summary 11 63 SRR1 cont 30 reserved 31 LE Little Endian 0 Processor executes in Big Endian mode 1 Processor executes in Little Endian mode 11 64 PPC403GA User s Manual SRR2 SRR2 see also Section 6 1 3 on page 6 5 SPR 0 29 30 31 Figure 11 46 Save Restore Register 2 SRR2 0 29 Next Instruction Address 30 31 reserved Register Summary 11 65 SRR3 SRR3 see also Section 6 1 3 on page 6 5 SPR RS ne rR el T E 2 0 12
540. rs before interrupting a burst to insure that line fills are not interrupted To a bus master a page cross or a refresh will appear as an extended delay between XACK occurrences a bus master does not need to have explicit knowledge of these events Memory and Peripheral Interface 3 55 The following figure illustrates an external master burst write data flows from the external master to DRAM Cycle 10 11 12 13 14 15 SysClk XREQ BSEL RAS CASO CASO CAS1 CAS1 CAS2 CAS2 CAS3 CAS3 Pre Ext Bus Master Chg HoldReq HoldAck DMAR3 XREQ RW FONTOS m E Aum UE DMAA3 KACK J NLS NLS NASA NNAS TAE WBEO A4 WBE1 A5 A629 A WBE2 A30 WBE3 A31 DO 31 L Go E DRAM control AMuxCAS RASn CAS0 3 DRAMOE DRAMWE Notes 1 XSize0 1 11 indicates a burst transfer at the width of the DRAM device 2 The burst is terminated in cycle 12 by deasserting the XREQ signal A burst may also be terminated by deasserting either XSize0 or XSize1 Note that the number of data transfers is equal to the number of XREQs plus one Bank Register Settings Seq Line Early Bus External RAS CAS Page First Burst Pre chg Refresh Refresh Fills RAS Width Mux Timing Mode Access Access Cycles RAS Rate Bit 13 Bit14 Bits 15 16 Bit17 Bit 18 Bit20 Bit 21 22 Bit 23 24 Bit 25 Bit 26 Bits 27 30 x x 10 1
541. rt interrupts When one of these interrupts occurs the bit corresponding to the interrupt is set in the EXISR Interrupts Exceptions and Timers 6 9 Figure 6 8 shows the EXISR bit definitions CIS oh D I SRI S JRIS DOIS D2IS E0IS E2IS E4IS EE E 10 11 112 26 27 29 30 31 6 8 5 sts CS Ss pais Se Edis Figure 6 8 External Interrupt Status Register EXISR CIS Critical Interrupt Status 0 No interrupt pending from the critical interrupt pin 1 Interrupt pending from the critical interrupt pin 1 3 reserved SRIS Serial Port Receiver Interrupt Status 0 No interrupt pending from the serial port receiver 1 Interrupt pending from the serial port receiver STIS JRIS Serial Port Transmitter Interrupt Status 0 No interrupt pending from the serial port transmitter 1 Interrupt pending from the serial port transmitter JTAG Serial Port Receiver Interrupt Status 0 No interrupt pending from the JTAG serial port receiver 1 Interrupt pending from the JTAG serial port receiver JTIS JTAG Serial Port Transmitter Interrupt Status 0 No interrupt pending from the JTAG serial port transmitter 1 Interrupt pending from the JTAG serial port transmitter DOIS DMA Channel 0 Interrupt Status 0 No interrupt pending from DMA Channel 0 1 Interrupt pending from DMA Channel 0 D1IS DMA Channel 1 Interrupt Status 0 No interrup
542. ruction There is an exception to the rule regarding the branch to CTR LR if there is a betr blr instruction just past one of the interrupt causing or interrupt returning instructions sc rfi or rfci the fetcher does not prevent speculatively fetching past these instructions In other words these interrupt causing and interrupt returning instructions are not considered by the fetcher when deciding whether to predict down a branch path Instructions after an rfi for example are considered to be on the determined branch path To understand the implications of this situation consider the code sequence handler aaa bbb rfi subroutine bctr When executing the interrupt handler the fetcher doesn t recognize the rfi as a break in the program flow and speculatively fetches the target of the betr which is really the first instruction of a subroutine that has not been called Therefore the CTR may contain an invalid pointer To protect against such a pre fetch the software should insert an unconditional branch hang b just after the rfi This will prevent the hardware from pre fetching the wrong target of the betr Consider also the above code sequence except the rfi instruction is replaced by an sc instruction The purpose of the system call is to get the CTR initialized with the appropriate value for the betr to branch to upon return from the system call It is undesirable to use the same technique as rfi since the sc handl
543. ruction Set 10 137 stbx Store Byte Indexed stbx RS RA RB 31 RS RA RB 215 0 6 11 16 21 31 EA lt RB RA O MS EA 1 e RS 24 31 An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The least significant byte of register RS is stored into the byte at the effective address in main storage If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 138 PPC403GA User s Manual sth Store Halfword sth RS D RA 44 RS RA D 0 6 11 16 31 EA lt EXTS D RA O MS EA 2 lt RS 16 31 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The least significant halfword of register RS is stored into the halfword at the effective address in main storage Registers Altered e None Architecture Note This instruction is part of the PowerPC Use
544. rupt from External Interrupt 0 pin enabled 28 E1IE External Interrupt 1 Enable 0 Interrupt from External Interrupt 1 pin disabled 1 Interrupt from External Interrupt 1 pin enabled 11 36 PPC403GA User s Manual EXIER cont 29 E2lE External Interrupt 2 Enable 0 Interrupt from External Interrupt 2 pin disabled 1 Interrupt from External Interrupt 2 pin enabled 30 E3IE External Interrupt 3 Enable 0 Interrupt from External Interrupt 3 pin disabled 1 Interrupt from External Interrupt 3 pin enabled 31 EAIE External Interrupt 4 Enable 0 Interrupt from External Interrupt 4 pin disabled 1 Interrupt from External Interrupt 4 pin enabled Register Summary 11 37 EXISR EXISR see also Section 6 1 6 on page 6 9 CIS SRIS JRIS DOIS D2IS ere DCR EQIS Cas E4IS 6 8 10 11 12 oji sl 26 27 29 30 31 Ss ode 5 7 ele sis Figure 11 24 External Interrupt Status Register EXISR 28 el S eds 0 CIS Critical Interrupt Status 0 No interrupt pending from the critical interrupt pin 1 Interrupt pending from the critical interrupt pin 1 3 reserved 4 SRIS Serial Port Receiver Interrupt Status 0 No interrupt pending from the serial port receiver 1 Interrupt pending from the serial port receiver 5 STIS Serial Port Transmitter Interrupt Status 0
545. rupt is enabled TCR 4 1 and MSR CE is enabled then interrupt 1 1 Cause Watchdog reset action specified by TCR 2 3 Copy pre reset TCR 2 3 into TSR 2 3 The controls described in the above table imply three different modes of operation that a programmer might select for the Watchdog timer Each of these modes assumes that TCR 2 3 has been set to allow processor reset by the Watchdog facility 1 Always take the Watchdog interrupt This is the mode described in the above text 1 Clear TSR 1 in the interrupt handler 6 34 PPC403GA User s Manual 2 Never use TSR O 2 Always take Watchdog interrupt when available but avoid when possible Assumes either that a recurring code loop of reliable duration exists outside the interrupt handlers or that a FIT interrupt handler is operational 1 Clear TSR 0 to 0 in loop or in FIT handler To clear TSR 0 write a 1 to TSR O and to any other bits that are to be cleared with 0 in all other bit locations 2 Clear TSR 1 in WDT handler not an expected event 3 Never take the Watchdog interrupt Assumes that a recurring code loop of reliable duration exists outside the interrupt handlers or that a FIT interrupt handler is opera tional This method only guarantees one Watchdog period before reset occurs 1 Clear TSR 1 in the loop or in FIT handler 2 Never use TSR O 6 3 6 Timer Status Register TSR The TSR may be accessed for read or for write t
546. rwritten by subsequent error events until BESR is cleared by software On instruction fetching errors and DMA errors the address of the error will be placed in the BEAR and the description of the error will be placed in the BESR assuming that these registers are not locked by the prior occurrence of a Data Machine Check How ever information placed in the BEAR and BESR because of errors during instruction fetching or during DMA transactions is not locked in those registers and will be over written if any subsequent error occurs The contents of the BESR can be loaded into a general purpose register via the move from 6 14 PPC403GA User s Manual device control register mfdcr instruction Figure 6 11 shows the BESR bit definitions aes Gs HEEN E 31 DMES H Figure 6 11 Bus Error Syndrome Register BESR 0 DSES Data Side Error Status 0 No data side error 1 Data side error DMES DMA Error Status 0 No DMA operation error 1 DMA operation error RWS Read Write Status 0 Error operation was a Write 1 Error operation was a Read 3 4 ET Error Type 5 31 reserved 00 Protection violation write to Read Only bank or read from Write Only bank 01 Access to a non configured bank 10 Active level on bus error input pin 11 Bus time out 6 1 10 Bus Error Address Register BEAR The Bus Error Address register is a 32 bit register which contains the address of the a
547. ry B 5 Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bdnzir Operands bdnzirl Function Decrement CTR Branch if CTR 0 to address in LR Extended mnemonic for bclr 16 0 Other Registers Changed Extended mnemonic for belrl 16 0 Page 10 32 bdnzf cr_bit target bdnzfa bdnzfl bdnzfla Decrement CTR Branch if CTR 0 AND CR pit 0 Extended mnemonic for bc 0 cr_bit target Extended mnemonic for bca 0 cr_bit target Extended mnemonic for bcl 0 cr_bit target LR Extended mnemonic for bcla 0 cr_bit target LR 10 21 bdnzfir cr_bit bdnzfirl Decrement CTR Branch if CTR 0 AND CR pit 0 to address in LR Extended mnemonic for bclr 0 cr_bit Extended mnemonic for bclrl 0 cr_bit LR 10 32 bdnzt cr_bit target bdnzta bdnztl bdnztla Decrement CTR Branch if CTR 0 AND CRe pit 1 Extended mnemonic for bc 8 cr_bit target Extended mnemonic for bca 8 cr_bit target Extended mnemonic for bcl 8 cr_bit target LR Extended mnemonic for bcla 8 cr_bit target LR 10 21 B 6 PPC403GA User s Manual Table B 4 Extended Mnemonics for PPC403GA cont Mnemonic bdnztir bdnztirl Operands cr_bit Function Decrement CTR Branch if CTR 0 AND CR pit 1 to address in LR Extended mnemonic for bclr 8 cr_bit
548. ry cont Mnemonic bir birl Operands Function Branch unconditionally to address in LR Extended mnemonic for bclr 20 0 Other Registers Changed Extended mnemonic for belrl 20 0 LR Page 10 32 bit bita bitl bitla cr_field tar get Branch if less than Use CRO if cr_field is omitted Extended mnemonic for be 12 4 cr_field 0 target Extended mnemonic for bca 12 4 cr_field 0 target Extended mnemonic for bel 12 4 cr_field 0 target LR Extended mnemonic for bcla 12 4 cr_field 0 target LR 10 21 blitctr bltctrl cr_field Branch if less than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 0 Extended mnemonic for bectrl 12 4 cr_field 0 LR 10 28 bitir bitirl cr_field Branch if less than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 0 Extended mnemonic for belrl 12 4 cr_field 0 LR 10 32 Alphabetical Instruction Summary A 11 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic bne Operands cr_field tar get bnea bnel bnela Function Branch if not equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 2 target Other Registers Changed Extended mnemonic for bca 4 4 cr_field 2 target
549. s not in general required for the same number of address bits to be transferred in each portion Assuming that the Bank Register of the PPC403GA has been configured for Internal Multiplex field IEM 0 the PPC403GA will multiplex the internal address bits a6 a31 onto the external address pins A11 A29 as shown in Table 3 6 Table 3 6 Multiplexed Address Outputs PPC403GA Logical Addr Logical Addr Pin Name During RAS During CAS 29 a22 a31 A28 a21 a30 A27 a20 a29 A26 a19 a28 A25 a18 a27 A24 a17 a26 A23 a16 a25 A22 a15 a24 A21 a14 a23 A20 a13 a22 A19 a12 a21 A18 a13 a12 A17 a12 att A16 a11 a10 A15 a10 a9 A14 a9 a8 A13 a8 a7 A12 a7 a6 Alt a6 xx Memory and Peripheral Interface 3 45 The above information has been combined with bus width and DRAM size to produce Table 3 7 through Table 3 9 which explicitly define how to connect the PPC403GA to a wide variety of DRAMs The tables show the external address pins of the PPC403GA the pins of the memory device to which they should be wired and the logical address bit carried on each line in both the RAS and CAS cycles There are separate tables for 8 bit 16 bit and 32 bit bus width as defined in Bank Register field BW Table 3 7 DRAM Multiplex for 8 bit Bus Meg Meg Meg Meg 1 2 4 8 16 32 64 PPC403GA DRAM Addr Logical Addr Logic
550. s DMACC0 DMACC3 sses 11 27 DMA Channel Control Registers DMACRO DMACR3 seese 11 28 DMA Count Registers DMACTO DMACTS3 ecceesceeestesseeeeereeeeeeeneeeeeeeees 11 30 DMA Destination Address Registers DMADA0 DMADA3 ese 11 31 DMA Source Address Registers DMASA0 DMASAS eeceeeeeeteeeeteeeee 11 32 DMA Status Register DMASR A 11 33 Exception Syndrome Register ESR ccescesceeeseeeeeseneeseeeeeeeseeeeeeeeneeeas 11 34 Exception Vector Prefix Register EVPR A 11 35 External Interrupt Enable Register EXIER eeseeeeseeeeseeeeesneeeeeneeereneees 11 36 External Interrupt Status Register EXISR ecceeeceeeceeeeeseeeeeeeeeeeeeneeees 11 38 General Purpose Register RO R31 eceeeceeeeeeeeeeeeeeeeeeeeeeeeeeeeaeeteneeeaeees 11 40 Instruction Address Compare IAC1 IAC2 oe eeeeceeeeeeeceeeteeeeeeeeneeteaeeeneeeaaee 11 41 Instruction Cache Cacheability Register ICCR eescesceeseeeseteteeeneeeeaee 11 42 Instruction Cache Debug Data Register ICDBDR AA 11 44 Input Output Configuration Register IOCR c ceeeeeceseeseeeeeteeteeeeeeeeeaee 11 45 Link Register ER iieii esses chs Wives ae eae ee 11 47 Machine State Register MP 11 48 Protection Bound Lower Register PBL1 PBL2 AA 11 50 Protection Bound Upper Register PBU1 PBU2 AA 11 51 Programmable Interval Timer PIT eessessseeeeesneeeeeneeeeeneeeeesneeeeeeeeseeees 11 52 Processor Version Register PVR csscsessseeeesser
551. s The index is the contents of register RB The base address is 0 if the RA field is 0 and is the contents of register RA otherwise If the cache block at the effective address is marked as modified stored into the cache block is copied back to main storage and then marked invalid in the data cache If the cache block is not marked as modified it is simply marked invalid in the data cache If the data block at the effective address is in the data cache the operation is performed whether or not the effective address is marked as cacheable in the DCCR If the data block at the effective address is not in the data cache no operation is performed If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Note The debf instruction is considered a load operation with respect to protection and does not cause a protection exception Debugging Note This instruction is considered a write with respect to data address compare DAC debug exceptions See Chapter 9 for more information about PPC403GA on chip debug facilities Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture 10 50 PPC403GA User s Manual dcbi Data Cache Block Invalidate debi RA RB 31 RA RB 470 0 6 11 16 21 31 EA lt RA 0 RB DCBI EA An effective address is formed by adding an index to a base a
552. s master The signals shown in Figure 3 2 assume that the PPC403GA is the bus master See Section 3 9 External Bus Master Interface and Figure 3 24 for signal usage when an external master is involved Block data movement under the control of the PPC403GA DMA Controller still utilizes the BIU with the PPC403GA as bus master Chapter 4 DMA Operations and Figure 4 1 describe the DMA signals and show their relation to the BIU and its signals 3 2 PPC403GA User s Manual Bus Interface Unit _ A6 A29 gt DO D31 e R W Common Signals I gt Error A BootW rn BusError OE p WBE0 A4 c p WBE1 A5 Bank Register 1 p WBE2 A30 SRAM ROM fie sec __y WBE3 A31 Peripheral Signals Lal Ready Bank Register 3 LB CS0 CS3 Bank Register 0 Bank Register 2 LB CS4 RAS3 Le CS5 RAS2 p CS6 RAS1 Bank Register 5 a CS7 RASO DRAM Signals and Bank Regisiere CAS0 CAS3 Common Chip Selects gt DRAMWE Bank Register 7 p DRAMOE p AMuxCAS Bank Register 4 Figure 3 2 Grouping of External BIU Signals 3 2 Access Priorities The BIU is the single pathway to external memory for a number of potentially competing memory requests For example the fetcher via the instruction cache ICU may be attempting to read instructions from memory while the data cache DCU is attempting to store data into memory While both of these things are occurring the DRAM
553. s to from memory will be accessed using the memory burst parameters Transfers continue in burst mode until DMAR is deasserted or until there is a higher priority request The features of Fly By Burst Mode are summarized in the following e Continuous burst up to 64k words e Additional peripheral signal DMADXFER for burst transfers The output DMADXFER is multiplexed with the BusReq output signal If the HoldAck signal is active the BusReq signal is gated to the output If the HoldAck signal is inactive then the DMADXFER sig nal is gated to the output DMADXFER is active in the last cycle of each transfer hence it is active continuously during single cycle transfers DMADXFER must be qualified with the DMAA signal by the external peripheral since DMADXFER will be activated in the last cycle of all trans fers not just DMA transfers DMADXFER when ORed with the processor input clock SysClk yields an appropriate signal to indicate that data has been latched on writes to memory or that data is available to be latched on reads from memory 4 14 PPC403GA User s Manual e Transfers from Peripheral to Memory e Peripheral drives data bus while DMAA is active DMAA can remain active for mul tiple transfers e DMADXFER ORed with SysClk is active during one cycle to indicate to the peripheral when one transfer is complete and the next one starts The peripheral provides new data for the next transfer in the following cyc
554. s 1 6 External Interfaces to DRAM SRAM ROM and UO 1 6 BIRTOKOT ENIE O E T TTT 1 7 DMA Interlace sienna a a a a a N 1 7 On Chip Peripheral Bus Interface A 1 7 External Bus Master Interface ccessccecessneeeseeeeeeeeceneeeeeeeneeeeeneeeeseeeeseseereneieetens 1 8 DMA Opreegung 1 8 Asynchronous Interrupt Controller A 1 9 Serial POM eiert dee elas Fl ieee en E eel ee 1 9 Reie de 1 10 Data Typa Siint ees EE Denies ceentea dest eves a A cs di livai ween eee 1 10 Register Set Summary a e a sthatl ets ateatiadey savers peicerechagna aa 1 10 General Purpose Registers AAA 1 10 Special Purpose Registers SPR AAA 1 11 Machine State Register AAA 1 11 Condition Registers csc aki deed ee ile 1 11 Device Control Registers AAA 1 11 Addressing Mode S ue cen cane le ee iA Aen Sel 1 11 Programmilhg MOGED iiscedacddunseceweine dinadaanieviiveadendd ucvieiueuiwisdauiiaas 2 1 ChapterOverview EET Aen dds odacipa sass tacauscs jess iaadscndesaachaacesvscebaanaives dave saee 2 1 Memory Organization and Addressing ccccceceeeseeeeeeeeeeeeeeeeeneeseaeeeaeeseaeesaeetsaeeteeeenaeenaaes 2 2 Double Mappinig EE E TTT 2 2 Supported Memeni dee eet hd Rechte ea et e AR 2 3 Memory Map Cacheability Regions sssssseeseeseeeseserseieersernsirstrntinstnnttnstnntnnnnnennenneen ena 2 3 PPC4OSGA Register Set neniioniinirm na e e o aa ne 2 5 General Purpose Registers AA 2 5 Special Purpose Registers snis nie eet alee ee eee tia 2 5 Gount Regis
555. s Signals There are 7 Trace Status signals TSO TS6 which are active high outputs from the PPC403GA They are designed to be sampled on the rising edge of the processor clock 9 8 1 2 Trace Status Connector A 20 pin male 2x10 header connector is suggested for connecting to the Trace Status port This connector definition matches the requirements of the RISCTrace feature of RISCWatch used with logic analyzers from Hewlett Packard and Tektronix The connector is shown in Figure 9 5 The connector should be placed as close as possible to the PPC403GA to ensure signal integrity SIGNAL NC SysClk NC NC NC NC TSO TS2 TS4 TS6 PROCESSOR LABEL NC CLK1 D14 D12 D10 D8 D6 D4 D2 DO 9 12 PPC403GA User s Manual 11 13 15 17 19 LABEL CLK2 D15 D13 D11 D9 D7 D5 D3 D1 GND 3M Part Number 3592 6002 or equivalent Figure 9 5 Trace Status Connector NC NC NC NC NC NC TS1 TS3 TS5 GND 9 8 2 IEEE 1149 1 Test Access Port JTAG The IEEE 1149 1 Test Access Port commonly called JTAG Joint Test Action Group is an architectural standard which is described in IEEE standards document 1149 1 The standard provides a method for accessing internal facilities on a chip using a four or five signal interface The JTAG port was originally designed to support scan based board testing The JTAG port has been enhanced to allow for the attachment of a debug tool s
556. s are always transferred in sequential order regardless of the state of the SLF field All packing and unpacking of bytes or halfwords within a word are always transferred in sequential order regardless of the state of the SLF field e The ERM field bit 14 alters the timing of when RASn becomes active In Early RAS Mode ERM 1 RASn becomes active approximately 1 4 cycle after address valid while in the standard ERM 0 mode RASn becomes active approximately 1 2 cycle after address valid Early RAS Mode provides more row address access time for the DRAM device to enable the first transfer of a DRAM burst 3 38 PPC403GA User s Manual Related to the ERM field usage is the usage of IOCR DRC bit 26 of the IOCR If DRC 1 values from the data bus are latched on the rise of CAS which provides a longer access time than the standard DRC 0 mode This provides more time for data to arrive from memory on every transfer first and all burst transfers of a read Both of these timing enhancements are used to provide maximum DRAM access time The use of these enhancements is illustrated for single transfers in Figure 3 15 on page 3 29 and in Figure 3 16 on page 3 30 and for burst transfers in Figure 3 20 on page 3 34 and in Figure 3 20 on page 3 34 The BW field bits 15 16 controls the width of bank accesses If the BW field is b 00 the bank is assumed to have an 8 bit data bus b 01 indicates a 16 bit data bus b
557. s book describes the PPC403GA device architecture programming model external interfaces internal registers and instruction set This book contains the following chapters Conventions The following is a brief list of notational conventions frequently used in this manual Also see Section 10 2 and Section 10 3 Active_Low An overbar indicates an active low signal Ox1f Hexadecimal numbers 0b1001 Binary numbers FLD A named field FLDp A bit in a named field RA RS A general purpose register GPR RA The contents of a GPR About This Book XXV RA O The contents of a GPR or the value 0 REG A bit in a named register REGp p A range of bits in a named register REGpp A list of bits by number or name in a named register REG FLD A field of a named register CRe Lp The field in the condition register pointed to by a field of an instruction 24s The sign bit is replicated sign extended 24 times XX Bit positions which are don t cares Related Publications The following publications contain related information e PowerPC 403GA Data Sheet MPR403DSU 02 To obtain copies of this publication call the IBM PowerPC Literature Center at 800 POWERPC e PowerPC Architecture Customer Reorder Number 52G7487 To obtain copies of this publication call the IBM Advanced Workstation Division Customer Fulfillment Center at 800 IBM MIRS xxvi PPC403GA User s Manual Overview This chapter presents the IB
558. s complete and the next one starts For transfer rates of one transfer per cycle DMADXFER remains active throughout the transfer CASO 142 O DRAM Column Address Select 0 CASO is used with byte 0 of all DRAM banks CAST 143 0 DRAM Column Address Select 1 CAS is used with byte 1 of all DRAM banks CAS2 144 O DRAM Column Address Select 2 CAS2 is used with byte 2 of all DRAM banks 12 2 PPC403GA User s Manual Table 12 1 PPC403GA Signal Descriptions cont Signal Name Pin UO Type Function CAS3 145 O DRAM Column Address Select 3 CAS3 is used with byte 3 of all DRAM banks CINT 36 l Critical Interrupt To initiate a critical interrupt the user must maintain a logic 0 on the CINT pin for a minimum of one SysClk clock cycle followed by a logic 1 on the CINT pin for at least one SysClk cycle CSO 155 O SRAM Chip Select 0 Bank register 0 controls an SRAM bank CS0 is the chip select for that bank CS1 154 O SRAM Chip Select 1 Same function as CSO but controls bank 1 CS2 153 O SRAM Chip Select 2 Same function as CSO but controls bank 2 CS3 152 O SRAM Chip Select 3 Same function as CSO but controls bank 3 CS4 RAS3 151 O Chip Select A DRAM Row Address Select 3 When bank register 4 is config ured to control an SRAM bank CS4 RAS3 functions as a chip select When bank register 4 is configured to control a DRAM bank CS4 RAS3 is the row
559. s decided dynamically depending on other pending BIU operations first and then on ranking of the channels within the DMA controller High Priority Class Channel 0 Decreasing Priority Highest priority for Channel 1 external bus Channel 2 Channel 3 Low Priority Class Channel 0 Decreasing Priority Lowest priority for Channel 1 external bus Channel 2 Channel 3 Figure 4 16 DMA Transfer Priorities 4 26 PPC403GA User s Manual 4 2 10 Interrupts For each DMA channel the DMA Channel Control Register DMACR is used to initialize the DMA channel and enable DMA interrupts As shown in Figure 4 17 below DMACR CIE 1 will enable DMA interrupts for DMA channel n Each channel enabled in its DMACR can generate interrupts for end of transfer terminal count errors or chaining For any DMA channel for which interrupts are enabled interrupts will occur in the following circumstances e Channels with chaining Channel_X_Interrupt Channel_X_Interrupt_Enable amp TC_Enable amp Transfer_Count 0 OR EOT Active amp EOT_Chain_Mode Disabled OR Channel_X_Error OR Channel_X_Chaining_ Status e Channels without chaining Channel_X_Interrupt Channel_X_Interrupt_Enable amp TC_Enable amp Transfer_Count 0 OR EOT Active A EOT_Chain_Mode Disabled OR Channel_X_Error All DMA interrupts are presented to the processor as EXT
560. s empty 0 Transmitter Shift Register is full TSR is reset to 0 when a new character is trans 1 Transmitter Shift Register is empty ferred from the SPTB into the SPTSR and remains reset as characters are transmitted 7 reserved 11 56 PPC403GA User s Manual SPRB SPRB see also Section 7 3 5 on page 7 16 MMIO Figure 11 39 Serial Port Receive Buffer SPRB 0 7 Received Data Register Summary 11 57 SPRC SPRC see also Section 7 3 6 on page 7 16 MMIO ER SS o 1 2 3 4 5 7 DME PME Figure 11 40 Serial Port Receiver Command Register SPRC 0 ER Enable Receiver For the serial port receiver to operate ER must 0 Disable receiver be set to 1 If ER is reset to 0 the serial port 1 Enable receiver receiver is disabled no data is shifted into the are active SPRSR and no serial port receiver interrupts 1 2 DME DMA Mode Interrupt Enable 00 DMA is disabled RBR interrupt is disabled 01 DMA is disabled RBR interrupt is enabled 10 DMA is enabled Receiver is source for DMA channel 2 11 DMA is enabled Receiver is source for DMA channel 3 3 EIE Error Interrupt Enable 0 Receiver error interrupt disabled 1 Receiver error interrupts enabled 4 PME Pause Mode Enable 0 RTS is controlled by software 1 RTS is controlled by hardware 5 7 reserved 11 58 PPC403GA User s Manual SPRGO0 SPRG3 SPRGO SPRG3 see also Section 2
561. s to 0x7000 0000 to Ox77FF FFFF are non cacheable while both data and instruction accesses to 0xF000 0000 to OxF7FF FFFF are cacheable To access external memory hardware one of the Bank Registers must be programmed Suppose for this example that one megabyte of external SRAM memory has been defined to the PPC403GA at locations from 0x7000 0000 to 0x700F FFFF and there fore also accessible as 0xF000 0000 to OxFOOF FFFF by programming Bank Register BR1 appropriately That would produce a Chip Select signal CS1 on any external access to addresses in that one megabyte range Note that accesses to these addresses may not produce Chip Select if the address is cacheable because the access may be satisfied internally to the PPC403GA by the cache Suppose that only part of the one megabyte range is populated by normal program memory from which one would read instructions and read and write data Cacheable access is correct and normal for such memory so it would be accessed using addresses in the OxF000 0000 to OxFOOF FFFF range Suppose further that part of the one megabyte range is occupied by memory mapped hardware of some type or by shared memory In such cases it is mandatory that Chip Select occurs so that accesses reach the actual hardware not a cache image of the hardware Therefore non cacheable access is appropriate using addresses in the 0x7000 0000 to Ox700F FFFF range PPC403GA User s Manual The program can interleave access
562. se address is 0 if the RA field of the instruction is 0 and is the contents of register RA otherwise The cache is indexed by a field of the effective address Both lines in the associated congruence class are invalidated whether or not they match the effective address The operation specified by this instruction is performed whether or not the effective address is marked as cacheable in the DCCR If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Note Execution of this instruction is privileged This instruction is used in the power on reset routine to invalidate the entire cache tag array before enabling the cache using the DCCR A series of decci instruction should be executed one for each congruence class Then cacheability can be enabled in the DCCR Because this instruction does not refer to a particular effective address but rather to a broad congruence class of addresses the instruction cannot cause a protection exception Debugging Note This instruction simply specifies a congruence class of addresses and will not cause data address compare DAC debug exceptions See Chapter 9 for more information about PPC403GA on chip debug facilities Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not
563. sed exclusively from the cache This is accomplished by organizing data such that it uni formly uses address bits 23 27 minimizing the use of data with congruent addresses C 2 5 Instruction Cache Usage Recognize the size and structure of the instruction cache so that code may be orga nized to minimize cache misses For the instruction cache any two addresses which are the same in address bits 22 27 but which differ in address bits 0 21 are called congruent Address bits 28 31 define the 16 bytes within a line which is the minimum size object which is brought into the cache Two congruent lines may be present in the cache simultaneously accessing a third congruent line will cause the removal from the cache of one of the two lines previously there Continually moving new code into the cache is time consuming since it occurs at the speed of external memory Much faster execution occurs if blocks of code can be accessed exclusively from the cache This is accomplished by organizing code such that frequently accessed blocks of code uniformly use address bits 22 27 minimizing the use of code with congruent addresses C 2 6 Dependency Upon CR GA For CR setting instructions of categories Arithmetic Logical Compare and the mterf instruction Put two instructions between a CR setting instruction and a Branch instruction that uses a CR bit in the CR field being set by the CR setting instruction For CR setting instructions of
564. served 16 31 Chained Count Register Summary 11 27 DMACRO DMACR3 DMACRO DMACRS3 see also Section 4 3 1 on page 4 29 DCR CE TD PW SAI TM PWC PHC TCE BME TCD ZZ 4 4 yy oi ell slelsle 9 pl 12 13 18 19 21 22 23 24 25 26 27 28 31 ei d DAI CP eh us e d Figure 11 16 DMA Channel Control Registers DMACRO DMACR3 0 CE Channel Enable 0 Channel is disabled 1 Channel is enabled for DMA operation 1 CIE Channel Interrupt Enable 0 Disable DMA interrupts from this channel to the processor 1 All DMA interrupts from this channel end of transfer terminal count reached are enabled 2 TD Transfer Direction Valid only for buffered mode and fly by mode don t care in memory to memory mode 0 Transfers are from memory to peripheral 1 Transfers are from peripheral to memory 3 PL Peripheral Location 0 Peripheral is external to the PPC403GA 1 Peripheral is internal to PPC403GA internal peripherals are those on the OPB 4 55 PW Peripheral Width Transfer Width is the same as Peripheral Width 00 Byte 8 bits 01 Halfword 16 bits 10 Word 32 bits 11 M2M line 16 bytes MeM transfer initiated by software only 6 DAI Destination Address Increment 0 Hold the destination address do not increment 1 Increment the destination address by 1 if the transfer width is one byte 8 bits 2 if the transfer width is a halfword
565. signed CR CRO mullwo RT lt prodga 63 XER SO OV mullwo CR CRO XER SO OV nand RA RS RB NAND RS with RB 10 116 Place answer in RA nand CR CRO B 36 PPC403GA User s Manual Table B 6 Arithmetic and Logical Instructions cont Other Mnemonic Operands Function Registers Page Changed neg RT RA Negative twos complement of RA 10 117 RT RA 1 neg CR CRO nego XER SO OV nego CR CRO XER SO OV nor RA RS RB NOR RS with RB 10 118 Place answer in RA nor CR CRO or RA RS RB OR RS with RB 10 119 Place answer in RA or CR CRO orc RA RS RB OR RS with RB 10 120 Place answer in RA orc CR CRO ori RA RS IM OR RS with 160 IM 10 121 Place answer in RA oris RA RS IM OR RS with IM 160 10 122 Place answer in RA subf RT RA RB Subtract RA from RB 10 155 RT RA RB 1 subf CR CRO subfo XER SO OV subfo CR CRO XER SO OV subfc RT RA RB Subtract RA from RB 10 156 RT RA RB 1 subfc Place carry out in XER CA CR CRO subfco XER SO OV subfco CR CRO XER SO OV subfe RT RA RB Subtract RA from RB with carry in 10 157 RT lt RA RB XER CA subfe Place carry out in XER CA CRICRO subfeo XER SO OV subfeo CR CRO XER SO O
566. some or all of the contents of RS into CR as specified by FXM field mask 4 FXMbg 4 FXMy4 Il I FXMs 4 FXMz CR lt RS A mask v CR a mask Other Registers Changed Page 10 105 mtbear mtbesr mtbr0O mtbr1 mtbr2 mtbr3 mtbr4 mtbr5 mtbr6 mtbr7 mtdmaccO mtdmacc1 mtdmacc2 mtdmacc3 mtdmacr0 mtdmacr1 mtdmacr2 mtdmacr3 mtdmact0O mtdmact1 mtdmact2 mtdmact3 mtdmada0 mtdmada1 mtdmada2 mtdmada3 mtdmasa0 mtdmasa1 mtdmasa2 mtdmasa3 mtdmasr mtexisr mtexier mtiocr RS Move to device control register DCRN Extended mnemonic for mtdcr DCRN RS 10 107 mtdcr DCRN RS Move to DCR from RS DCR DCRN RS 10 107 mtmsr RS Move to MSR from RS MSR lt RS 10 109 Alphabetical Instruction Summary A 27 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic mtcdbcr mictr mtdac1 mtdac2 mtdbsr mtdcecr mtesr mtevpr mtiac1 mtiac2 mticcr mticdbdr mtlr mtpbl1 mtpbl2 mtpbu1 mtpbu2 mtpit mipvr mtsprgO mtsprg1 mtsprg2 mtsprg3 mier mtsrr1 mtsrr2 mtsrr3 mitbhi mttblo mttcr mttsr mtxer Operands RS Function Move to special purpose register SPRN Extended mnemonic for mtspr SPRN RS Other Registers Changed Page 10 110 mtspr SPRN RS Move to SPR from RS SPR SPRN lt RS 10 110 mulhw RT RA RB mulhw Multiply RA and RB signed Place h
567. spr mtspr Writing to the PIT using mtspr simultaneously writes to a hidden reload register Reading the PIT using mfspr returns the current PIT contents there is no mechanism to read the content of the hidden reload register When written to a non zero value the PIT begins decrementing A PIT event occurs when a decrement occurs on Interrupts Exceptions and Timers 6 31 a PIT count of one When the PIT event occurs the following things happen 1 2 3 The If the PIT is in auto reload mode TCR 9 1 the PIT reloads with the last value that was written to the PIT using a mtspr instruction The decrement from one immediately causes the reload an intermediate PIT content of zero does not occur If the PIT is not in auto reload mode TCR 9 0 decrement from one simply causes a PIT content of zero Timer Status Register TSR bit 4 is set If enabled by Timer Control Register TCR bit 5 and MSR EE a PIT Interrupt is taken See Section 6 2 9 for details of register behavior under the PIT interrupt interrupt handler will be expected to reset TSR 4 via software This is done by writing a word to TSR using mtspr with a 1 in bit 4 and any other bits that are to be cleared and 0 in all other bits The write data to the status register is not direct data but a mask A 1 causes the bit to be cleared and a 0 has no effect Forcing the PIT to 0 using the mtspr instruction will NOT cause the PIT interrupt howeve
568. ss RA lt EA 10 94 lwzux RT RA RB Load word from EA RA 0 RB and place in RT RT MS EA 4 Update the base address RA e EA 10 95 lwzx RT RA RB Load word from EA RA 0 RB and place in RT RT MS EA 4 10 96 stb RS D RA Store byte RS o4 31 in memory at EA RA 0 EXTS D 10 135 stbu RS D RA Store byte RS 24 31 in memory at EA RA O EXTS D Update the base address RA e EA 10 136 stbux RS RA RB Store byte RS o4 31 in memory at EA RA O RB Update the base address RA e EA 10 137 stbx RS RA RB Store byte RS 24 31 in memory at EA RA 0 RB 10 138 sth RS D RA Store halfword RS 16 31 in memory at EA RA 0 EXTS D 10 139 Instructions By Category B 31 Table B 5 Data Movement Instructions cont Mnemonic sthbrx Operands RS RA RB Function Store halfword RS 16 31 byte reversed in memory at EA RA 0 RB MS EA 2 lt RS 24 31 Il RS 16 23 Other Registers Changed Page 10 140 sthu RS D RA Store halfword RS 16 31 in memory at EA RA O EXTS D Update the base address RA e EA 10 141 sthux RS RA RB Store halfword RS 16 31 in memory at EA RA O RB Update the base address RA lt EA 10 142 sthx RS RA RB Store hal
569. ss This protection mechanism is intended solely for hardware protec tion the exception caused is an asynchronous imprecise Machine Check This mech anism has nothing to do with the software Protection mechanism implemented using the Bounds registers It is mentioned here only to indicate that the PPC403GA does have hardware read and write protection to critical devices Programming Model 2 33 e The MSR contains a bit to enable the bounds protection mechanism the PE bit When this bit is a 0 protection is disabled and R W access is enabled for ALL of memory e The MSRI PE bit is automatically reset upon any interrupt giving the interrupt handler access to all of memory e At processor reset the values of the MSR PX and the MSR PE bit are 0 as are the rest of the exception enable bits in the MSR e Protection Exceptions cause precise errors and interrupt to vector offset 0x0300 The protection violation is recognized before the instruction is executed and the execution is suppressed SRRO contains the address of the suppressed instruction and the DEAR has the value of the excepting data address 2 10 1 Application to Data Cache Instructions In addition to describing Protection as it applies to data cache instructions this section also describes the DAC Data Address Compare debug events as they apply to data cache instructions See chapter 9 for further information on PPC403GA debugging facilities Architecturally the ins
570. ssed from memory instead addresses at the branch target will be accessed Therefore placing an unconditional branch just prior to the start of a sensitive address space for example at the end of amemory area that borders an I O device will guarantee that sequential fetching will not occur into that sensitive area 2 9 2 6 Suggested Location of Memory Mapped Hardware The dual mapped SRAM regions as discussed in Section 2 2 1 are illustrated in Table 2 7 The system designer has the option of mapping all of his I O devices and all of his ROM and SRAM anywhere into these regions The BIU bank registers break the SRAM region into pieces ranging in size from 1MB to 64MB All 8 BIU banks could be programmed as 1MB banks inside one 128MB region or they can be mixed matched as desired Obviously only two 64MB banks could be mapped into one of the 128MB regions Table 2 7 SRAM Mapping 0x7000 0000 0x77FF FFFF ICCR DCCR bit 14 dual mapped as 128 Mbyte Region 1 0xF000 0000 OxF7FF FFFF ICCR DCCR bit 30 AND 0x7800 0000 Ox7FFF FFFF ICCR DCCR bit 15 dual mapped as 128 Mbyte Region 2 OxF800 0000 OxFFFF FFFF ICCR DCCR bit 31 One way to avoid the problem of cacheable instruction fetches colliding with I O devices meant to be accessed as non cacheable would be to put all ROM SRAM code devices in the 128MB Region 2 and put all I O devices in the 128MB Region 1 This allows for 128MB of actual SRAM us
571. starting address is NOT word aligned the Error bit is set for that channel and no transfer occurs Figure 4 19 DMA Destination Address Registers DMADA0 DMADA3 0 31 Memory address for transfers between memory and peripheral Destination address for memory to memory transfers The contents of the DMA Destination Address Register can be accessed via the move to from device control register mtdcr mfdcr instructions 4 3 4 DMA Source Chained Address Register DMASA0 DMASA3 The DMA Source Chained Address Register is a 32 bit register which is only used in memory to memory move mode for any channel or when chaining has been enabled in buffered or fly by mode In memory to memory move mode the DMA Source Chained Address Register contains the source memory address for the next transfer If chaining is enabled via the chaining enable bit in DMA Channel Control Register the DMA Source Chained Address Register contains the address which is loaded into the DMA Destination Address register when the terminal count is reached In memory to memory mode if DMACR SAI 1 the DMASA is incremented by 1 2 or 4 depending on the Transfer Width Peripheral Width If the Transfer Width is Byte the address is always incremented by 1 If the Transfer Width is Halfword and the starting 4 34 PPC403GA User s Manual address is halfword aligned the address is incremented by 2 If the Transfer Width is Halfword and the s
572. synch op DCRs should be considered to belong to the peripherals of the processor DCRs can be considered analogous to memory mapped registers in that their context is managed in a manner similar to memory contents Finally the architecture specifically allows for the Machine Check exception to be exempted from the context synchronization control This means that it is possible for an instruction that is encountered prior in the instruction stream to the context synch op to subsequently cause a Machine Check exception after the context synch op and addi tional instructions have completed Here are a few specific scenarios which illustrate the application of the caveats to the context synchronization requirements described in 3 above Programming Model 2 39 5 A Instruction sequence STORE non cachable to address XYZ isync XYZ instruction In this sequence the isyne does not guarantee that the XYZ instruction will be fetched after the STORE has occurred to memory Thus there is no guarantee that the XYZ instruction will have the old value or the new STORE d value B Instruction sequence STORE non cachable to address XYZ isync MTDCR to remove memory bank in BIU In this sequence there is no guarantee that the STORE will occur through the BIU prior to the mtder changing the BIU Bank Configuration Register such that the STORE ends up causing a machine check due to a non configured address error As an example of what
573. t Mnemonic bgtctr Operands cr_field bgtctrl Function Branch if greater than to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 12 4 cr_field 1 Other Registers Changed Extended mnemonic for bectrl 12 4 cr_field 1 LR Page 10 28 bgtir cr_field bgtirl Branch if greater than to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 12 4 cr_field 1 Extended mnemonic for belrl 12 4 cr_field 1 LR 10 32 ble cr_field tar get blea blel blela Branch if less than or equal Use CRO if cr_field is omitted Extended mnemonic for be 4 4 cr_field 1 target Extended mnemonic for bca 4 4 cr_field 1 target Extended mnemonic for bel 4 4 cr_field 1 target LR Extended mnemonic for bcla 4 4 cr_field 1 target LR 10 21 blectr cr_field blectrl Branch if less than or equal to address in CTR Use CRO if cr_field is omitted Extended mnemonic for bectr 4 4 cr_field 1 Extended mnemonic for bectrl 4 4 cr_field 1 LR 10 28 blelr cr_field blei A 10 Branch if less than or equal to address in LR Use CRO if cr_field is omitted Extended mnemonic for belr 4 4 cr_field 1 Extended mnemonic for belrl 4 4 cr_field 1 PPC403GA User s Manual LR 10 32 Table A 1 PPC403GA Instruction Syntax Summa
574. t ILE Interrupt Little Endian 0 Interrupt handlers execute MSR ILE is copied to MSR LE when an interrupt is taken in Big Endian mode 1 Interrupt handlers execute in Little Endian mode External Interrupt Enable 0 Asynchronous exceptions are disabled 1 Asynchronous exceptions are enabled EE controls these interrupts non critical external DMA serial port JTAG serial port programmable interval timer fixed interval timer Problem State 0 Supervisor State all instructions allowed 1 Problem State limited instructions available 18 reserved 19 ME Machine Check Enable 0 Machine check exceptions are disabled 1 Machine check exceptions are enabled 20 21 reserved 22 DE Debug Exception Enable 0 Debug exceptions are disabled 1 Debug exceptions are enabled 23 27 reserved 28 PE Protection Enable 0 Protection exceptions are disabled 1 Protection exceptions are enabled 29 PX Protection Exclusive Mode 0 Protection mode is inclusive as defined in Section 2 10 on page 2 33 1 Protection mode is exclusive as defined in Section 2 10 on page 2 33 30 reserved 31 LE Little Endian 0 Processor executes in Big Endian mode 1 Processor executes in Little Endian mode The contents of SRRO and SRR1 can be loaded into general purpose registers via the move from special purpose register mfspr instruction The contents of general p
575. t can be performed are described below Each type of reset may be generated internal to the chip by a debug tool the watchdog timer or a specific sequence of code System Reset may also be initiated external to the chip via the RESET signal Core Reset Resets the processor core including the data and instruction caches The reset does not alter the DMA Controller Bus Interface Unit or Serial Port configurations The contents of external DRAM is preserved since refreshes con tinue during the reset Chip Reset Resets the entire chip including the core caches DMA Controller Bus Interface Unit and Serial Port The contents of external DRAM is not preserved since refreshes stop during and after the reset System Reset Resets the entire chip with the same effect as Chip Reset In addition if the system reset is generated internal to the chip the RESET signal is driven active for a minimum of three clock cycles Logic external to the chip is required to maintain the active level on the RESET pin for a total of at least eight clock cycles Reset and Initialization 5 1 5 2 Processor State After Reset Table 5 1 describes the processor configuration after a core chip or system reset Table 5 1 Processor Configuration After a Reset Chip Resource Chip Reset or System Reset Configuration Core Reset Configuration DMA Channels Disabled Channels Disabled EOT TC Configured as EOT EOT TC Configured as EO
576. t has gone inactive of the SPHS 1 cs CTS Input Inactive Error To reset the CS bit the application software 0 CTS input is active must store a 1 in this bit location at the address 7 1 CTS input has gone inactive of the SPHS 2 7 reserved 7 14 PPC403GA User s Manual 7 3 4 Serial Port Line Status Register SPLS The SPLS reflects the status of the serial port receiver and transmitter and it reports errors detected in a received character The bits in the SPLS are reset to 0 by writing a 1 to the bit positions using a store instruction Writing a 0 to a bit position does not affect the bit value Figure 7 7 shows the SPLS bits ane OE LB a D A 6 7 3 5 d pe ror Figure 7 7 Serial Port Line Status Register SPLS 0 RBR Receive Buffer Ready Reset by hardware when received data is read 0 Receive buffer is not full from the SPRB into a GPR using a load instruc 1 Receive buffer is full tion or during chip reset can be reset by soft ware 1 FE Framing Error Must be reset by software 0 No framing error detected 1 Framing error detected 2 OE Overrun Error Must be reset by software 0 No overrun error detected 1 Overrun error detected 3 PE Parity Error Must be reset by software 0 No parity error detected 1 Parity error detected 4 LB Line Break Must be reset by software 0 No line break detected 1 Line break detected 5 TBR Tra
577. t main memory 2 34 PPC403GA User s Manual external memory is being written is considered to be the event of interest 2 10 2 Application to String Instructions Table 2 8 Handling of Dcache Instructions Possible Instruction Possible Debug Data Address Compare Protection Violation decci no no dcbz when enabled for dacWrite yes dcbtst when enabled for dacRead if cacheable no dcbt when enabled for dacRead if cacheable no dcbst when enabled for dacWrite no dch when enabled for dacWrite yes dcbf when enabled for dacWrite no The stswx instruction with the string length equal to zero XER TBC field is a no op The Iswx instruction with the string length equal to zero will alter the RT contents with undefined data as allowed by the architecture Neither stswx nor Iswx with zero length will cause a debug data address compare since storage is not accessed by these instructions Also the stswx will not cause a bounds protection error when the the TBC field is zero 2 10 3 Protection Bound Lower Register PBL1 PBL2 0 19 20 31 Figure 2 11 Protection Bound Lower Register PBL1 PBL2 0 19 Lower Bound Address address bits 0 19 20 31 reserved Programming Model 2 35 CH 2 10 4 Protection Bound Upper Register PBU1 PBU2 0 19 20 31 Figure 2 12 Protection Bound Upper Register PBU1 PBU2 0 19 Upper Bound Address address bits 0 19
578. t pending from DMA Channel 1 1 Interrupt pending from DMA Channel 1 10 D2IS DMA Channel 2 Interrupt Status 0 No interrupt pending from DMA Channel 2 1 Interrupt pending from DMA Channel 2 11 D3IS DMA Channel 3 Interrupt Status 0 No interrupt pending from DMA Channel 3 1 Interrupt pending from DMA Channel 3 12 26 reserved 27 EOIS External Interrupt 0 Status 0 No interrupt pending from External Interrupt 0 pin 1 Interrupt pending from External Interrupt 0 pin 28 EIS External Interrupt 1 Status 0 No interrupt pending from External Interrupt 1 pin 1 Interrupt pending from External Interrupt 1 pin PPC403GA User s Manual 29 E2ls External Interrupt 2 Status 0 No interrupt pending from External Interrupt 2 pin 1 Interrupt pending from External Interrupt 2 pin 30 E3IS External Interrupt 3 Status 0 No interrupt pending from External Interrupt 3 pin 1 Interrupt pending from External Interrupt 3 pin 31 EAIS External Interrupt 4 Status 0 No interrupt pending from External Interrupt 4 pin 1 Interrupt pending from External Interrupt 4 pin External hardware interrupts are enabled via the External Interrupt Enable Register EXIER The DMA channel interrupts the JTAG serial port interrupts and the serial port interrupts may be enabled via the EXIER and must also be enabled by the interrupt enable bits in thei
579. t significant four bits of the BRDH are implemented The contents of these registers are concatenated to form a 12 bit divisor which is used to derive the frequency at which to transmit and receive data through the SPU The serial port transmitter consists of an eight bit transmit buffer SPTB a parallel to serial shift register SPTSR and a command register SPTC The SPTC contains control information specific to the transmitter such as the transmitter enable DMA mode and interrupt enables line break generation enable pattern generation mode enable and auto handshaking enable Stop Pause on CTS input Data to be transmitted is loaded into the 7 4 PPC403GA User s Manual SPTB until the data is transferred into the SPTSR when transmission begins The transmitter reports SPTSR and SPTB full empty status reflected as TxEmpty and TxReady respectively in the SPLS register The transmitter also provides the status of the handshaking inputs for the SPHS register The serial port receiver consists of an eight bit receive buffer SPRB a serial to parallel shift register SPRSR and a command register SPRC The SPRC contains control information specific to the receiver such as the receiver enable DMA mode and interrupt enables and auto handshaking enable hw sw control of the RTS output When a data byte has been received by the SPRSR provided that no errors were detected it is transferred to the SPRB and SPRB full status reflected in
580. ta Bus illustrated for Write operations Figure 3 5 Parameter Definitions SRAM Single Transfer 3 12 PPC403GA User s Manual SysClk d d ef A6 A2OUl WBE2 A30 WBE3 A31 Valid First Addr Valid Next Addr Valid Next Addr DAN 1 Wait 0 lt FWT lt 15 1 Wait 0 lt BWT lt 3 1 Wait 0 lt BWT lt 3 CSon i i Hold 0 lt TH lt 7 0 1 0 7 Ki D0 D31 9 Valid First Data Valid Next Data Valid Next Data Notes 1 WBE 2 3 are address bits 30 31 if the Bus Width is programmed as Byte or Halfword 2 See Table 3 3 for WBEn signal definition based on Bus Width 3 Data Bus illustrated for Write operations Figure 3 6 Parameter Definitions SRAM Burst Mode Memory and Peripheral Interface 3 13 3 6 1 1 SRAM Read Example Figure 3 7 shows the timing of chip select output enable write byte enables the address bus and the data bus relative to the system clock SysClk for a read cycle from SRAM ROM or peripheral devices Two different accesses are illustrated each with different timing parameters This results from the sharing of the bus by devices defined in different bank registers 2 3 4 5 6 7 WW 9 se 9 WW lt gt gt lt 1 Wait TWT 00011 Hold 01 Wait 00000 Hold 00 A6 A29 l DAN C O CSon 0 CSon 1 CSn TTT Wm emm CSon 0 CSon 1 0 CSon 1 OEon 0 OEon 0 1 OEon
581. taken does not add any extra cycles An branch that is predicted not taken but which actually is taken adds 1 extra clock cycle A branch that is predicted taken but which is actually not taken does not add any cycles except for this case An l cache miss that occurs while fetching the correct instruction adds 4 extra clock cycles 3 memory speed Pre fetch will halt whenever there is a LR CTR update ahead of a branch to the LR CTR and the branch is predicted taken As a result of pre fetch halt a mtlr blr pair or a mtctr bctr pair has a 2 cycle penalty if there are no instructions between String Opcodes Computation of execution time for string instructions requires understanding of data alignment and of the behavior of the string instructions with respect to alignment Illustrated below is an example string of 21 bytes The beginning 3 bytes do not begin on a word address boundary and the final 2 bytes do not end on a word address boundary The PPC403GA handles any unaligned bytes at the beginning of the string as special cases then moves as many bytes as possible in the form of aligned words and finally handles any trailing bytes as special cases PPC403GA User s Manual C 3 5 C 3 6 CE Arrows indicate word boundaries address is an exact multiple of 4 Shaded boxes represent non aligned bytes To determine the execution time of the string instruction first determine the number of word aligned
582. tarting address is NOT halfword aligned the Error bit is set for that channel and no transfer occurs If the Transfer Width is Word and the starting address is word aligned the address is incremented by 4 If the Transfer Width is Word and the starting address is NOT word aligned the Error bit is set for that channel and no transfer occurs The DMA Source Chained Address Register can be accessed via move to from device control register mtdcr mfdcr instructions with the appropriate DCR number Figure 4 20 shows the DMASA bit definitions Figure 4 20 DMA Source Address Registers DMASA0 DMASA3 0 31 Source address for memory to memory transferes Replacement contents for Destination Address for chained transfers 4 3 5 DMA Count Register DMACT0 DMACTS3 The DMA Count Register is a 32 bit register of which only 16 bits are implemented The DMA Count Register contains the number of transfers left in the DMA transaction for its respective channel The maximum number of transfers is 64K and each transfer can be 1 2 or 4 bytes as programmed in the DMA Channel Control Register The maximum count of 64K transfers is programmed by writing a value of 0 to the DMACT The DMA Count Register can be accessed via move to from device control register mtdcr mfdcr instructions using the appropriate DCR number Figure 4 21 shows the DMA Count Register bit definitions Figure 4 21 DMA Count Registers DMACT0 D
583. te R W 13 SLF Sequential Line Fills 0 Line fills are Target Word First 1 Line fills are Sequential 3 22 PPC403GA User s Manual 14 BME Burst Mode Enable For cache line fills and flushes bus master burst 0 Bursting is disabled operations DMA flyby burst and DMA memory 1 Bursting is enabled to memory line burst operations and all packing and unpacking operations 15 16 BW Bus Width 00 8 bit bus 01 16 bit bus 10 32 bit bus 11 Reserved 17 RE Ready Enable 0 Ready pin input is disabled 1 Ready pin input is enabled 18 23 TWT Transfer Wait Wait states on all non burst transfers Used if field BME 0 18 21 FWT First Wait Wait states on first tranfer of a burst Used if field BME 1 22 23 BWT Burst Wait Wait states on non first transfers of a burst Used if field BME 1 24 CSN Chip Select On Timing 0 Chip select is valid when address is valid 1 Chip select is valid one SysClk cycle after address is valid 25 OEN Output Enable On Timing Controls when the data bus goes active 0 Output Enable is valid when for writes as well as reads chip select is valid 1 Output Enable is valid one SysClk cycle after chip select is valid 26 WBN Write Byte Enable On Timing 0 Write byte enables are valid when Chip Select is valid 1 Write byte enables are valid one SysClk cycle after chip select is valid 27 WBF Write Byte Enable Off Timing 0 Write byte enables become inacti
584. te writeability to improve the performance of byte and halfword store operations PPC403GA DCU operations employ a copy back store in strategy to update cached data and maintain coherency with external memory A copy back cache updates only the data cache not external memory during store operations Only data lines that have been modified are flushed to external memory and then only when it is necessary to free up locations for incoming lines Cache flushes are always sequential starting at the first word of the cache block and proceeding sequentially to the end of the block Cache lines are loaded either target word first or sequentially controlled by bit 13 of the bank register Target word first fills start at the requested fullword continue to the end of the block and then wrap around to fill the remaining fullwords at the beginning of the block Sequential fills start at the first word of the cache block and proceed sequentially to the last word of the block The GPRs receive the requested fullword of data immediately upon being received from main storage via a cache bypass mechanism Subsequent requests to the cache line being filled are also forwarded The words are placed into the cache as received and the line is marked valid when the Cache Operations 8 7 fourth word is filled Subsequent load or store instructions that hit in the cache can be serviced during the line fill in cycles in which a word is not being received from the
585. ter CTR sinc nae ee in i a ee eee 2 6 Link Register UR ee iee rees a teen deter cin edd ENEE 2 7 Processor Version Register DVD 2 8 Special Purpose Register General SPRGO SPRG3 amp ccceceesseeeeesteeeesteeessneees 2 8 Fixed Point Exception Register XER A 2 9 Contents v vi Condition Register CH 2 11 CR Fields after Compare Instructions ccceeeceeeseeeeeeeeeeeeeeeeeeseaeeeeeseeeeeseeeeaeetaees 2 12 hetPO Eield 2 eege wii del eee in aie 2 12 Machine State Register AAA 2 13 Device Control Registers AAA 2 14 Memory Mapped Input Output Registers ceeceecceeeeeeeeeeeeeeeeeeseeeeeeeeeeeeeeeeeaeeeeeteas 2 14 JTAG Accessible Registers AAA 2 14 Data Types and Alignment 2 i scccssecresssceseicaieesaccersuaesneesadaanseceeetaranesesceeesiecseacenaacecessastinns 2 15 Alignment for Data Movement Instructions cc eeeeeseeeeeneeeeneeeeeeneeeeseeeeeneeeeseaeeeesaes 2 16 Alignment for Cache Control Instructions c cecceeeceeeeeeeeeeeeeeeeeeeseeeeeeeeeeeeeeneeteaeeenneeeas 2 16 Little Endian dl EE 2 17 Non processor Memory Access in Little Endian A 2 21 Control of Endian Mode a ieee oaaae a aaea a aa S a i aoak 2 22 Jill tee TEE 2 23 Data andinstruction Caches s siiri sair tie ces Sst teen tintin ee cer eset 2 24 Instruction Cache asii geed dei tied eee beatae hatte aye endian eet 2 24 Data Gachen ts efccat TAE atletl As adinstetestaesiatisih tall TESTTE 2 25 Branching CONi OD
586. ter move 10 47 Extended mnemonic for cror bx by by Instruction Set 10 47 crore Condition Register OR with Complement crore BT BA BB 0 6 11 16 21 31 Chor Con WM CRpgg The condition register CR bit specified by the BA field is ORed with the ones complement of the CR bit specified by the BB field the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 48 PPC403GA User s Manual crxor Condition Register XOR crxor BT BA BB 19 BT BA BB 193 0 6 11 16 21 31 CRer lt Con Co The CR bit specified by the BA field is XORed with the CR bit specified by the BB field the result is placed into the CR bit specified by the BT field Registers Altered e CR Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Table 10 16 Extended Mnemonics for crxor Other Mnemonic Operands Function Registers Changed erelr Condition register clear 10 49 Extended mnemonic for crxor bx bx bx Instruction Set 10 49 dcbf Data Cache Block Flush dcbf RA RB 31 RA RB 86 0 6 11 16 21 31 EA lt RA 0 RB DCBF EA An effective address is formed by adding an index to a base addres
587. ternal multiplexer Also as shown in Figure 3 24 the system designer must provide a multiplexer to generate the DRAM row and column address from the address output by the external master The multiplexer is controlled by the AMuxCAS output from the PPC403GA Signals for external bus arbitration are described in the next section HoldReq Le HoldReq FreqO HoldPri Le Priority HoldAck pe HoldAck BusReq DMADXFER B gt BusReq RAN Le R W DMAR3 XREQ lt j XREQ DMAA3 XACK p gt XACK EOT3 TC3 XSize0 OE XSize1 Nl ASIE D0 31 DATA0 31 WBEO A4 e WBE1 A5 Gs A6 29 WBE2 A30 ADDR6 31 WBE3 A31 External Bus Master AMuxCAS Mux Flow direction for address i shown for External Master in control RASO gt CAS0 3 DRAM DRAMWE Bank 0 DRAMOE L PPC403GA Figure 3 24 Sample PPC403GA External Bus Master System Memory and Peripheral Interface 3 49 3 9 1 External Bus Arbitration To gain control of the bus from the PPC403GA the external bus master requests the bus by placing an active level on the PPC403GA HoldReq input The PPC403GA indicates that it has relinquished the bus to the external bus master by placing an active level on the HoldAck output The priority signal HoldPri is used to control bus master HoldReq priority When the HoldPri input is low the bus master HoldReq has the highest priority in arbitration over a load store instruction fetch or DM
588. terrupt Enable bit to 1 Executing the return from critical interrupt instruction rfci restores the contents of the program counter and the MSR from SRR2 and SRR3 respectively and the PPC403GA resumes execution at the address contained in the program counter Table 6 2 Register Settings during Critical Interrupt Exceptions SRR2 Loaded with the address of the next instruction to be executed SRR3 Loaded with the contents of the MSR 6 18 PPC403GA User s Manual Table 6 2 Register Settings during Critical Interrupt Exceptions cont MSR WE 0 PR 0 CE 0 EE 0 ME Unchanged DE 0 PE 0 PX Unchanged PC EVPR 0 15 0x0100 6 2 3 Machine Check Exceptions Machine Check exceptions occur when an error is detected during external bus transfers or when accesses are attempted to non configured addresses After detecting a Machine Check during an instruction access the PPC403GA takes the Machine Check Exception stores the address of the next sequential instruction in SRR2 and places an active signal on the PPC403GA Error pin Simultaneously the current contents of the MSR are loaded into SRR3 Machine Check can occur from either instruction side or data side events See Section 2 13 Interrupts and Exceptions on page 2 43 for a discussion of instruction side behavior The cause of an instruction side check is recorded in the Exception Syndrome Register ESR which does not have to be cleared
589. ters Altered e None Invalid Instruction Forms e Reserved fields Programming Notes Because the debz instruction can establish an address in the data cache without fetching the address from main storage the address established may be invalid with respect to the storage subsystem A subsequent operation may cause the address to be copied back to main storage to make room for a new cache block A storage fault could occur due to the invalid address and a machine check exception If dcbz is attempted to a non cacheable effective address the software alignment exception handler should emulate the instruction by storing zeros to the block in main storage dcbz is treated as a store with respect to memory protection and may cause a protection exception Instruction Set 10 55 dcbz Data Cache Block Set to Zero Debugging Note This instruction is considered a write with respect to data address compare DAC debug exceptions See Chapter 9 for more information about PPC403GA on chip debug facilities Architecture Note This instruction is part of the PowerPC Virtual Environment Architecture 10 56 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family dccci Data Cache Congruence Class Invalidate decc RA RB 0 6 11 16 21 31 EA lt RA 0 RB DCCCI EA An effective address is formed by adding an index to a base address The index is the contents of register RB The ba
590. that DMAA stays active after the first full SysClk cycle DMAA is active For instance the PWC bits have a value of 5 then DMAA is active for six SysClk cycles 19 21 PHC Peripheral Hold Cycles The value 0 7 of these bits determines the number of SysClk cycles between the time that DMAA becomes inactive until the bus is available for the next bus access During this period the address bus the data bus and control signals remain active 22 ETD End of Transfer Terminal Count EOT TC Pin Direction 0 The EOT TC pin is programmed as an end of transfer EOT input 1 The EOT TC pin is programmed as a terminal count TC output When programmed as TC and the terminal count is reached this signal will go active the cycle after DMAA goes inactive 23 TCE Terminal Count Enable 0 Channel does not stop when terminal count reached 1 Channel stops when terminal count reached 24 CH Chaining Enable 0 DMA Chaining is disabled 1 DMA chaining is enabled for this channel 25 BME Burst Mode Enable In all modes except fly by and M2M line burst 0 Channel does not burst to memory must have BME 0 1 Channel will burst to memory 26 ECE EOT Chain Mode Enable ETD must be programmed for EOT 0 Channel will stop when EOT is active 1 If Chaining is enabled channel will chain when EOT is active 27 TCD TC Chain Mode Disable 0 If Chaining is enabled channel will chain when TC reaches zero 1 C
591. that up to four DRAM banks are supported in the DRAM regions If no DRAM is used all eight chip selects can be programmed into the SRAM region 3 4 Table 3 1 SRAM And DRAM Banks Supported Number of Number of DRAM SRAM Banks Banks 4 4 5 3 PPC403GA User s Manual Table 3 1 SRAM And DRAM Banks Supported Number of Number of DRAM SRAM Banks Banks 6 2 7 1 8 0 The BIU contains eight bank registers as shown in Figure 3 2 Each bank register controls a CS or CS RAS signal For example bank register 0 controls CSO bank register 6 controls the shared signal CS6 RAS1 and bank register 7 controls the shared signal CS7 RASO Bank registers 0 3 can control SRAM only Bank registers 4 7 can control DRAM in addition to controlling SRAM For bank registers 4 7 the setting of bit 31 in each bank register determines which type of memory is configured 3 4 Attachment to the Bus Byte wide halfword wide and word wide devices can all be attached to the data bus Regardless of which bank register controls the devices and regardless of whether the devices are SRAM or DRAM the devices share the same address and data bus Different bank registers activate different control lines SRAM or DRAM These control lines which differentiate among separate devices and among types of devices may informally be considered to be a separate control bus As shown in Figure 3 3 devices of different widt
592. the cause of specific exceptions of the machine state upon entering the interrupt handler for those exceptions and of the behavior on return from the interrupt handler Exceptions discussed include Interrupts Exceptions and Timers 6 1 e Reset Exceptions core chip and system on page 6 16 e Critical Interrupt Pin Exception on page 6 18 e Machine Check Exceptions on page 6 19 e Protection Exception on page 6 20 e External Interrupt Exception serial port interrupt JTAG serial port interrupt DMA interrupt or external interrupt pins on page 6 21 e Alignment Error on page 6 22 e Program Exceptions on page 6 23 e System Call on page 6 23 e Programmable Interval Timer on page 6 24 e Fixed Interval Timer on page 6 25 e Watchdog Timer on page 6 26 e Debug Exception on page 6 26 Finally Chapter 6 discusses the PPC403GA timer architecture beginning on page 6 28 Included are details of the associated registers e Time Base TBHI and TBLO on page 6 29 e Programmable Interval Timer PIT on page 6 31 e Fixed Interval Timer FIT on page 6 33 e Watch Dog Timer WDT on page 6 33 e Timer Status Register TSR on page 6 35 e Timer Control Register TCR on page 6 36 6 1 Interrupt Registers 6 1 1 Machine State Register MSR The Machine State Register MSR is a 32 bit register that holds the current context of the PPC403GA If a non critical exception is taken the contents of the MSR
593. the left The result is placed into register RA if register RS contains a negative number and any 1 bits were shifted out of the least significant bit position XER CA is set to 1 otherwise it is set to 0 If bit 26 of register RB contains 1 register RA and XER CA are set to bit 0 of register RS Registers Altered e RA e XER CA e CRICRO cr eo so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 132 PPC403GA User s Manual srawi Shift Right Algebraic Word Immediate srawi RA RS SH Rc 0 srawi RA RS SH Re 1 31 RS RA SH 824 Rc 0 6 T 16 21 31 n amp SH r lt ROTL RS 32 n m lt MASK n 31 s lt RS RA amp r A m v s A m XER CA 4 s A r A m 0 The contents of register RS are shifted right by the number of bits specified in the SH field Bits shifted out of the least significant bit are lost Bit O of register RS is replicated to fill the vacated positions on the left The result is placed into register RA If register RS contains a negative number and any 1 bits were shifted out of the least significant bit position XER CA is set to 1 otherwise it is set to 0 Registers Altered RA e XERI CA e CR CRO ct a so if Re contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 133 srw Shift Right Word
594. the same or larger memory address range say SRAM on BR39 If program was being fetched via BRO then the code must allow for a time interval when both BRO and BR3 are invalid since a machine check would result if both were valid on the same accessed address at the same time A probable way to accomplish this would be for the code to cache itself then disable BRO and then enable BR3 with appropriate settings During the time when both BRO and BR3 were disabled all required memory addresses must already be valid in the cache 5 6 2 Initialization Code Example This section presents an example of initialization code to illustrate the steps that should be taken to initialize the processor before the operating system or user programs are executed It is presented in pseudo code with function calls similar to PPC403GA mnemonics Specific implementations may require different ordering of these sections to ensure proper operation For optimum performance the initialization code should reprogram the bank configuration register for the high memory bank as soon as possible In some systems the high memory bank devices may allow for the bank register configuration to change while the memory is being accessed In this case the initialization code can reprogram the high memory bank immediately There are cases where the memory devices cannot be reprogrammed while they are being accessed In these cases the code to perform the bank reconfiguration must ei
595. the the dispatched instruction 4 e The instructions that can be folded are C 4 3 Fold Blocking Rules For CR Logical and merf Instructions Table C 3 Foldable Instructions Branch b ba bl bla bc bca bel bcla belr belrl bectr bectrl CR Logical crand cror crxor crnand crnor creqv crandc crorc CR Move merf e ACR logical instruction or the mert instruction cannot be folded if any CR Updating Instruction is in DCD C 4 4 Fold Blocking Rules For Branch Instructions e A branch can be folded only if both 1 2 1 the branch direction is known Branch Direction is known if It is an unconditional branch the branch target address is known Instruction Timing and Optimization 2 If the branch is dependent on the CTR for the condition and the instruction in DCD is not a CTR Updating Instruction If the branch is dependent on the CR then any instruction updating the CR field being used cannot be in DCD for e CR Logical Instructions e mcrf and merxr DCD or EXE for e Arithmetic Instructions e Logical Instructions e Extend Sign Instructions e Count Instructions e Rotate and Shift Instructions e Set Clear Bit Instructions e Compare Instructions e mtcrf considered to update ALL CR fields e Special Instructions NOTE If a branch is dependent on both CTR and CR then both conditions 2 and 3 must be met e Branch Target Address is know
596. ther Mnemonic Operands Function Registers Page Changed crand BT BA BB AND bit CRga with CRgp 10 42 Place answer in Cer crandc BT BA BB AND bit CRga with CRgp 10 43 Place answer in CRpr creqv BT BA BB Equivalence of bit Ces with CRgg 10 44 Ce Kand CRga CRepp crnand BT BA BB NAND bit CRga with CRgp 10 45 Place answer in CRpr crnor BT BA BB NOR bit CRga with CRgp 10 46 Place answer in CRpr cror BT BA BB OR bit CRga with CRgp 10 47 Place answer in CRpr crorc BT BA BB OR bit CRga with CRgp 10 48 Place answer in Cer crxor BT BA BB XOR bit CRga with CRgp 10 49 Place answer in Cher merf BF BFA Move CR field CR CRn CR CRm 10 97 where m BFA and n lt BF Instructions By Category B 39 B 8 Branch Instructions The architecture provides conditional and unconditional branches to any storage location The conditional branch instructions test condition codes set previously and branch accordingly Conditional branch instructions may decrement and test the Count Register CTR as part of determination of the branch condition and may save the return address in the Link Register LR The target address for a branch may be a displacement from the current instruction address CIA or may be contained in the LR or CTR or may be an absolute address Table B 8 Branch Instructions Other Mnemonic
597. ther be contained entirely within the instruction cache or in another configured bank Reset and Initialization 5 7 Lag d PPC 403 GA Initialization Pseudo Code OxFFFFFFFC Initial instruction fetch from OxFFFFFFFC ba init_code branch from initial fetch address to init_code init_code Start of initialization psuedo code Ts Configure system memory ZS ZS NOTE ZS If bank 0 memory can be configured while being accessed then start by reconfiguring bank 0 then configure banks 1 7 as necessary j If bank 0 memory cannot be configured while being accessed then start by configuring banks 1 7 as required and then configure bank 0 Bank 0 can be configured by executing bank 0 configuration code in one of the other configured banks or by executing bank 0 configuration code that is guarenteed to be in the cache The example shown below uses another bank to reconfigure bank 0 E i Reconfigure bank 0 if allowed d if configuring bank 0 while accessing bank 0 is allowed rig configure banks 1 7 if they exist d mtdcr BRO bank 0 configuration if Dank 1 exists mtdcr BR1 bank_1_ configuration if bank_2_ exists mtdcr BR2 bank_2_ configuration if Dank 2 exists mtdcr BR3 bank 23 configuration 5 8 PPC403GA User s Manual if bank_4 exists mtdcr BR4 bank_4_configuration if bank_5 exists
598. these Terminating Conditions are detected The channel will stop when the Transfer Count reaches zero AND Terminal Count is enabled AND Chaining is disabled OR Terminal Count is enabled AND TC Chain mode is disabled The channel always sets Terminal Count status whenever TC 0 and the channel does not chain The channel will stop when the EOT is active AND EOT Chain Mode is disabled AND EOT TC Direction is set for EOT The following Special Conditions should be noted Channel does not chain when the Transfer Count 0 If DMACR 27 1 TC Chain Mode Disable the channel will not chain when TC 0 Channel does not stop when the Transfer Count 0 If DMACR 23 0 TC Enable control bit Terminal Count is disabled and the channel will not stop when the Transfer Count 0 The channel will continue to transfer data and the Transfer Count will wrap past zero Channel does not chain when EOT is active If the Chaining Enable bit is not set and the channel is configured to chain when EOT is active the channel will not chain The channel will continue to transfer data until some other condition is met 4 2 8 1 Chaining Example Quick Start of Transfer In this example a normal DMA transfer is initiated and then the chaining operation is set up while the first transfer is in progress This approach minimizes the time required to get data moving If the first block is short then this approach would run the risk that the first transfer woul
599. thhs teres deed ege a athy csi ee aetna dedi et 11 1 General Purpose Register Numbering ecceeeceeeeeeeeeeeeeeeeeeeeaeeeeeeeeaeeseeeeeaeeseaeeneneteatens 11 1 Machine State Register and Condition Register Numbering ceeeeeeeeeeeeeteeeeteeeeeeeees 11 2 Device Control Register Numbering cecceeeeeeeeeeeeeeeeneeeeeeeeaeeeeeeeeaeeseeeeaeeseeeeeseeseaeeeaneteas 11 2 Special Purpose Register Numbering cecceeeeeeeeeeeeeeeeeeeeeeeeeaeeeeeeeeaeeseeeeeeeseaeeeeeeteaeees 11 4 Memory Mapped I O Register Numbering eeceeeceeeeeeeeeeeeeeeeaeeteeeeeeeeseeeeeeeseaeeeeetaas 11 6 Gel A Vu CT 12 1 Alphabetical Instruction Summary ecceeeeeeeeeeeeeeeeeeeeeeeeeeees A 1 Instruction Set and Extended Mnemonics Alphabetical AA A 1 Instructions By Category ccccceeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeneeees B 1 Instruction Set Summary Categories ceceeccececeeeceeeneeeeeeeeeeseaeeseeeeeaeeseaeeeaeessaeeeenetneeees B 1 Instructions Specific to PowerPC Embedded Controllers cccccceeeeeeeeeeeeeeeeeeeeesneeeees B 1 Privileged Instructions lt ni 04 sieic evita vl eed ala iinet B 3 Assembler Extended Mnemonics cceseccecsesceeeseceeesenseseeeeeecneneneneneeseseeeseseseneseneeteaces B 5 Data Movement Instructions eeeeeeeeeeeeeeneeeeeneeeeeneeeeeeneeeesaeeeeeaaeeeseaeeeseaeeeseneeeeseaeeeeeaeees B 29 Arithmetic and Logical Instructions ceecceeeeeeee
600. tions In Table 2 6 z represents a mandatory value of zero and y is a branch prediction option discussed in Section 2 8 5 Table 2 6 Conditional Branch BO Field BO Value 0000y Description Decrement the CTR then branch if the decremented CTR 0 and CR BI 0 0001y Decrement the CTR then branch if the decremented CTR 0 and CR BI 0 001zy Branch if CR BI 0 0100y Decrement the CTR then branch if the decremented CTR 0 and CR BI 1 0101y Decrement the CTR then branch if the decremented CTR 0 and CR BI 1 O11zy Branch if CR BI 1 1z00y Decrement the CTR then branch if the decremented CTR 0 1z01y Decrement the CTR then branch if the decremented CTR 0 1z1zz Branch always Programming Model 2 27 2 8 5 Branch Prediction In the PPC403GA the fetcher attempts to bring instructions from memory which may be slow into the instruction queue where they are immediately available for use in advance of actual need Conditional branches present a problem to the fetcher the branch may be taken or the branch may simply fall through to the next sequential instruction The fetcher must predict which will occur in advance of the actual execution of the branch instruction The fetcher s decision may be wrong in which case time will be lost while the correct instruction is brought into the instruction queue This section discusses how the f
601. to 32 bits by concatenating 24 0 bits to its left The result is placed into register RT If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 75 Iha Load Halfword Algebraic Iha RT D RA 42 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RT lt EXTS MS EA 2 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 if the RA field is 0 and is the contents of register RA otherwise The EA must be halfword aligned a multiple of 2 If it is not it will cause an alignment exception The halfword at the effective address is sign extended to 32 bits and placed into register RT Registers Altered e RT Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 76 PPC403GA User s Manual Ihau Load Halfword Algebraic with Update Ihau RT D RA 43 RT RA D 0 6 11 16 31 EA lt EXTS D RA O RA EA RT lt EXTS MS EA 2 An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA fie
602. to PowerPC Embedded Controllers To meet the functional requirements of processors for embedded systems and real time applications the PowerPC Embedded Controller family defines instructions that are not part of the PowerPC Architecture Instructions By Category B 1 Table B 2 summarizes the PPC403GA instructions specific to the PowerPC Embedded Controller family Table B 2 Instructions Specific to PowerPC Embedded Controllers Mnemonic dccci Operands RA RB Function Invalidate the data cache congruence class associated with the effective address RA O RB Other Registers Changed Page 10 57 dcread icbt RT RA RB RA RB Read either tag or data information from the data cache congruence class associated with the effective address RA 0 RB Place the results in RT Load the instruction cache block which contains the effective address RA O RB 10 58 10 67 iccci RA RB Invalidate instruction cache congruence class associated with the effective address RA O RB 10 68 icread RA RB Read either tag or data information from the instruction cache congruence class associated with the effective address RA O RB Place the results in ICDBDR 10 69 mfdcr mtdcr RT DCRN DCRN RS Move from DCR to RT RT lt DCR DCRN Move to DCR from RS DCR DCRN RS 10 100 10 107 rfci Return from critical int
603. to accept DMA requests from an internal source Setting the Peripheral Location PL bit of the DMACRn to a logic 1 configures DMA channel to accept DMA requests from the serial port 7 2 2 5 Transmitter Interrupts The serial port transmitter interrupts can be generated based on three conditions TxReady TBR or TxEmpty TBR being active in the SPLS register or a handshaking error DIS or CIS is flagged in the SPHS register Each of these conditions have separate interrupt enables in the SPTC 7 8 PPC403GA User s Manual As mentioned in Table 7 5 above setting the DME field of the SPTC to a value of 0b01 enables TxReady interrupt generation Thus an interrupt will be generated whenever the SPTB is ready to be loaded with new data The TIE bit of the SPTC is the enable for generating interrupts based on TxEmpty When TxEmpty and TIE are both ones in the SPU will raise the transmitter interrupt request to the asynchronous interrupt controller unit to indicate that character transmission has completed Similarly the Error Interrupt Enable EIE bit of the SPTC enables interrupt requests when either a DSR or CTS inactive error is flagged indicating that the DSR CTS handshaking signal became inactive during the transmission of a character When a transmitter interrupt request to the asynchronous interrupt controller occurs the Serial Port Transmitter Interrupt Status STIS bit of the External Interrupt Status Register EXISR is set Note how
604. to sensitive devices guarding them from accesses that are not actually required by the program flow Note that for cachable storage the Architecture specifically allows for the accessing of the entire cache block containing the referenced storage even in guarded storage 2 9 2 Speculative Accesses on PPC403GA Primarily due to the fact that there is no memory management unit MMU function on the PPC403GA it does not implement the concept of guarded storage The PPC403GA does allow speculative instruction fetches to be performed to all storage whether cacheable or non cacheable The PPC403GA does not perform out of order execution thus speculative loads are never executed In order to guard against speculative instruction fetches to sensitive devices the system hardware and system software designers need to be aware of a number of details regarding the PPC403GA implementation 2 9 2 1 Pre Fetch Distance from an Unresolved Branch The instruction pre fetcher will speculatively fetch down the predicted branch path either taken or sequential The maximum distance down an unresolved branch path that the fetcher can access is 7 instructions 28 bytes This corresponds to the unresolved branch in the DCD stage of the instruction queue see Section 2 6 on page 2 23 for discussion of the instruction queue with the next 3 instructions in 1Q1 IQ3 and the Instruction Cache Unit ICU requesting the 4th subsequent instruction which is at the start of
605. tor In these cases the exception handling routine must examine specific status registers to determine the exact cause of the exception At the end of the exception handling routine execution of a return from interrupt rfi instruction forces the contents of SRRO and SRR1 to be loaded into the program counter and the MSR respectively Execution then begins at the address in the program counter The four critical exceptions are processed in a similar manner When a critical exception is taken SRR2 and SRR hold the next sequential address to be processed when returning from the exception and the contents of the machine state register respectively At the end of the critical exception handling routine execution of the return from critical interrupt rfci forces the contents of SRR2 and SRR3 to be loaded into the program counter and the MSR respectively Table 2 11 Exception Vector Offsets Offset hex Exception Type Causing Conditions 0100 Critical Interrupt Critical Interrupt pin 0200 Machine Check External bus errors non configured memory errors bank protection violations time outs 0300 Protection Violation Violation of the addresses defined by the protection bound registers 0500 External Interrupt Caused by interrupts from the DMA channels serial port JTAG port and external interrupt pins 0600 Alignment Error Misaligned data accesses and DCBZ to non cacheable addresses 0700 Program Attempted execution of il
606. transfers required Assuming single cycle memory access they require 1 cycle each Next determine the number of non aligned bytes at the beginning of the transfer e 1 or 2 non aligned starting bytes add 1 cycle e 3non aligned starting bytes add 2 cycles Finally determine the number of non aligned trailing bytes e 1 or 2 non aligned trailing bytes add 1 cycle e 3non aligned trailing bytes add 2 cycles Data Cache Loads and Stores Cacheable stores that miss in the D cache take 0 extra cycles Cacheable loads that miss in the D cache take 3 extra cycles 2 memory speed Non cacheable stores take 0 extra cycles Non cacheable loads take 2 extra cycles 1 memory speed Instruction Cache Misses In general when the pre fetch queue is full and instructions are being fetched from cacheable memory there is no penalty The penalty is 1 memory speed hence 0 for single cycle memory If the queue only has one instruction in it at the time of the Lcache miss then a 3 cycle penalty is incurred 2 memory speed When executing instructions from non cacheable memory a 3 cycle penalty 2 memory speed is incurred Instruction Timing and Optimization C 9 C 4 Detailed Folding Rules C 4 1 Instruction Classifications for Folding The discussion which follows will define dependency rules based on these instruction categories CTR Updating Instructions LR Updating Instructions and CR Updating Instructions Thes
607. truction is part of the PowerPC Virtual Environment Architecture 10 52 PPC403GA User s Manual dcbt Data Cache Block Touch debt RA RB 31 RA RB 278 0 6 11 16 21 31 EA lt RA 0 RB DCBT EA An effective address is formed by adding an index to a base address The index is the contents of register RB The base address is 0 when the RA field of the instruction is 0 and is the contents of register RA otherwise If the data block at the effective address is not in the data cache and the effective address is marked as cacheable in the DCCR the block is read from main storage into the data cache If the data block at the effective address is in the data cache or if the effective address is marked as non cacheable in the DCCR no operation is performed If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Programming Notes 10 The debt instruction allows a program to begin a cache block fetch from main storage before the program needs the data The program can later load data from the cache into registers without incurring the latency of a cache miss The debt instruction is considered a load with respect to memory protection and cannot cause a protection exception Debugging Note This instruction is considered a read with respect to data address compare DAC debug exceptions See Chapter 9 for more inform
608. tructions are provided to perform logical operations on CR bits and to test CR bits 1 3 8 5 Device Control Registers Device control registers exist outside the RISC core and contain status and controls for the BIU DMA controller and asynchronous interrupt controller DCRs are accessed using mtdcr and mfder instructions Access to all DCRs is restricted to supervisor mode programs 1 3 9 Addressing Modes The addressing modes of the PPC403GA allow efficient retrieval and storage of data that is closely spaced in memory These modes relieve the processor from repeatedly loading a GPR with an address for each piece of data regardless of the proximity of the data in memory In the base plus displacement addressing mode the effective address is formed by adding a displacement to a base address contained in a GPR The displacement is an immediate field in the instruction In the indexed addressing mode the effective address is formed by adding an index to the base address Both the base address and the index address are held in GPRs The base plus displacement and the indexed addressing modes also have a with update mode In the with update mode the effective address calculated for the current operation is saved in the base GPR and can be used as the base in the next operation Overview 1 11 1 12 PPC403GA User s Manual Programming Model 2 1 Chapter Overview This chapter covers a wide range of topics of potential
609. tructions dcbz and debi are treated as stores since they can change data or cause loss of data by invalidating a dirty line therefore they require bounds protection They are also considered debug data address compares for writes dcbz to a non cacheable address that is bounds protected with a matching debug data address compare is an example of three simultaneous exceptions The handling priority is first debug then protection and finally alignment The decci instruction may also be considered a store since it can change data by invalidating a dirty line however decci is not address specific it affects an entire congruence class Because it is not address specific it will not cause bounds exceptions and will not cause data address compares for writes To restrict possible damage from an instruction which can change data and yet avoids the protection mechanism the decci instruction is privileged Architecturally dcbtst dcbt dcbst dcbf are treated as loads since they do not change data therefore there is no bounds protection on these instructions Flushing or storing a line from the cache is not architecturally considered a store since the store has already been done to update the cache and the debst or debf is only updating the main memory s copy Although debst and debf are architecturally treated as loads they are treated as writes for debug data address compares In a debug environment the fact tha
610. true a TRAP occurs Registers Altered e None Programming Note This instruction is inserted into the execution stream by a debugger to implement breakpoints and is not typically used by application code Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 164 PPC403GA User s Manual twi Trap Word Immediate Table 10 31 Extended Mnemonics for twi Other Mnemonic Operands Function Registers Page Changed tweqi RA IM Trap if RA equal to EXTS IM 10 164 Extended mnemonic for twi 4 RA IM twgei Trap if RA greater than or equal to EXTS IM Extended mnemonic for twi 12 RA IM twgti Trap if RA greater than EXTS IM Extended mnemonic for twi 8 RA IM twlei Trap if RA less than or equal to EXTS IM Extended mnemonic for twi 20 RA IM twigei Trap if RA logically greater than or equal to EXTS IM Extended mnemonic for twi 5 RA IM twigti Trap if RA logically greater than EXTS IM Extended mnemonic for twi 1 RA IM twllei Trap if RA logically less than or equal to EXTS IM Extended mnemonic for twi 6 RA IM twllti Trap if RA logically less than EXTS IM Extended mnemonic for twi 2 RA IM twingi Trap if RA logically not greater than EXTS IM Extended mnemonic for twi 6 RA IM twinli Trap if RA logically not less than EXTS IM Extended mnemonic for
611. ts both interface and core Overview 1 3 Data Bus SRAM ROM Control Address Bus DRAM Control SRAM Controller DRAM Controller On chip d OPB Peripheral Bus Interface Unit Controller H Bus OPB serial 4 Channel gt DMA Controller Instruction Data Cache Cache Execution Unit Interrupt Controller Timers Figure 1 1 PPC403GA Block Diagram 1 3 1 RISC Core The RISC core comprises three tightly coupled functional units the data cache unit DCU the instruction cache unit ICU and the execution unit EXU Each cache unit consists of a data array tag array and control logic for cache management and addressing The EXU consists of general purpose registers GPRs special purpose registers SPRs ALU and multiplier timers instruction decode and the control logic required to manage instruction execution and EXU data flow 1 3 1 1 Execution Unit EXU The EXU handles instruction fetching decoding and execution queue management branch prediction and branch folding The instruction cache unit passes instructions to the queue in the EXU or in the event of a cache miss requests a fetch from external memory through the bus interface unit BIU Data transfers to and from the EXU are handled through the bank of 32 GPRs each 32 bits 1 4 PPC403GA User s Manual wide Load and store instructions move data operands between the GPRs and
612. ts of register RT are undefined if the Rc also contains 1 the contents of CR CRO are undefined Either invalid division operation sets XER OV SO to 1 if the OE field contains 1 Registers Altered e RT e CRICRO cr eo so if Re contains 1 e XER OV SO if OE contains 1 Programming Note The 32 bit remainder can be calculated using the following sequence of instructions divw RT RA RB RT quotient mullw RT RT RB RT quotient x divisor subf RT RT RA RT remainder The sequence does not calculate correct results for the invalid divide operations Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 60 PPC403GA User s Manual divwu Divide Word Unsigned divwu RT RA RB OE 0 Rc 0 divwu RT RA RB OE 0 Rc 1 divwuo RT RA RB OE 1 Rc 0 divwuo RT RA RB OE 1 Rc 1 31 RT RA RB OE 459 Re 0 6 TI T6 21 22 31 RT lt RA RB The contents of register RA are divided by the contents of register RB The quotient is placed into register RT The dividend and the divisor are interpreted as unsigned integers The quotient is the unique unsigned integer that satisfies dividend quotient x divisor remainder If an attempt is made to perform n 0 the contents of register RT are undefined if the Re also contains 1 the contents of CR CRO are also undefined The invalid division operation also sets XER OV SO to 1 if the OE field contai
613. tter is DMA channel 3 destination 3 TIE Transmitter Empty Interrupt Enable 0 Transmitter shift register empty interrupt disabled 1 Transmitter shift register empty interrupt enabled 4 EIE Transmitter Error Interrupt Enable 0 Transmitter shift register error interrupt disabled 1 Transmitter shift register error interrupt enabled 5 SPE Stop Pause on CTS Inactive 0 Pause mode when CTS is inactive 1 Stop mode when CTS is inactive 6 TB Transmit Break 0 Disable break character generation 1 Enable break character generation 7 PGM Pattern Generation Mode Chip Reset or System Reset clears to 0 0 Disable pattern generation 1 Enable pattern generation 7 18 PPC403GA User s Manual Cache Operations The PPC403GA incorporates two internal caches a 2KB instruction cache and a 1KB data cache The instruction cache unit ICU stores instructions to be passed as needed to the instruction queue in the execution unit The data cache unit DCU stores frequently used data blocks to minimize data transfer overhead between the EXU and external memory banks 8 1 Cache Debugging Features To aid in the debug of cache problems special resources are provided For ICU debug the icread instruction and the ICDBDR special purpose register are provided see Section 8 2 4 on page 8 6 For DCU debug the dcread instruction is provided see Section 8 3 4 on page 8 10 Both the icread and the dcread instruct
614. twi 5 RA IM twlti Trap if RA less than EXTS IM Extended mnemonic for twi 16 RA IM twnei Trap if RA not equal to EXTS IM Extended mnemonic for twi 24 RA IM twngi Trap if RA not greater than EXTS IM Extended mnemonic for twi 20 RA IM twnli Trap if RA not less than EXTS IM Extended mnemonic for twi 12 RA IM Instruction Set 10 165 This instruction is specific to the PowerPC Embedded Controller family wrtee Write External Enable wrtee RS 31 RS 131 0 6 11 21 31 MSRIEE lt RS 16 The MSRIEE is set to the value specified by bit 16 of register RS If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e MSRI EE Invalid Instruction Forms e Reserved fields Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations 10 166 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family wrteei Write External Enable Immediate wrteei E 31 E 163 0 6 16 17 21 31 MSR EE lt E The MSRIEE is set to the value specified by the E field If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered MSR EE Invalid Instruction Forms e Reserved fields Architecture Note This instruction
615. uch as the RISCWatch 400 product from IBM Please refer to the IEEE 1149 1 Test Access Port standards document for more information on the JTAG port Table 9 1 JTAG Port Summary JTAG Signals The JTAG port implements the four required JTAG signals TCLK TMS TDI and TDO It does not implement the optional TRST signal JTAG Clock The frequency of the TCLK signal can range from DC up to 1 2 Requirements the frequency of the processor clock JTAG Reset The JTAG debug port logic is reset at the same time as a system Requirements reset When a system reset is performed the JTAG TAP Controller returns to the Test Logic Reset state 9 8 2 1 JTAG Connector A 16 pin male 2x8 header connector is suggested for connecting to the JTAG port This connector definition matches the requirements of the RISCWatch 400 debugger from IBM The connector is shown in Figure 9 6 and the signals are shown in Table 9 2 on page 9 14 The connector should be placed as close as possible to the PPC403GA to ensure signal integrity Debugging 9 13 Note that position 14 does not contain a pin t 1 X X 2 KX X xX X DI P E ate Xx KTE X KEY 15 X 16 ore Figure 9 6 JTAG Connector top view Physical Layout Table 9 2 JTAG Connector Signals Connector PPC403GA Pin vO Signal Description 1 JTAG Test Data Out reserved JTAG Test Data In reserved reserved JTAG Test Clock
616. uction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 19 b Branch b target AA 0 LK 0 ba target AA 1 LK 0 bl target AA 0 LK 1 bla target AA 1 LK 1 18 LI AA LK 0 6 30 31 If AA 1 then LI lt targets 29 NIA lt EXTS LI 20 else LI lt target CIA 29 NIA lt CIA EXTS LI 20 if LK 1 then LR lt CIA 4 The next instruction address NIA is the effective address of the branch The NIA is formed by adding a displacement to a base address The displacement is obtained by concatenating two 0 bits to the right of the LI field and sign extending the result to 32 bits If the AA field contains 0 the base address is the address of the branch instruction which is also the current instruction address CIA If the AA field contains 1 the base address is 0 Program flow is transferred to the NIA If the LK field contains 1 then CIA 4 is placed into the LR Registers Altered e LR if LK contains 1 Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 20 PPC403GA User s Manual bc Branch Conditional be BO Bl target AA 0 LK 0 bca BO Bl target AA 1 LK 0 bel BO Bl target AA 0 LK 1 bcla BO Bl target AA 1 LK 1 16 BO BI BD AA LK 0 6 11 16 30 31 if BO 0 then CTR lt CTR 1 if BO 1 v CTR 0 BOs A BO 1 v Cha BO then
617. umber DCRN specified in the assembler language coding of the mtder instruction refers to an actual DCR number see Table 11 2 The assembler handles the unusual register number encoding to generate the DCRF field Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in 10 PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations Instruction Set 10 107 This instruction is specific to the PowerPC Embedded Controller family mtdcr Move To Device Control Register Table 10 20 Extended Mnemonics for mtdcr Other Mnemonic Operands Function Registers Page Changed mtbear RS Move to device control register DCRN 10 107 mtbesr Extended mnemonic for mtbrO mtdcr DCRN RS mtbr1 mtbr2 mtbr3 mtbr4 mtbr5 mtbr6 mtbr7 mtdmaccO mtdmacc1 mtdmacc2 mtdmacc3 mtdmacrO mtdmacr1 mtdmacr2 mtdmacr3 mtdmact0 mtdmact1 mtdmact2 mtdmact3 mtdmada0 mtdmada1 mtdmada2 mtdmada3 mtdmasa0 mtdmasa1 mtdmasa2 mtdmasa3 mtdmasr mtexisr mtexier mtiocr 10 108 PPC403GA User s Manual mtmsr Move To Machine State Register mtmsr RS 31 RS 146 0 6 11 21 31 MSR lt RS The contents of register RS are placed into the MSR If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e MSR Invalid Instruction Forms e Reserved fields Programming Note The mtms
618. urpose registers can be written to SRRO and SRR1 via the move to special purpose register mtspr instruction 6 1 3 Save Restore Register 2 and 3 SRR2 SRR3 SRR2 and SRR3 are two 32 bit registers which hold the interrupted context of the machine when a critical interrupt occurs Save Restore Register 2 SRR2 is loaded with the 32 bit Interrupts Exceptions and Timers 6 5 effective address of the instruction which was to be executed next at the time the exception occurred Save Restore Register 3 SRR3 is loaded with the contents of the Machine State Register At the end of the exception processing routine executing a return from critical interrupt rte instruction restores the program counter and the machine state register from SRR2 and SRR3 respectively Figure 6 4 shows the SRR2 bit definitions 0 29 30 31 Figure 6 4 Save Restore Register 2 SRR2 0 29 Next Instruction Address 30 31 reserved Figure 6 5 shows the bit definitions for SRR3 sig ILE mR el oe d SG 0 12 13 14 15 16 19 20 21 22 23 27 28 29 30 31 CE EE PE Figure 6 5 Save Restore Register 3 SRR3 0 12 reserved 13 WE Wait State Enable 0 The processor is not in the wait state and continues processing 1 The processor enters the wait state and remains in the wait state until an exception is taken or the PPC403GA is reset or an external debug tool clears the WE bit
619. using a read modify write strategy That is read the register alter desired fields with logical instructions and then write the register 2 3 1 General Purpose Registers The PPC403GA contains 32 General Purpose Registers GPRs each of 32 bits The contents of these registers can be transferred from memory via load instructions and stored to memory via store instructions GPRs are also addressed by most integer instructions See Table 11 1 on page 11 2 for the numbering of the GPRs Figure 2 2 General Purpose Register RO R31 0 31 General Purpose Register data 2 3 2 Special Purpose Registers Special Purpose Registers SPRs are on chip registers that exist architecturally inside the processor core and are part of the PowerPC Embedded Architecture They are accessed with the mtspr move to special purpose register and mfspr move from special purpose register instructions which are defined in Chapter 10 Special purpose registers control the use of the debug facilities the timers the interrupts the protection mechanism memory cacheability and other architected processor resources Table 11 3 on page 11 4 shows the mnemonic name and number for each SPR Programming Model 2 5 The only SPRs that are not privileged are the Link Register LR the Count Register CTR and the Fixed point Exception Register XER All other SPRs are privileged for both read and write See Section 2 11 Privileged Mode Operation on page 2 36
620. ve when chip select becomes inactive 1 Write byte enables become inactive one SysClk cycle before chip select becomes inactive 28 30 TH Transfer Hold Contains the number of hold cycles inserted at the end of a transfer Hold cycles insert idle bus cycles between transfers to enable slow periph erals to remove data from the data bus before the next transfer begins reserved for BRO BR3 For BRO BR3 on a write this bit is ignored on a read a zero is returned 31 SD SRAM DRAM Selection for BR4 BR7 For BR4 BR7 in SRAM configuration 0 DRAM usage 1 SRAM usage this bit must be 1 Memory and Peripheral Interface 3 23 e The BAS field bits 0 7 sets the base address for a SRAM device The BAS field is compared to bits 4 11 of the effective address If the effective address is within the range of a BAS field the associated bank is enabled for the transaction Fields BS and BAS are not independent See Section 3 5 3 on page 3 10 including Table 3 2 Restric tions on Bank Starting Address Multiple bank registers inadvertently may be programmed with the same base address or as overlapping banks An attempt to use such overlapping banks is reported as a Non Configured error to the Data Cache Instruction Cache or DMA Controller which ever originated the access No external access will be attempted This error may result in a Machine Check exception See Section 2 13 1 3 Instruction Machine Check Han dling o
621. whenever the Transfer Count Cs3 0 Terminal count has not been reached in the reaches 0 and the channel does not chain Transfer Count Register for channels 0 3 respectively 1 Terminal count has been reached in the Transfer Count Register for channels 0 3 respectively 4 7 T Channel 0 3 End Of Transfer Status Valid only if EOT TC has been programmed for the EOT func TS3 tion 0 End of transfer has not been requested for channels 0 3 respectively 1 End of transfer has been requested for channels 0 3 respectively 8 11 RIO Channel 0 3 Error Status BIU errors RIS 0 No error Bus Protection 1 Error Non configured Bank Bus Error Input Time out Check DMA errors Unaligned Address 12 CTO Chained Transfer on Channel 0 0 No chained transfer has occurred 1 Chaining has occurred 13 16 IRO Internal DMA Request IR3 0 No internal DMA request pending 1 A DMA request from an internal device is pending 17 20 ERO External DMA Request ER3 0 No external DMA request pending 1 A DMA request from an external device is pending 21 24 CBO Channel Busy CB3 0 Channel not currently active 1 Channel currently active 25 27 CT1 Chained Transfer on Channel 1 3 CT3 0 No chained transfer has occurred 1 Chaining has occurred 28 31 reserved Register Summary 11 33 ESR ESR see also Section 6 1 8 on page 6 13 SPR IMCP IMCB PEI PET oy 4 oiniaiaialsleiz 31
622. with False and True values represented by 0 and 1 respectively by using Condition Register bits to hold these variables instead of using General Purpose Registers Most common operations on Boolean variables can be accomplished using Condition Register Logical instructions An example of such use may be found in Section C 2 2 below C 2 2 CR Logical Instructions for Compound Branches Better or equal performance will always result when one or more Condition Register Logical instructions are used to replace a like number of Conditional Branch instructions in cases where compound conditions are being tested As an example consider code of this form if Var28 Var29 Var30 Var 31 branch to target where Var28 Var31 are Boolean variables maintained as bits 28 31 of the Condition Register with a value of 1 representing True and 0 representing False This might be coded entirely with branches as bt 28 target bt 29 target bt 30 target bt 31 target An equivalent coding using CR Logical instructions would be cror 2 28 29 cror 2 2 30 cror 2 2 31 bt 2 target C 2 3 Floating Point Emulation There are two ways of handling floating point on the PPC403GA The preferred way of handling floating point emulation is via a call interface to subroutines located in a floating point emulation run time library The alternative approach is to write code that uses the PowerPC floating point opcodes The PPC403GA bei
623. xample of such a precise data exception However the architecture makes no statement regarding imprecise exceptions related to stswx with XER TBC 0 The PPC403GA will generate an imprecise exception Machine Check on this instruction under these circumstances The instruction passes all protection bounds checking and the address is passed on to the D cache and the address is cacheable and the address misses in the D cache resulting in a line fill request to the BIU and the address encounters some form of bus error non configured etc Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture Instruction Set 10 147 stw Store Word stw RS D RA 36 RS RA D 0 6 E 16 31 EA lt EXTS D RA O MS EA 4 lt RS An effective address is formed by adding a displacement to a base address The displacement is obtained by sign extending the 16 bit D field to 32 bits The base address is 0 when the RA field is 0 and is the contents of register RA otherwise The EA must be word aligned a multiple of 4 If it is not it will cause an alignment exception The contents of register RS are stored at the effective address Registers Altered e None Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 148 PPC403GA User s Manual stwbrx Store Word Byte Reverse Indexed stwbrx RS RA RB 31 RS RA RB
624. xecutes in Little Endian mode The contents of SRR2 and SRR can be loaded into general purpose registers via the move from special purpose register mfspr instruction The contents of general purpose registers can be written to SRR2 and SRR3 via the move to special purpose register mtspr instruction 6 1 4 Exception Vector Prefix Register EVPR The EVPR is a 32 bit register whose high order 16 bits contain the prefix for the address of the exception processing routines The 16 bit exception vector offsets shown in Table 2 11 are concatenated to the right of the high order 16 bits of the EVPR to form the 32 bit address of the exception processing routine Figure 6 6 shows the EVPR bit definitions 31 Figure 6 6 Exception Vector Prefix Register EVPR 0 15 Exception Vector Prefix Interrupts Exceptions and Timers 6 7 16 31 reserved The contents of the EVPR can be loaded into a general purpose register via the move from special purpose register mfspr instruction The contents of a general purpose register can be written to the EVPR via the move to special purpose register mtspr instruction 6 1 5 External Interrupt Enable Register EXIER This 32 bit register contains enables for the six external hardware interrupts the DMA channel interrupts the JTAG serial port interrupts and the serial port interrupts Setting the bit in this register which corresponds to the interrupt
625. xtended subfze RT RA OE 0 Re 0 subfze RT RA OE 0 Re 1 subfzeo RT RA OE 1 Re 0 subfzeo RT RA OE 1 Re 1 31 RT RA OE 200 Re 6 31 RT lt RA XER CA if RA XER CA gt 292 1 then XER CA lt 1 else XER CA lt 0 The sum of the ones complement of register RA and XER CA is stored into register RT XER CA is set to a value determined by the unsigned magnitude of the result of the subtraction operation Registers Altered e RT e XER CA e CR CRO t e a so if Re contains 1 e XER SO OV if OE contains 1 Invalid Instruction Forms e Reserved fields Architecture Note This instruction is part of the PowerPC User Instruction Set Architecture 10 160 PPC403GA User s Manual sync Synchronize sync 31 598 0 6 21 31 Synchronize System The sync instruction guarantees that instructions initiated by the processor preceding the sync instruction will complete before the sync instruction completes and that no subsequent instructions will be initiated by the processor until after sync completes When sync completes all storage accesses initiated by the processor prior to syne will have been completed with respect to all mechanisms that access storage If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e None Invalid Instruction Forms e Reserved fields Architecture Note Although the e
626. y 1 Dirty 27 V Cache Line Valid 0 Not valid 1 Valid 28 30 reserved 31 LRU Least Recently Used 0 Not least recently used 1 Least recently used If instruction bit 31 contains 1 the contents of CR CRO are undefined Registers Altered e RT 10 58 PPC403GA User s Manual This instruction is specific to the PowerPC Embedded Controller family dcread Data Cache Read Invalid Instruction Forms e Reserved fields Programming Note Execution of this instruction is privileged Architecture Note This instruction is specific to the PowerPC Embedded Controller family it is not described in PowerPC Architecture Programs using this instruction may not be portable to other PowerPC implementations Instruction Set 10 59 divw Divide Word divw RT RA RB OE 0 Rc 0 divw RT RA RB OE 0 Rc 1 divwo RT RA RB OE 1 Rc 0 divwo RT RA RB OE 1 Rc 1 31 RT RA RB OE 491 Re 0 6 T 16 21 22 31 RT lt RA RB The contents of register RA are divided by the contents of register RB The quotient is placed into register RT Both the dividend and the divisor are interpreted as signed integers The quotient is the unique signed integer that satisfies dividend quotient x divisor remainder where the remainder has the same sign as the dividend and its magnitude is less than that of the divisor If an attempt is made to perform x 8000 0000 1 or n 0 the conten
627. y considering a memory mapped UO device with a status register that is automatically reset when it is read Serial ports are an example where reading the receive buffer auto resets the RxRdy bit in the status register In situations such as these if the processor speculatively loads from these registers when an intervening branch or interrupt may take the program flow away from the code containing the load instruction and then back again upon return and re reading the status register the wrong result will be obtained Similarly if the program code itself exists in memory right next to the I O device say code goes from 0x0000 0000 to 0x0000 OFFF and the I O device is at Ox0000 1000 then pre fetching past the end of the code can hit the I O device Another example of a need for guarded storage protection from pre fetching past the end of memory The fetcher will attempt to keep fetching past the last valid address likely getting machine checks on the fetches to invalid addresses While these machine checks do not actually get reported as an exception unless execution is attempted of the instruction at the invalid address some systems may still suffer from the attempt to access such an invalid Programming Model 2 29 address eg an external memory controller may log the error Thus the PowerPC Architecture provides for a mechanism by which the system software can protect those areas of the address space that are mapped
628. y SH n amp SH r ROTL RS 32 n m lt MASK n 31 s lt RS o RA r a m v s A m XER CA lt s Ur A ml CRICRO 10 133 Alphabetical Instruction Summary A 31 Table A 1 PPC403GA Instruction Syntax Summary cont Mnemonic srw Operands RA RS RB srw Function Shift right RS by RB o7 31 ne RB o7 31 r lt ROTL RS 32 n if RB og 0 then m lt MASK n 31 elsem e 220 RA eram Other Registers Changed CRI CRO Page 10 134 srwi RA RS n srwi Shift right immediate n lt 32 RA n 31 e RS o 31 n RA o n1 lt lt 0 Extended mnemonic for rlwinm RA RS 32 n n 31 Extended mnemonic for rlwinm RA RS 32 n n 31 CRICRO 10 126 stb stbu RS D RA RS D RA Store byte RS 24 31 in memory at EA RA 0 EXTS D Store byte RS 24 31 in memory at EA RA O EXTS D Update the base address RA e EA 10 135 10 136 stbux RS RA RB Store byte RS 24 31 in memory at EA RA O RB Update the base address RA e EA 10 137 stbx RS RA RB Store byte RS 24 31 in memory at EA RA 0 RB 10 138 sth RS D RA Store halfword RS 16 31 in memory at EA RA 0 EXTS D 10 139 sthbrx RS RA RB Store halfword RS 46 3 byte reversed in memory at EA RA 0 RB MS EA 2 e RS o4 31 Il RS 16
629. y be represented by two separate address ranges One of these may be set up as cacheable and the other as non cacheable Software may then exercise total control of data behavior by the choice of address used As an example software would access memory mapped hardware as non cacheable but would access frequently used program variables as cacheable The Data Cache does not provide any snooping facilities therefore the application program must make careful use of disabled regions and cache control instructions in order to ensure proper operation of the cache in systems where external devices are capable of updating memory Cache flushing copying data in the cache that has been updated by the processor to main storage and filling loading requested data from main storage into the cache are triggered by Load Store and Cache Control Instructions executed by the processor Cache flushes are always sequential starting at the first word of the cache block and proceeding sequentially to the end of the block Cache lines are loaded either target word first or sequentially controlled by bit 13 of the bank register Target word first fills start at the requested fullword continue to the end of the block and then wrap around to fill the remaining fullwords at the beginning of the block Sequential fills start at the first word of the cache block and proceed sequentially to the last word of the block If the data necessary to satisfy a load instruction is
630. ype of Instruction Machine Check This exception is clearly asynchronous to the actual erroneous memory access it is handled as synchronous with respect to the attempted execution from the erroneous address In the PPC403GA only one exception is handled at any one time If multiple exceptions occur simultaneously they are handled in the priority order shown in Table 2 10 which summarizes the PPC403GA exception priorities their types and their classes Table 2 10 PPC403GA Exception Priorities Types and Classes Priority Exception Type Exception Class 1 System Reset Asynchronous imprecise 2 Machine Check Asynchronous imprecise 3 Debug Synchronous precise except UDE and EXC 4 Critical Interrupt Asynchronous precise 5 WatchdogTimer Time out Asynchronous precise 6 Program Exception Protection Violation and System Synchronous precise Call 7 Alignment Exception Synchronous precise 8 External Interrupt Asynchronous precise 9 Fixed Interval Timer Asynchronous precise 10 Programmable Interval Timer Asynchronous precise The PPC403GA processes exceptions as non critical and critical Four exceptions are defined as critical machine check exceptions debug exceptions exceptions caused by an active level on the critical interrupt pin and the first time out from the watchdog timer For clarity exception handling for critical interrupts is discussed after the following discussion of non critical exc
Download Pdf Manuals
Related Search
Related Contents
Mode d`emploi rapide pour Outlook Voice Access 769-07309 P02 TB CARB Addendum EPA.indd ASUS C200 User's Manual SECO-LARM USA 16-Port User's Manual 取扱説明書の表示 Poignée de porte électronique intelligente OMEGA Mifare IES My Book Duo User Manual Arkon LMCBOLD holder Copyright © All rights reserved.
Failed to retrieve file