Project Part A: Single Cycle Processor

Similar documents
MIPS Reference Guide

The MIPS Instruction Set Architecture

MIPS Instruction Reference

MIPS Instruction Set

101 Assembly. ENGR 3410 Computer Architecture Mark L. Chang Fall 2009

Computer Architecture Experiment

Mips Code Examples Peter Rounce

F. Appendix 6 MIPS Instruction Reference

Computer Architecture. The Language of the Machine

MIPS Instruction Format

EEM 486: Computer Architecture. Lecture 2. MIPS Instruction Set Architecture

EE108B Lecture 3. MIPS Assembly Language II

Question 0. Do not turn this page until you have received the signal to start. (Please fill out the identification section above) Good Luck!

Week 10: Assembly Programming

Final Project: MIPS-like Microprocessor

ICS 233 COMPUTER ARCHITECTURE. MIPS Processor Design Multicycle Implementation

Exam in Computer Engineering

RTL Model of a Two-Stage MIPS Processor

TSK3000A - Generic Instructions

SPIM Instruction Set

M2 Instruction Set Architecture

Midterm. Sticker winners: if you got >= 50 / 67

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam One 4 February Your Name (please print clearly)

ECE Exam I February 19 th, :00 pm 4:25pm

Reduced Instruction Set Computer (RISC)

Anne Bracy CS 3410 Computer Science Cornell University. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

Anne Bracy CS 3410 Computer Science Cornell University. See P&H Chapter: , , Appendix B

Q1: /30 Q2: /25 Q3: /45. Total: /100

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

ECE 2035 Programming HW/SW Systems Fall problems, 7 pages Exam Two 23 October 2013

Instruction Set Principles. (Appendix B)

Computer Architecture. MIPS Instruction Set Architecture

Instruction Set Architecture of. MIPS Processor. MIPS Processor. MIPS Registers (continued) MIPS Registers

Reduced Instruction Set Computer (RISC)

CSc 256 Midterm 2 Fall 2011

MIPS%Assembly% E155%

ece4750-parc-isa.txt

INSTRUCTION SET COMPARISONS

ECE410 Design Project Spring 2013 Design and Characterization of a CMOS 8-bit pipelined Microprocessor Data Path

MIPS ISA. 1. Data and Address Size 8-, 16-, 32-, 64-bit 2. Which instructions does the processor support

ENCM 369 Winter 2013: Reference Material for Midterm #2 page 1 of 5

Laboratory Exercise 6 Pipelined Processors 0.0

MIPS Assembly Language. Today s Lecture

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam Two 11 March Your Name (please print) total

Lab 3: Simulation and Testing

CSc 256 Midterm 2 Spring 2012

Today s Lecture. MIPS Assembly Language. Review: What Must be Specified? Review: A Program. Review: MIPS Instruction Formats

Examples of branch instructions

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 22 September Your Name (please print clearly) Signed.

Concocting an Instruction Set

A General-Purpose Computer The von Neumann Model. Concocting an Instruction Set. Meaning of an Instruction. Anatomy of an Instruction

Programming the processor

Alexandria University

Flow of Control -- Conditional branch instructions

Assembly Programming

Overview. Introduction to the MIPS ISA. MIPS ISA Overview. Overview (2)

Review of the Machine Cycle

A Processor! Hakim Weatherspoon CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam One 19 September 2012

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 23 October Your Name (please print clearly) Signed.

CS 351 Exam 2 Mon. 11/2/2015

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Concocting an Instruction Set

Concocting an Instruction Set

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

CS61CL Machine Structures. Lec 5 Instruction Set Architecture

EECS 150 Fall 2012 Checkpoint 1: Pipelined MIPS Processor

Patrick Murray 4/17/2012 EEL4713 Assignment 5

Concocting an Instruction Set

EECS 150 Fall 2013 Checkpoint 1: Pipelined MIPS Processor

Mark Redekopp, All rights reserved. EE 357 Unit 11 MIPS ISA

MIPS Assembly Language Programming

Lec 10: Assembler. Announcements

ECE 2035 Programming HW/SW Systems Fall problems, 6 pages Exam Two 21 October 2016

