Digital Design and Computer Architecture

Similar documents
Digital Design and Computer Architecture

Slide Set 6. for ENCM 369 Winter 2018 Section 01. Steve Norman, PhD, PEng

Contents Slide Set 6. Introduction to Chapter 7 of the textbook. Outline of Slide Set 6. An outline of the first part of Chapter 7

EECS150 - Digital Design Lecture 9 - CPU Microarchitecture. CMOS Devices

ASIC = Application specific integrated circuit

Pipeline design. Mehran Rezaei

CMOS VLSI Design. Lab 3: Datapath and Zipper Assembly

Introduction to CMOS VLSI Design (E158) Lab 3: Datapath and Zipper Assembly

Fundamentals of Computer Systems

Lecture 10: Sequential Circuits

06 1 MIPS Implementation Pipelined DLX and MIPS Implementations: Hardware, notation, hazards.

CS 152 Midterm 2 May 2, 2002 Bob Brodersen

EE 447/547 VLSI Design. Lecture 9: Sequential Circuits. VLSI Design EE 447/547 Sequential circuits 1

Ryerson University Department of Electrical and Computer Engineering COE/BME 328 Digital Systems

Lab #12: 4-Bit Arithmetic Logic Unit (ALU)

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

CS 110 Computer Architecture. Finite State Machines, Functional Units. Instructor: Sören Schwertfeger.

Chapter 4 (Part I) The Processor. Baback Izadi Division of Engineering Programs

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

ECE337 Lab 4 Introduction to State Machines in VHDL

Pipelining. Improve performance by increasing instruction throughput Program execution order. Data access. Instruction. fetch. Data access.

EECS 578 SVA mini-project Assigned: 10/08/15 Due: 10/27/15

IS1500 (not part of IS1200) Logic Design Lab (LD-Lab)

PIPELINING: BRANCH AND MULTICYCLE INSTRUCTIONS

Experiment # 12. Traffic Light Controller

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus

You will be first asked to demonstrate regular operation with default values. You will be asked to reprogram your time values and continue operation

CS3350B Computer Architecture Winter 2015

Go BEARS~ What are Machine Structures? Lecture #15 Intro to Synchronous Digital Systems, State Elements I C

Inside Digital Design Accompany Lab Manual

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design ALU and Storage Elements

Altera s Max+plus II Tutorial

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

First Name Last Name November 10, 2009 CS-343 Exam 2

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Performance Evolution of 16 Bit Processor in FPGA using State Encoding Techniques

EE 209 Lab 7 A Walk-Off

More Digital Circuits

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

CS61C : Machine Structures

EE 101 Lab 7 Crosswalk

Review C program: foo.c Compiler Assembly program: foo.s Assembler Object(mach lang module): foo.o. Lecture #14

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science. EECS 150 Spring 2000

ELEC 204 Digital System Design LABORATORY MANUAL

Register Transfer Level (RTL) Design Cont.

Lab Assignment 2 Simulation and Image Processing

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

Fingerprint Verification System

Checkpoint 4. Waveform Generator

Co-simulation Techniques for Mixed Signal Circuits

Lab 17: Building a 4-Digit 7-Segment LED Decoder

EEC 116 Fall 2011 Lab #5: Pipelined 32b Adder

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Fill-in the following to understand stalling needs and forwarding opportunities

CSE140L: Components and Design Techniques for Digital Systems Lab. CPU design and PLDs. Tajana Simunic Rosing. Source: Vahid, Katz

Programmable Logic Design I

LAB 3 Verilog for Combinational Circuits

CS61C : Machine Structures

Digital Systems Laboratory 1 IE5 / WS 2001

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

CS/EE 6710 Digital VLSI Design CAD Assignment #3 Due Thursday September 21 st, 5:00pm

LAB 3 Verilog for Combinatorial Circuits

Computer Systems Architecture

Logic Analysis Basics

Logic Analysis Basics

Modeling Latches and Flip-flops

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Lab #11: Register Files

CSC258: Computer Organization. Combinational Logic

Register Transfer Level in Verilog: Part II

