ECE 353 Lab 2 Pipeline Simulator. Aims Further experience in C programming Handling strings Further experience in the use of assertions Reinforce concepts.

Slides:



Advertisements
Similar presentations
CMPE 421 Advanced Parallel Computer Architecture Pipeline datapath and Control.
Advertisements

Lecture 4: CPU Performance
1 ITCS 3181 Logic and Computer Systems B. Wilkinson Slides9.ppt Modification date: March 30, 2015 Processor Design.
CIS 314 Fall 2005 MIPS Datapath (Single Cycle and Multi-Cycle)
Lecture Objectives: 1)Define pipelining 2)Calculate the speedup achieved by pipelining for a given number of instructions. 3)Define how pipelining improves.
ELEN 468 Advanced Logic Design
CMPT 334 Computer Organization
ECE 353 Lab C Pipeline Simulator. Aims Further experience in C programming Handling strings Further experience in the use of assertions Reinforce concepts.
ECE 353 ECE 353 Fall 2009 Lab C Pipeline Simulator October 22, 2009.
ECE 353 ECE 353 Fall 2011 Lab C Pipeline Simulator October 20, 2011.
Pipeline Exceptions & ControlCSCE430/830 Pipeline: Exceptions & Control CSCE430/830 Computer Architecture Lecturer: Prof. Hong Jiang Courtesy of Yifeng.
CSCE 212 Quiz 9 – 3/30/11 1.What is the clock cycle time based on for single-cycle and for pipelining? 2.What two actions can be done to resolve data hazards?
Lec 8: Pipelining Kavita Bala CS 3410, Fall 2008 Computer Science Cornell University.
7/2/ _23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering.
ECE 353 ECE 353 Fall 2007 Lab 3 Machine Simulator November 1, 2007.
What are Exception and Interrupts? MIPS terminology Exception: any unexpected change in the internal control flow – Invoking an operating system service.
Pipeline Hazard CT101 – Computing Systems. Content Introduction to pipeline hazard Structural Hazard Data Hazard Control Hazard.
Chapter 2 Summary Classification of architectures Features that are relatively independent of instruction sets “Different” Processors –DSP and media processors.
Pipelined Datapath and Control
Comp Sci pipelining 1 Ch. 13 Pipelining. Comp Sci pipelining 2 Pipelining.
Chapter 4 The Processor. Chapter 4 — The Processor — 2 Introduction We will examine two MIPS implementations A simplified version A more realistic pipelined.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
CMPE 421 Parallel Computer Architecture
1 Designing a Pipelined Processor In this Chapter, we will study 1. Pipelined datapath 2. Pipelined control 3. Data Hazards 4. Forwarding 5. Branch Hazards.
ECE 353 Lab 2 Pipeline Simulator Additional Material.
CSIE30300 Computer Architecture Unit 04: Basic MIPS Pipelining Hsin-Chou Chi [Adapted from material by and
10/11: Lecture Topics Execution cycle Introduction to pipelining
Introduction to Computer Organization Pipelining.
Simulator Outline of MIPS Simulator project  Write a simulator for the MIPS five-stage pipeline that does the following: Implements a subset of.
CS161 – Design and Architecture of Computer Systems
Computer Organization
ECE 353 Lab 3 Pipeline Simulator
Computer Organization CS224
ARM Organization and Implementation
CSCI206 - Computer Organization & Programming
ELEN 468 Advanced Logic Design
Single Clock Datapath With Control
ECE 353 Lab 3 Pipeline Simulator
CDA 3101 Spring 2016 Introduction to Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
Pipelining: Advanced ILP
Morgan Kaufmann Publishers The Processor
Chapter 4 The Processor Part 2
Pipelining review.
Superscalar Processors & VLIW Processors
Design of the Control Unit for One-cycle Instruction Execution
Pipelining in more detail
Systems Architecture II
CSCI206 - Computer Organization & Programming
Rocky K. C. Chang 6 November 2017
Pipelining Basic concept of assembly line
Pipeline control unit (highly abstracted)
The Processor Lecture 3.6: Control Hazards
Control unit extension for data hazards
Instruction Execution Cycle
Computer Architecture
Lecture 14: Single Cycle MIPS Processor
ECE 353 Lab 3 Pipeline Simulator
Pipeline control unit (highly abstracted)
Pipelining: Basic Concepts
Pipeline Control unit (highly abstracted)
Pipelining Basic concept of assembly line
Control unit extension for data hazards
Morgan Kaufmann Publishers The Processor
Introduction to Computer Organization and Architecture
Control unit extension for data hazards
MIPS Pipelined Datapath
Problem ??: (?? marks) Consider executing the following code on the MIPS pipelined datapath: add $t5, $t6, $t8 add $t9, $t5, $t4 lw $t3, 100($t9) sub $t2,
Pipelining Hazards.
Presentation transcript:

ECE 353 Lab 2 Pipeline Simulator

Aims Further experience in C programming Handling strings Further experience in the use of assertions Reinforce concepts from pipelining Techniques for simulating parallel operations with a sequential program

Statement of Work Write a C program to simulate the register contents of a MIPS machine running an abbreviated instruction set Should be cycle-accurate with respect to register contents. Simulates a machine consisting of add, sub, addi, mul, lw, sw, beq instructions only. Will need to provide some error detection wrt the assembly program input.

Simulation Approaches State change in simulation Event-driven Simulation: Follows events as they occur. Time-driven Simulation: Driven by a clock; does something every clock transition. Computational Platform Sequential: Simpler to program and debug; slower. Parallel: More complicated program (need to take interactions into account); much higher throughput (potentially). Lab 2 involves a sequential, time-driven simulation.

Inputs to the Simulator MIPS assembly language program which will be in a file read by the simulator. Parameters of the simulated machine: Memory access time: c cycles. Multiply time: m cycles. All other EX operations: n cycles. ID and WB stages take one cycle to complete their tasks.

Memory Separate instruction and data memories (separate address spaces). Instruction Memory: Addressed by the PC. Size: 2K bytes (512 words). Data Memory: Accessible to the program. Size: 2K bytes (512 words). Implement both as linear arrays.

Processor Five stages: IF, ID, EX, MEM, WB Each stage follows the rules you learned in ECE 232, except that IF and EX can take multiple cycles to complete an operation.

IF Fetches from the Instruction Memory. Will have to freeze if there is an unresolved branch. Branches are detected in the ID stage. When a branch is detected, no further instructions are decoded until the branch is resolved. Branches are resolved in the EX stage where a subtraction operation is carried out and the result used to determine if the branch is taken or not.

ID Decodes instructions (takes 1 cycle to do this). Checks for data (RAW) and control hazards. Holds up further processing until these hazards have been resolved (no forwarding in this machine). Provides the EX stage with the operands it needs.

EX Executes the specified operation on the operands it receives from ID. Can take multiple cycles depending on the operation. EX is not itself pipelined; only one instruction can be in EX at any time. Use a counter to keep track of ongoing operations.

MEM Is only used by the lw and sw instructions. Receives the data memory address from EX and carries out the data memory read/write operation. Can take multiple cycles to do this (c cycles).

WB Writes back into the register file. Will have nothing to do if the instruction does not do a register write. Register reads/writes follow the approach in Hennessy & Patterson.

Simulator Modules progScanner(): Reads from the file provided by the user, containing the assembly language program. Note that this will have to flexible in dealing with empty spaces. parser(): From the instruction passed to it by progscanner(), break it up into its constituent fields (opcode, source registers, immediate field, destination register). Detect a certain subset of errors in the program : Illegal opcode Unrecognized register name Register number out of bounds Immediate field that is too large

Simulator Modules (contd.) Pipeline stage modules: IF ID EX MEM WB Pipeline stages will communicate via latches separating them. A latch can only hold information relating to a single instruction. Deal with structural hazards. Use valid/empty bits to specify if (a) the contents of a latch are valid for use by the stage to its right and (b) the latch is available to be written into by the stage to its left.

Simulator Execution We need to simulate parallel operations with a sequential program. How? Maintain a counter to represent the clock value. Each time the counter increments (representing an advance in time by one cycle), call the stages in reverse order: WB, MEM, EX, ID, IF. Why should this work?

Assertions Use assertions to help with correctness. Assertions should have been thought through and contribute meaningfully to the reliability of the program. Preconditions, postconditions, invariants can all be checked. For a good introduction, see

Submission Summary sheet on Moodle Authorship/testing information. Call graph of code Testing procedures used Assertions used Results (Seven tables: one for each of the programs provided on the course website). Upload program code on quark. Only a single file should be uploaded: no zipfiles. ONLY ONE COPY PER GROUP SHOULD BE SUBMITTED.