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

CMOS VLSI Design. Lab 3: Datapath and Zipper Assembly

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

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

Pipeline design. Mehran Rezaei

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

ECE337 Lab 4 Introduction to State Machines in VHDL

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

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

Lecture 10: Sequential Circuits

ASIC = Application specific integrated circuit

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

More Digital Circuits

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

CSC258: Computer Organization. Combinational Logic

Fundamentals of Computer Systems

CS3350B Computer Architecture Winter 2015

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

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

Inside Digital Design Accompany Lab Manual

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

Experiment # 12. Traffic Light Controller

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

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

CPE300: Digital System Architecture and Design

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

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

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.

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

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

Instruction Level Parallelism

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

Modeling Digital Systems with Verilog

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

CS 152 Midterm 2 May 2, 2002 Bob Brodersen

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Register Transfer Level in Verilog: Part II

Synchronous Sequential Logic

Digital Systems Laboratory 1 IE5 / WS 2001

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

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

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

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

Last time, we saw how latches can be used as memory in a circuit

Microprocessor Design

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

ASYNCHRONOUS COUNTER CIRCUITS

CS61C : Machine Structures

Sequencing and Control

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

Checkpoint 4. Waveform Generator

Modeling Latches and Flip-flops

EE 101 Lab 7 Crosswalk

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

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

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

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

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

Computer Systems Architecture

Modeling Latches and Flip-flops

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

Asynchronous (Ripple) Counters

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

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

CS150 Fall 2012 Solutions to Homework 4

LAB 3 Verilog for Combinational Circuits

Logic Devices for Interfacing, The 8085 MPU Lecture 4

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

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

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

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

CHAPTER 4 RESULTS & DISCUSSION

EE 209 Lab 7 A Walk-Off


EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Fingerprint Verification System

CprE 281: Digital Logic

FPGA Implementation of Sequential Logic

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

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

Lab #11: Register Files

Sequential Logic. Introduction to Computer Yung-Yu Chuang

PROCESSOR BASED TIMING SIGNAL GENERATOR FOR RADAR AND SENSOR APPLICATIONS

Smart Night Light. Figure 1: The state diagram for the FSM of the ALS.

Digital Blocks Semiconductor IP

CSE 140 Exam #3 Tajana Simunic Rosing

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

EE178 Spring 2018 Lecture Module 5. Eric Crabill

COE328 Course Outline. Fall 2007

ECSE-323 Digital System Design. Datapath/Controller Lecture #1

PIPELINING: BRANCH AND MULTICYCLE INSTRUCTIONS

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

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

ECE 555 DESIGN PROJECT Introduction and Phase 1

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

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

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

Transcription:

Digital Design and Computer Architecture Lab 0: Multicycle ARM Processor (Part ) Introduction In this lab and the next, you will design and build your own multicycle ARM 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 (at the end of the lab) for your convenience. It should handle the following instructions: ADD, SUB, AND, and ORR (with register and immediate operands, but no shifts), LDR and STR (with positive immediate offset), and B. 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 Decode and Conditional Logic units. We've repeated the control unit diagram in Figure 2 (at the end of the lab) for your convenience. In this lab you will design and test the controller. Overall Design Now you will begin the hardware implementation of your multicycle ARM processor. First, copy the provided arm_multi.sv to your own directory and rename it arm_multi_xx.sv. The arm module instantiates both the datapath and the control unit (called the controller module). You will design the controller module (and all of its submodules) 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 (controller) is the most complex part of the multicycle processor. It consists of two modules: Decode (decode) and Conditional Logic (condlogic). decode instantiates the Main FSM (mainfsm) and includes logic for the ALU Decoder, PC Logic, and Instruction Decoder. On reset, the Main FSM should start at

State 0 (DECODE). The state transition diagram is given in Figure 3 at the end of this handout. The controller, decode, condlogic, and mainfsm headers are given in arm_multi.sv showing the inputs and outputs for each module. A portion of the SystemVerilog code for the control units has been given to you. Complete the SystemVerilog code to completely design the hardware of the controller and its submodules. Remember that you can reuse code from the single-cycle processor of Lab 9. Please see Figure 2 at the end of this handout for a change to the Condition Logic module. Generating Control Signals Before you begin developing the hardware for your ARM 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.4 in the book and in Figure 3 in these instructions. Complete the output table of the Main FSM in Table 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. Testing Create a controllertest_xx.sv testbench for the controller module. Test each of the instructions that the processor should support: ADD, SUB, AND, and ORR (with register and immediate operands, but no shifts), LDR and STR (with positive immediate offset), and B. Be sure to test both taken and nontaken branches. From Figure 2, the controller inputs are:, reset, Cond 3:0, Op :0, Funct 5:0, Rd 3:0, and ALUFlags 3:0. The SystemVerilog header for controller lists clk, reset, Instr[3:2], and ALUFlags[3:0] as inputs. Recall from the machine code formats that Instr[3:2] includes the Cond, Op, Funct, and Rd fields (as well as Rn, which is not used). Your test bench should apply the inputs to controller (clk, reset, Instr[3:2], and ALUFlags[3:0]). Visually inspect the states and outputs to verify that they match your expectations from Table. 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 at each state. 2

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 FSM output table (Table ). 3. Your arm_multi_xx.sv file highlighting your controller, decode, condlogic, and mainfsm modules. 4. Your controllertest_xx.sv testbench module. 5. Simulation waveforms of the controller module showing (in the given order):, Reset, Cond, OP, Funct, Rd, ALUFlags, ALUControl, ImmSrc, RegSrc, rite, rite, PCWrite, state, and the entire control word (i.e. the 4-nibble word you entered in Table ) demonstrating each instruction (including taken and non-taken branches). Display all signals in hexadecimal. Does it match your expectations? 3

