MO601/MC973 - Computer Architecture II

22/12Final grades.
18/12Exam 2 grades.
12/12Project 4 deadline postponed to Dec. 15th.
11/12Project 2 grades.
05/12Project 1 grades.
20/10Class for 21/oct cancelled. Project 2 postponed to 23/oct (end of day).
16/10Exam 1 grades.
10/08Lectures will start on Monday, 22nd.
22/julImportant dates in the school calendar: Graduate and Undergraduate programs.

This course will cover tools and methodologies for Computer Architecture research including modern simulators, benchmarks for single/multi-cores and clusters. We will study recent papers on the area and how they model pipelines, caches, execution engines, power evaluation, etc.

The recommended bibliography contains:

  • Processor Microarchitecture: An Implementation Perspective. Antonio González, Fernando Latorre and Grigorios Magklis. Synthesis Lectures on Computer Architecture. Morgan && Claypool Publishers.
  • Modern Processor Design: Fundamentals of Superscalar Processors. John Paul Shen, Mikko H. Lipasti. Waveland Press. 2013.
  • Papers from Top Computer Architecture Conferences

Videos about virtual memory (Contributed by Alberto Oliveira): 1, 2, 3, 4.

2 Written exams: 60% of final grade (30% each).

Practical Projects: 40% of final grade.

Grade ranges: A for grade > 8.4, B for grade > 6.9, C for grade > 4.9, D for grade < 5.

Any unethical behavior related to the evaluation process will result in failing the course with the lowest possible grade. Every assignment is an individual assignment unless otherwise mentioned. Students are not expected to see each other solutions to the assignments.

Exercises provided by Marcus Angeloni

  1. O que são benchmarks?
  2. Qual é a diferença entre arquitetura e microarquitetura de computadores?
  3. Quais são as dimensões mais comuns para classificação de microarquiteturas de processadores? Explique três delas.
  4. Qual a diferença de processadores multicore e multithreaded?
  5. Quais são os sete estágios do pipeline de um microprocessador?
  6. Qual seria o tamanho da memória cache em um sistema ideal? Por quê?
  7. Qual a diferença entre a memória cache de primeiro nível e as de demais níveis?
  8. Quais as motivações para uso de endereçamento virtual?
  9. O que é virtual aliasing?
  10. O que é uma página?
  11. O que é e para que serve a TLB?
  12. Qual a diferença entre tag paralela e tag serial no contexto de acesso a array de dados?
  13. Quais são os tipos de misses no contexto de loockup-free caches?
  14. Qual a diferença entre MSHRs explicitamente endereçadas e implicitamente endereçadas?
  15. Qual a diferença entre caches multiportas e multibancos?
  16. Qual é a responsabilidade da instruction fetch unit?
  17. Como funciona e para que serve o branch prediction?
  18. Qual a diferença entre BTB e RAS?
  19. Qual a diferença entre cache convencional e trace cache?
  20. Qual a diferença entre predição estática e dinâmica?
  21. Como é feita a escolha de qual branch predictor utilizar?
  22. Qual o propósito do decodificador de instrução? O que ele identifica?
  23. Qual a diferença de RISC e CISC?
  24. Qual o tamanho em bytes que uma instrução pode assumir em uma arquitetura x86?
  25. O que são e para que servem micro-operações?
  26. Qual é o papel da fase de alocação no pipeline de microprocessadores?
  27. Por que o register renaming é necessário?
  28. Qual é o principal limitante do número de registradores no processador?
  29. Para que serve o reorder buffer?
  30. Qual a diferença entre rename buffer e reorder buffer?
  31. Como funciona a estratégia de merged register file?
  32. Quais são as estratégias para quando os valores de registradores são lidos? Quais as vantagens de cada uma delas?
  33. Qual a ideia da abordagem de SimPoints? Quais os benefícios?
  34. O que são fases de um programa?
  35. O que são SimPoints?

Other exercises

  1. What are the main limitants on the number of instructions executed in parallel?
  2. Design a piece of C code containing a function call, a loop, and an if statement. Show where should be the branches in the assembly code. For each branch, explain how easy/difficult they can be predicted.
  3. Show a piece of assembly code containing, at least, one WAR, RAR, WAW, RAW dependencies. What will happen to this code after register renaming?
  4. Show an example (piece of code) of a Trace Cache performing better than a conventional cache. How good is this cache in this example?
  5. How can you decode multiple x86 instructions from a block of bytes retrieved from the instruction cache?
  6. Considering a sequency of 10 instructions to be fetched from memory in a scalar processor. Consider also that this processor has a branch predictor. How many times will the branch predictor hardware be accessed? Why?

