Constructive Computer Architecture: Lab Comments & RISCV

Slides:



Advertisements
Similar presentations
An EHR based methodology for Concurrency management Arvind (with Asif Khan) Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology.
Advertisements

Constructive Computer Architecture: Multirule systems and Concurrent Execution of Rules Arvind Computer Science & Artificial Intelligence Lab. Massachusetts.
From: From:
Constructive Computer Architecture: FIFO Lab Comments Revisiting CF FIFOs Andy Wright TA October 20, 2014http://csg.csail.mit.edu/6.175L14-1.
Constructive Computer Architecture Tutorial 4: SMIPS on FPGA Andy Wright 6.S195 TA October 7, 2013http://csg.csail.mit.edu/6.s195T04-1.
Asynchronous Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology October 13, 2009http://csg.csail.mit.edu/koreaL12-1.
Constructive Computer Architecture Tutorial 5: Programming SMIPS: Single-Core Assembly Andy Wright TA October 10, 2014http://csg.csail.mit.edu/6.175T04-1.
Types for Programs and Proofs Lecture 1. What are types? int, float, char, …, arrays types of procedures, functions, references, records, objects,...
Constructive Computer Architecture Tutorial 3: Debugging SMIPS Andy Wright 6.S195 TA October 4, 2013http://csg.csail.mit.edu/6.s195T03-1.
1 INTRODUCTION TO PROBLEM SOLVING AND PROGRAMMING.
Implementing RISC Multi Core Processor Using HLS Language – BLUESPEC Final Presentation Liam Wigdor Advisor Mony Orbach Shirel Josef Semesterial Winter.
Constructive Computer Architecture Tutorial 2 Advanced BSV Sizhuo Zhang TA Oct 9, 2015T02-1http://csg.csail.mit.edu/6.175.
Constructive Computer Architecture Tutorial 4 Debugging Sizhuo Zhang TA Oct 23, 2015T04-1http://csg.csail.mit.edu/6.175.
Constructive Computer Architecture Tutorial 2 Advanced BSV Andy Wright TA September 26, 2014http://csg.csail.mit.edu/6.175T02-1.
September 22, 2009http://csg.csail.mit.edu/koreaL07-1 Asynchronous Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab.
Elastic Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology February 28, 2011L08-1http://csg.csail.mit.edu/6.375.
Constructive Computer Architecture Tutorial 4: Running and Debugging SMIPS Andy Wright TA October 10, 2014http://csg.csail.mit.edu/6.175T04-1.
Constructive Computer Architecture: Control Hazards Arvind Computer Science & Artificial Intelligence Lab. Massachusetts Institute of Technology October.
February 20, 2009http://csg.csail.mit.edu/6.375L08-1 Asynchronous Pipelines: Concurrency Issues Arvind Computer Science & Artificial Intelligence Lab Massachusetts.
Modular Refinement Arvind Computer Science & Artificial Intelligence Lab Massachusetts Institute of Technology March 8,
Constructive Computer Architecture Tutorial 6: Five Details of SMIPS Implementations Andy Wright 6.S195 TA October 7, 2013http://csg.csail.mit.edu/6.s195T05-1.
6.375 Tutorial 4 RISC-V and Final Projects Ming Liu March 4, 2016http://csg.csail.mit.edu/6.375T04-1.
October 20, 2009L14-1http://csg.csail.mit.edu/korea Concurrency and Modularity Issues in Processor pipelines Arvind Computer Science & Artificial Intelligence.
Elastic Pipelines: Concurrency Issues
CS1010 Discussion Group 11 Week 5 – Functions, Selection, Repetition.
Shellcode COSC 480 Presentation Alison Buben.
ESC101: Introduction to Computing
Computer Terms Review from what language did C++ originate?
Types for Programs and Proofs
Concurrency properties of BSV methods and rules
Bluespec-6: Modeling Processors
Scheduling Constraints on Interface methods
Sequential Circuits: Constructive Computer Architecture
Constructive Computer Architecture Tutorial 6: Discussion for lab6
Performance Specifications
Pipelining combinational circuits
Multirule Systems and Concurrent Execution of Rules
Introduction to the C Language
Constructive Computer Architecture: Guards
Object Oriented Programming COP3330 / CGS5409
Central Processing Unit
Constructive Computer Architecture Tutorial 7 Final Project Overview
Pipelining combinational circuits
EHR: Ephemeral History Register
Constructive Computer Architecture: Well formed BSV programs
Lab 4 Overview: 6-stage SMIPS Pipeline
Functions A function is a “pre-packaged” block of code written to perform a well-defined task Why? Code sharing and reusability Reduces errors Write and.
Constructive Computer Architecture Tutorial 3 RISC-V Processor
Modeling Processors: Concurrency Issues
Pipelining combinational circuits
6.375 Tutorial 5 RISC-V 6-Stage with Caches Ming Liu
How to improve (decrease) CPI
Elastic Pipelines: Concurrency Issues
Chapter Six.
Threads and Memory Models Hal Perkins Autumn 2009
Elastic Pipelines: Concurrency Issues
Constructive Computer Architecture: Guards
Control Hazards Constructive Computer Architecture: Arvind
Explaining issues with DCremoval( )
Multirule systems and Concurrent Execution of Rules
Stacks and Queues.
Tutorial 4: RISCV modules Constructive Computer Architecture
Modeling Processors Arvind
Modeling Processors Arvind
Control Hazards Constructive Computer Architecture: Arvind
Data Structures & Algorithms
Why we have Counterintuitive Memory Models
Constructive Computer Architecture: Well formed BSV programs
Lecture 4: Instruction Set Design/Pipelining
Working with the Compute Block
Presentation transcript:

