Page 2
AMD, the AMD logo and combinations thereof are trademarks of Advanced Micro Devices, Inc. Am386 and Am486 are registered trademarks, and AMD-K5 and K86 are trademarks of Advanced Micro Devices, Inc. Microsoft and Windows are registered trademarks and Windows NT is a trademark of Microsoft.
Page 8
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.3.8 Exceptions and Interrupts in SMM ....6-32 6.3.9 SMM Compatibility with Pentium Processor ... . 6-33 6.4 Clock Control .
Page 9
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Appendix A Compatibility With the Pentium and 486 Processors A.1 Bus Signals ......... A-2 A.1.1 Signal Comparison .
Page 15
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Preface This manual describes the technical features of the AMD-K5™ processor, and its dif- ferences from the Pentium processor, at a level of detail suitable for a hardware designer or system-software developer to implement system boards, core system logic, and system software.
Page 16
Pins have pin numbers; sig- nals have signal names. On processors that multiplex signals, pins can carry more than one signal; the AMD-K5 processor, however, does not multiplex signals in this manner.
Page 17
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Writeback—This term refers to two related concepts: • Bus Cycle—A 32-byte burst write cycle to a memory block that has been cached in the modified state. Writebacks can be caused by inquire cycles, internal...
Page 18
• Internal Snooping: These snoops are initiated by the processor (rather than sys- tem logic) during certain types of cache accesses. Both the AMD-K5 and Pen- tium microprocessors support this type of internal snooping for the purpose of detecting self-modifying code. See page 2-22 for details.
Page 19
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Brumm, Penn, and Don Brumm. 80386/80486 Assembly Language Programming. Wind- crest: McGraw-Hill, 1993. Chappell, Geoff. DOS Internals. Reading: Addison-Wesley, 1994. Crawford, John H., and Patrick P. Gelsinger. Programming the 80386. San Francisco: Sybex, 1987.
Page 20
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Pietrek, Matt. Windows Internals. Reading: Addison Wesley, 1993. Richter, Jeffrey. Advanced Windows NT. Redmond: Microsoft Press, 1994. Ro, Sen-Cuo, and Sheau-Chuen Her. i386/i486 Advanced Programming. New York: Van Nostrand Reinhold, 1993. Slater, Michael. Microprocessor-Based Design. Englewood Cliffs: Prentice-Hall, 1989.
XXCAL testing laboratory. The result can be seen in the AMD-K5 processor’s perfor- mance. This performance plus its compatibility with an immense library of existing x86 software make the AMD-K5...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Features Pentium-Processor Standard Compatible with the Pentium (735\90, 815\100) • processor 296-pin socket Compatible with existing Pentium (735\90, 815\100) • processor support infrastructure and system designs Compatible with Pentium, 486, and 386 processor soft- •...
Page 23
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 High-Performance Cache and TLBs • 16-Kbyte instruction cache supports split-line access 8-Kbyte, dual-ported data cache with MESI cache coher- • ency protocol Dual-tagged (both linear and physical tags) • Inquire cycles run in parallel with program cache access •...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Internal Architecture The RISC design techniques used in the processor’s internal architecture account, in large part, for its high performance. The following sections summarize the processor’s execution pipeline behavior, the hardware aspects of the internal instruc- tion cache and data cache, and the hardware aspects of mem- ory management.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Prefetch and Predecode Figure 2-1 (top-left corner) shows the processor’s prefetch and predecode logic being fed with data from the external bus via the memory management unit. Prefetching attempts to keep the instruction cache and prefetch cache filled ahead of the execution pipeline’s fetch requirements.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Execution Pipeline Figure 2-1 shows the relation between the internal logic and the stages of the execution pipeline. Figure 2-2 shows the func- tions of the pipeline stages. The first five stages—Fetch, Decode 1, Decode 2, Execute, and Result—affect throughput performance.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 2.2.1 Fetch The processor can fetch up to 16 bytes per clock out of the instruction cache. Fetching begins with the calculation of the linear address for the next instruction along a predicted branch of the x86 instruction stream. The address accesses the instruction cache or, during a miss, the prefetch cache.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 2.2.2 Decode The two-stage decode logic accepts predicted x86 instruction bytes and their predecode bits from the fetch logic, shifts them into a 16-byte FIFO buffer called the byte queue, merges regis- ter tags and operands, and generates internal RISC operations (ROPs).
ALUs have two-entry reservation stations. Table 2-1 shows the types of ROPs executed by each ALU. Unlike the Pentium pro- cessor, the AMD-K5 processor has few restrictions on the pair- ing of integer instructions needed to use both integer units in parallel.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Floating-Point Unit The IEEE 854-compatible floating-point unit (FPU) can issue pipelined ROPs from its 2-entry reservation station at the rate of one per clock. One ROP can be issued to either the add or multiply pipeline in each clock, even when the operations are separated by an exchange ROP.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The branch unit receives branch-prediction information from the decoder. If the branch unit executes a branch differently than predicted, it signals the instruction cache, reorder buffer, and decode logic, and it passes the correct information to the branch-prediction array in the fetch stage.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 2.2.5 Retire The processor implements a real-state (non-speculative) regis- ter file that contains the x86-architecture registers and a real- state 8-Kbyte data cache. While ROPs complete out of order and their results are forwarded to other execution units and to the ROB out of order, their results are always written at retire- ment time to the real-state x86 registers in program order.
Since most x86 instructions access memory, they benefit greatly by being cached, and the faster cache- access time on the AMD-K5 processor is a performance advan- tage. The enabling and operating modes for the caches are software controlled by the CD and NW bits of CR0.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The following sections describe the basic architecture and resources of the processor’s internal caches. For information about how the system software and hardware control cache configuration and coherency, see Section 6.2 on page 6-8.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Parts of the current code-segment descriptor are maintained in the instruction cache. This allows the cache to translate logical addresses for branches and other prefetch targets to linear address tags for the incoming cache-line fills.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 buffer, which resides between the load/store units and the data cache, moves to the real-state data cache or memory. Details on the data-cache storage formats and testing are given in Section 7.4 on page 7-7.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 dated, many or all of the cached lines may still be valid, but accesses miss in the linear tags and go through the MMU to the physical tags. If an access misses the linear tags but hits in the physical tags, the processor restores the linear tag using the linear address for the access.
The contents of the processor’s data cache are always real-state. Furthermore, on the AMD-K5 processor, writes to both memory and the data cache are always done in program order, irrespective of the state of the EWBE input sig- nal.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 2-2. Cache States for Read and Write Accesses Type Cache State Access Cache State After Access Tags Before Access Type Writeback- MESI State Writethrough State invalid single read invalid invalid Read Miss Linear...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 2-3. Cache States for Snoops, Invalidation, and Replacements Type of Cache State Cache State After Operation Tags Memory Access Operation Before Writeback- MESI State Operation Writethrough State INV=0 shared writethrough shared or exclu- —...
2.3.6 Snooping The term snooping commonly refers to at least three different actions, only two of which are supported by the AMD-K5 and Pentium processors: Inquire Cycles—These are bus cycles initiated by external logic that cause the processor to look up an address in its physical cache tags.
The AMD-K5 processor, like the 486 processor but unlike the Pentium processor, requires a jump (near or far) after a self- modifying write to clear the prefetch cache. However, both the...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 buffer, load/store execution units, reservation stations, decode unit, or prefetch cache—are not relevant to an inquire cycle or internal snoop. Such stores are speculative and might never occur, due to a branch misprediction, an interrupt, or other intervening event.
EWBE on writes is to hold additional writes off when the signal is negated. In particular, assertion of EWBE does not permit the AMD-K5 processor to observe a weakly ordered memory-write model, in which writes to cache may...
Nevertheless, the strongly ordered AMD-K5 processor supports high perfor- mance without using weakly ordered memory writes by buffer- ing speculative stores in the store buffer.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 2.4.4 Paging and the TLBs The processor supports 4-Kbyte and 4-Mbyte paging with two separate translation lookaside buffers (TLBs) that work in par- allel: 4-Kbyte Pages—A 128-entry, four-way, set-associative TLB that can cover 512 Kbytes of memory space 4-Mbyte Pages—A four-entry, fully-associative TLB that can...
Page 53
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 the TLB reload involves a write to memory to set the PDE Accessed or Dirty bit, a hit during the physical-tag snoop causes the cache line to be invalidated. Details on software configuration for 4-Mbyte paging are given in Section 3.1.2 on page 3-5.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Software Environment and Extensions The AMD-K5 processor is compatible with the instruction set, programming model, memory management mechanisms, and other software infrastructure supported by the 486 and Pen- tium (735\90, 815\100) processors. Operating system and appli- cation software that runs on the Pentium processor can be executed on the AMD-K5 processor without modification.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The sections that follow provide details on the architectural extensions visible to system and application software. Some sections include pseudo-code algorithms for suggested BIOS modifications to support the extensions. Architectural exten- sions visible to debug and test software, such as I/O break- points, are described in Chapter 7.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-1. Control Register 4 (CR4) Fields Mnemonic Description Function Enables retention of designated entries in the 4-Kbyte TLB or 4-Mbyte TLB during invalidations. Global Page Extension 1 = enabled, 0 = disabled. See Section 3.1.3 on page 3-9 for details.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 3.1.1 Machine-Check Exceptions Bit 6 in CR4, the machine-check enable (MCE) bit, controls generation of machine-check exceptions (12h). If enabled by the MCE bit, these exceptions are generated when either of the following occurs:...
However, large data structures such as a video frame buffer or non-paged operating system code can consume many pages and easily overrun the TLB. The AMD-K5 processor accommodates large data structures by allowing the operating system to specify 4-Mbyte pages as well as 4-Kbyte pages, and by implementing a four-entry, fully-associative 4-Mbyte TLB which is separate from the 128-entry, 4-Kbyte TLB.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Figure 3-1 and Table 3-1 show the fields in CR4. Figure 3-4 and Table 3-2 show the fields in a page-directory entry. 4-Kbyte page translation differs from 4-Mbyte page translation in the following ways: 4-Kbyte Paging (Figure 3-2)—Bits 31–22 of the linear address...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-2. Page-Directory Entry (PDE) Fields Mnemonic Description Function For 4-Kbyte pages, bits 31–12 contain the physical base address of a 4-Kbyte page table. Physical Base 31–12 BASE For 4-Mbyte pages, bits 31–22 contain the physical base address Address of a 4-Mbyte page and bits 21–12 must be cleared to 0.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 3.1.3 Global Pages The processor’s performance can sometimes be improved by making some pages global to all tasks and procedures. This can be done for both 4-Kbyte pages and 4-Mbyte pages. The processor invalidates (flushes) both the 4-Kbyte TLB and the 4-Mbyte TLB whenever CR3 is loaded with the base address of the new task’s page directory.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-3. Page-Table Entry (PTE) Fields Mnemonic Description Function Physical Base 31–12 BASE The physical base address of a 4-Kbyte page. Address Software may use the field to store any type of information. Available to Soft- 11–9...
Without the VME extensions available on the AMD-K5 proces- sor, the operating system controls Virtual-8086 mode access to the IF flag by trapping instructions that can read or write this flag.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 In addition to these performance problems caused by virtual- ization of the IF flag in Virtual-8086 mode, software interrupts (those caused by INTn instructions that vector through inter- rupt gates) cannot be masked by the IF flag or virtual copies of the IF flag, these flags only affect hardware interrupts.
Page 68
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 protection exception with error code zero, thereby notifying the operating system that the program is now prepared to accept the interrupt. Thus, when VME extensions are enabled, the VIF and VIP bits are set and cleared as follows: VIF—This bit is controlled by the processor and used by the...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-5A through Table 3-5E shows the effects, in various x86-processor modes, of instructions that read or write the IF and VIF flag. The column headings in this table include the fol- lowing values: PE—Protection Enable bit in CR0 (bit 0)
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-5C. Instructions that Modify the IF or VIF Flags—Virtual-8086 Mode TYPE IOPL GP(0) IF ← 0 — No Change < 3 — — — IF ← 1 — No Change < 3 —...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-5D. Instructions that Modify the IF or VIF Flags—Virtual-8086 Mode Interrupt Extensions (VME) TYPE IOPL GP(0) IF ← 0 — No Change < 3 VIF ← 0 — No Change IF ← 1 —...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-5E. Instructions that Modify the IF or VIF Flags—Protected Mode Virtual Interrupt Extensions (PVI) TYPE IOPL GP(0) IF ← 0 — No Change < 3 VIF ← 0 — No Change IF ← 1 —...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Software Interrupts In Virtual-8086 mode, software interrupts (INTn exceptions and the Interrupt that vector through interrupt gates) are trapped by the operat- Redirection Bitmap ing system for emulation, because they would otherwise clear (IRB) Extension the real IF.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-6 compares the behavior of hardware and software interrupts in various x86-processor operating modes. It also shows which interrupt table is accessed: the Protected-mode IDT or the Real- and Virtual-8086-mode IVT. The column head- ings in this table include: PE—Protection Enable bit in CR0 (bit 0)
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 3.1.5 Protected Virtual Interrupt (PVI) Extensions The Protected Virtual Interrupts (PVI) bit in CR4 enables sup- port for interrupt virtualization in Protected mode. In this vir- tualization, the processor maintains program-specific VIF and VIP flags in a manner similar to those in Virtual-8086 Mode Extensions (VME).
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Model-Specific Registers (MSRs) The processor supports model-specific registers (MSRs) that can be accessed with the RDMSR and WRMSR instructions when CPL = 0. The following index values in the ECX register access specific MSRs:...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 3.2.2 Machine-Check Type Register (MCTR) The processor latches the cycle definition and other informa- tion about the current bus cycle in its 64-bit Machine-Check Type Register (MCTR) at the same times that the Machine- Check Address Register (MCAR) latches the cycle address: when a bus-cycle error occurs.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 3-7. Machine-Check Type Register (MCTR) Fields Mnemonic Description Function Set to 1 if the processor was asserting LOCK during the bus LOCK Locked Cycle cycle. M/IO Memory or I/O 1 = memory cycle, 0 = I/O cycle.
RDMSR instruction when the ECX register contains the value 83h. For details on the HWCR, see Section 7.1 on page 7-3. New Instructions In addition to supporting all of the 486 processor instructions, the AMD-K5 processor implements the following instructions: CPUID CMPXCHG8B MOV to and from CR4 RDTSC...
For detailed instructions on processor and feature identification see the AMD Proces- sor Recognition application note, order# 20734. Table 3-8 outlines the AMD-K5 processor family codes and model codes with the CPU clock frequencies (MHz), bus frequencies (MHz), and P-rating strings (“Pxxx”).
Page 88
CPL is greater than 0, or to access an undefined model-specific register, the proces- sor generates a general-protection exception with error code zero. Model-specific registers, as their name implies, may or may not be implemented by later models of the AMD-K5 processor. 3-34 Software Environment and Extensions...
The code optimization suggestions in this section cover both general superscalar optimization (that is, techniques common to both the AMD-K5 and Pentium processors) and techniques specific to the AMD-K5 processor. In general, all optimization techniques used for the Pentium processor apply to any wide- issue x86 processor, but wider-issue designs like the AMD-K5 processor have fewer restrictions.
Page 92
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Moreover, future implementations may increase the penal- ties associated with microcoded instructions. Dependencies—Spread out true dependencies to increase the opportunities for parallel execution. Antidependencies and output dependencies do not impact performance. Memory Operands—Instructions that operate on data in memory (load/op/store) can inhibit parallelism.
Indexed Addressing—There is no penalty for base + index addressing in the AMD-K5 processor. However, future implementations may have such a penalty to achieve a higher overall clock rate. 4.1.2 Techniques Specific to the AMD-K5 Processor Jumps and Loops—JCXZ requires 1 cycle (correctly pre-...
Page 94
Pentium processor's 4 to 9 cycles. Register-based bit-offset forms on the AMD-K5 processor take 5 cycles. If the semantics of the register-based bit-offset form are desired (where the bit off- set can cover a very large bit string in memory), it is better...
Table 4-3 on page 4-19 contains the definitions for the floating-point instructions. The first column in these tables indicates the instruction mnemonic and operand types. The fol- lowing notations are used in the AMD-K5 microprocessor docu- mentation: reg—register mem—memory location imm—immediate value...
Page 96
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The second column contains an identifier with the following format: x_xx_xxxxxxxx_xxx_xxx MODrm[2:0] MODrm[5:3] Opcode Addressing Mode: 0x = register 10 = memory without index 1x = memory with or without index 11 = memory with index...
Page 97
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The x/y value following the ROP type indicates the relative dis- patch and execution cycle of the opcode, in the absence of any conflicts. The format is: x/y[/z] where: x = Dispatch Cycle—The relative cycle in which the ROP is dispatched from decode to the reservation station.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 4.2.2 Integer Instructions Table 4-1 shows the execution-unit usage for each integer instruction, along with relative cycle numbers for dispatch and execution of the associated ROPs for the instruction. Table 4-1. Integer Instructions Fastpath or...
Page 102
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 4-1. Integer Instructions (continued) Fastpath or Execution Instruction Mnemonic Opcode Format Microcode Unit Timing MOV reg, mem 0_1x_1000101x_xxx_xxx MOV mem, reg 0_10_1000100x_xxx_xxx MOV mem, reg 0_11_1000100x_xxx_xxx 1/2/3 (base + index addressing) MOV AL/AX/EAX, mem...
Page 103
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 4-1. Integer Instructions (continued) Fastpath or Execution Instruction Mnemonic Opcode Format Microcode Unit Timing NOT mem 0_1x_1111011x_010_xxx 1/1/3 OR reg, reg 0_0x_000010xx_xxx_xxx OR reg, mem 0_1x_0000101x_xxx_xxx OR mem, reg 0_1x_0000100x_xxx_xxx 1/1/3 OR AL/AX/EAX, imm...
Page 104
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 4-1. Integer Instructions (continued) Fastpath or Execution Instruction Mnemonic Opcode Format Microcode Unit Timing ROL reg, 1 0_0x_1101000x_000_xxx alu1 ROL mem, 1 0_1x_1101000x_000_xxx alu1 1/1/3 ROL reg, imm alu1 0_0x_1100000x_000_xxx ROL mem, imm...
Page 105
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 4-1. Integer Instructions (continued) Fastpath or Execution Instruction Mnemonic Opcode Format Microcode Unit Timing SETcc mem 1_1x_1001xxxx_xxx_xxx 1/2/3 SHL reg, 1 alu1 0_0x_1101000x_1x0_xxx SHL mem, 1 0_1x_1101000x_1x0_xxx alu1 1/1/3 SHL reg, mem 0_0x_1100000x_1x0_xxx...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 4-2 shows the timing of internal operations from dis- patch to retire of each ROP for nearly two iterations of this loop. All memory accesses are assumed to hit in the cache. EVEN_ARRAY_SIZE is set to 20.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 4.2.4 Floating-Point Instructions Floating-point ROPs are always dispatched in pairs to the FPU reservation station. The first ROP conveys the lower halves of the A and B operands, and it always has the fpfill ROP type.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Bus Interface This chapter describes two closely related subjects, bus signals (Sections 5.1 and 5.2) and the bus-cycle protocols implemented with those signals (Sections 5.3 and 5.4). These sections describe only the architectural characteristics and functions of the signals and bus cycles.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Signal Overview The signals on the AMD-K5 processor are compatible with the comparable signals on the Pentium (735\90, 815\100) processor 296-pin socket. Appendix A gives a complete list of hardware and software issues relating to this compatibility. The follow- ing figures and tables summarize the characteristics and behavior of the AMD-K5 processor’s signals:...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.1.1 Signal Characteristics Table 5-1. Summary of Signal Characteristics Sampled (Input) or Internal Signal Type Floated Resistor Asserted (Output) Every clock. A20M Output: From ADS until last expected BRDY of the bus AHOLD +1, cycle.
Page 121
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-1. Summary of Signal Characteristics (continued) Sampled (Input) or Internal Signal Type Floated Resistor Asserted (Output) BOFF +1 or From ADS until the last expected BRDY of the bus cycle. HLDA Output (single transfer): From one clock after ADS until BRDY.
Page 122
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-1. Summary of Signal Characteristics (continued) Sampled (Input) or Internal Signal Type Floated Resistor Asserted (Output) Every clock. IGNNE Every clock. Rising-edge-triggered. Recognized at next INIT instruction boundary. Every clock. Level-sensitive. Recognized at next instruc- tion boundary.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-1. Summary of Signal Characteristics (continued) Sampled (Input) or Internal Signal Type Floated Resistor Asserted (Output) BOFF +1 or SCYC From ADS until last expected BRDY of the bus cycle. HLDA Every clock. Falling-edge-triggered. Recognized at next pullup instruction boundary.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-2. Conditions for Driving and Sampling Signals Conditions under which signals are meaningfully driven or sampled Reset, Arbitration Bus Cycles or Cache Accesses States and Modes Debug Signal Bus Arbitration AHOLD — BOFF —...
Page 125
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-2. Conditions for Driving and Sampling Signals (continued) Conditions under which signals are meaningfully driven or sampled Reset, Arbitration Bus Cycles or Cache Accesses States and Modes Debug Signal Cache Control CACHE 38 37 25 25 25 25 16...
Page 126
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-2. Conditions for Driving and Sampling Signals (continued) Conditions under which signals are meaningfully driven or sampled Reset, Arbitration Bus Cycles or Cache Accesses States and Modes Debug Signal External Interrupts, Interrupt Acknowledgments, and Reset...
Page 127
PRDY is asserted, it is latched and acted upon after PRDY is negated. 23. During AHOLD, the system must prevent other bus masters from locking the same address that the AMD-K5 processor is locking. 24. Different than the Pentium processor, which ignores STPCLK in this state.
Page 128
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 30. The first code fetch after register initialization during INIT or RESET does not occur if AHOLD, BOFF, or HLDA is asserted. 31. PRDY is asserted either when R/S goes Low or when the Test Access Port (TAP) instruction, USEHDT, is executed. In the latter case, R/S is watched for a Low-to-High transition, which takes the processor out of the Hardware Debug Tool (HDT) mode.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.1.3 External Interrupts Interrupts and exceptions are often differentiated in x86 docu- mentation as follows: an interrupt is the assertion of a hard- ware input signal and an exception is a software event, such as an invalid opcode or execution of an INTn instruction.
Page 130
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The processor writes (pushes) its current state onto the stack prior to entering the service routine for exceptions and for BUSCHK, SMI, NMI, and INTR interrupts. Because of these writes, the state of EWBE affects the processor’s response to such interrupts and exceptions.
Page 131
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 INTR Interrupts—The processor disables INTR interrupts during all software interrupts (that is, INTn instructions that vector through interrupt gates or through task gates that reference a TSS with IF cleared in its EFLAGS image). It does this by automatically clearing the IF bit in EFLAGS.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-3. Summary of Interrupts and Exceptions Priority Description Type Acknowledgment Sampling Vector Point of Interruptibility INTn instruc- tions and all exceptions internal 0-255 none Entry to service routine. other software exceptions interrupt level-sensitive...
FLUSH operation will then continue; any writebacks that com- pleted before BOFF was asserted are not affected. 5.1.4 Bus Signal Compatibility with Pentium Processor The differences in bus signal functions between the AMD-K5 and Pentium processors are described in Section A.1 on page A-2. Signal Descriptions The following pages describe each signal in detail.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.1 A20M (Address Bit 20 Mask) Input Summary Assertion of A20M causes the processor to clear bit 20 of the A31–A3 address bus to 0 prior to accessing the cache or mem- ory in Real mode. The clearing of address bit 20 bit maps addresses above 1 Mbyte to addresses below 1 Mbyte.
Page 135
The AMD-K5 processor simply ignores A20M except when the processor runs in Real mode. The AMD-K5 processor applies A20M masking to its linear cache tags, through which all programs access the caches. Thus, assertion of A20M affects all program-generated cache...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.2 A31–A3 (Address Bus) A31–A5 Bidirectional, A4–A3 Output Summary A31–A3 carries the physical address for the current bus cycle. The processor drives addresses on A31–A3 during memory and I/O cycles, and cycle definition information during special bus cycles.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 addresses on A31–A3. In this manner, BE7–BE0 replace the function of address bits A2–A0, which do not exist. When the processor drives burst reads it drives the starting address on A31–A3 (which is the address of the quadword that contains the instruction or data required) and it drives BE7–...
Page 138
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The EADS input defines the beginning of the inquire cycle and validates the input address on A31–A5. The AP input carries the even parity bit for the A31–A5 address. The APCHK output indicates a parity error for the inquire cycle address on A31–A5.
Page 139
See the data sheet for details. Unlike the Pentium processor, pipelined address-data transac- tions are not supported by the AMD-K5 processor. Thus, the NA input has no effect on the processor’s address bus. NA only affects the sampling time for the KEN and WB/WT inputs.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.3 ADS (Address Strobe) Output Summary The processor asserts ADS to specify the beginning of a mem- ory or I/O bus cycle, or a cache writeback to memory. The sig- nal validates the processor’s address and cycle definition signals and it can be used by system logic to enable accesses to memory and I/O.
Page 141
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 entries, the processor uses a pseudo-random algorithm to select a line for replacement. If the selected line is cached in the modified state, it must be written back to memory. In this case, the order of events is: 1.
Page 142
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 bus masters, thus intervening temporarily in the processor’s sequential operations. If BOFF is asserted while ADS is asserted, ADS remains Low (floats asserted). System logic must consider this when inter- preting the state of ADS after negating BOFF. In the next clock after BOFF is negated, the processor may reassert ADS to restart a cycle if a cycle was aborted by the assertion of BOFF.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.4 ADSC (Address Strobe Copy) Output Summary ADSC is an identical copy of ADS. In systems that would other- wise place large capacitive loads on ADS, the ADSC output can be used instead of ADS to distribute loads, thereby increasing response time.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.5 AHOLD (Address Hold) Input Summary System logic can assert AHOLD to obtain control of the bidi- rectional A31–A3 address bus and AP address parity signal to drive one or more inquire cycles to the processor.
Page 145
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 When the processor releases control of A31–A3 and AP in response to AHOLD, the processor still maintains control of the remaining signals on the bus so that it can (a) finish driving a bus cycle it may have begun before AHOLD was asserted, and (b) drive a writeback if an inquire cycle hits a modified line in the processor’s data cache.
Page 146
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 BREQ asserted continuously. For a list of signals recognized while AHOLD is asserted, see Table 5-2 on page 5-8. The processor may again drive its own cycles with ADS as early as one clock after system logic negates AHOLD. Before negat-...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.6 AP (Address Parity) Bidirectional Summary AP carries the even parity bit for cache line addresses driven and sampled on A31–A5. The processor drives AP when it drives an address for a read or write cycle. The processor sam- ples AP during inquire cycles in order to drive the APCHK out- put.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.7 APCHK (Address Parity Check) Output Summary The processor asserts APCHK if an even-parity error occurs on A31–A5 during an inquire cycle. Driven The processor drives APCHK for one clock, two clocks after system logic asserts EADS with an inquire address.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.8 BE7–BE0 (Byte Enables) Output Summary The eight bits of BE7–BE0, when cleared to 0, validate the eight bytes driven on D63–D0. In this way, BE7–BE0 expands on the function of address bits A2–A0, which do not exist on the A31–A3 address bus.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 logic drives KEN with the first BRDY. If system logic negates KEN, it must return as a single transfer only the bytes speci- fied on BE7–BE0. If system logic asserts KEN, it must ignore BE7–BE0 during all transfers of the burst and return all eight...
1. For all special bus cycles, D/C = 0, M/IO = 0 and W/R = 1. System logic must return BRDY in response to this cycle. 2. The message in a branch-trace message special bus cycle is different in the AMD-K5 and Pentium processors.
Reserved Notes: 1. The default processor-to-clock ratios are shown in Table 5-7. Specific models of the AMD-K5 processor may implement different ratios for the High and Low values of BF. For authorative information, see the data sheet for each AMD-K5 processor model.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.10 BOFF (Backoff) Input Summary When system logic asserts BOFF, the processor floats the bus and continues to float it until BOFF is negated. If the processor is driving a bus cycle when BOFF is asserted, the cycle is aborted and restarted after BOFF is negated.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 BOFF provides the fastest response of the three bus-hold inputs. Because of its ability to help resolve deadlock prob- lems, it is required in almost all systems with multiple-caching masters. In such designs, system logic typically drives separate BOFF signals to each bus master in the system.
Page 155
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 it wants. The processor has no way of breaking the hold. While the processor is backed off, it continues to execute out of its instruction and data caches, if possible. If it can no longer operate out of its caches, it holds BREQ asserted continuously.
Page 156
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 If BOFF is asserted when BUSCHK is asserted, BOFF is recog- nized and BUSCHK is ignored. For a list of signals recognized while BOFF is asserted, see Table 5-2 on page 5-8. 5-40 Bus Interface...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.11 BRDY (Burst Ready) Input Summary For bus cycles that transfer data, system logic must assert BRDY to indicate that it has received a data transfer on D63– D0 during a write and to indicate that it has placed valid data on D63–D0 during a read.
Page 158
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The processor samples BRDY during all types of bus cycles, including the following: Single-transfer reads Single-transfer writes (including cache writethroughs) Burst reads (cache line fills) Burst writebacks Special bus cycles Interrupt acknowledge cycles The number of BRDYs expected by the processor depends on...
Page 159
PCHK—Two clocks after every BRDY for writes. In addition to the above uses of BRDY on the 486 processor, BRDY on the AMD-K5 and Pentium processors is used for both single-transfer and burst cycles, and it terminates special bus cycles.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.12 BRDYC (Burst Ready) Input Summary BRDYC is an identical copy of BRDY, except that BRDYC has an internal pullup resistor whereas BRDY does not. In systems that would otherwise place large capacitive loads on BRDY, the BRDYC output can be used in place of BRDY to distribute loads, thereby increasing response times.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.13 BREQ (Bus Request) Output Summary The processor asserts BREQ to indicate that it is either driving a cycle on the bus, performing certain types of cache accesses, or needs access to the bus in order to continue operating.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.14 BUSCHK (Bus Check) Input Summary System logic can assert BUSCHK if it determines that the cur- rent bus cycle has or will have any type of error. In response, the processor stores information about the aborted bus cycle and (optionally) generates a machine check exception.
Page 163
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Details Bus cycle errors such as parity can be reported to the processor on BUSCHK if this reporting is not done on NMI. The BUSCHK signal is not used in most PC systems, although higher-end sys- tems may find uses for it in special situations.
Page 164
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 BUSCHK is asserted and recognizes latched interrupts in prior- ity order when BUSCHK is negated. The MCE bit in CR4, which enables machine check exceptions during BUSCHK, also enables machine check exceptions dur- ing data parity errors that are indicated on PCHK while PEN is asserted.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.15 CACHE (Cacheable Access) Output Summary The processor drives CACHE to specify that the current bus cycle is a burst cycle. If CACHE is asserted for a read cycle, the cycle is a four-transfer burst and fills a cache line. If CACHE is asserted for a write cycle, the cycle is a four-transfer burst writeback of a modified cache line.
Page 166
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 during write hits to shared cache lines and during write misses, but writethroughs are driven as single transfers of 1 to 8 bytes. CACHE is not asserted during writethroughs. CACHE is partially determined by the PCD bit maintained by...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 CACHE is not asserted for the following types of memory reads (M/IO = 1): Locked reads (that is, while LOCK is asserted) TLB reads Any read with PCD asserted (PCD is a factor in determining the state of CACHE) Table 5-9.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.16 CLK (Bus Clock) Input Summary CLK, in conjunction with the state of BF at RESET, determines the frequency of the processor’s internal clock. Sampled The processor always samples CLK. The clock must have begun oscillating prior to the assertion of RESET during power-up.
(indicating a code access) or its load/store logic (indicating a data access). In the AMD-K5 processor, code accesses can be done specula- tively, but data accesses are not. Only data (not code) can be...
Page 170
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 During special bus cycles, the processor drives D/C = 0, M/IO = 0, and W/R = 1. The cycles are then differentiated by BE7–BE0 and A31–A3. 5-54 Bus Interface...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.18 D63–D0 (Data Bus) Bidirectional Summary The processor drives and samples up to eight bytes on D63–D0 during memory or I/O accesses. System logic must decode the source and destination of these transfers using the address bus and various control signals.
If memory reads, memory writes, or I/O reads are misaligned, the Pentium processor transfers the highest-addressed portion followed by the lowest-addressed portion. The AMD-K5 proces- sor runs such cycles in the opposite order from the Pentium processor. I/O writes, however, are performed in the same order on both processors.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.19 DP7–DP0 (Data Parity) Bidirectional Summary DP7–DP0 carry the even-parity bits for each byte driven and sampled on the D63–D0 data bus. While DP7–DP0 are outputs, system logic can use the signals to check parity. While DP7–...
AHOLD is negated, EADS is not recognized. If EADS is asserted on the same clock that HOLD is negated, both the AMD-K5 and the Pentium processors recognize this as a valid inquire cycle and process it correctly. However, if EADS is...
Page 175
(c) automatic bus watching, in which a caching device con- stantly compares addresses being driven by any other device on the address bus with its own cached addresses. The AMD-K5 and Pentium processors only support the first two types of snooping, not the third.
Page 176
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 negated one clock after the last BRDY of the writeback, at which time another EADS can be asserted. If AHOLD is held asserted throughout an inquire cycle, system logic must latch the inquire cycle address when EADS is asserted.
Page 177
HIT and HITM change state two clocks after EADS, and EADS can be asserted in the same clock in which HITM is negated. The AMD-K5 processor does not sample EADS in the clock after a valid EADS assertion. Signal Descriptions...
EWBE is asserted. Details All writes on the AMD-K5 processor—whether to cache, mem- ory, or I/O—are performed in program order, regardless of the state of EWBE. The only effect of EWBE on writes is to hold off additional writes when the signal is negated.
Page 179
EWBE is asserted. If system logic implements memory-mapped I/O as non-cache- able memory (the standard method), EWBE on the AMD-K5 processor has the same effect on writes to memory-mapped I/O as does EWBE on the Pentium processor—neither processor reorders reads ahead of writes.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.22 FERR (Floating-Point Error) Output Summary The processor asserts FERR to report the occurrence of an unmasked floating-point exception resulting from the execu- tion of a floating-point instruction. This signal is provided to allow the system logic to handle this exception in a manner consistent with IBM-compatible PC/AT systems.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.23 FLUSH (Cache Flush) Input Summary FLUSH causes the processor to writeback (if necessary) and invalidate each line in its data and instruction caches. The pro- cessor generates a flush-acknowledge special bus cycle at the end of the entire operation.
Page 182
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 use the Flush-Acknowledge special bus cycle to initiate such action. Entry into SMM may require the assertion of FLUSH. If the SMM physical memory space overlaps physical main memory that is cacheable, FLUSH must be asserted with SMI (the FLUSH will be performed first, because it is a higher-priority interrupt).
Page 183
The Float-Test mode can only be exited by assert- ing RESET again. On the AMD-K5 and Pentium processors, FLUSH is an edge- triggered interrupt. On the early 486 processors, however, the signal is a level-sensitive input.
Errors detected by the checker are reported on the checker’s IERR output. On the AMD-K5 processor, the IERR output is reserved solely for functional-redundancy checking; no other errors are reported on that output.
Page 185
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 their signals are tied together so that they run the same pro- gram. The Functional-Redundancy Checking mode can only be exited by the assertion of RESET. Functional-redundancy checking cannot be done in the Hardware Debug Tool (HDT) mode.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.25 HIT (Inquire-Cycle Hit) Output Summary The processor asserts HIT to indicate that an inquire cycle hit a valid line in the processor’s instruction or data cache. Driven The processor drives HIT every clock. The signal changes state two clocks after the assertion of EADS and retains that state until two clocks after the next EADS.
WT = 1. This may cause the line to be cached in the exclusive state in two separate caches if the system supports other cach- ing masters. In such cases, the AMD-K5 processor asserts HIT and caches the line in the shared state or does not cache it, depending on the state of the INV signal.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.26 HITM (Inquire Cycle Hit To Modified Line) Output Summary The processor asserts HITM to indicate that an inquire cycle hit a modified line in the processor’s data cache. If this occurs, the processor writes the line back to memory during or after the bus-hold tenure, depending on which signal is holding the processor off the bus.
Page 189
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The processor drives writebacks by asserting ADS and either reusing the inquire cycle address (if AHOLD is held asserted throughout the writeback) or driving the address itself (if AHOLD is negated for the writeback, or if BOFF or HOLD was used to obtain the bus).
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.27 HLDA (Bus-Hold Acknowledge) Output Summary When system logic asserts HOLD, the processor completes any in-progress bus cycle, floats its cycle-driving outputs, and asserts HLDA as an acknowledgment. While HLDA is asserted, another bus master can drive cycles on the bus, including inquire cycles to the processor.
Page 191
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Unlike BOFF, the assertion of HOLD does not abort an in- progress cycle. If the processor is not driving a bus cycle when HOLD is asserted, the bus master asserting or causing the assertion of HOLD can begin driving its first bus cycle in the clock after HLDA is asserted, which occurs two clocks after HOLD is asserted.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.28 HOLD (Bus-Hold Request) Input Summary When system logic asserts HOLD, the processor completes any in-progress bus cycle, floats its cycle-driving outputs, and asserts HLDA to acknowledge the HOLD. Sampled and The processor samples HOLD every clock. It acknowledges...
Page 193
However, if EADS is asserted on the clock fol- lowing the negation of HOLD, the AMD-K5 processor does not recognize this as a valid inquire cycle.
No other errors are reported with IERR. Unlike the Pentium processor, the AMD-K5 processor does not report parity errors on IERR for every cache or TLB access. Instead, the AMD-K5 processor fully tests cache parity during the built-in self test (BIST), which is invoked by asserting INIT during RESET.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.30 IGNNE (Ignore Numeric Error) Input Summary IGNNE, in conjunction with the numeric error (NE) bit in CR0, is used by the system logic to control the effect of an unmasked floating-point exception on a previous floating-point instruc- tion during the execution of a floating-point instruction or the WAIT instruction—hereafter referred to as the target instruc-...
Page 196
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 If an unmasked floating-point exception is pending and the tar- get instruction is considered error-insensitive, then the proces- sor ignores the floating-point exception and continues with the execution of the target instruction. FERR is not affected by the state of the NE bit or IGNNE.
INIT is not. If INIT and NMI are both asserted during the Stop Grant state (not necessarily simultaneously), the AMD-K5 processor recognizes the INIT after leaving the Stop Grant state, then it recognizes the NMI prior to fetching any instructions.
Page 198
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 writes to a port (such as port 64h in the keyboard controller) that asserts INIT. INIT is also used to support 286 software that must return to Real mode after accessing extended memory in Protected mode.
Page 199
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 asserted three clocks before the BRDY of that write in order to prevent another cycle from starting. INIT invokes the processor’s built-in self test (BIST) if asserted at the falling edge of RESET. The BIST runs a series of tests on the internal hardware that exercise the following resources—...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.32 INTR (Maskable Interrupt) Input Summary The assertion of INTR, if enabled by software (unmasked), causes the processor to acknowledge the interrupt and enter an interrupt service routine. The routine is specified by the vector obtained during the acknowledgment.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 2. Acknowledge—Drives an Interrupt acknowledge operation (a cycle pair) on the bus. System logic must return a BRDY in response to both cycles. Table 5-13 shows the signal val- ues driven during the first and second bus cycles. Both bus cycles are reads, but any data returned on the first cycle is ignored.
Page 202
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The interrupt service routine, upon entry, may re-enable inter- rupts by setting the IF bit in the EFLAGS before servicing the interrupt. This is typically done if the routine is lengthy, so that the processor can respond to higher-priority interrupts while the current interrupt is being serviced, thus allowing nested interrupts.
Page 203
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 INTR is not recognized if asserted while AHOLD, BOFF, or HLDA is asserted, because the processor cannot drive the interrupt acknowledge operation and therefore cannot obtain the interrupt vector. Signal Descriptions 5-87...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.33 INV (Invalidate Cache Line) Input Summary During an inquire cycle, the state of INV determines whether the addressed cache line, if found in the processor’s instruction or data cache, transitions to the invalid or shared state.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.34 KEN (External Cache Enable) Input Summary System logic overrides the cacheability of read cycles with KEN. If KEN is negated during a read cycle, the data returned to the processor will not be cached. If KEN is asserted at that...
Page 206
On the 486 processor, KEN is sampled twice (on the first and last transfer of a burst) and must be asserted at both times for a burst read to be treated as a cache-line fill. On the AMD-K5 and Pentium processors, however, KEN is sampled only on the first clock of a transfer, during BRDY or NA, whichever is first.
1, (2) if the bit is cleared to 0, the processor then drives a locked read-modify-write to set the bit to 1. During updates to the Accessed and Busy bits, the AMD-K5 processor drives a locked four-byte read and four- Signal Descriptions 5-91...
Page 208
Thus, up to four bus cycles can occur for misaligned accesses. (The AMD-K5 processor runs certain misaligned bus cycles in the opposite order from the Pentium processor; see the description of SCYC on page 5-114 for details.)
Page 209
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The processor always negates LOCK for at least one idle clock between sequential locked operations. For example, if a read- modify-write is followed by another read-modify-write, there is an unlocked idle clock (sometimes called a dead clock) between the two sequences to allow system logic to reallocate the bus to another bus master.
Page 210
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 writeback is pending when BOFF is negated, the writeback takes precedence over the restarting of the aborted cycles in the locked operation. For purposes of interrupts and exceptions, locked operations are treated by the processor as if the entire multi-cycle opera- tion were a single instruction.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.36 M/IO (Memory or I/O) Output Summary The processor drives M/IO to indicate whether it is accessing memory or I/O on the bus. The signal is driven at the same time as the other two cycle definition signals, D/C and W/R. A spe- cific encoding of D/C, M/IO, and W/R identifies one of several special bus cycles.
Details NA is an input that is asserted when external memory is pre- pared to accept a pipelined cycle. The AMD-K5 processor drives the pending ADS two clocks after NA is sampled active. NA does not generate pipelined cycles when LOCK is asserted, during writeback cycles, or when there are no pending internal cycles.
INIT, or PRDY is asserted. If INIT and NMI are both asserted during the Stop Grant state (not necessarily simultaneously), the AMD-K5 processor recog- nizes the INIT after leaving the Stop Grant state, then it recog- nizes the NMI prior to fetching any instructions. Current implementations of the Pentium processor do not recognize the NMI in such cases, although future implementations may.
Page 214
NMI interrupt before executing the first instruction of the INTR handler. By contrast, the AMD-K5 processor recog- nizes a pending NMI interrupt after returning (via the IRET instruction) from a prior interrupt.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.39 PCD (Page Cache Disable) Output Summary The processor drives PCD to indicate the operating system’s specification of cacheability for the entire current page. Sys- tem logic can use PCD to control external caching.
Page 216
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 In Real mode, or in Protected and Virtual-8086 modes while paging is disabled (PG bit in CR0 cleared to 0): PCD output = CD bit in CR0 (Thus, whenever the CD bit in CR0 is set to 1, the PCD out- put is asserted and the access is non-cacheable.)
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.40 PCHK (Parity Status) Output Summary The processor asserts PCHK during reads if it detects an even parity error on one or more bytes of D63–D0 during a read cycle. Driven The processor drives PCHK for one clock, two clocks after each BRDY during read cycles.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.41 PEN (Parity Enable) Input Summary System logic can assert PEN to enable cycle information latch- ing and (optionally) machine check exception generation for data bus parity errors during read cycles. Sampled The processor samples PEN every BRDY during read cycles.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.42 PRDY (Probe Ready) Output Summary The processor asserts PRDY to acknowledge the system logic’s assertion of R/S or execution of the Test Access Port (TAP) instruction, USEHDT, and to indicate the processor’s entry into the Hardware Debug Tool (HDT) mode for debugging.
Page 220
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Documentation on the HDT is available under nondisclosure agreement to test and debug developers. For information, con- tact your AMD sales representative or field application engi- neer. 5-104 Bus Interface...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.43 PWT (Page Writethrough) Output Summary The processor drives PWT to indicate the operating system’s specification of writeback or writethrough state for the entire current page. PWT, together with WB/WT, specifies the data- cache MESI state of cacheable read misses and write hits.
Page 222
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 the accessed line is cached in, transitions to, or remains in the shared state after the access. If PWT is Low and WB/WT is High, the accessed line is cached in, transitions to, or remains in the exclusive state after a read miss or the first write hit.
Hardware Debug Tool (HDT) mode, which supports access to the processor’s DR7–DR0 debug registers through an external debug port. The AMD-K5 processor imple- ments the HDT in a manner different than the Pentium proces- sor’s Probe mode.
Page 224
For information, con- tact your AMD sales representative or field application engi- neer. The AMD-K5 processor implements the HDT mode in a manner different than the Pentium processor’s Probe mode. For details on the processor’s PRDY acknowledgment to R/S, see page 5- 103.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.45 RESET (Reset) Input Summary The assertion of RESET initializes the processor to the power- up state. Sampled The processor samples RESET every clock and recognizes it at the next instruction boundary. The RESET process begins at the falling edge of RESET.
FFFF_FFF0h, the same entry point used after INIT, where it expects to find the BIOS entry point. The contents of AMD-K5 processor registers at the conclusion of RESET or INIT is identical to that of the Pentium processor, except that the CPU ID in EDX is 0000_050xh. The upper byte of DX (DH) contains 05h and the lower byte of DX (DL) con- tains 0xh, the processor’s type and stepping identifier.
Page 229
BF (BF1–BF0), FLUSH, FRCMC, the hold signals (AHOLD, BOFF, HOLD, and HLDA), INIT, and R/S. Unlike the Pentium processor, the AMD-K5 processor does not recognize RESET in the Hardware Debug Tool (HDT) mode. System hardware or software must exit the HDT (by driving R/ S High) before asserting RESET.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.46 SCYC (Split Cycle) Output Summary The processor asserts SCYC during misaligned, locked trans- fers on the D63–D0 data bus. The processor generates addi- tional bus cycles to complete the transfer of misaligned data.
Page 231
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 If memory reads, memory writes, or I/O reads are misaligned, the AMD-K5 processor runs the bus cycles in the opposite order of the Pentium processor. The AMD-K5 processor trans- fers the low-address portion followed by the high-address por- tion instead of the high-address portion followed by the low- address portion.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.47 SMI (System Management Interrupt) Input Summary The assertion of SMI causes the processor to enter System Management Mode (SMM). In this mode, which can be trans- parent to standard system and application software, an SMM interrupt service routine accesses a memory space separate from main memory.
Page 233
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 that an I/O device has not been accessed for several minutes. The power management logic can then assert SMI, and the SMM service routine can obtain relevant information from the power management logic with which to make power-down deci- sions under program control.
Page 234
Real mode, and the full 4 Gbytes can be accessed without a segment limit violation. Unlike the Pentium processor, the AMD-K5 processor does not recognize A20M in SMM. The processor exits SMM (that is, the SMM service routine) when it executes the RSM instruction.
Page 235
I/O trap restart slot, and return. During a simultaneous SMI I/O trap (for I/O instruction restart) and debug breakpoint trap, the AMD-K5 processor responds to the SMI first and postpones writing the exception-related information to the stack until after the return from SMM via the RSM instruction.
Page 236
NMI interrupt before executing the first instruction of the INTR handler. By contrast, the AMD-K5 processor recog- nizes a pending NMI interrupt after returning (via the IRET instruction) from a prior interrupt.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.48 SMIACT (System Management Interrupt Active) Output Summary The processor acknowledges the assertion of SMI with the assertion of SMIACT. The acknowledgment signifies the pro- cessor’s readiness to enter System Management Mode (SMM) and begin executing the service routine for that interrupt mode.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.49 STPCLK (Stop Clock) Input Summary The assertion of STPCLK causes the processor to complete any in-progress bus cycle and enter the Stop Grant state (proces- sor’s internal clock stopped), from which it can subsequently transition to the Stop Clock state (bus clock stopped).
Page 239
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 relevant information and decide to power itself (the processor) down, and the decision would be communicated to the power management logic, which would assert STPCLK to the proces- sor and, optionally, stop driving CLK to the processor and other logic.
Page 240
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 the Halt state, the processor transitions to the Stop Grant state; it then returns to the Halt state when STPCLK is negated. No processor registers are saved before entering the Halt state because the processor returns to the next unexe- cuted instruction in program order when it returns to its prior operating mode.
Page 241
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 mal writeback (immediately if AHOLD is asserted, or delayed if BOFF or HOLD are asserted) and returns to the state from which it entered the Stop Grant Inquire state in the clock in which it negates HITM. If HITM is not asserted, the processor returns two clocks after EADS.
Page 242
STPCLK. The AMD-K5 proces- sor does not guarantee this. In the Halt or Stop Grant states, the AMD-K5 processor can- not enter a low-power state if it does not have the bus (that is, if AHOLD, BOFF or HLDA is asserted). The same may not be true of the Pentium processor.
Section 7.8 on page 7-19 summarizes the implementation of TAP testing on the AMD-K5 processor. System logic should tie TCK High if TAP testing is not implemented. See the IEEE Standard Test Access Port and Boundary-Scan Architecture (IEEE 1149.1) specification for details on how the...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.51 TDI (Test Data Input) Input Summary TDI carries input test data and instructions for testing on the Test Access Port (TAP). Sampled The processor samples TDI every rising TCK edge, but only during the shift_IR and shift_DR states. TDI has an internal pullup resistor.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.52 TDO (Test Data Output) Output Summary TDO carries output data for testing on the Test Access Port (TAP). Driven and Floated The processor drives TDO every falling TCK edge, but only during the shift_IR and shift_DR states. It is floated at all other times.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.53 TMS (Test Mode Select) Input Summary TMS specifies the test function and sequence of test changes for testing on the Test Access Port (TAP). Sampled The processor samples TMS every rising TCK edge. TMS has an internal pullup resistor.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.54 TRST (Test Reset) Input Summary The assertion of TRST initializes the Test Access Port (TAP) by resetting its state machine. Sampled TRST is an asynchronous input. Unlike other asynchronous inputs, no synchronous setup and hold time are specified for TRST.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.55 W/R (Write or Read) Output Summary The processor drives W/R to indicate whether it is performing a write or read cycle on the bus. The signal is driven at the same time as the other two cycle definition signals: D/C and M/IO.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.2.56 WB/WT (Writeback or Writethrough) Input Summary WB/WT, together with PWT, specifies the data-cache MESI state of cacheable read misses and write hits. Sampled The processor samples WB/WT in the same clock as the first BRDY of a bus cycle or NA, whichever comes first.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 the exclusive state, a subsequent write hit to the same line tran- sitions the line to the modified state. During write hits, the states of PWT and WB/WT can only change a line from shared to exclusive;...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 5-18. MESI-State Transitions for Writes Result of Cache Lookup Write Hit Signal or Event Write Miss exclusive shared or modified — — — — — CACHE, PCD — — — — — —...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Bus Cycle Overview The bus signals described in the previous section combine to form various types of bus transactions, or bus cycles. This sec- tion summarizes the general features of the bus cycles: cycle definition, addressing, alignment, and priorities.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 the signals shown in Table 5-23 on page 5-180. In addition to the processor-driven bus cycles shown in Table 5-19, system logic can drive inquire cycles to the processor. These bus cycles are described later, in Section 5.4.4 on page 5-156.
Page 254
SCYC throughout the misaligned sequence of bus cycles. If memory reads, memory writes, or I/O reads are misaligned, the AMD-K5 processor runs the bus cycles in the opposite order of the Pentium processor. The AMD-K5 processor trans- fers the least-significant bytes first followed by the most-signif- icant bytes.
DRAM-page hit and 8-3-3-3 for a DRAM-page miss. 5.3.5 Bus-Cycle Priorities The AMD-K5 processor can support only one on-going bus cycle at a time—pending bus cycles are not buffered. System logic maintains the ultimate control over the bus. The proces- sor asserts BREQ to request control of the bus.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Bus Cycle Timing The following sections describe and illustrate the timing and relationship of bus signals during various types of bus cycles. Only a representative set of bus cycles are illustrated. Many more combinations are possible.
8 bytes. Misaligned instructions or operands result in a split cycle, which requires multiple transactions on the bus. During single-transfer (non-cacheable) code fetches, the AMD-K5 and Pentium processors read 8 bytes, not 16 bytes as the 486 pro- cessor does.
Page 258
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 BRDY, the processor latches the physical address and cycle definition of the failed bus cycle in its 64-bit machine-check address register (MCAR) and its 64-bit machine-check type register (MCTR). For details on such parity errors, see the descriptions of PCHK and PEN on pages 5-101 and 5-102.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Single-Transfer Figure 5-3 shows two consecutive memory writes. The first Memory Write write fills an external write buffer and the second write is Delayed by EWBE stalled for three clocks by the negation of EWBE.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 I/O Read and Write Figure 5-4 shows an I/O read followed by an I/O write. The pro- cessor accesses I/O when it executes an I/O instruction (any of the INx or OUTx instructions). Accesses to memory-mapped I/O ports appear on the bus as accesses to memory rather than to the I/O address space.
The processor writes the word to I/O address 90h, followed by the word to I/O address 8Eh. The AMD-K5 processor performs misaligned memory read, memory write, and I/O read transfers in the reverse order of the Pentium processor, but misaligned I/O write transfers are performed in the same order on both processors.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.4.3 Burst Cycles The processor drives burst cycles, which consist of four sequen- tial eight-byte (quadword) transfers on the data bus, only in the following cases: Burst Read—Cache-line fills from memory. These burst reads occur when the processor asserts CACHE during ADS and system logic asserts KEN during the first BRDY of a read cycle.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 (rather than BRDY) is asserted. KEN and WB/WT are validated by either NA or BRDY, whichever comes first. NA will not gen- erate a pipelined cycle in the event that there are no pending internal cycles.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Burst Writeback Figure 5-8 shows a burst read followed by a writeback. Write- backs are the only type of burst write that the processor per- forms. They can be initiated by the processor or by system...
Page 270
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 (BE7–BE0 = 00h). Thus, A4–A3 are always 0 for writebacks. During inquire cycle writebacks, the processor does the same thing, except that if system logic holds AHOLD asserted throughout the writeback, the processor lets system logic pro- vide the address.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.4.4 Bus Arbitration and Inquire Cycles The processor bus may be required by another bus master, which may need to drive its own cycles on the bus, or by system logic, which may need to drive an inquire cycle to the proces- sor or resolve bus deadlock.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 2. Two clocks after the assertion of BOFF or AHOLD, or one clock after sampling HLDA asserted when HOLD is used, assert EADS while driving a cache-line address on A31–A5, and assert or negate INV. The processor latches the address when it samples EADS asserted.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 For an AHOLD inquire cycle to be recognized, AHOLD must have been asserted continuously for two clocks at the time EADS is asserted. AHOLD and BOFF can be asserted in con- junction with each other without interfering with EADS recog- nition, as long as the sampling criteria for at least one of the signals (AHOLD or BOFF) is met.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 AHOLD-Initiated Figure 5-10 shows an example similar to Figure 5-9, minus the Inquire Hit to Shared address parity error, but this inquire cycle hits either a shared or Exclusive Line or exclusive line in the cache, as indicated by the assertion of HIT and the negation of HITM two clocks after the assertion of EADS.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 AHOLD-Initiated Figure 5-11 shows the same sequence as in Figure 5-10, but this Inquire Hit to time the inquire cycle hits a modified line. As in Figure 5-10, Modified Line system logic asserts INV with EADS. Two clocks later, the pro- cessor asserts both HIT and HITM.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Bus Backoff (BOFF) BOFF provides the fastest response of the three bus-hold inputs. Unlike AHOLD and HOLD, BOFF does not permit an in-progress bus cycle to complete. It forces the processor off the bus in the next clock, aborting any in-progress bus cycle that the processor may have begun.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 BOFF-Initiated Figure 5-13 shows a burst read interrupted by the assertion of Inquire Hit to BOFF for the purpose of an inquire cycle. One clock after sam- Modified Line pling BOFF asserted, the processor aborts the burst read and floats its bus.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 HOLD-Initiated Figure 5-14 shows HOLD asserted in the same clock that the Inquire Hit to Shared processor begins a read cycle. The processor completes the or Exclusive Line read (which is a burst read) and asserts HLDA two clocks after the last BRDY of the in-progress cycle.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 HOLD-Initiated Figure 5-15 shows an example similar to the one in Figure 5-14, Inquire Hit to except that the inquire cycle hits a modified line (both HIT and Modified Line HITM asserted two clocks after EADS). System logic negates HOLD in the clock after EADS, and two clocks later (one clock after HIT and HITM transition) the processor negates HLDA.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.4.5 Locked Cycles The processor asserts LOCK across certain sequences of mem- ory bus cycles that require integrity. These include interrupt acknowledge operations, descriptor-table updates, page-direc- tory and page-table updates, and exchange operations. In addi- tion, the processor asserts LOCK during bus cycles initiated by any instruction that has the LOCK prefix.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 TLB Miss Figure 5-17 shows a TLB miss for a 4-Kbyte page. An overview (4-Kbyte Page) of the 4-Kbyte paging mechanism is illustrated in Figure 3-2 on page 3-5. The paging mechanism for 4-Mbyte pages (Figure 3-3 on page 3-6) is similar but somewhat simpler.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Locked Operation Unlike AHOLD and HOLD, BOFF does not permit an in- with BOFF progress bus cycle to complete. It forces the processor off the Intervention bus in the next clock, aborting any in-progress bus cycle that the processor may have begun.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Interrupt Figure 5-19A shows system logic asserting INTR during a burst Acknowledge read. The figure shows the resulting bus behavior, up to the Operation start of the interrupt handler. When the processor recognizes an INTR interrupt at the next instruction-retirement bound- ary, the processor performs the following actions: Finish In-Progress Bus Cycle—In Figure 5-19A, a burst read is...
Page 292
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 the processor executes housekeeping microcode, the processor prepares to service the interrupt by performing the following accesses on the bus: IDT Lookup—Using the interrupt vector and, in Protected mode, the base address of the interrupt descriptor table...
1. For all special bus cycles, D/C = 0, M/IO = 0 and W/R = 1. System logic must return BRDY in response to this cycle. 2. The message in a branch-trace message special bus cycle is different in the AMD-K5 and Pentium processors.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Basic Special Bus Figure 5-20 shows a basic special bus cycle, which is defined Cycle during ADS by D/C = 0, M/IO = 0, and W/R = 1 and differenti- ated by BE7–BE0 and A31–A3. In this example, BE7–BE0 = FBh and A31–A3 = 0, so it is the special cycle the processor...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Shutdown Cycle Figure 5-21 shows a shutdown and the special cycle that fol- lows. The processor enters shutdown when an interrupt or exception occurs during the handling of a double fault (vector 8), which amounts to a triple fault. When the processor encoun- ters such a triple fault, it stops its activity on the bus and gen- erates the special bus cycle for shutdown (BE7–BE0 = FEh).
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 FLUSH-Acknowledge Figure 5-22 shows the FLUSH-acknowledge special bus cycle, Cycle which the processor drives in response to system logic’s asser- tion of FLUSH. This example shows the processor completing other unrelated bus cycles following the assertion of FLUSH.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Cache-Invalidation Figure 5-23 shows the cache-invalidation special bus cycle, Cycle (INVD which the processor drives in response to the execution of the Instruction) INVD instruction. The INVD instruction causes the processor to invalidate each line in its instruction and data caches. Modi- fied lines in the data cache are not written back.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Cache-Writeback Figure 5-24A and Figure 5-24B show the cache-writeback and and Invalidation invalidation special bus cycle, followed by the cache-invalida- Cycle (WBINVD tion special bus cycle. The processor drives these two special Instruction) cycles after executing the WBINVD instruction.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Branch-Trace Figure 5-25 shows the two branch-trace message special bus Message Cycles cycles that the processor generates for each taken branch when branch tracing is enabled as described in Section 7.6 on page 7-17. System logic can accumulate the address and data bus values for debugging or profiling.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 5.4.7 Mode Transitions, Reset, and Testing System logic can control the system-management, clocking, and initialization states of the processor with SMI, STPCLK, INIT, and RESET. The following examples shows the proces- sor’s response to some of the signals.
Page 306
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 A31–A3 BE7–BE0 BRDY CACHE D63–D0 FLUSH LOCK M/IO SMIACT SMIACT SMI Asserted Asserted Figure 5-26A. Transition from Normal Execution to SMM Part 1 5-190 Bus Interface...
Page 307
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 A31–A3 BE7–BE0 BRDY CACHE D63–D0 FLUSH LOCK M/IO SMIACT Begin save of processor state Figure 5-26B. Transition from Normal Execution to SMM Part 2 Bus Cycle Timing 5-191...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Stop-Grant and Stop- Figure 5-27A and Figure 5-27B show the processor’s transition Clock States from normal execution to the Stop-Grant state, then to the Stop-Clock state, and finally back to normal execution. The series of transitions begins when system logic asserts STPCLK.
Page 309
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 A31–A3 BE7–BE0 BRDY CACHE D63–D0 LOCK M/IO STPCLK Stop Clock State Stop Grant STPCLK Special Cycle Asserted Figure 5-27A. Stop-Grant and Stop-Clock Modes Part 1 Bus Cycle Timing 5-193...
Page 310
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 A31–A3 BE7–BE0 BRDY CACHE D63–D0 LOCK M/IO STPCLK Normal State Figure 5-27B. Stop-Grant and Stop-Clock Modes Part 2 5-194 Bus Interface...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 INIT-Initiated Figure 5-28 shows an example in which the operating system Transition from writes to an I/O port, causing system logic to assert INIT. The Protected Mode to assertion of INIT starts an extended microcode sequence that Real Mode terminates with a code fetch from the Reset location.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 System Design This chapter summarizes topics that may be of help to system board designers. The discussions touch on the design of mem- ory, cache, System Management Mode (SMM), clock control (power management), and a few other topics. Many of the details that relate to this subject are also covered in Chapter 5, which describes the processor’s signals and bus cycles not only...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.1.1 Memory Map Figure 6-1 shows a typical physical memory map for a DOS- based desktop system after DOS boots. Various regions of this memory map to RAM or ROM on the motherboard and adapter boards.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.1.2 Memory-Decoder Aliasing of Boot ROM Space The processor boots in Real mode at address FFFF_FFF0h. However, because the boot ROM space must be accessed after the first far jump in the processor’s Real mode, which gener-...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 entries because these data structures are cached only in CR3 and the TLBs. System logic normally defines the cacheable address space by implementing external registers which BIOS or other system software initializes during boot with the cacheable (or non- cacheable) ranges of the address space.
Page 318
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 During boot, the address decoder must allow BIOS to address the SMM memory area in the main memory address space without entering into the SMM mode in order to initialize it with configuration parameters and the SMM service routine.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Fill Down 0003_FFFF State-Save Area 0003_FE00 32-Kbyte Minimum Service Routine Service Routine Entry Point 0003_8000 SMM Base Address (CS) 0003_0000 Figure 6-2. Default SMM Memory Map System logic controls the cacheability of SMM memory with KEN in the same way that it controls the cacheability of mem- ory space.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The cacheability of SMM memory has both advantages and dis- advantages. By caching SMM memory, the advantage of faster repetitive accesses is offset by delays due to overwriting cache lines that may otherwise be reusable after returning from SMM.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 page table entries to control caching properties for specific physical pages. The PCD and PWT bits control the state of the PCD and PWT output signals, which system logic can use to control L2 caching.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 writethroughs, which are driven as single writes rather than burst writes. From the system’s viewpoint, the cacheability of bus cycles is controlled by the KEN and WB/WT inputs, as described in Sec- tion 6.1.3 on page 6-4. During reads, system logic can use the assertion of CACHE to initiate a table lookup of cacheable addresses.
Page 323
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 A memory write that occurs after a previous cache up- • date to the same location is a writeback. Writebacks are driven as burst cycles on the bus. Coherency State—There is a relationship between MESI...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Repetitive writes to the same location are slower than in • writeback mode. No updates to the data cache are hidden from the sys- • tem. When returning from SMM with SMM memory cache- •...
Page 325
If INV was negated with EADS, a hit leaves the line in the shared state, or transitions it from the modified to shared state. On the AMD-K5 processor, the maximum inquire or invalida- tion rate with inquire cycles is one every two clocks, because HIT and HITM change state two clocks after EADS, and EADS can be asserted in the same clock in which HITM is negated.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Inquire cycle logic in systems with look-aside caches can be simplified by monitoring only HITM and ignoring HIT. This works because the resulting state of a hit line is determined only by the state of INV during the inquire as follows: If INV is negated during a hit, the hit line—whether shared,...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 cycles is of paramount importance. Support for BOFF is usu- ally needed to resolve potential deadlock problems that arise as a result of inquire cycles, and if BOFF is supported, there is usually no reason to support HOLD. The sections that follow further describe these relative advantages and disadvantages.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 3. The processor responds with HITM to system logic. 4. System logic asserts BOFF to the requesting master. (HITM from the processor can be used to generate BOFF.) 5. The other master negates BOFF to the processor so that the processor can write back its modified line to main memory and the shared L2 cache.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 AHOLD Arbitration AHOLD’s sole function is to support inquire cycles. The asser- tion of AHOLD by system logic only gets control of the address bus, leaving the data bus available to the processor for the completion of an in-progress bus cycle.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Writeback AMD-K5 Processor HITM AHOLD EADS Look-Through L2 Cache HITM 4 BOFF EADS System Logic Memory Access System Bus BOFF Other Main Memory Master Figure 6-4. AHOLD and BOFF Example 6-18 System Design...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 HOLD Arbitration System logic can use the HOLD (request) and HLDA (acknowl- edge) protocol to gain control of the address and data buses. Like BOFF, HOLD/HLDA gains control of both the address and data buses but only after the processor completes any in- progress bus cycle or a sequence of cycles, like a locked cycle.
Page 332
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The writethrough to memory must be accompanied by an invalidation of this line in any other caching master’s cache. 3. During the second write to that line, the processor updates its shared line and writes through to the exclusive line of the L2 cache.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.2.7 Cache Invalidations The term invalidation usually means one of the following things: Individual Cache Lines—Writebacks and/or invalidations of single lines in the instruction and data caches can be done with inquire cycles (driven by system logic) or internal snoops (initiated by the processor).
AMD-K5 and Pentium processors of masking linear vs. physical addresses is not visible to software because linear and physical addresses are identical in Real mode, and the AMD-K5 proces- sor samples A20M only in Real mode. System Management Mode (SMM) SMM is an operating mode entered via an interrupt and per- formed by an interrupt service routine.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.3.1 Operating Mode and Default Register Values The software environment in SMM has the following features: Addressing as in Real mode 4-Gbyte segment limit Default 16-bit operand, address, and stack size, although instruction prefixes can override these defaults...
SMM base address. The SMM service routine can alter any of the read/write values in the state-save area. The con- tents of any reserved locations in the state-save area are not necessarily the same between the AMD-K5 processor and the Pentium or 486 processors. System Management Mode (SMM)
These fields are the same as in the Pentium processor. Unlike the Pentium processor, however, the I/O trap restart and the SMM base address relocation functions are always enabled in the AMD-K5 processor and do not need to be specifically enabled. 6.3.4...
Page 341
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 If the SMM base address is rewritten, the processor saves its state at the new base address the next time SMM is entered, and each time thereafter, until RESET. The relocated addresses for the SMM memory will then be as follows: SMM base address—Default: 0003_0000h.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.3.5 Halt Restart Slot During entry into SMM, the halt restart slot at offset FF02h in the SMM state-save area specifies if SMM was entered from the Halt state. Before returning from SMM, the halt restart slot...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.3.6 I/O Trap Dword If the assertion of SMI is recognized on the boundary of an I/O instruction, the I/O trap dword at offset FFA4h in the SMM state-save area contains information about the instruction. The fields of the I/O trap dword are configured as follows: Bits 31–16—I/O port address...
I/O restart slot (offset FF00) to 00FFh During a simultaneous SMI I/O-instruction trap and debug breakpoint trap, the AMD-K5 processor first responds to the SMI and postpones writing the exception-related information to the stack until after the return from SMM via the RSM instruction.
NMI interrupt before executing the first instruction of the INTR handler. By contrast, the AMD-K5 processor recog- nizes a pending NMI interrupt after returning (via the IRET instruction) from a prior interrupt.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 tions can be entered from any of the processor’s normal operat- ing modes (Real, Virtual-8086, or Protected mode), from system management mode (SMM), or from the Halt state. In typical PC systems that implement power control, the STP-...
Page 347
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 state, and it returns to the Halt state when STPCLK is negated. No processor registers are saved before entering the Halt state because the processor returns to the next unexecuted instruc- tion in program order when it returns to its prior operating mode.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 6.4.3 Stop Grant State The assertion of STPCLK causes the processor to enter the Stop Grant state. The processor can enter the Stop Grant state from the normal operating modes (Real, Protected, or Virtual- 8086), SMM, or the Halt state.
6.4.6 Clock Control Compatibility with Pentium Processor The differences in clock control functions between the AMD-K5 and Pentium processors are described in Section A.5 on page A-12. Power and Ground Design All of the processor input signals operate at 3 V except CLK, which can operate at 3 V or 5 V.
Page 351
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 immediately after AHOLD is negated. If the processor is also driving data with BRDY on the data bus at the same time, the processor then drives 96 bits simultaneously and ground- bounce spikes can occur. Such ground-bounce spikes can be...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Power-Up Requirements During power-up, CLK should be toggling and RESET should be asserted as V is ramping toward normal operating volt- age. Figure 6-7 shows this timing. After V and CLK reach specification, RESET must be asserted for a minimum of 1 ms to allow the phase-lock loop to synchronize.
Use at least three vias to the +3-V processor power plane • for the output power connection. AMD recommends using a split power plane to isolate the pro- cessor from the rest of the motherboard. This approach Noise Reduction 6-41...
Such cooling products are widely available. For detailed speci- fications and assistance is selecting a product, contact your AMD field application engineer or browse the AMD home page on the World Wide Web (see Section 6.9 for details). When gluing a heat sink to the processor case, follow these guidelines: Use thermal paste.
AMD-K5 processor. You can locate the FAE nearest you by contacting one of the AMD offices listed in this manual. You can also find support information on AMD’s World Wide Web pages.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Test and Debug The AMD-K5 processor has the following modes in which pro- cessor and system operation can be tested or debugged: Hardware Configuration Register (HWCR)—The HWCR is a model-specific register that contains configuration bits that enable cache, branch tracing, debug, and clock control func- tions.
Page 358
R/S Low or loads the AMD-K5 processor’s Test Access Port (TAP) instruction register with the USEHDT instruction. The test-related signals and their descriptions include the fol- lowing: FLUSH—Page 5-65...
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Hardware Configuration Register (HWCR) The Hardware Configuration Register (HWCR) is a model-spe- cific register (MSR) that contains configuration bits that enable cache, branch tracing, debug, and clock control func- tions. The WRMSR and RDMSR instructions access the HWCR when the ECX register contains the value 83h, as described in Section 3.3.5 on page 3-33.
Disables stopping of internal processor clocks in the Disable Stopping Halt and Stop Grant states. DSPC Processor Clocks 0 = enabled, 1 = disabled. Notes: Documentation on the Hardware Debug Tool (HDT) is available from AMD under a nondisclosure agreement. Test and Debug...
The TLB is tested by microcode. Unlike the Pentium processor, the AMD-K5 processor does not report parity errors on IERR for every cache or TLB access. Instead, the AMD-K5 processor fully tests its caches during the BIST. EADS should not be asserted during a BIST.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 LFSR signature test on the PLA, in that order. Upon comple- tion of the PLA test, the processor transfers the test result from an internal Hardware Debug Test (HDT) data register to the EAX register for external access, resets the internal micro- code, and begins normal code fetching.
The Output-Float Test mode can only be exited by asserting RESET again. On the AMD-K5 and Pentium processors, FLUSH is an edge- triggered interrupt. On the 486 processor, however, the signal is a level-sensitive input.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 7.4.2 Array Pointer The array pointers entered in EDX (Figures 7-3 through 7-8, top) specify particular array locations. For example, in the data- and instruction-cache arrays, the way (or column) and set (or index) in the array pointer specifies a cache line in the 4- way, set-associative array.
7–0 of the array pointer). If the linear tag array (E1h) were accessed, the data read or written includes the tag and the status bits. The details of the valid fields in EAX are shown in Appendix A of the AMD-K5 Processor Software Development Guide, order# 20007. EDX: Array Pointer...
DR3–DR0 Entering the bit pattern, 10b, in the corresponding 2-bit R/W field in DR7 All data breakpoints on the AMD-K5 processor are precise, including those encountered in repeated string operations, which trap after completing the iteration on which the break- point match occurs.
7.5.3 Debug Compatibility with Pentium Processor The differences in debug functions between the AMD-K5 and Pentium processors are described in Section A.7 on page A-15. Branch Tracing Branch tracing is enabled by writing bits 3–1 with 001b and set- ting bit 5 to 1 in the Hardware Configuration Register (HWCR), as described in Section 7.1 on page 7-3.
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table 7-4. Branch-Trace Message Special Bus Cycle Fields Signals First Special Bus Cycle Second Special Bus Cycle 0 = first special bus cycle (source) 1 = second special bus cycle (target) Operating Mode of Target: 11 = Virtual-8086 Mode A30–A29...
No action other than the assertion of IERR is taken by the proces- sor. On the AMD-K5 processor, the IERR output is reserved solely for functional-redundancy checking. No other errors are reported on that output.
Page 376
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 The TAP consists of the following: Test Access Port (TAP) Controller—A synchronous, finite state machine that decodes the inputs on the TMS signal to control a sequence of test operations. Instruction Register (IR)—Accepts serially shifted instruc- tions from the TDI input.
(update_DR or update_IR). The sections below describe only those aspects of the IEEE standard that are implemented uniquely by the AMD-K5 pro- cessor. For a description of the IEEE-mandatory TAP functions and the IEEE optional functions implemented by the AMD-K5 processor, see the IEEE Standard Test Access Port and Boundary- Scan Architecture (IEEE 1149.1-1990) specification.
As defined by the IEEE standard BYPASS 11111 As defined by the IEEE standard Undefined instruction encodings select the BYPASS BYPASS undefined instruction Notes: 1. Documentation on the Hardware Debug Tool (HDT) is available from AMD under a nondisclosure agreement. 7-22 Test and Debug...
Port (TAP) instruction register with the USEHDT instruction. Documentation on the HDT is available under nondisclosure agreement to test and debug developers. For information, con- tact your AMD sales representative or field application engi- neer. Hardware Debug Tool (HDT) 7-23...
Page 380
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 7-24 Test and Debug...
Page 381
Pentium and AMD-K5 processors. This appendix describes these differences. (For the most current list of differences, see the Comparison of the AMD-K5 and Pen- tium Processors application note, order# 20025.)
18524C/0—Nov1996 Bus Signals A.1.1 Signal Comparison Table A-1 compares the signals on the Pentium processor with those on the AMD-K5 processor, showing which signals are sup- ported on each processor. Table A-1. AMD-K5 and Pentium Processor Signal Comparison Pentium Signal...
Page 383
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table A-1. AMD-K5 and Pentium Processor Signal Comparison (continued) Pentium Signal (735\90, AMD-K5 Function 815\100) System Clock (5 V-tolerant) CPUTYP Primary or Secondary Processor Data or Code Cycle D63–D0 Data Bus Dual or Primary Processor Cycle DP7–DP0...
Page 384
AMD-K5 Processor Technical Reference Manual 18524C/0—Nov1996 Table A-1. AMD-K5 and Pentium Processor Signal Comparison (continued) Pentium Signal (735\90, AMD-K5 Function 815\100) PBREQ Private Bus Request Page Cache Disable PCHK Parity Check Parity Enable PHIT Private Hit PHITM Private Hit to Modified Line...
If the Accessed bit needs to be set, two locked reads will be followed by one 1-byte locked write. For updates to the Busy bit in the TSS descriptor, the AMD-K5 processor behaves in the manner described for updates to the Accessed bit.
A.2.4 Halt Cycle after FLUSH When halted, the AMD-K5 processor reruns a Halt special cycle after the Flush Acknowledge special cycle following a cache flush operation. The Pentium processor does not rerun a Halt special cycle.
AMD-K5 processor Drive Strength 2 is between the Pentium processor Drive Strength medium and strong The only way to get the AMD-K5 processor Drive Strength 2 is to select the Pentium processor Drive Strength strong (as shown in the table above)
BOFF or AHOLD or both asserted, the Pentium processor treats the snoop as a hit, whereas the AMD-K5 processor may or may not treat it as a hit. For DCACHE linefills, the AMD-K5 processor treats the snoop...
Model 1 of the AMD-K5 processor does not have the difference. Comments In treating the snoop as a hit, the AMD-K5 and Pentium proces- sors assert the HIT pin and also cache the line as either shared or invalid, depending on the state of the INV pin. The cycle restarts after the deassertion of BOFF and AHOLD.
However, if two or more writes to different locations within the same cache line are queued up in the store buffer, the line is shared and the WB/WT pin is set High, then the AMD-K5 pro- cessor correctly allows the first write to reach the bus and the line transitions to exclusive.
The Pentium processor performs speculative TLB refills (including setting the accessed bit) for code prefetches. This may result in the accessed bit being set for a page that is not actually used. The AMD-K5 processor does not perform specu- lative TLB refills. A.4.2...
I/O instructions, where the timing of the SMI met the requirements for SMI I/O trapping. On the AMD-K5 processor, if, on the RSM, the I/O Restart Flag in the SMM save area is set, the debug trap is cancelled and will be redetected as a result of the reexecution of the I/O instruction.
AMD-K5 and Pentium processors. In addi- tion, the AMD-K5 and the Pentium processors store the IDT base at different locations in the SMM save area. The AMD-K5 processor stores the IDT base at offset 7F94h, and the Pentium processor stores it at offset 7F90h.
486 processors prioritize the limit violation fault. A.6.2 Task Switch On a task switch, the AMD-K5 processor sets the busy bit of the incoming task after storing the outgoing TSS according to 486 and Pentium processor documentation. The Pentium processor sets the busy bit before trying to store the outgoing TSS.
Multiple Debug Breakpoint Matches Multiple debug breakpoint matches on a single memory access do not set multiple DR6.B bits on the AMD-K5 processor. The Pentium processor may set multiple B-bits, regardless of whether the additional matching debug registers are enabled.
Need help?
Do you have a question about the K5 and is the answer not in the manual?
Questions and answers