Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
DC_Final_Fitted.doc
Скачиваний:
1
Добавлен:
01.05.2025
Размер:
2 Мб
Скачать
☆

Questions for Self-Testing

1. Why are the two instruction pipelines and floating-point unit on the Pentium processor capable of independent operations?

2. How is branch prediction implemented in the Pentium processor?

3. Why does the Pentium processor include separate code and data caches integrated on chip?

4. What has the Pentium processor increased the data bus for?

5. What is a second processor, the "checker" is used for when functional redundancy checking is used?

6. What peculiarities of the Shared Memory Multiprocessing (SMM) architecture are realized in the Pentium processor?

7. What architecture peculiarities are represented in the block diagram (Fig. 4.10) of the Pentium processor?

8. What kind of micro-architecture does the Pentium processor have?

9. How is the pipeline operation organized in the Pentium processor?

10. What conditions should be satisfied by the Pentium processor instructions?

4.4. Features of Organization Structure of the Pentium Processors

Procedure of Interruption the Pentium Processors. The Pentium uses two lines request of interruption, namely NMI (Non-Maskable Interrupt) for nonmaskable interruptions and INTR for maskable interruptions named users’ interruptions as well. The requests of interruptions via line NMI are always accepted by the processor. The requests via line INTR are accepted only in the case they have the higher level of priority than the currently executed program. Requests INTR may be enabled or disabled by setting the bit of interrupt enable in the interrupt status register. In addition to external interruptions there are many exceptions connected with events which occur during the program execution. Such events are illegal codes of operation, dividing errors, overflowing, etc.

Any of the pointed events forces the processor to transfer the control to the Interrupt Handling Routine. The vector number is appointed to each interrupt or exception. In the case of interrupt via line INTR, the vector number directed by I/O device to the processor after acknowledgment the fact of the interruption. For the rest exceptions the vector number is appointed beforehand. Knowing the vector number the processor defines the initial address of the Interrupt Handling Routine using the Interrupt Descriptor Table. The Pentium processor works together with the Advanced Programmable Interrupt Controller (APIC). Different I/O devices are connected with the processor via APIC which defines their priorities and directs their vector numbers to the processor.

T he Pentium processor status register is called EFLAGS, 7 bits of which are shown in Fig. 4.13. Among them are Interrupt enable Flag (IF), Trap Flag (TF), and I/O Privilege Level (IOPL) as well. When IF = 1, interrupts via line INTR are enabled. TF enables trap interrupts after each program instruction. The Pentium processor has rather a complex structure of priorities, in accordance to which routines of the operating system conditionally divided onto 4 groups and each of them is appointed one of the four priority levels. For each of such levels is assigned its address space of the processor. When switching from one to another privilege level many tests are executed realizing so-called mechanism of lockout. Such architecture allows designing operating systems with high degree of security. But the Pentium processor may work in the very simple mode as well, when there is no privilege and all the programs function in the same memory segment. Let us consider such simple mode. At occurring exception and after receiving an interrupt request, the processor executes operations listed below.

1. Pushes the number of Current Segment (CS) and the instruction pointer EIP to the processor stack pointed by the ESP register.

2. If the exception is initiated by a nonstandard situation while the program execution, pushes the code of the exception to the stack.

3. If necessary, clears IF to disable further requests of the same source.

4. Using the interrupt vector number, finds the initial address of the Interrupt Handling Routine in the Interrupt Descriptor Table and pushes it into EIP and after this continues the instructions execution.

Having serviced the request (e.g., transferred input or output data), the Interrupt Handling Routine returns the control to the interrupted program by executing instruction IRET, which restore values of registers EIP, CS, and processor status from the stack.

To enable interrupts in the processor, execute instruction STI setting flag IF of the processor status register to 1.

External Interrupt Considerations. The Pentium processor recognizes the following external interrupts: BUSCHK#, R/S#, FLUSH#, SMI#, INTT, NMI, and INTR. These interrupts are recognized at instruction boundaries. On the Pentium processor, the instruction boundary is the first clock in the execution stage of the instruction pipeline. This means that before an instruction is executed, the Pentium processor checks to see if any interrupts are pending. If an interrupt is pending, the processor flushes the instruction pipeline and then services the interrupt. The priority order of external interrupts is as shown below: BUSCHK#, R/S#, FLUSH#, SMI#, INTT, NMI, INTR.