ECE 473 Computer Architecture and Organization Project: Design of a Five Stage Pipelined MIPS-like Processor Project Team TWO Objectives

CSc 256 Midterm (green) Fall 2018

IMPLEMENTATION MICROPROCCESSOR MIPS IN VHDL LAZARIDIS DIMITRIS.

Character Is a byte quantity (00~FF or 0~255) ASCII (American Standard Code for Information Interchange) Page 91, Fig. 2.21

CS3350B Computer Architecture MIPS Instruction Representation

CPS311 - COMPUTER ORGANIZATION. A bit of history

CPU Design for Computer Integrated Experiment

CS 61c: Great Ideas in Computer Architecture

Adventures in Assembly Land

CS654 Advanced Computer Architecture. Lec 1 - Introduction

MACHINE LANGUAGE. To work with the machine, we need a translator.

Computer Architecture

Lab 4 Report. Single Cycle Design BAOTUNG C. TRAN EEL4713C

ECE 2035 A Programming Hw/Sw Systems Fall problems, 8 pages Final Exam 8 December 2014

CS 4200/5200 Computer Architecture I

Computer Architecture Instruction Set Architecture part 2. Mehran Rezaei

ISA and RISCV. CASS 2018 Lavanya Ramapantulu


Instruction Set Architecture part 1 (Introduction) Mehran Rezaei

Computer Organization & Design

ECE 2035 A Programming Hw/Sw Systems Spring problems, 8 pages Final Exam 29 April 2015

EE 109 Unit 8 MIPS Instruction Set

TENTAMEN Luleå tekniska universitet

ECE 154B Spring Project 4. Dual-Issue Superscalar MIPS Processor. Project Checkoff: Friday, June 1 nd, Report Due: Monday, June 4 th, 2018

Lab 5: Pipelining an SMIPSv2 Processor: Part I

Transcription:

Curtis Mayberry Andrew Kies Mark Monat Iowa State University CprE 381 Professor Joseph Zambreno Project Part A: Single Cycle Processor Introduction The second part in the three part MIPS Processor design lab, this project assembles a single cycle MIPS processor. Each part of the processor, the control logic, data path, instruction fetch logic and ALU design is brought together to form our first fully operational microprocessor. The processor handles forty five unique instructions. Although the final part of the project improves upon our single cycle design to create a pipelined processor, the single cycle processor is still able to perform the same computations, just not as efficiently. Pre-lab R-Type Instructions (Opcode 000000) Instruction Function add rd, rs, rt 100000 addu rd, rs, rt 100001 and rd, rs, rt 100100 jalr rd, rs 001001 jr rs 001000 mul rd 010000 nor rd, rs, rt 100111 or rd, rs, rt 100101 sll rd, rt, sa 000000 sllv rd, rt, rs 000100 slt rd, rs, rt 101010 sltu rd, rs, rt 101011 slt rd, rs, rt 101010 sltu rd, rs, rt 101011 sra rd, rt, rs 000111 srav rd, rt, rs 000111 srl rd, rt, sa 000010 srlv rd, rt, rs 000110

sub rd, rs, rt 100010 subu rd, rs, rt 100011 xor rd, rs, rt 100110 I-Type Instructions (All opcodes except 000000, 00001x, and 0100xx) Instruction Opcode Notes addi rt, rs, immediate 001000 addiu rt, rs, immediate 001001 andi rt, rs, immediate 001100 beq rs, rt, label 000100 bgez rs, label 000001 rt = 00001 bgtz rs, label 000111 rt = 00000 blez rs, label 000110 rt = 00000 bltz rs, label 000001 rt = 00000 bne rs, rt, label 000101 lb rt, immediate(rs) 100000 lbu rt, immediate(rs) 100100 lh rt, immediate(rs) 100001 lhu rt, immediate(rs) 100101 lui rt, immediate 001111 lw rt, immediate(rs) 100011 ori rt, rs, immediate 001101 sb rt, immediate(rs) 101000 slti rt, rs, immediate 001010 sltiu rt, rs, immediate 001011 sh rt, immediate(rs) 101001 sw rt, immediate(rs) 101011 xori rt, rs, immediate 001110 J-Type Instructions (Opcode 00001x) Instruction Opcode Target j label 000010 coded address of label jal label 000011 coded address of label