Constructive Computer Architecture: Lab Comments & RISCV 11/15/2018 http://csg.csail.mit.edu/6.175

Notes Inelastic VS Elastic The FIFO lab has been graded Good job on the conflicting, pipeline, and bypass FIFOs Difficulties in the Conflict-Free FIFO with clear. 11/15/2018 http://csg.csail.mit.edu/6.175

What is a Conflict-Free FIFO? Is it a FIFO with a conflict matrix filled with CFs? Not really... Is it a FIFO that, in its typical use, doesn’t impose any more conflicts than necessary? Yes! 11/15/2018 http://csg.csail.mit.edu/6.175

Typical FIFO use Enqueuing: Dequeuing: Clearing: check notFull and call enq(x) Dequeuing: check notEmpty and call first and deq Clearing: call clear These are the methods that commonly appear in the same rule A CF FIFO says enqueuing and dequeuing rules will have no scheduling conflict imposed by the FIFO. {notFull, enq} CF {notEmpty, first, deq} 11/15/2018 http://csg.csail.mit.edu/6.175

Sequential FIFO Execution Assume FIFO is empty initially How many clock cycles does this take? Should that change the answer to these questions? enq(1) first deq enq(2) clear enq(3) enq(4) What is the state of the fifo here? What does first return? How many elements are in the FIFO at the end? 11/15/2018 http://csg.csail.mit.edu/6.175

Concurrent FIFO Execution With Clock Cycles Clock cycle boundary enq(1) first deq enq(2) clear enq(3) enq(4) enq(1) first deq enq(2) clear enq(3) enq(4) If these are both valid executions for a given FIFO, they should produce the same results. 11/15/2018 http://csg.csail.mit.edu/6.175

Concurrent FIFO Execution Clear-Enq Interactions first deq enq(2) clear enq(3) enq(4) enq(1) first deq enq(2) clear enq(3) enq(4) What should clear and enq do when they happen in the same cycle? If both executions are valid, then the action has to be dynamic based on the order. 11/15/2018 http://csg.csail.mit.edu/6.175

Can we detect the order of methods firing? In order for a method to know if it fired after another method fired, it has to always be scheduled after that method If you want two methods to be able to tell if either of them came after the other, they have to conflict They will never fire in the same cycle making this problem of who fired first trivial... 11/15/2018 http://csg.csail.mit.edu/6.175

