1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 11, 2012.

Slides:



Advertisements
Similar presentations
Memory Mapped I/O. What is Memory Mapped I/O? Instead of having special methods for accessing the values to be read or written, just get them from memory.
Advertisements

1 Memory-Mapped I/O Lecture 23 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
1 Nested Procedures Procedures that don't call others are called leaf procedures, procedures that call others are called nested procedures. Problems may.
COMP541 Datapath & Single-Cycle MIPS
1 COMP541 Wrap Up Montek Singh Nov 24, Conclusion of this course  What did we learn this semester? Combinational logic Combinational logic Sequential.
1 Quiz 3, Answers 1,3 The CPI is: 0.22* * * *12 = = 5.42 In the 2nd case the CPI is 1.0. Every instruction.
1 Chapter Five The Processor: Datapath and Control.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Instruction Representation II (1) Fall 2007 Lecture 10: Instruction Representation II.
Lecture 16: Basic CPU Design
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Oct 29, 2014.
COMP541 Input Devices: Keyboards, Mice and Joysticks
1 COMP541 Completing the MIPS Datapath Montek Singh Mar 27, 2007.
Chapter 8 Input/Output l I/O basics l Keyboard input l Monitor output l Interrupt driven I/O l DMA.
1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 16, 2012.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Overview of Hardware.
Registers and MAL Lecture 12. The MAL Architecture MAL is a load/store architecture. MAL supports only those addressing modes supported by the MIPS RISC.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
CSCI 136 Lab 1: 135 Review.
1 COMP541 Multicycle MIPS Montek Singh Apr 4, 2012.
COMP541 Multicycle MIPS Montek Singh Apr 8, 2015.
Input-Output Organization
1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 6, 2015.
CDA 3101 Fall 2013 Introduction to Computer Organization
1 COMP541 Datapaths II & Control I Montek Singh Mar 22, 2010.
1. Building A CPU  We’ve built a small ALU l Add, Subtract, SLT, And, Or l Could figure out Multiply and Divide  What about the rest l How do.
COMP541 Multicycle MIPS Montek Singh Mar 25, 2010.
D ATA P ATH OF A PROCESSOR (MIPS) Module 1.1 : Elements of computer system UNIT 1.
December 26, 2015©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
Microarchitecture. Outline Architecture vs. Microarchitecture Components MIPS Datapath 1.
Computer Organization CS224 Fall 2012 Lessons 7 and 8.
Computer Organization Rabie A. Ramadan Lecture 3.
MIPS Instruction Set Architecture Prof. Sirer CS 316 Cornell University.
February 22, 2016©2003 Craig Zilles (derived from slides by Howard Huang) 1 A single-cycle MIPS processor  As previously discussed, an instruction set.
Control Structures Computer Organization I 1 October 2009 © McQuain, Feng & Ribbens Conditional Control Structure if ( i < j ) goto A; else.
Lecture 9. MIPS Processor Design – Single-Cycle Processor Design Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
Lecture 5. MIPS Processor Design
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
1 COMP541 Wrap Up Montek Singh Apr 24, Conclusion of this course  What did we learn this semester? Combinational logic Combinational logic Sequential.
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 6, 2010.
Computer System Structures
CS/COE 0447 (term 2181) Jarrett Billingsley
I/O Systems.
COMP541 Input Devices: Keyboards, Mice and Joysticks
Single-Cycle Datapath and Control
CS2100 Computer Organisation
COMP541 Datapaths I Montek Singh Mar 28, 2012.
COMP541 Input Devices: Keyboards, Mice and Joysticks
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
The University of Adelaide, School of Computer Science
CSCI206 - Computer Organization & Programming
CSCI206 - Computer Organization & Programming
MIPS Processor.
ECE232: Hardware Organization and Design
Instruction encoding The ISA defines Format = Encoding
MIPS Assembly.
Computer Architecture and Assembly Language
MIPS Microarchitecture Multicycle Processor
Instruction encoding The ISA defines Format = Encoding
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Instruction encoding The ISA defines Format = Encoding
Introduction to Microprocessor Programming
Introduction to Computer Systems
MIPS Instruction Set Architecture
Instruction encoding The ISA defines Format = Encoding
MIPS Processor.
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 11, 2012