FSM Control Word ALUOp ALUSrcB:0 ALUSrcA:0 ResultSrc:0 State (Name) 0 (Fetch) 0 0 0 0 0 0 0 0 0x4C (Decode) 0 0 0 0 0 0 0 0 0 0 0x004C 2 (MemAdr) 3 (MemRead) 4 (B) 5 (rite) 6 (ExecuteR) 7 (ExecuteI) 8 (ALUWB) 9 () Table. Main FSM output 4

PCWrite rite 3:28 27:26 25:20 5:2 Control Unit Cond Op Funct Rd Flags ResultSrc ALUControl ALUSrcB ALUSrcA ImmSrc rite ALUFlags PC' EN PC 0 Adr A RD Instr / Data Memory WD WE ReadData Instr EN 9:6 5 3:0 5:2 0 0 0 RegSrc RA RA2 A A2 A3 WD3 R5 WE3 Register File RD RD2 A WriteData 0 0 00 4 00 0 0 SrcA SrcB ALU ALUResult ALUOut 00 0 0 Data 23:0 Extend ExtImm Result Figure. ARM Multicycle Processor 5

Rd 3:0 PC Logic PCS PCS PCWrite rite Cond 3:0 ALUFlags 3:0 Op :0 Funct 5:0 Rd 3:0 Decode FlagW :0 PCS Conditional Logic PCWrite rite rite ResultSrc ALUSrcA ALUSrcB Op :0 Funct 5:0 5,0 4:0 Main FSM ALUOp ALU Decoder ResultSrc ALUSrcA ALUSrcB ALUControl :0 FlagW :0 Register Enables Multiplexer Selects FlagW :0 Cond 3:0 ALUFlags 3:0 [3:2] Flags 3:2 [] FlagWrite:0 CondEx Condition Check rite ImmSrc :0 RegSrc :0 ALUControl :0 Op :0 Instr Decoder ImmSrc :0 RegSrc :0 [:0] Flags :0 [0] (a) Control Unit (b) Decode (c) Conditional Logic Figure 2. ARM Multicycle Control: (a) Control unit, (b) Decode unit, (c) Conditional Logic unit Important: Notice the flip-flop after the CondEx signal. Explanation: This flip-flop delays the CondEx signal sent to PCWrite, rite, and rite until the end of the instruction (in the ALUWB state). It fixes an error that occurs when an instruction is both conditionally executed and sets the condition flags (Cond!= 0 AND S=). Without this flip-flop, PCWrite, rite and rite depend on Flags set by the current instruction instead of a prior instruction. This flip-flop is missing in the figure in draft ARM chapter 7. 6

Reset S2: MemAdr ALUSrcA = 00 ALUSrcB = 0 S0: Fetch = 0 AluSrcA = 0 ALUSrcB = 0 ResultSrc = 0 Memory Op = 0 S6: ExecuteR ALUSrcA = 00 ALUSrcB = 00 ALUOp = S: Decode ALUSrcA = 0 ALUSrcB = 0 ResultSrc = 0 Data Reg Op = 00 Funct 5 = 0 Data Imm Op = 00 Funct 5 = S7: ExecuteI ALUSrcA = 00 ALUSrcB = 0 ALUOp = Op = 0 S9: ALUSrcA = 0 ALUSrcB = 0 ResultSrc = 0 State Fetch Decode MemAdr MemRead B rite ExecuteR ExecuteI ALUWB Datapath µop Instr Mem[PC]; PC PC+4 ALUOut PC+4 ALUOut Rn + Imm Data Mem[ALUOut] Rd Data Mem[ALUOut] Rd ALUOut Rn op Rm ALUOut Rn op Imm Rd ALUOut PC ALUOut + offset STR LDR Funct 0 = Funct 0 = 0 S3: MemRead ResultSrc = 00 = S5: rite ResultSrc = 00 = S8: ALUWB ResultSrc = 00 S4: B ResultSrc = 0 Figure 3. ARM Main FSM state transition diagram 7