Chapter Six Pipelining Harzard

Slides:



Advertisements
Apresentações semelhantes
Presenter’s Notes Some Background on the Barber Paradox
Advertisements

Chapter Six Pipelining
Chapter Five The Processor: Datapath and Control (Parte B: multiciclo)
1998 Morgan Kaufmann Publishers Mario Côrtes - MO401 - IC/Unicamp- 2004s2 Ch5A-1 Chapter Five The Processor: Datapath and Control.
Conjunto de Instruções MIPS
PIPELINE (continuação).
Aula 06: Introdução ao Pipelining, Hazards Estruturais e Forwarding
Aula 08: Execução Multiciclo e MIPS R4000
Introdução Arquitectura com unidade de controlo uniciclo.
0. Introdução.
Exemplo de arquitetura registrador-registrador- MIPS
MIPS PIPELINE.
Processador Fluxo de Dados e Controle
AULA 06 - MIPS PIPELINE.
Processo de Pipelining (exemplo da lavanderia)
MC Prof. Paulo Cesar Centoducatte MC542 Organização de Computadores Teoria e Prática.
1998 Morgan Kaufmann Publishers Mario Côrtes - MO401 - IC/Unicamp- 2002s1 Ch6-1 Chapter Six Pipelining.
MC Prof. Paulo Cesar Centoducatte MC542 Organização de Computadores Teoria e Prática.
Pipeline.
SSC114 Arquitetura de Computadores Pipeline - Predição de desvios
Multiplicador e Forwarding no MIPS
Melhorando o desempenho com pipeline
Prof. Felipe Ferreira de Oliveira
AdsRcatyb It's sad to think we're not gonna make it É triste pensar que não vamos conseguir It's sad to think we're not gonna make it É triste pensar.
Conceitos Avançados de Arquitetura de Computadores Arquiteturas RISC Reduced Instruction Set Computer 6.
Conceitos Avançados de Arquitetura de Computadores Arquiteturas RISC Arquiteturas Superpipeline e Superescalares.
1  1998 Morgan Kaufmann Publishers Paulo C. Centoducatte – MC542 - IC/Unicamp- 2006s Prof. Paulo Cesar Centoducatte
Used to.
TRABALHO AVALIATIVO ALUNO: FRANCISCO HELIÉSUS DE MEDEIROS MATÉRIA: ORGANIZAÇÃO DE COMPUTADORES.
Construção de Via de dados Trabalho Avaliativo do Primeiro Bimestre. Marcos André de Sena Silva.
Pesquisa Operacional aplicada à Gestão de Produção e Logística Prof. Eng. Junior Buzatto Case 3.
Learning english with comics …………….. Aprendendo inglês com quadrinhos.
Phases of Hackers. Module 1: Today’s Threat Landscape Module 2: Key Principles of Security Module 3: Understanding your enemy! Module 4: Phases of Hackers.
Arquitetura do SET de instruções Instruction SET CISC vs RISC
PSI3441 – Arquitetura de Sistemas Embarcados
Visão geral do Aprendizado de máquina
SSC-0114 ARQUITETURA DE COMPUTADORES 11/09/2017
Computador MIPS Organização básica e conjunto de instruções.
Caminho de Dados (aula passada)
Grammar Reference Relative Pronouns Upgrade 2 - Unit 8
LIÇÃO DE PROGRAMAÇÃO INTERMEDIÁRIA
Teste e Qualidade de Software
SENOP Seminário Nacional de Operadores de Sistemas e de Instalações Elétricas Atualização Tecnológica como base para a Inovação nos Processos da Operação.
-A partir do 2º Slide a passagem é automática!
LINGUAGENS DE PROGRAMAÇÃO
TAKEAWAYS MY 8 KEY FROM THE SUPER INSIGHTFUL Q&A WITH GARY VEE.
Grammar Reference: Modal Verbs
Three analogies to explain reactive power Why an analogy? Reactive power is an essential aspect of the electricity system, but one that is difficult to.
E.E.F. LUIZ BEZERRA DE PAULA – BARRA DO SOTERO – CROATÁ – CE. DISCIPLINA DE INGLÊS – 8° & 9° ANO. ESTUDO DA MÚSICA PERFECT ED SHEERAN PROFESSOR: LUIZ FILHO.
Aplicativo EBSCO eBooks Autenticação
Grammar Reference Simple Future Future Continuous Upgrade 2 - Unit 2
Grammar Reference: Modal Verbs
Neither one of us Nenhum de nós Glady's Knight AdsRcatyb.
Unit l Verb to be.
Determinou o endereço de A
THE WAY WE WERE O JEITO COMO NÓS ÉRAMOS (Memories)
Indirect Speech Upgrade 3 - Unit 4
Top-Down Parsing Teoría de Autómatas y Lenguajes Formales
Verbs followed by infinitive and gerund- page 24.
Grammar Reference: Modal Verbs
Developing a Hypothesis
Organização: projeto Segurança Digital
Introduction to density estimation Modelação EcoLÓGICA
Student #1: Go to the board and write a word.
Pesquisadores envolvidos Recomenda-se Arial 20 ou Times New Roman 21.
How can I say? – Class 4.
Chapter 3 Instructions: Language of the Machine
FORMAS VERBAIS II (TEMPOS PROGRESSIVOS, PERFEITOS)
4W Mozambique Quem está fazendo oquÊ onde E quando
Quem está fazendo o quÊ onde E quando
Transcrição da apresentação:

Chapter Six Pipelining Harzard