PROCESSOR BASED TIMING SIGNAL GENERATOR FOR RADAR AND SENSOR APPLICATIONS

On the Rules of Low-Power Design

CPE300: Digital System Architecture and Design

Microprocessor Design

CARLETON UNIVERSITY. Facts without theory is trivia. Theory without facts is bull 2607-LRB

UC Berkeley CS61C : Machine Structures

University of Pennsylvania Department of Electrical and Systems Engineering. Digital Design Laboratory. Lab8 Calculator

Sequential Elements con t Synchronous Digital Systems

Modeling Latches and Flip-flops

6.3 Sequential Circuits (plus a few Combinational)

Logic Devices for Interfacing, The 8085 MPU Lecture 4

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

Module 4:FLIP-FLOP. Quote of the day. Never think you are nothing, never think you are everything, but think you are something and achieve anything.

cs281: Introduction to Computer Systems Lab07 - Sequential Circuits II: Ant Brain

Synchronous Sequential Logic

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Switching Circuits & Logic Design, Fall Final Examination (1/13/2012, 3:30pm~5:20pm)

Introduction to Computer Engineering. CS/ECE 252, Spring 2017 Rahul Nayar Computer Sciences Department University of Wisconsin Madison

CS 61C: Great Ideas in Computer Architecture

CS/ECE 250: Computer Architecture. Basics of Logic Design: ALU, Storage, Tristate. Benjamin Lee

Lab 2: Hardware/Software Co-design with the Wimp51

Sequential Logic Design CS 64: Computer Organization and Design Logic Lecture #14

Instruction Level Parallelism

Design and Implementation of Timer, GPIO, and 7-segment Peripherals

Laboratory 4. Figure 1: Serdes Transceiver

CS 151 Final. Instructions: Student ID. (Last Name) (First Name) Signature

Lab #10 Hexadecimal-to-Seven-Segment Decoder, 4-bit Adder-Subtractor and Shift Register. Fall 2017

COE328 Course Outline. Fall 2007

Transcription:

Digital Design and Computer Architecture Lab 0: Multicycle Processor (Part ) Introduction In this lab and the next, you will design and build your own multicycle MIPS processor. You will be much more on your own to complete these labs than you have been in the past, but you may reuse any of your hardware (SystemVerilog modules) from previous labs. Your multicycle processor should match the design from the text, which is reprinted in Figure for your convenience. It should handle the following instructions: add, sub, and, or, slt, lw, sw, beq, addi, and j. The multicycle processor is divided into three units: the controller, datapath, and mem (memory) units. Note that the mem unit contains the shared memory used to hold both data and instructions. Also note that the controller unit comprises both the Main Decoder that takes OP 5:0 as inputs and the ALU Decoder that takes as inputs ALUOp :0 and the Funct 5:0 code from the 6 least significant bits of the instruction. The controller unit also includes the gates needed to produce the write enable signal, PCEn, for the PC register. In this lab you will design and test the controller. 202 David Money Harris and Sarah L. Harris

control 3:26 5:0 Control Unit Op Funct PCWrite Branch PCSrc :0 ALUControl 2:0 ALUSrcB :0 ALUSrcA RegWrite PCEn RegDst PC' PC 0 EN Adr A mem RD Instr / Data Memory WD WE Instr EN Data 25:2 20:6 20:6 5: 0 0 A A2 A3 WD3 WE3 Register File RD RD2 A B 3:28 0 4 <<2 00 0 0 SrcA SrcB ALU Zero ALUResult ALUOut PCJump <<2 27:0 00 0 0 5:0 Sign Extend ImmExt 25:0 (jump) datapath Figure. Multicycle Processor 202 David Money Harris and Sarah L. Harris 2

Unit Overview The three units have the following inputs and outputs. Although the signal names are in upper case here to match the diagram, remember to use lower case for all names in your SystemVerilog files. Reset Op [5:0] Funct [5:0] Zero RegDst RegWrite ALUSrcA ALUSrcB [:0] ALUControl [2:0] PCSrc [:0] PCEn Table. Controller Note that PCWrite and Branch are internal signals (wires) within the controller. 202 David Money Harris and Sarah L. Harris 3