Exercises provided by Marcus Angeloni

  1. Qual o objetivo do estágio de despacho?
  2. Qual a diferença entre despacho em ordem e fora de ordem?
  3. Como funciona o scoreboarding?
  4. Como funciona a fila de despacho quando os operandos são lidos antes do despacho?
  5. Quais são e o que fazem os diferentes eventos da fila de despacho?
  6. Qual a principal diferença entre a leitura depois do despacho e antes do despacho?
  7. Como funciona a fila de emissão quando os operandos são lidos após o despacho?
  8. Como funcionam os diferentes tipos de desambiguação de memória?
  9. Quais os conceitos por detrás de uma fila de despacho distribuída?
  10. Para que servem as matrizes de indeterminação e dependência?
  11. Por que especular no acesso a memória é considerado bem crítico?
  12. Quais as diferenças entre wakeup conservador e especulativo?
  13. Qual objetivo do estágio de execução?
  14. Quais as unidades de execução mais comuns?
  15. O que é a rede de bypassing?
  16. Por que as unidades de lógica e aritmética em geral é separada da de multiplicação e divisão?
  17. Como funcionam as operação de multiplicação e divisão em processadores que não implementam essas unidades?
  18. Qual a diferença entre modelo de memória segmentada e flat?
  19. O que é endereço efetivo?
  20. Qual o objetivo da unidade de branch?
  21. Como funcionam as unidades SIMD? Quais suas vantagens?
  22. Geralmente como é composta uma unidade SIMD? O que são vias (lanes)?
  23. O que são bolhas? Com o bypassing pode minimizá-las?
  24. Quais as vantagens e desvantagens do bypass?
  25. Por que o result bypassing em processadores em ordem costuma ser mais complexo do que de processadores fora de ordem?
  26. O que são e para que servem os SRF?
  27. Como funciona o clustering?
  28. Cite e explique dois tipos de clustering.
  29. Por que é necessário um estágio de commit?
  30. O que são e como se relacionam os estágios arquiteturais e especulativos?
  31. Qual a diferença entre estados arquiteturais baseados em Retire Register File e Merged Register File? Para que tipo de processadores é mais adequado utilizar cada um deles?
  32. Como é realizada a recuperação de um branch misprediction?
  33. Quais são as formas de tratamento de branch misprediction?
  34. Como é realizada a recuperação de pois de uma exceção?

Exercises provided by Pedro Henrique Amorim

  1. Qual o papel do Issue stage?
  2. Quais os principais esquemas de issue?
  3. Em geral como é executado o esquema in order e o esquema out of order?
  4. Qual o papel do scoreboarding?
  5. Comente sucintamente como funciona1 a técnica "in-order" nos processadores VLIW?
  6. Descreva o cenário em que é assumido o unified issue queue.
  7. Descreva o cenário em que é assumido o reservation stations.
  8. Em um esquema read before issue existem vários componentes, comente o objetivo dos seguintes componentes:
    1. Qual o papel do do bloco "ctrl info" no esquema issue out of order?
    2. Qual a função da Memória CAM (Content Address Memory)?
    3. Arrays chamados Src1Id e Src2Id?
    4. Blocos V1 e V2?
    5. Blocos R1 e R2?
  9. Descreva os seguintes eventos:
    1. Issue queue allocation.
    2. Instruction wakeup.
    3. Instruction selection.
    4. Issue queue reclamation.
  10. Cite dois motivos que podem fazer uma instrução ficar parada no estágio de issue.
  11. No pipeline de um determinado processador o estágio de Issue executa 8 instruções por vez mas no estágio de fetch é possível executar 16 instruções simultaneamente, quantas instruções serão obtidas simultaneamente após o estágio de commit ser finalizado?

Exercises provided by Rafael Junio

  1. Como se calcula o tamanho de uma flat page table? Calcule o tamanho de uma flat page table de um processador de 64 bits utilizando páginas de 4KB.
  2. Como uma multilevel page table consegue salvar espaço em relação a flat page table?
  3. Dado uma page table de 4 níveis: 64 bits endereço virtual, 64 kb page size, 8B entrada da página. Apenas os endereços entre 0 e 4GB são utilizadas, calcule o tamanho da flat page table e da page table de 4 níveis dívididas igualmente.
  4. Calcule a latência de um miss em uma tradução de endereço virtual para físico considerando uma page table de 3 níveis. Considere que:
    • 1 ciclo para computar o endereço virtual
    • 1 ciclo para acessar a cache
    • 20 ciclos para acessar a memória
    • 90% de hit para dados
    1. page table não esta em cache.
    2. page table esta em cache e tem 90% de hit de dados.
  5. Qual o tamanho de uma TLB com página de 4KB tal que tenha a mesma taxa de hits de uma cache com 32KB de tamanho e 64B de tamanho de bloco?