Data Dependencies Problem with starting next instruction before first is finished dependencies that “go backward in time” are data hazards qual instrução receberá o valor errado de $2 (velho 10, novo -20) I M R e g C 1 2 3 4 5 6 T i m ( n c l o k y s ) u b $ , P r a x t d D 7 8 9 / – w V f :

Erro devido à dependência de dados sub $2, $1, $3 and $12, $2, $5 or $13, $6, $2 add $14, $2, $2 sw $15, 100($2) and e or lêem resultado errado (velho 10) store está claramente à direita (depois no tempo) e lê resultado certo (-20) hazard no add pode ser evitado se a escrita no banco de registradores for feita (em CC5) na metade do ciclo (borda de descida) CC4 CC5 CC6 Reg WR Reg RD

Software Solution Have compiler guarantee no hazards Where do we insert the “nops” ? Quantos sub $2, $1, $3 and $12, $2, $5 or $13, $6, $2 add $14, $2, $2 sw $15, 100($2) Problem: this really slows us down!

Forwarding Use temporary results, don’t wait for them to be written register file forwarding to handle read/write to same register ALU forwarding I M R e g C 1 2 3 4 5 6 T i m ( n c l o k y s ) u b $ , P r a x t d D 7 8 9 / – w V f : X E W B what if this $2 was $13?

Forwarding P C I n s t r u c i o m e y R g M x l A L U E X W B D / a F .

Can't always forward Load word can still cause a hazard: an instruction tries to read a register following a load instruction that writes to the same register. Thus, we need a hazard detection unit to “stall” the load instruction R e g I M C 1 2 3 4 5 6 T i m ( n c l o k y s ) w $ , P r a x u t d D 7 8 9

Stalling We can stall the pipeline by keeping an instruction in the same stage l w $ 2 , ( 1 ) P r o g a m e x c u t i n d s 4 5 8 6 9 7 R I M D C 3 T k y b

Hazard Detection Unit Stall by letting an instruction that won’t write anything go forward P C I n s t r u c i o m e y R g M x l A L U E X W B D / a H z d F w .

Exemplo pag 493 H a z r d e t c i o n u M x I F / D W P C E X . R g s M x I F / D W P C E X . R g s l w $ 2 , ( 1 ) m y B 4 5 b f < > k 3 A L U Exemplo pag 493

Exemplo pag 493 H a z r d e t c i o n u M x I F / D W P C E X . R g s M x I F / D W P C E X . R g s $ 2 5 4 B m y , b l w f < 1 > k A L U 9 Exemplo pag 493

Branch Hazards When we decide to branch, other instructions are in the pipeline! We are predicting “branch not taken” (stalling is too slow) need to add hardware for flushing instructions if we are wrong R e g C 1 T i m ( n c l o k y s ) 4 b q $ , 3 7 P r a x u t d I M D 2 5 8 6 w 9

Diminuindo a penalidade do “branch taken” no esquema anterior decisão só é tomada no estágio MEM caso “branch taken” é necessário limpar (flush) os estágios IF, ID e EX 3 clocks perdidos para diminuir a penalidade: antecipar a decisão do estágio MEM para o estágio ID economia de dois clocks flush somente instrução sendo lida da memória (fetched) mudanças no hardware: cálculo do endereço do desvio (PC + offset<<2) comparação dos registradores 32 XORs com or na saída mais rápido do que a ALU

Flushing Instructions P C I n s t r u c i o m e y 4 R g M x A L U E X W B D / a H z d F w . l h S = f 2

Improving Performance Try and avoid stalls! E.g., reorder these instructions: lw $t0, 0($t1) lw $t2, 4($t1) sw $t2, 0($t1) sw $t0, 4($t1) Add a “branch delay slot” the next instruction after a branch is always executed rely on compiler to “fill” the slot with something useful Branch prediction: tentar acertar se o desvio será tomado ou não em loops, desvio é tomado a maior parte das vezes branch history table Superscalar: start more than one instruction in the same cycle

Dynamic Scheduling The hardware performs the “scheduling” hardware tries to find instructions to execute out of order execution is possible speculative execution and dynamic branch prediction All modern processors are very complicated DEC Alpha 21264: 9 stage pipeline, 6 instruction issue PowerPC and Pentium: branch history table Compiler technology important This class has given you the background you need to learn more Video: An Overview of Intel’s Pentium Processor (available from University Video Communications)

Comparação de desempenho (p 504) para monociclo, multiciclo e pipeline gcc: lw (23%), sw (13%), beq (19%), j (2%), resto (43%) pipeline: 2ns (memória e ALU) e 1ns para o registrador (RD ou WR) 1/2 dos lw seguidas por instruções que usam o resultado 1/4 dos beq são errados (1 clock perdido) jumps perdem um ciclo lw: 1 clock sem hazard e 2 clock com hazard; média = 1.5 beq: 1 clock se OK (3/4) e 2 clocks se não OK (1/4); média = 1.25 jump: 2 clocks demais instruções: 1 clock CPI = 1.5*0.23+1*0.13+1*0.43+1.25*0.19+2*0.02 = 1.18 clock = 2ns; tempo médio de execução = 2*1.18=2.36ns multiciclo; 4.02*2=8.08ns; monociclo = 8ns pipeline é 3.4 vezes mais rápido do que monociclo ou multiciclo

Circuito completo P C I n s t r u c i o m e y 4 R g S x d M l A L U E W B D / a H z F w . h p f 2 1 3 6 [ 5 – ] O =