EECS150 - Digital Design Lecture 18 Line Drawing Engine. Announcements

Similar documents
EECS150 - Digital Design Lecture 15 - Video

EECS150 - Digital Design Lecture 12 - Video Interfacing. MIPS150 Video Subsystem

EECS150 - Digital Design Lecture 15 - Project Description, Part 5

EECS150 - Digital Design Lecture 9 Project Introduction (I), Serial I/O. Announcements

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

Department of Electrical Engineering and Computer Sciences Fall 2003 Instructor: Dave Patterson CS 152 Exam #1. Personal Information

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling

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

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

Processor design - MIPS

EECS150 - Digital Design Lecture 11 SRAM (II), Caches. Announcements

1. Truthiness /8. 2. Branch prediction /5. 3. Choices, choices /6. 5. Pipeline diagrams / Multi-cycle datapath performance /11

University of California, Berkeley College of Engineering

Grading Results Total 100

University of California, Berkeley College of Engineering

University of California College of Engineering Computer Science Division -EECS. CS 152 Midterm I

EECS150 Lab Lecture 5 Introduction to the Project

Review. Lecture #9 MIPS Logical & Shift Ops, and Instruction Representation I Logical Operators (1/3) Bitwise Operations

Line Drawing Week 6, Lecture 9

CS61C Machine Structures. Lecture 12 - MIPS Procedures II & Logical Ops. 2/13/2006 John Wawrzynek. www-inst.eecs.berkeley.

CS 61C: Great Ideas in Computer Architecture. MIPS Instruction Formats

Computer Architecture I Midterm I (solutions)

CS654 Advanced Computer Architecture. Lec 1 - Introduction

Please put your cellphone on vibrate

CSE 378 Final Exam 3/14/11 Sample Solution

In today s lecture we ll have a look at: A simple technique The mid-point circle algorithm

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Computer Architecture I Midterm I

COMP 303 MIPS Processor Design Project 3: Simple Execution Loop

ECE 30 Introduction to Computer Engineering

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

Programmable Machines

CPSC / Scan Conversion

ELEC / Computer Architecture and Design Fall 2013 Instruction Set Architecture (Chapter 2)

Programmable Machines

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete

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

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