Model Specific Registers. The Pentium processor defines certain Model Specific Registers that are used in execution tracing, performance monitoring, testing, and machine check errors. They are unique to the Pentium processor and may not be implemented in the same way in future processors.

Two new instructions, RDMSR and WRMSR (read/write model specific registers), are used to access these registers. When these instructions are executed, the value in ECX specifies which model specific register is being accessed. Table 4.1 lists all-model specific registers and the corresponding values (in Hex) that need to be loaded into ECX to access them.

Table 4.1.

Model Specific Registers

Value (in Hex)

Register Name

Description

00H

Machine Check Address

Stores address of cycle causing the exception

01H

Machine Check Type

Stores cycle type of cycle causing the exception

0EH

Test Register 12 (TR12)

New feature control

Note: Do not execute RDMSR or WRMSR with undefined values in ECX. Software must not depend on the value of reserved bits in the model specific registers. Any writes to the model specific registers should write "0" into any reserved bits.

Floating Point Unit. The floating-point unit (FPU) of the Pentium processor is integrated with the integer unit on the same chip. It is heavily pipelined. The FPU is designed to be able to accept one floating-point operation every clock. It can receive up to two floating-point instructions every clock, one of which must be an exchange instruction.

Floating-Point Pipeline Stages. The Pentium processor FPU has 8 pipeline stages, the first five of which it shares with the integer unit. Integer instructions pass through only the first 5 stages. Integer instructions use the fifth (X1) stage as a WB (write-back) stage. The 8 FP pipeline stages and the activities that are performed in them are summarized below: PF - Prefetch; Dl - Instruction Decode; D2 - Address generation; EX - Memory and register read; conversion of FP data to external memory format and memory write; X1 - Floating Point Execute stage one, conversion of external memory format to internal FP data format and write operand to FP register file, bypass; X2 - Floating Point Execute stage two; WF - Perform rounding and write floating-point result to register file, bypass 2; ER - Error Reporting/Update Status Word.

On-Chip Caches. The Pentium processor implements two internal caches for a total integrated cache size of 16 Kbytes: an 8 Kbyte data cache and a separate 8 Kbyte code cache. The data cache fully supports the MESI (modified/exclusive/shared/invalid) writeback cache consistency protocol. The code cache is inherently write protected to prevent code from being inadvertently corrupted, and as a consequence supports a subset of the MESI protocol, the S (shared) and I (invalid) states.

The caches have been designed for maximum flexibility and performance. The data cache is configurable as writeback or writethrough on a line by line basis. Memory areas can be defined as non-cacheable by software and external hardware. Cache writeback and invalidations can be initiated by hardware or software. Protocols for cache consistency and line replacement are implemented in hardware, easing system design.

Cache Organization. Each of the caches is 8 Kbytes in size and each is organized as a 2-way set associative cache. There are 128 sets in each cache, each set containing 2 lines (each line has its own tag address). Each cache line is 32 bytes wide. Replacement in both the data and instruction caches is handled by the LRU mechanism which requires one bit per set in each of the caches. A conceptual diagram of the organization of the data and code caches is shown below in Fig. 4.14. Note that the data cache supports the MESI write­back cache consistency protocol, which requires 2 state bits, while the code cache supports the S and I state only and therefore requires only one state bit.

C ache Structure. The instruction and data caches can be accessed simultaneously. The instruction cache can provide up to 32 bytes of raw opcodes and the data cache can provide data for two data references all in the same clock. This capability is implemented partially through the tag structure. The tags in the data cache are triple ported. One of the ports is dedicated to snooping while the other two are used to lookup two independent addresses corresponding to data references from each of the pipelines. The instruction cache tags are also triple ported. Again, one port is dedicated to support snooping and other two ports facilitate split line accesses (simultaneously accessing upper half of one line and lower half of the next line). The storage array in the data cache is single ported but interleaved on 4 byte boundaries to be able to provide data for two simultaneous accesses to the same cache line. Each of the caches is parity protected. In the instruction cache, there are parity bits on a quarter line basis and there is one parity bit for each tag. The data cache contains one parity bit for each tag and a parity bit per byte of data. Each of the caches is accessed with physical addresses and each cache has its own TLB (translation lookaside buffer) to translate linear addresses to physical addresses. The data cache has a 4-way set associative, 64-entry TLB for 4 Kbyte pages and a separate 4-way set associative, 8-entry TLB to support 4 Mbyte pages. The code cache has one 4-way set associative, 32-entry TLB for 4 Kbyte pages and 4 Mbyte pages which are cached in 4 Kbyte increments. The TLBs associated with the instruction cache are single ported whereas the data cache TLBs are fully dual ported to be able to translate two independent linear addresses for two data references simultaneously. Replacement in the TLBs is handled by a pseudo LRU mechanism that requires 3 bits per set. The tag and data arrays of the TLBs are parity protected with a parity bit associated with each of the tag and data entries in the TLBs.