Reset PCEn RegDst RegWrite ALUSrcA ALUSrcB [:0] ALUControl [2:0] PCSrc [:0] ReadData [3:0] Op [5:0] Funct [5:0] Zero Adr [5:0] WriteData [3:0] Table 2. Datapath Reset Adr [5:0] WriteData [3:0] ReadData [3:0] Table 3. Memory (mem) 202 David Money Harris and Sarah L. Harris 4

Generating Control Signals Before you begin developing the hardware for your MIPS multicycle processor, you ll need to determine the correct control signals for each state in the multicycle processor s state transition diagram. This state transition diagram is shown in Figure 7.42 in the book. Complete the output table of the Main Decoder in Table 4 at the end of this handout. Give the FSM control word in hexadecimal for each state. The first two rows are filled in as examples. Be careful with this step. It takes much longer to debug an erroneous circuit than to design it correctly the first time. Overall Design Now you will begin the hardware implementation of your multicycle processor. First, copy mipsmulti.sv from the E85 Lab 0 directory on Charlie to your own directory and rename it mipsmulti_xx.sv. The mips module instantiates both the datapath and control unit (called the controller module). The controller module in turn instantiates the main decoder module (maindec) and the ALU decoder module (aludec). You will design the controller in this lab. In the next lab, you will design the datapath. The memory is essentially identical to the data memory from Lab 9 and will be provided for you. Control Unit Design The control unit is the most complex part of the multicycle processor. It consists of two modules, the Main Decoder and the ALU Decoder. The Main Decoder, maindec, should take the Opcode input and produce the outputs described in Table 4. On reset, the control unit should start at State 0. The control unit should support the instructions from Figure 7.42 in the text. The state transition diagram is also given at the end of this handout. Design your controller using an FSM for the Main Decoder and combinational logic for the ALU Decoder. Also include any additional logic needed to compute PCEn from the internal signals PCWrite, Branch, and Zero. The controller, maindec, and aludec headers are given showing the inputs and outputs for each module. A portion of the SystemVerilog code for the control unit has been given to you. Complete the SystemVerilog code to completely design the hardware of the controller and its submodules. Create a controllertest_xx testbench for the controller module. Test each of the instructions that the processor should support (add, sub, and, or, slt, lw, sw, beq, addi, and j). Be sure to test both taken and nontaken branches. Remember that the controller inputs are: clk, Reset, OP, Funct, and Zero. Your test bench should apply the inputs. Visually inspect the states and outputs to verify that they match your expectations from Table 4. Also verify that PCEn performs correctly. If you find any errors, debug your circuit and correct the errors. Save a copy of your waveforms showing the inputs, state, and control outputs, and PCEn at each state.

What to Turn In Submit the following elements in the following order. Clearly label each part by number. Poorly organized submissions will lose points.. Please indicate how many hours you spent on this lab. This will not affect your grade, but will be helpful for calibrating the workload for next semester s labs. 2. A completed Main Decoder output table (Table 4). 3. The SystemVerilog for your controller, maindec, and aludec modules. 4. Your controllertest_xx testbench. 5. Simulation waveforms of the controller module showing (in the given order):, Reset, OP, Funct, Zero, the state (this is an internal registered signal), ALUControl, PCEn, and the entire control word (i.e. the 4-nibble word you entered in Table 4) demonstrating each instruction (including taken and non-taken branches). Display all signals in hexadecimal. Does it match your expectations?

FSM Control Word ALUOp[:0] PCRsc[:0] ALUSrcB[:0] RegDst Branch ALUSrcA RegWrite PCWrite State (Name) 0 (Fetch) 0 0 0 0 0 0 0 0 00 00 0x500 (Decode) 0 0 0 0 0 0 0 0 0 00 00 0x0030 2 (MemAdr) 3 (MemRd) 4 (MemWB) 5 (MemWr) 6 (RtypeEx) 7 (RtypeWB) 8 (BeqEx) 9 (AddiEx) 0 (AddiWB) (JEx) Table 4. Main Decoder Control output