I will provide office hour after each class. If you need more or alternative time, feel free to schedule by email.

Every assignment is an individual assignment unless otherwise mentioned. Students are not expected to see each other solutions to the assignments.

Project 1

Infrastructure: PIN and SPEC 2006

Tasks:

  1. Install SPEC 2006, execute it, understand the runspec script.
  2. Install PIN, execute a few examples. Understand how it works.
  3. Use the available pintools to count the number of instructions of each SPEC program.
  4. Create a new pintool and use it in, at least, 5 SPEC programs.

Report:

  • Create a folder called project1 in your repository
  • Due to 19/Sep, 10AM
  • Report document. SBC Template. You can choose either English or Portuguese for your report. Maximum of 6 pages containing the count (item 3 above) and the description and result of your pintool. Filename: report.pdf
  • Presentation Document. Create a file called presentation.pdf containing slides for a 5 minutes presentation of your project.
  • CSV file. Include a file results.csv containing the results of the instruction count. This file should contain two columns where the first is the program name and the second is the instruction count. For programs that execute more than one time, include the execution number (1, 2, 3) after their names.
  • Source code. Include your source code in the folder src. This folder should contain all code that you created/modified together with scripts to execute and a README.md file explaining dependencies. Your script could rely on environment variables for pre-requisites.

Project 2

Infrastructure: PIN, and 10 benchmarks

Task:

  • Evaluate Virtual to Physical memory translation for 4KB and 4MB pages.
  • Consider up to 512 entries TLB for instruction and data.
  • Consider 3 or 4 levels page table.
  • Look for benchmarks with large memory footprint.
  • Create one toy benchmark to check your environment.

Report:

  • Create a folder called project2 in your repository
  • Due to 23/Oct (end of the day)
  • Report document. SBC Template. You can choose either English or Portuguese for your report. Maximum of 6 pages containing the count (item 3 above) and the description and result of your pintool. Filename: report.pdf
  • Presentation Document. Create a file called presentation.pdf containing slides for a 5 minutes presentation of your project.
  • CSV file. Include a file results.csv containing your results. For each benchmark, include the following columns: benchmark name (nd input if necessary), total memory access for instructions, total TLB misses for instructions, total page table access for instructions, total memory access for data, total TLB misses for data, total page table access for data.
  • Source code. Include your source code in the folder src. This folder should contain all code that you created/modified together with scripts to execute and a README.md file explaining dependencies. Your script could rely on environment variables for pre-requisites.

Project 3

Goal: Reproduce one item (graph, table, etc) of a pre-selected paper from the last three editions of the following conferences: ISCA, ASPLOS, MICRO, HPCA.

Tasks:

  • Create a folder called project3 in your repository
  • Every Friday, up to 21/Oct, include the reference to one paper that you preliminary inspected in a file called papers.txt
  • When you feel that you have selected the desired paper, talk to me to reserve it and avoid conflicts. Insert the paper PDF in your repository as paper.pdf and create a short overview of it together with the specification of your task and how you plan to execute it in the following weeks. This presentation should be in a file called presentation1.pdf and you are expected to talk about it for 15 minutes in the classes of 31/Oct and 04/Nov.

Report:

  • Create a folder called project3 in your repository
  • Due to 17/Nov (end of the day)
  • Report document. SBC Template. You can choose either English or Portuguese for your report. Maximum of 6 pages containing the count (item 3 above) and the description and result of your pintool. Filename: report.pdf
  • Presentation Document. Create a file called presentation2.pdf containing slides for a up to 15 minutes presentation of your project.
  • Source code. Include your source code in the folder src. This folder should contain all code that you created/modified together with scripts to execute and a README.md file explaining dependencies. Your script could rely on environment variables for pre-requisites.

