Arquitectura de Computadores I

Download Report

Transcript Arquitectura de Computadores I

PIPELINING - INTRODUCCION
Definciónes básicas
Ejemplos prácticos
Ejemplos sobre un procesador
Tiempo entre instrucciones
Pipeline Hazard
ARQUITECTURA DE COMPUTADORES PIPELINING
1
PIPELINING
– Un PIPELINE es una serie de etapas, en
donde en cada etapa se realiza una
porción de una tarea. La tarea no se
termina hasta el momento en que haya
pasado a través de todas las etapas.
– Un PIPELINE es usado para mejorar el
desempeño mas allá de lo que puede
ser alcanzado con un procesamiento sin
pipeline.
ARQUITECTURA DE COMPUTADORES PIPELINING
2
PIPELINE - TROOUGHPUT
– Este mecanismo incrementa el
throughput -el número de
instrucciones completadas por unidad
de tiempo.
– No reduce la latencia -el tiempo de
ejecución de una solo instrucción
ARQUITECTURA DE COMPUTADORES PIPELINING
3
COMPLEJIDAD DEL HARDWARE
Y EL CONTROL
A cierto nivel usar Pipelining implica
replicación de algunas funciones. Con el
propósito de garantizar ejecución
simultanea.
ARQUITECTURA DE COMPUTADORES PIPELINING
4
EJEMPLO – SIN PIPELINING
Source
http://cse.stanford.edu/class/sophomore-college/projects-00/risc/pipelining/
http://www.ece.arizona.edu/~ece462/Lec03-pipe/
ARQUITECTURA DE COMPUTADORES PIPELINING
5
EJEMPLO – CON PIPELINING
Source
http://cse.stanford.edu/class/sophomore-college/projects-00/risc/pipelining/
http://www.ece.arizona.edu/~ece462/Lec03-pipe/
ARQUITECTURA DE COMPUTADORES PIPELINING
6
Figure PIPELINING.4: A single-cycle processor
http://arstechnica.com/articles/paedia/cpu/pipelining-1.ars/2
Autor: Jon Stokes
ARQUITECTURA DE COMPUTADORES PIPELINING
7
Figure PIPELINING.5: A four-stage pipeline
Figure PIPELINING.5: A four-stage pipeline
http://arstechnica.com/articles/paedia/cpu/pipelining-1.ars/2
Autor: Jon Stokes
ARQUITECTURA DE COMPUTADORES PIPELINING
8
EJEMPLO EN EL PROCESADOR
ARQUITECTURA DE COMPUTADORES Figura 6.3 Single-cycle, nonpipelined
execution in top versus
PIPELINING
pipelined execution in botton
9
Time betwen instructions pipelined
Time betweb instructions pipelined=
(Time betweb instructions
nonpipelined) / Number of pipe
stages
ARQUITECTURA DE COMPUTADORES PIPELINING
10
DEEP PIPELINING
Deep Pipelining hace referencia a la cantidad de
estados en los cuales es dividido el proceso.
En el caso del procesador estudiado se tienen 5
estado
Fetch
Read register while decoding instruction
Execute the operation or calculate an address
Access an operand in data memory
Write the result into a register
ARQUITECTURA DE COMPUTADORES PIPELINING
11
PIPELINE HAZARDS
STRUCTURAL HAZARD
Es cuando el hardware no puede soportar la
combinación de instrucciones que se desean
ejecutar en el mismo ciclo de reloj.
DATA HAZARD
Ocurren cuando el pipeline debe detenerse en un
paso mientras que se espera que otro se
complete
CONTROL HAZARD:
Ocurren cuando ha necesidad de tomar una
dedición basada en el resultado de una
instrucción mientras esta se está ejecutando
ARQUITECTURA DE COMPUTADORES PIPELINING
12
STRUCTURAL HAZARD
EJEMPLO:
Se dispone de un sistema de una
sola memoria para programa y
datosCuando se ejecuta una cuarta
instrucción se darían dos accesos a
memoria al mismo tiempo
ARQUITECTURA DE COMPUTADORES PIPELINING
13
DATA HAZARD
Add $s0, $t0, $t1
Sub $t2, $s0, $t3
Existe una dependencia de la segunda
instrucción sobre la primera mientras
está en el pipelining
ARQUITECTURA DE COMPUTADORES PIPELINING
14
DATA HAZARD: EJEMPLO
FORWARDING O BYPASSING
Figure 6.5: Graphical representation of forwarding. Computer Organization
15
ARQUITECTURA DE COMPUTADORES and Design. David A Paterson
PIPELINING
DATA HAZARD :EJEMPLO
FORWARDING O BYPASSING AND STALL
Figure 6.6 We need a stall even with forwarding when an R-format
instruction following a load tries to use the data . Computer Organization and
Design. David A Paterson
ARQUITECTURA DE COMPUTADORES PIPELINING
16
CONTROL HAZARD
Son llamados tambíen branch
hazard.
Existen dos alternativas
– STALL: Después de realizar fetch de una
instrucción de salto se hace fetch de la
siguiente, pero no se sabe si esta
efectivamen va a realizars, de modo que
se agrega una burbuja
– PREDICT: una aproximación simple es
asumir que el salto no va a ser tomado
ARQUITECTURA DE COMPUTADORES PIPELINING
17
CONTROL HAZARD: STALL
Figure 6.7: Pipeline shwing stalling on every cibditional branch as
solution to control hazard. Computer Organization and Design.
David A Paterson
ARQUITECTURA DE COMPUTADORES PIPELINING
18
CONTROL HAZARD : PREDICT
Figure 6.8: Predicting thar branches are no taken as a solution to
control hazard. Computer Organization and Design. David A
Paterson
ARQUITECTURA DE COMPUTADORES PIPELINING
19