MIPS Programming. A basic rule is: try to be mechanical (that is, don't be "tricky") when you translate high-level code into assembler code.

CS 61c: Great Ideas in Computer Architecture

Chapter 2. Instructions:

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

EE108B Lecture 2 MIPS Assembly Language I. Christos Kozyrakis Stanford University

SAE5C Computer Organization and Architecture. Unit : I - V

4. What is the average CPI of a 1.4 GHz machine that executes 12.5 million instructions in 12 seconds?

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics

UCB CS61C : Machine Structures

Review of instruction set architectures

MIPS Assembly Programming

Computer Architecture EE 4720 Midterm Examination

CS475m - Computer Graphics. Lecture 1 : Rasterization Basics

The MIPS Instruction Set Architecture

Lecture 9. Pipeline Hazards. Christos Kozyrakis Stanford University

Assembly Programming

Midterm II CS164, Spring 2006

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

C 1. Last time. CSE 490/590 Computer Architecture. Complex Pipelining I. Complex Pipelining: Motivation. Floating-Point Unit (FPU) Floating-Point ISA

CS3350B Computer Architecture Quiz 3 March 15, 2018

CSCI 402: Computer Architectures. Arithmetic for Computers (4) Fengguang Song Department of Computer & Information Science IUPUI.

(Refer Slide Time: 00:02:00)

Examples of branch instructions

Computer Architecture. MIPS Instruction Set Architecture

Computer Architecture Experiment

Problem maximum score 1 35pts 2 22pts 3 23pts 4 15pts Total 95pts

CS 61C: Great Ideas in Computer Architecture. Lecture 11: Datapath. Bernhard Boser & Randy Katz

ECE/CS 552: Introduction to Computer Architecture ASSIGNMENT #1 Due Date: At the beginning of lecture, September 22 nd, 2010

Review of Last Lecture. CS 61C: Great Ideas in Computer Architecture. The Flynn Taxonomy, Intel SIMD Instructions. Great Idea #4: Parallelism.

Final Project: MIPS-like Microprocessor

Topic Notes: MIPS Instruction Set Architecture

(Refer Slide Time: 00:03:51)

Review of Last Lecture. CS 61C: Great Ideas in Computer Architecture. MIPS Instruction Representation II. Agenda. Dealing With Large Immediates

ECE331: Hardware Organization and Design

Winter 2003 MID-SESSION TEST Monday, March 10 6:30 to 8:00pm

I-Format Instructions (3/4) Define fields of the following number of bits each: = 32 bits

Winter 2012 MID-SESSION TEST Tuesday, March 6 6:30pm to 8:15pm. Please do not write your U of C ID number on this cover page.

CS 61C: Great Ideas in Computer Architecture. The Flynn Taxonomy, Intel SIMD Instructions

EN2910A: Advanced Computer Architecture Topic 02: Review of classical concepts

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

Today s lecture. Translating an if-then statement

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

Flow of Control -- Conditional branch instructions

08 - Address Generator Unit (AGU)

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

LECTURE 10. Pipelining: Advanced ILP

CS 164, Midterm #2, Spring O, M, C - e1 : Bool O, M, C - e2 : t2 O, M, C - e2 : T3 O, M, C - if e1 then e2 else e3 fi : T2 _ T3

CSE 378 Midterm 2/12/10 Sample Solution

ASIC = Application specific integrated circuit

R asterisation. Part I: Simple Lines. Affine transformation. Transform Render. Rasterisation Line Rasterisation 2/16

CS/COE 0447 Example Problems for Exam 2 Fall 2010

Winter 2002 FINAL EXAMINATION

Appendix C: Pipelining: Basic and Intermediate Concepts

Computer Science 61C Spring Friedland and Weaver. The MIPS Datapath

CPS 104 Computer Organization and Programming

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

ENCM 369 Winter 2018 Lab 9 for the Week of March 19

CS61C : Machine Structures

The plot thickens. Some MIPS instructions you can write cannot be translated to a 32-bit number

CS 316: Procedure Calls/Pipelining

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

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

Transcription:

EECS150 - Digital Design Lecture 18 Line Drawing Engine November 1, 2011 Elad Alon Electrical Engineering and Computer Sciences University of California, Berkeley http://www-inst.eecs.berkeley.edu/~cs150 Fall 2011 EECS150 Lecture 18 Page 1 Announcements Project checkpoint #3 due this week Checkpoint #4 due in two weeks Intermediate check point due in one week More details on the web soon Fall 2011 EECS150 Lecture 18 Page 2

Project Notes Offer: GSIs will be available to look at your code with you today in office hours/lab Make sure you check-off even if your design isn t fully functional Note that in this case the only thing we can really give partial credit for are your tests Fall 2011 EECS150 Lecture 18 Page 3 Modularity and Verification You are dealing with a complex design You therefore need to decompose your design into simple sub-elements You also need to verify that each of these sub-elements works as desired I.e., unit testing matters! And yes, writing the tests could easily take you twice (or more) as long as writing the module itself Fall 2011 EECS150 Lecture 18 Page 4

Additional Project Tips Use make report to look at the hardware you actually got In particular, double check that you got the latches you wanted (not any more or any less) Look at the block diagrams you drew Make sure you understand how everything is working together And where the synchronous boundaries are Midterm problem #4 was there for a reason Fall 2011 EECS150 Lecture 18 Page 5 Midterm Problem 4 Review WE AW AR 1 AR 1 D 1 AR 2 AR 2 RF D 2 WE AW DW w Fall 2011 EECS150 Lecture 18 Page 6

Midterm Problem 4 Review WE AW AR 1 AR 1 D 1 AR 2 AR 2 RF D 2 WE AW DW w Fall 2011 EECS150 Lecture 18 Page 7 MIPS150 Video Subsystem Gives software ability to display information on screen. Equivalent to standard graphics cards: Processor can directly write the display bit map 2D Graphics acceleration Fall 2011 EECS150 Lecture 18 Page 8

Graphics Software Clearing the screen - fill the entire screen with same color Remember Framebuffer base address: 0x8000_0000 Size: 1024 x 768 clear: # a0 holds 4-bit pixel color # t0 holds the pixel pointer ori $t0, $0, 0x8000 # top half of frame address sll $t0, $t0, 16 # form framebuffer beginning address # t2 holds the framebuffer max address ori $t2, $0, 768 # 768 rows sll $t2, $t2, 12 # * 1K pixels/row * 4 Bytes/address addu $t2, $t2, $t0 # form ending address addiu $t2, $t2, -4 # minus one word address # # the write loop L0: sw $a0, 0($t0) # write the pixel bneq $t0, $t2, L0 # loop until done addiu $t0, $t0, 4 # bump pointer jr $ra How long does this take? What do we need to know to answer? How does this compare to the frame rate? Fall 2011 EECS150 Lecture 18 Page 9 Optimized Clear Routine Amortizing the loop overhead. clear:... # the write loop L0: sw $a0, 0($t0) # write some pixels sw $a0, 4($t0) sw $a0, 8($t0) sw $a0, 12($t0) sw $a0, 16($t0) sw $a0, 20($t0) sw $a0, 24($t0) sw $a0, 28($t0) sw $a0, 32($t0) sw $a0, 36($t0) sw $a0, 40($t0) sw $a0, 44($t0) sw $a0, 48($t0) sw $a0, 52($t0) sw $a0, 56($t0) sw $a0, 60($t0) bneq $t0, $t2, L0 # loop until done addiu $t0, $t0, 64 # bump pointer jr $ra0 What s the performance of this one? Fall 2011 EECS150 Lecture 18 Page 10

Line Drawing Fall 2011 EECS150 Lecture 18 Page 11 Bresenham Line Drawing Algorithm Developed by Jack E. Bresenham in 1962 at IBM. "I was working in the computation lab at IBM's San Jose development lab. A Calcomp plotter had been attached to an IBM 1401 via the 1407 typewriter console. Computers of the day, slow at complex arithmetic operations, such as multiply, especially on floating point numbers. Bresenham s algorithm works with integers and without multiply or divide. Simplicity makes it appropriate for inexpensive hardware implementation. With extension, can be used for drawing circles. Fall 2011 EECS150 Lecture 18 Page 12

Line Drawing Algorithm Fall 2011 EECS150 Lecture 18 Page 13 Line Drawing, Examples deltay = 1 (very low slope). y only gets incremented once (halfway between x0 and x1) deltay = deltax (45 degrees, max slope). y gets incremented for every x Fall 2011 EECS150 Lecture 18 Page 14

Line Drawing Example Fall 2011 EECS150 Lecture 18 Page 15 C Version Modified to work in any quadrant and for any slope. What s needed to do it in hardware? Goal is one pixel per cycle. Pipelining might be necessary. Fall 2011 EECS150 Lecture 18 Page 16

Hardware Implementation Notes Read-only control register Write-only trigger registers Write-only non-trigger registers 0x8040_0064: 0x8040_0060: 0x8040_005c: 0x8040_0058: 0x8040_0054: 0x8040_0050: 0x8040_004c: 0x8040_0048: 0x8040_0044: 0x8040_0040: 10 0 CPU initializes line engine by sending pair of points and color value to use. Writes to 0x8040_005* trigger engine. Framebuffer has one write port - Shared by CPU and line engine. Priority to CPU - Line engine stalls when CPU writes. 32 ready color y1 x1 y0 x0 y1 x1 y0 x0 Fall 2011 EECS150 Lecture 18 Page 17