Concurrent FIFO Execution CF FIFO solution Invalid Execution enq(1) first deq enq(2) clear enq(3) enq(4) enq(1) first deq enq(2) clear enq(3) enq(4) Force enq < clear 11/15/2018 http://csg.csail.mit.edu/6.175

What does a CF FIFO do? It allows the most flexible scheduling constraints possible while still requiring all valid concurrent executions to match the expected result from sequential execution. That is why {enq, deq} < clear and not {enq, deq} CF clear 11/15/2018 http://csg.csail.mit.edu/6.175

What about the canonicalize rule? What happens if you have: {enq, deq} < canonicalize < clear If deq and clear occur in the same rule, that rule conflicts with canonicalize. This may or may not be a problem depending on the exact use. {enq, deq} < clear < canonicalize canonicalize can always fire at the end of the cycle independent of how enq, deq, and clear are used in rules 11/15/2018 http://csg.csail.mit.edu/6.175

RISCV tutorial 11/15/2018 http://csg.csail.mit.edu/6.175

Introduction In lab 5, you will be making modifications to an existing, functional, RISCV processor How do you know if your processor is working? You will run an existing suite of C and assembly software test benches on your processor What could go wrong? Software and Hardware How will you debug this? 11/15/2018 http://csg.csail.mit.edu/6.175

Running RISCV 11/15/2018 http://csg.csail.mit.edu/6.175

Connectal Testbench Interface tb – C++ mkProc – BSV COP PC Core iMem dMem 11/15/2018 http://csg.csail.mit.edu/6.175

Loading Programs tb – C++ mkProc – BSV COP Core test.vmh iMem dMem PC 11/15/2018 http://csg.csail.mit.edu/6.175

Starting the Processor tb – C++ mkProc – BSV COP Starting PC 0x1000 PC Core iMem dMem 11/15/2018 http://csg.csail.mit.edu/6.175

Printing to Console tb – C++ mkProc – BSV COP Core iMem dMem Get write to reg 18 and 19 18: Print int x 19: Print char x COP PC Core iMem dMem 11/15/2018 http://csg.csail.mit.edu/6.175

Finishing Program tb – C++ mkProc – BSV COP Core iMem dMem Get write to csr x == 0: “PASSED” x != 0: “FAILED x” COP PC Core iMem dMem 11/15/2018 http://csg.csail.mit.edu/6.175

Ballad in the code Compilation of software Life of a print statement Software side Hardware side Example of debugging 11/15/2018 http://csg.csail.mit.edu/6.175

Programming RISCV 11/15/2018 http://csg.csail.mit.edu/6.175

Tooling for RISCV software How to compile your own C How to assemble How to disassemble 11/15/2018 http://csg.csail.mit.edu/6.175

C Programs Start code Print library No malloc Jumps to main. Can print chars, ints, and strings No malloc You can write one! 11/15/2018 http://csg.csail.mit.edu/6.175

Functional Programming 11/15/2018 http://csg.csail.mit.edu/6.175

Functional Programming Basics of functional programming emphasizes pure functions pure functions have no side effects Avoids mutable data (mutable = mutate + able) Example: Instead of sorting a list in place, create a function called sort that takes in a list and returns a new list that is sorted Functions are typically first-class objects Functions can take in functions as arguments and return them 11/15/2018 http://csg.csail.mit.edu/6.175

Intro to Haskell A functional programming language Function type definition: addFive :: Integer -> Integer The function addFive takes in an integer and produces an integer Function definition: addFive x = x + 5 The function addFive applied to a variable x produces x + 5 11/15/2018 http://csg.csail.mit.edu/6.175

Intro to Haskell A functional programming language Function type definition: add :: Integer -> Integer -> Integer The function add takes in two integers and produces an integer Function definition: add x y = x + y The function add applied to variable x and y produces x + y addFive = add 5 11/15/2018 http://csg.csail.mit.edu/6.175

Intro to Haskell A functional programming language The add function is actually curried It is a function on one Integer that returns (a function on one Integer that returns an Integer) add :: Integer -> (Integer -> Integer) add x :: Integer -> Integer Like add(x)(y) instead of add(x,y) BSV supports currying too 11/15/2018 http://csg.csail.mit.edu/6.175