Cache Operating Modes. The operating modes of the caches are controlled by the CD (cache disable) and NW (not write-through) bits in CR0. For normal operation and highest performance, these bits should both be reset to "0." The bits come out of RESET as CD = NW=1. To completely disable the cache, the following two steps must be performed.

  1. CD and NW must be set to 1.

  2. The caches must be flushed.

If the cache is not flushed, cache hits on reads will still occur and data will be read from the cache. In addition, the cache must be flushed after being disabled to prevent any inconsistencies with memory.

Page Cacheability. Two bits for cache control, PWT and PCD are defined in the page table and page directory entries. The states of these bits are driven out on the PWT and PCD pins during memory access cycles. The PWT bit controls write policy for the second level caches used with the Pentium processor. Setting PWT to 1 defines a writethrough policy for the current page, while clearing PWT to 0 defines a writeback policy for the current page.

The PCD bit controls cacheability on a page by page basis. The PCD bit is internally ANDed with the KEN# signal to control cacheability on a cycle by cycle basis. PCD = 0 enables cacheing, while PCD = 1 disables it. Cache line fills are enabled when PCD = 0 and KEN# = 0.

Inquire Cycles. Inquire cycles are initiated by the system to determine if a line is present in the code or data cache, and what its state is. (This document refers to inquire cycles and snoop cycles interchangeably.) Inquire cycles are driven to the Pentium processor when a bus master other than the Pentium processor initiates a read or write bus cycle. Snoop cycles are driven to the Pentium processor when the bus master initiates a read to determine if the Pentium processor data cache contains the latest information. If the snooped line is in the Pentium processor data cache in the modified state, the Pentium processor has the most recent information and must schedule a writeback of the data. Inquire cycles are driven to the Pentium processor when the other bus master initiates a write to determine if the Pentium processor code or data cache contains the snooped line and to invalidate the line if it is present.

Cache Flushing. The on-chip cache can be flushed by external hardware or by software instructions. Flushing the cache through hardware is accomplished by driving the FLUSH# pin low. This causes the cache to writeback all modified lines in the data cache and mark the state bits for both caches invalid. The Flush Acknowledge special cycle is driven by the Pentium processor when all writebacks and invalidations are complete. The INVD and WBINVD instructions cause the on-chip caches to be invalidated also. WBINVD causes the modified lines in the internal data cache to be written back, and all lines in both caches to be marked invalid. After execution of the WBINVD instruction, the Writeback and Flush special cycles are driven to indicate to any external cache that it should writeback and invalidate its contents. INVD causes all lines in both caches to be invalidated. Modified lines in the data cache are not written back. The Flush special cycle is driven after the INVD instruction is executed to indicate to any external cache that it should invalidate its contents. Care should be taken when using the INVD instruction that cache consistency problems are not created. Note that the implementations of the INVD and WBINVD instructions are processor dependent. Future processor generations may implement these instructions differently.

Data Cache Consistency Protocol (MESI Protocol). The Pentium processor Cache Consistency Protocol is a set of rules by which states are assigned to cached entries (lines). The rules apply for memory read/write cycles only. I/O and special cycles are not run through the data cache. Every line in the Pentium processor data cache is assigned a state dependent on both Pentium processor generated activities and activities generated by other bus masters (snooping). The Pentium processor Data Cache Protocol consists of 4 states that define whether a line is valid (HIT/MISS), if it is available in other caches, and if it has been MODIFIED. The four states are the M (Modified), E (Exclusive), S (Shared) and the I (Invalid) states and the protocol is referred to as the MESI protocol. The Pentium processor code cache follows a subset of the MESI protocol.