Selected papers

  • João Paulo Labegalini de Carvalho: Varun Agrawal, Abhiroop Dabral, Tapti Palit, Yongming Shen, and Michael Ferdman. 2015. Architectural Support for Dynamic Linking. In Proceedings of the Twentieth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '15). ACM, New York, NY, USA, 691-702. DOI: http://dx.doi.org/10.1145/2694344.2694392
  • Gustavo Ciotto Pinton: R. Parihar and M. C. Huang, "Accelerating decoupled look-ahead via weak dependence removal: A metaheuristic approach," 2014 IEEE 20th International Symposium on High Performance Computer Architecture (HPCA), Orlando, FL, 2014, pp. 662-677.
  • Ciro Ceissler: Shao, Yakun Sophia, et al. "Aladdin: A pre-rtl, power-performance accelerator simulator enabling large design space exploration of customized architectures." 2014 ACM/IEEE 41st International Symposium on Computer Architecture (ISCA). IEEE, 2014.
  • Rafael Junio: FLUSH+RELOAD: A High Resolution, Low Noise, L3 Cache Side-Channel Attack. Usenix Security Simposium 2014.
  • Lucas Prado Melo: Hilton, A. D., B. C. Lee, and Z. Huang. "Decoupling loads for nano-instruction set computers." Proceedings of The 43rd International Symposium on Computer Architecture. 2016.
  • Paulo Henrique Junqueira Amorim: Tri M. Nguyen and David Wentzlaff. 2015. MORC: a manycore-oriented compressed cache. In Proceedings of the 48th International Symposium on Microarchitecture (MICRO-48).
  • Uglaybe Fernandes: Albericio, Jorge, et al. "Wormhole: Wisely predicting multidimensional branches." Proceedings of the 47th Annual IEEE/ACM International Symposium on Microarchitecture. IEEE Computer Society, 2014.
  • Alceu Emanuel Bissoto: Akanksha Jain, Calvin Lin. "Back to the Future: Leveraging Belady’s Algorithm for Improved Cache Replacement". Proceedings of The 43rd International Symposium on Computer Architecture (ISCA). 2016.
  • Marcus de Assis Angeloni: S. Bucur, J. Kinder, and G. Candea - "Prototyping symbolic execution engines for interpreted languages". In Proceedings of the 19th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS '14). ACM, New York, NY, USA, 239-254.
  • Rafael Soares: S. Girbal, G. Mouchard, A. Cohen, and O. Temam. DiST: A simple, reliable and scalable method to significantly reduce processor architecture simulation time. In Proceedings of the 2003 ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Systems, pages 1–12, June 2003.
  • Alfredo Salvarani: D. Gope and M. H. Lipasti, "Bias-Free Branch Predictor," 2014 47th Annual IEEE/ACM International Symposium on Microarchitecture, Cambridge, 2014, pp. 521-532.
  • George Araújo: S. Khan, A. R. Alameldeen, C. Wilkerson, O. Mutluy and D. A. Jimenezz, "Improving cache performance using read-write partitioning," 2014 IEEE 20th International Symposium on High Performance Computer Architecture (HPCA), Orlando, FL, 2014, pp. 452-463.
  • Paulo Henrique: Eric Rotenberg, Steve Bennett, and James E. Smith. 1996. Trace cache: a low latency approach to high bandwidth instruction fetching. In Proceedings of the 29th annual ACM/IEEE international symposium on Microarchitecture (MICRO 29). IEEE Computer Society, Washington, DC, USA, 24-35.
  • Davi Castro: G. Aşılıoğlu, Z. Jin, M. Köksal, O. Javeri and S. Önder, "LaZy Superscalar," 2015 ACM/IEEE 42nd Annual International Symposium on Computer Architecture (ISCA), Portland, OR, 2015, pp. 260-271.
  • Pedro Tadahiro: The Inner Most Loop Iteration counter: a new dimension in branch history - Andre Seznec (INRIA/IRISA), Joshua San Miguel (University of Toronto), Jorge Albericio (University of Toronto)

Project 4

Goal: Expand one activity of the project 3 paper.

Tasks:

  • Create a folder called project4 in your repository
  • You can explore more configurations, you can make any variation to the algorithm, you can choose other opportunities. You do not need to get better results. You can even work to better explain the oficial result.

Report:

  • Create a folder called project4 in your repository
  • Due to 12/Dec (end of the day)
  • Report document. SBC Template. You can choose either English or Portuguese for your report. Maximum of 6 pages containing the count (item 3 above) and the description and result of your pintool. Filename: report.pdf
  • Presentation Document. Create a file called presentation.pdf containing slides for a up to 15 minutes presentation of your project.
  • Source code. Include your source code in the folder src. This folder should contain all code that you created/modified together with scripts to execute and a README.md file explaining dependencies. Your script could rely on environment variables for pre-requisites.
DateTopic
22/agoIntroduction
26/agoReading a paper - Project 3 description
29/agoIntroduction do Microarchitecture
02/setOverview of Execution Environments
05/setCaches
09/setWork time for Project 1
12/setWork time for Project 1
16/setFetch Unit
19/setProject 1
23/setDecode Unit
26/setAllocation
30/setSimPoints
03/outWork time for Project 2
07/outWork time for Project 2
10/outReview
14/outExam 1
17/outExam 1 resolution
21/outClass cancelled
24/outProject 2 - Presentation
28/outHolliday
31/outProject 3 - Preliminary presentation
04/novProject 3 - Preliminary presentation
07/novIssue
11/novReview Project 3
14/novHolliday
18/novProject 3 - Presentation
21/novProject 3 - Presentation
25/novExecute
28/novCommit
02/dezCache Coherence
05/dezReview
09/dezHolliday
12/dezExam 2
16/dezProject 4