Part 1: Control Logic Unit The entire single cycle processor needs a brain that controls all of the functions of the processor based on the instruction that has been decoded. Part 1a A spreadsheet detailing a list of each supported instruction s control signals was created. See the attached file Control Instructions.xlsx for our list of instruction control signals. Part 1b The MIPS processor control logic unit was described using dataflow VHDL and incorporates a 25 bit control bud. See attached file Processor_Ctl_logic.vhd for our implementation. The control logic unit was tested using the test bench tb_processor_ctl_logic.vhd. Part 2: Instruction Fetch Logic Our instruction fetch logic was built on top of the provided generic memory module. The instruction fetch not only provides the instruction specified by the program counter, but also handles the incrementing of the PC and the branching and jumping logic that affects the program counter. Part 2a The instruction logic control signals control the functioning of the jumping and branching logic. These jump control signals include i_c_jr, which enables the jump register function and i_c_jump that handles all other jump instructions, including jump and jump and link instructions. The branch control logic includes i_c_branch, which enables branches. Part 2b The instruction fetch schematic is outlined using a dotted line in the main processor schematic in part 3. Part 2c The generic memory that was used for the mips instruction memory, gen_mem is the same as the memory used for the data memory and is tested in the test bench tb_gen_mem_wcontrol.vhd, which also includes extra control logic to facilitate the data memory. It is also tested within the instruction fetch test bench tb_instruction_fetch.vhd. Part 2d The instruction fetch logic is implemented using structural VHDL in file Instruction_Fetch.vhd. The test bench was implemented using assert statements that automatically check each test case of the instruction fetch logic. The assert statement compares the simulated value with the expected value. A green arrow on the test bench waveform corresponds to a passed test, whereas a red arrow corresponds to a failed test. All instructions matched there expected outputs and the test was successful.

Part 3 The MIPS processor design shown in figure 1 was created and then implemented in structural VHDL. Figure 1: MIPS single cycle processor design The processor implements a reset instruction and uses the gen_mem memory module for both instruction and data memory. The major challenges included mistakes that needed to be worked out in our test bench. We had a number of tests where the test bench s expected value was incorrect. We also had to rework our jump register and load/store logic. Also, the ALU had to be redesigned to incorporate new features needed for the functioning of the processor.

Part 4 Testing was an extensive part of our processor design flow. The testing and debugging of the processor took significantly longer than the design of the processor. There were three tests that had to be run, including a test bench of every instruction, a BubbleSort algorithm and a MergeSort algorithm. A.do script was created in each instance to simplify the running of the test bench. Part 4a We had to create a program that tested each instruction individually. We ran 53 separate tests for the 45 unique instructions. The test bench contained over six hundred lines of test code and included assert statements to check each test to see if the test s output matched the expected output. The testbench file is tb_mips_single_cycle_processor.vhd. Part 4b Next a BubbleSort algorithm coded in MIPS was ran in a separate test bench. Two memory initialization files, imem_bubblesortours.mif and dmem_bubblesort_2.mif were used for the instruction and data memory, respectively. The test bench was then ran from a script and the device under test was simulated. The contents of the memory were then viewed to see if they were properly sorted. Part 5 On November 16, 2010 we successfully demoed our test application making use of all 45 instructions and the BubbleSort algorithm we wrote. We were also able to successfully demonstrate the Taylor series sine approximation program that was provided. Conclusion The Single Cycle processor as the penultimate step to creating a final pipelined MIPS processor in VHDL has proven capable of all the functionality required in a MIPS processor. The design incorporates the data path, control logic, instruction fetch logic and memories needed to construct a fully functioning processor. The ALU had to be redesigned and both the instruction and data memory had to be altered. The processor had to be thoroughly tested using a number of programs. Each of these programs had to be written, have test benches designed and test scripts written. IN the end having a fully functioning MIPS processor has paid off and the group is excited to move forward to implementing the pipelined processor.