COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59



Similar documents
Reduced Instruction Set Computer (RISC)

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

PCSpim Tutorial. Nathan Goulding-Hotta v0.1

Winter 2002 MID-SESSION TEST Friday, March 1 6:30 to 8:00pm

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Typy danych. Data types: Literals:

Instruction Set Design

Assembly Language Programming

MIPS Assembler and Simulator

SMIPS Processor Specification

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

CPU Organization and Assembly Language

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Computer Organization and Components

Introducción. Diseño de sistemas digitales.1

Pipeline Hazards. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by Arvind and Krste Asanovic

Computer organization

Instruction Set Architecture

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

Design of Digital Circuits (SS16)

EECS 427 RISC PROCESSOR

Solutions. Solution The values of the signals are as follows:

CPU Organisation and Operation

The 104 Duke_ACC Machine

Design of Pipelined MIPS Processor. Sept. 24 & 26, 1997

CSE 141L Computer Architecture Lab Fall Lecture 2

Microprocessor & Assembly Language

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

Administration. Instruction scheduling. Modern processors. Examples. Simplified architecture model. CS 412 Introduction to Compilers

5 MIPS Assembly Language

Introduction to MIPS Assembly Programming

A SystemC Transaction Level Model for the MIPS R3000 Processor

(Refer Slide Time: 00:01:16 min)

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Computer Organization and Components

PROBLEMS #20,R0,R1 #$3A,R2,R4

Chapter 2 Logic Gates and Introduction to Computer Architecture

Memory Systems. Static Random Access Memory (SRAM) Cell

EE361: Digital Computer Organization Course Syllabus

CSE 141 Introduction to Computer Architecture Summer Session I, Lecture 1 Introduction. Pramod V. Argade June 27, 2005

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings:

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Instruction Set Architecture (ISA)

University of Toronto Faculty of Applied Science and Engineering

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

Review: MIPS Addressing Modes/Instruction Formats

Lecture N -1- PHYS Microcontrollers

8051 MICROCONTROLLER COURSE

CHAPTER 7: The CPU and Memory

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Translating C code to MIPS

Lecture 8: Binary Multiplication & Division

CS352H: Computer Systems Architecture

Intel 8086 architecture

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

================================================================

COMPUTER ORGANIZATION ARCHITECTURES FOR EMBEDDED COMPUTING

SIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands

