Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

20
Arquitectura de Arquitectura de Computadores I Computadores I Memoria Cache Memoria Cache

Transcript of Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Page 1: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Arquitectura de Arquitectura de Computadores IComputadores IArquitectura de Arquitectura de Computadores IComputadores I

Memoria CacheMemoria Cache

Page 2: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Principal Memoria Cache

Memoria Cache

Page 3: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Principio de Localidad

• Localidad Temporal: Si un dato es buscado, este tiende a ser buscado nuevamente.

• Localidad Espacial: Si un dato es buscado, datos cercanos tienden a ser buscados.

Page 4: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Jerarquía de Memoria

Registros

Cache

Principal

Secundaria (Disco)

Page 5: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache

Page 6: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Jerarquía de Memoria

Page 7: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache

Jerarquía de dos niveles

Unidad mínima de información(Bloque)

Hit: dato pedido por el procesador SI está en el nivel más alto

Miss: dato pedido por el procesador NO está en el nivel más alto

Nivel alto

Page 8: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache Razón de Acierto: Tasa de referencias a memoria que

producen aciertos.

Razón de Desacierto: 1 - (Razón de Acierto).

Tiempo de Acierto: Tiempo que tarda en leer un dato del cache.

Penalidad de Desacierto: (Tiempo en Reemplazar Bloque) + (Tiempo de Lectura de Dato al Procesador).

Tiempo de Acceso Promedio a Memoria: (Razón de Acierto) * (Tiempo de Acierto) + (Razón de Desacierto) * (Penalidad de Desacierto).

Page 9: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache1. Correspondencia Directa (Direct

Mapped)2. Completamente Asociativa (Fully

Associative)3. Asociativa por Conjuntos (Set

Associative)

Page 10: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache• Correspondencia Directa

(Direct Mapped)

Page 11: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache

Bit de Validez

Bloque

Etiqueta

Dirección del bloque

Cache vacía

Referencia a Memoria 1 0 1 1 0

Page 12: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria CacheReferencia a Memoria 1 1 0 1 0

Referencia a Memoria 1 0 0 0 0

Page 13: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache

Page 14: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Memoria Cache

Page 15: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Notas de Memoria Cache

• Intel Corp.'s Pentium III processor has 32KB of L1 cache on the processor chip and either 256KB of L2 on-chip or 512KB of L2 off-chip. The L2 cache on the CPU chip can be accessed four times faster than if it were on a separate chip.

Page 16: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Notas de Memoria Cache

• For high-end processors, it can take from one to three clock cycles to fetch information from L1, while the CPU waits and does nothing. It takes six to 12 cycles to get data from an L2 on the processor chip, and dozens or even hundreds of cycles for off-CPU L2.

Page 17: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Notas de Memoria Cache

• Where's my data?When the CPU needs data, it first looks in its own data registers. If the data isn't there, the CPU looks to see if it's in the nearby Level 1 cache. If that fails, it's off to the Level 2 cache. If it's nowhere in cache, the CPU looks in main memory. Not there? The CPU gets it from disk. All the while, the clock is ticking, and the CPU is sitting there waiting.

Page 18: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Notas de Memoria Cache

• In 2000, Intel introduced Level 3 (L3) cache in its 64-bit server processors, called Itanium. The 2MB or 4MB cache connected to the processor over a bus that runs as fast as the processor - 800 MHz.

Page 19: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Notas de Memoria Cache

• The frequency of cache misses can be reduced by making caches bigger. But big caches draw a lot of power, generate a lot of heat and reduce the yield of good chips in manufacturing.

Page 20: Arquitectura de Computadores I Memoria Cache. Memoria PrincipalMemoria Cache.

Notas de Memoria Cache

• Intel's first Celeron processor has no cache, but the company gave the Celeron A 128K of internal cache. The Pentium II separates the cache from the main chip but keeps it on the board. This is a disadvantage because the PII cache runs at one-half the processor speed. This is why the Celeron A processor can be faster than a PII, even with less cache.

• The AMD K62 has 64K L1 cache.