2 Summary of Remaining Labs, etc.  HW #2 (last one) assigned later today due Fri April 20 due Fri April 20  Lab Demos Fri April 20, 1-2:50pm Fri April 20, 1-2:50pm  grade by 4/23 Mon April 23, 1-3:30pm Mon April 23, 1-3:30pm  grade by 4/25 Wed April 25, 1-2:15pm: final chance for demos Wed April 25, 1-2:15pm: final chance for demos  grade by 4/27  Optional Take-Home Test #2 assigned April 20 assigned April 20 due anytime up until Apr 30, 3pm (final exam slot) due anytime up until Apr 30, 3pm (final exam slot)

Tasks for Lab Final Project/Demo  April 13: Lab 10 Completed Show: Show:  show a complete and working Lab 10 I will show you how to: I will show you how to:  add keyboard/joystick/mouse  integrate your VGA display code  April 13-20: Demo development Do: Do:  add any new instructions you need  develop your game/demo app (keep it simple!)  April 20, 23, 25: Show: Show:  show a complete and working final demo 3

A few tips on finishing up your MIPS  Sign extension: simple assume all of your I-type instructions are signed assume all of your I-type instructions are signed  e.g., lw, sw, addi, beq thus, simply sign-extend every immediate operand thus, simply sign-extend every immediate operand  just extend value of bit 15 to upper 16 bits  Add any other instrs needed slt could be very useful for loops! slt could be very useful for loops! you can do without all “unsigned” instructions you can do without all “unsigned” instructions  Do everything step-by-step! 4

This is your single-cycle MIPS 5

6Memories  Word width both instruction (IM) and data memories (DM) have 32-bit words both instruction (IM) and data memories (DM) have 32-bit words  be careful about word vs. byte addresses  i.e., whether or not to multiply/divide by 4 size IM so it can hold your code (say, 200 instructions) size IM so it can hold your code (say, 200 instructions) size DM so it can hold all your data (say, 100 words) size DM so it can hold all your data (say, 100 words) lw and sw should suffice lw and sw should suffice  skip lb and sb  they could be done in software

Memory-Mapped I/O  Simple technique for accessing I/O give each I/O device a “fake” memory address give each I/O device a “fake” memory address i.e., CPU reads and writes a specific range of memory locations for I/O devices i.e., CPU reads and writes a specific range of memory locations for I/O devices  using lw and sw  pretending I/O devices were simply memory locations  net effect is reading and writing I/O each device is assigned its own range of memory each device is assigned its own range of memory  “address space” example: example:  data memory from ’h0000_0000 to ’h0000_FFFF  VGA display (screen memory) from ’h1000_0000 to ’h1000_03FF  joystick status at ’h1100_0000  mouse status at ’h1100_0004  keyboard status at ’h1100_0008 … 7

8 Memory Map Data Memory Character Memory FFFF FF Do you test all bits in your memory decoder? Up to you.  Keep in mind: your character memory may have different word widths your character memory may have different word widths e.g., x1, or x8, etc. e.g., x1, or x8, etc. you may need to do some address and data conversion you may need to do some address and data conversion joystick, etc. gap

Memory Map  How to do in Verilog? Let’s do this interactively! Let’s do this interactively! 9

10 Adding I/O  Look at memory-mapped I/O  Conceptually like this

11 In Reality  Isolated from CPU  On standard buses PCI PCI  Ours will typically be simpler Just memory addresses Just memory addresses

12 Joystick, mouse, etc.  You’ll add joystick or keyboard (or both) into memory locations that you can read e.g., at two locations right above character memory e.g., at two locations right above character memory  I will show you on Fri

13 How Does Processor Begin?  One way is to initialize PC to 0 or some other predefined address or some other predefined address  Another possibility is to have a reset each time you hit a reset button, PC starts again at 0 each time you hit a reset button, PC starts again at 0  Make sure to have instructions there Modern computers have flash memory to boot CPU or go to configuration utility Modern computers have flash memory to boot CPU or go to configuration utility On (very) old computers had to enter boot program on front panel On (very) old computers had to enter boot program on front panel

Summary  Now we are done with creating a CPU!  Start creating your final demo! 14