PIC Programming in Assembly. (

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

MACHINE ARCHITECTURE & LANGUAGE

Using The PIC I/O Ports

A Processor Generation Method from Instruction Behavior Description Based on Specification of Pipeline Stages and Functional Units

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:

1 Classical Universal Computer 3

Basic Computer Organization

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

Figure 1: Graphical example of a mergesort 1.

Generating MIF files

MIPS Assembly Code Layout

Z80 Microprocessors Z80 CPU. User Manual UM Copyright 2014 Zilog, Inc. All rights reserved.

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

A Generic Network Interface Architecture for a Networked Processor Array (NePA)

Lecture Outline. Stack machines The MIPS assembly language. Code Generation (I)

Programming Logic controllers

Gates, Plexers, Decoders, Registers, Addition and Comparison

CSC 2405: Computer Systems II

In the Beginning The first ISA appears on the IBM System 360 In the good old days

Administrative Issues

2011, The McGraw-Hill Companies, Inc. Chapter 5

Hardware/Software Co-Design of a Java Virtual Machine

Chapter 5 Instructor's Manual

Systems I: Computer Organization and Architecture

İSTANBUL AYDIN UNIVERSITY

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

EE360: Digital Design I Course Syllabus

LSN 2 Computer Processors

An Introduction to MPLAB Integrated Development Environment

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

PART B QUESTIONS AND ANSWERS UNIT I


CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

EXERCISES OF FUNDAMENTALS OF COMPUTER TECHNOLOGY UNIT 5. MEMORY SYSTEM

LC-3 Assembly Language

A New, High-Performance, Low-Power, Floating-Point Embedded Processor for Scientific Computing and DSP Applications

Transcription:

COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December 2009 23:59 Overview: In the first projects for COMP 303, you will design and implement a subset of the MIPS32 architecture in Logisim, a software logic simulator. The goal of these projects is to move you from designing small special-purpose circuits, such as those you designed as homework exercises, to building complex, general-purpose CPUs. We will be implementing a basic 32-bit MIPS processor. We will ignore more advanced features such as the MIPS coprocessor instructions and traps/exceptions. Read this document entirely, paying special attention to the section Deviation from the MIPS standard. We will be using Logisim, a free hardware design and circuit simulation tool. We have implemented a library of components to help you, and Logisim comes with libraries containing basic gates, memory chips, multiplexors and decoders, and other simple components. You may use any of these basic components in your designs, but you may not use the Logisim arithmetic library anywhere in your design. If you wish to download additional libraries from the web to use in your design, please check with the course staff for approval.

Project 4: MIPS Processor In this project you will complete the design of your MIPS processor by adding most of the remaining MIPS instructions. Your basic execution loop from the previous project should contain most of the major components, with the exception of RAM for the load/store instructions. For this project, we will use a split-memory design: The Program ROM will store a read-only copy of the instructions, and a separate Logisim RAM will be used to store data for the program s execution. Begin by making a pencil-and-paper design showing all of the components you will need, and create a list of all control signals in the processor. You will not submit this paper design, but the TAs will demand to see it if you ever have a question about anything. Next, decide for each instruction what the value of each control signal must be, and use this information to design the instruction decode logic. Lastly, implement your decoder and the rest of the processor in Logisim, and test your circuit with test programs of your own making. Your design must implementation the following subset of the MIPS architecture: Jumps (without a delay slot) Branches (without a delay slot) Memory Load/Store Immediate load Immediate arithmetic Register arithmetic Shifts (constant and variable) J, JR BEQ, BNE, BLEZ, BGTZ LW, SW LUI ADDIU, ANDI, ORI, XORI ADDU, SUBU, AND, OR, XOR, NOR SLL, SRL, SRA Finally, you must document your design in a short, 1 3 page paper. Include: A short overview of your processor design, highlighting the design choices you made and why, and any notable features of your processor might have. List of sources for any parts of your design that are not entirely yours, with the exception of built-in Logisim and cs316 library components (if any) List of known bugs or missing features (if any) An estimate of the number of gates used in your processor, with a breakdown of the number of gates for each major component (you can ignore the memory, program ROM, and register file). A description of the longest path in your design (assume that the register file takes about 4 gate delays to perform a read, and that the MIPS program ROM and memory each take about 10 gate delays to do a read or write). What to submit: A single Logisim project file containing your processor, a test program with comments describing the expected output, a text file containing your pencil-and-paper decode logic design (table giving the value of each control signal for every instruction, and formulas, diagrams, or descriptions of the logic for each), and a 1-3 page design document as described above.

For the Adventurous: Note: These suggestions for an extra challenge will be examined (and commented on, if your project works well) but not graded. They will have no impact on the class grades. They are here to provide some direction to those who finish their assignments early and are looking for a way to impress friends and family. - Implement the jump-and-link instructions JAL, JALR (barely challenging). - Implement the delay slot for branches/jumps (moderately challenging). - Implement multiply (MULT and/or MULTU) (moderately challenging). Note: increasing the number of delay slots after MULT makes this almost easy. - Implement pipelining (more challenging). Help and Hints: Ask the TAs for help. We expect to see most students in office hours during the course of the project. Extra hours will be scheduled as needed. Do a pencil and paper design for all components before implementing in Logisim. Deviation from the MIPS Standard: You can ignore any MIPS instruction or feature not mentioned in this document, and can assume that your processor will never encounter anything but legal instructions from the table above. In addition: - Assume loads and stores will be word aligned and to valid RAM addresses. - Assume all jumps will be word aligned and to valid ROM addresses. - Assume traps or exceptions will not occur (i.e., do not implement them). - Do not implement floating point, multiply/divide, or the HI and LO registers. - Use a split-memory design (separate program and data memories). - Branch and jumps take effect immediately, rather than after a oneinstruction delay slot (although we still compute the destination PC exactly as specified in the MIPS standard).

Logisim and Library Guide: Loading the cs316 library: Select project Load library Jar Library. Select cs316.jar, and enter edu.cornell.cs316.components as the class name. Loading the Memory library: Select project Load library Built-in. Select Memory. This library contains Logisim s built-in memory RAM chip, which is fully described in Logisim s help files. Below is a short description: Logisim RAM: Configurable to 32-bit wide word-addressed RAM, with up to 12-bits of address (16KB storage). The Logisim help describes this chip. Since it is word-addressed, be sure to drop the lowest 2 bits of the address, in addition to any extra high order bits, and use a tri-state buffer for driving the bidirectional D pin. The following shows a typical circuit: MIPS (subset) assembly syntax: The Program ROM component understands all of the instructions you will implement. The syntax is standard MIPS syntax. Labels are case sensitive, everything else ignores case. Anything following a '#' is a comment. Labels are used to mark places in the code. Jumps and branches can refer to these labels (for jumps, the address is inserted directly, for branches, a relative offset from the branch instruction is computed and inserted, accounting for the delay slot). The instruction syntax is the same as given in the MIPS standard (and different from the output of gcc and many other tools). Registers are written as $0, $1,..., $31, and the destination register goes on the left, followed by source registers and immediate values on the right. Absolute addresses (for J) are given in hex (i.e., 0x12ab), and all other integers can be in hex or signed decimal (i.e., 0x12ab or 1234 or -1234). The special constant PC can be used anywhere an integer is needed, and the assembler will replace it by the address of the instruction itself. The PC will normally fit in 15 bits or less

Some examples of instructions are: Jumps J 0x24 J my_label JR $31 Branches BEQ $5, $6, -12 BEQ $5, $6, my_loop_top BLEZ $9, 16 BLEZ $9, my_loop_done Memory Load/Store LW $12, -4($30) SW $12, 0($30) Immediate load Immediate arithmetic LUI $14, 0x123 ADDIU $12, $0, PC Register arithmetic ADDU $13, $0, $20 Shifts SLL $13, $13, 2 Labels my_loop_top: BNE $5, $6, 16 my_loop_done: MIPS (subset) opcode summary (from the MIPS handbook):

Academic Integrity. As one of the most widely studied architectures, MIPS has a wealth of information available on the web and in textbooks. You may consult any of the MIPS architecture documentation available to you in order to learn about the instruction set, what each instruction does, etc. But we expect your design to be entirely your own. If you are unsure if it is okay to borrow from some other source, just ask the TAs, and give credit in your final writeup. If you are unsure about asking the TAs, then it is probably not okay. Plagiarism in any form will not be tolerated.