Bus Functional Description. The Pentium processor bus is designed to support a data transfer rate. All data transfers occur as a result of one or more bus cycles.

Physical Memory and I/O Interface. Pentium processor memory is accessible in 8-, 16-, 32-, and 64-bit quantities. Pentium processor I/O is accessible in 8-, 16-, and 32-bit quantities. The Pentium processor can directly address up to 4 Gbytes of physical memory, and up to 64 Kbytes of I/O. In hardware, memory space is organized as a sequence of 64-bit quantities. Each 64-bit location has eight individually addressable bytes at consecutive memory addresses (Fig. 4.15). I/O space is organized as a sequence of 32-bit quantities. Each 32-bit quantity has four individually addressable bytes at consecutive memory addresses. Fig. 4.16 is for a conceptual diagram of the I/O space. 64-bit memories are organized as arrays of physical quadwords (8-byte words). Physical quadwords begin at addresses evenly divisible by 8. The quadwords are addressable by physical address lines A31-A3. 32-bit memories are organized as arrays of physical dwords (4-byte words). Physical dwords begin at addresses evenly divisible by 4. The dwords are addressable by physical address lines A31-A3 and A2. 16-bit memories are organized as arrays of physical words (2-byte words). Physical words begin at addresses evenly divisible by 2. The words are addressable by physical address lines A31-A3, A2-A1, BHE#, and BLE#. To address 8-bit memories, the lower 3 address lines (A2-A0) must be decoded from the byte enables.

Data Transfer Mechanism. All data transfers occur as a result of one or more bus cycles. Logical data operands of byte, word, dword, and quadword lengths may be transferred. Data may be accessed at any byte boundary, but two cycles may be required for misaligned data transfers. The Pentium processor considers a 2-byte or 4-byte operand that crosses a 4-byte boundary to be misaligned. In addition, an 8-byte operand that crosses an 8-byte boundary is misaligned. The Pentium processor address signals are split into two components. The address lines A31-A3 provide high-order address bits. The byte enables BE7#-BE0# form the low-order address and selects the appropriate byte of the 8-byte data bus. The byte enable outputs are asserted when their associated data bus bytes are involved with the present bus cycle. For both memory and I/O accesses, the byte enable outputs indicate which of the associated data bus bytes are driven valid for write cycles and on which bytes data is expected back for read cycles. Non-contiguous byte enable patterns will never occur. Because the data bus is 64 bits, special considerations need to be made for interfacing to 32-bit memory systems. Address bit 2 along with the appropriate byte enable signals need to be generated by external hardware.

I nterfacing with 8-, 16-, 32-, and 64-Bit Memories. In 64-bit physical memories such as Fig. 4.17, each 8-byte qword begins at a byte address that is a multiple of eight. A31-A3 are used as an 8-byte qword select and BE7#-BE0# select individual bytes within the word. Memories that are 32 bits wide require external logic for generating A2 and BE3#-BE0#. Memories that are 16 bits wide require external logic for generating A2, Al, BHE#, and BLE#. Memories that are 8 bits wide require external logic for generating A2, Al, and A0. All memory systems that are less than 64 bits wide require external byte swapping logic for routing data to the appropriate data lines. The Pentium processor expects all the data requested by the byte enables to be returned as one transfer (with one BRDY#), so byte assembly logic is required to return all requested bytes to the Pentium processor at one time. Note that the Pentium processor does not support BS8# or BS16# (or BS32#), so this logic must be implemented externally if necessary. Fig. 4.18 shows the Pentium processor address bus interface to 64, 32, 16 and 8-bit memories. Address bits A2, Al, and A0 and BHE#, BLE#, and BE3'#-BE0'# are decoded. External byte swapping logic is needed on the data lines so that data is supplied to and received from the Pentium processor on the correct data pins. For memory widths smaller than 64 bits, byte assembly logic is needed to return all bytes of data requested by the Pentium processor in one cycle. Operand alignment and size dictate when two cycles are required for a data transfer. When multiple cycles are required to transfer a multi-byte logical operand, the highest order bytes are transferred first.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]