EECS 373 Design of Microprocessor-Based Systems

Similar documents
EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Unit 11. Latches and Flip-Flops

Figure 1 shows a simple implementation of a clock switch, using an AND-OR type multiplexer logic.

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

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

Digital Circuits ECS 371

DEDICATED TO EMBEDDED SOLUTIONS

CS3350B Computer Architecture Winter 2015

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

DIGITAL ELECTRONICS MCQs

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1


EITF35: Introduction to Structured VLSI Design

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

Other Flip-Flops. Lecture 27 1

Lecture 8: Sequential Logic

Digital Fundamentals

EECS150 - Digital Design Lecture 3 Synchronous Digital Systems Review. Announcements

UC Berkeley CS61C : Machine Structures

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

Digital System Design

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

IT T35 Digital system desigm y - ii /s - iii

Chapter 2. Digital Circuits

Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

Synchronous Sequential Logic

Engr354: Digital Logic Circuits

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

CS61C : Machine Structures

ASYNCHRONOUS SEQUENTIAL CIRCUIT CONCEPTS

CS61C : Machine Structures

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

Administrative issues. Sequential logic

Sequential Design Basics

D Latch (Transparent Latch)

Logic Design II (17.342) Spring Lecture Outline

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

EECS150 - Digital Design Lecture 10 - Interfacing. Recap and Topics

PRE J. Figure 25.1a J-K flip-flop with Asynchronous Preset and Clear inputs

CS 61C: Great Ideas in Computer Architecture

System IC Design: Timing Issues and DFT. Hung-Chih Chiang

INTRODUCTION TO SEQUENTIAL CIRCUITS

CPS311 Lecture: Sequential Circuits

Logic Design. Flip Flops, Registers and Counters

Chapter 4. Logic Design

1. What does the signal for a static-zero hazard look like?

Software Engineering 2DA4. Slides 9: Asynchronous Sequential Circuits

FE REVIEW LOGIC. The AND gate. The OR gate A B AB A B A B 0 1 1

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

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

CS61C : Machine Structures

Chapter 3 Unit Combinational

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

Sequential Circuits: Latches & Flip-Flops

Logic Design II (17.342) Spring Lecture Outline

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

Asynchronous (Ripple) Counters

INC 253 Digital and electronics laboratory I

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

Decade Counters Mod-5 counter: Decade Counter:

Digital Logic Design ENEE x. Lecture 19

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

FPGA TechNote: Asynchronous signals and Metastability

2.6 Reset Design Strategy

Combinational vs Sequential

DIGITAL CIRCUIT LOGIC UNIT 11: SEQUENTIAL CIRCUITS (LATCHES AND FLIP-FLOPS)

LATCHES & FLIP-FLOP. Chapter 7

CARLETON UNIVERSITY. The Tug-of-War Game. Player 1 RESET

Clock Domain Crossing. Presented by Abramov B. 1

CHAPTER 1 LATCHES & FLIP-FLOPS

Chapter 5 Flip-Flops and Related Devices

Glitches/hazards and how to avoid them. What to do when the state machine doesn t fit!

CprE 281: Digital Logic

! Two inverters form a static memory cell " Will hold value as long as it has power applied

Advanced Digital Logic Design EECS 303

ELE2120 Digital Circuits and Systems. Tutorial Note 7

VLSI Clock Domain Crossing

Universal Asynchronous Receiver- Transmitter (UART)

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

CHAPTER 6 COUNTERS & REGISTERS

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

EE178 Lecture Module 4. Eric Crabill SJSU / Xilinx Fall 2005

ECE 341. Lecture # 2

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

CS61C : Machine Structures

CSE140: Components and Design Techniques for Digital Systems. More D-Flip-Flops. Tajana Simunic Rosing. Sources: TSR, Katz, Boriello & Vahid

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

ECE321 Electronics I

Review of digital electronics. Storage units Sequential circuits Counters Shifters

Outline. EECS150 - Digital Design Lecture 27 - Asynchronous Sequential Circuits. Cross-coupled NOR gates. Asynchronous State Transition Diagram

Course Administration

Logic Gates, Timers, Flip-Flops & Counters. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Transcription:

EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 13: Wrapping up and moving forward. Review error with ADCs/DACs Finish design rules Quick discussion of MMIO in C

Announcements HW5 due Tuesday Oct 23 rd. Student talk assignments coming out today. Wednesday in class is a review session Just questions and answers If you don t have questions it will be very short. I expect most questions will come from old exams and homework assignments. Exam is 6:30pm on Wednesday in IOE1610. 2

Analog conversion errors review 3

Quantization error Ideal transfer function Ideal transfer with ½ LSB offset Here we take all values from 0 to ⅛ and call them 000. Here we shift over the value by ½ LSB. This means the ideal transfer function and the actual one are never more than ½ LSB (1/16 in this case) off. http://www.embedded.com/showarticle.jhtml?articleid=60403334 4

Integral nonlinearity The integral nonlinearity (INL) is the deviation of an ADC's transfer function from a straight line. This line is often a best-fit line among the points in the plot but can also be a line that connects the highest and lowest data points, or endpoints. INL is determined by measuring the voltage at which all code transitions occur and comparing them to the ideal. The difference between the ideal voltage levels at which code transitions occur and the actual voltage is the INL error, expressed in LSBs. INL error at any given point in an ADC's transfer function is the accumulation of all DNL errors of all previous (or lower) ADC codes, hence it's called integral nonlinearity.

It s a promise it won t be worse than X. Differential nonlinearity DNL is the worst cases variation of actual step size vs. ideal step size.

Digital design 7

Glitches x z Full adder (from Wikipedia) y Consider the adjacent circuit diagram. Assuming the XOR gates have a delay of 0.2ns while AND and OR gates have a delay of 0.1ns, fill in the following chart. Only selected causality arrows shown

Glitching: a summary When input(s) change The output can be wrong for a time However, that time is bounded And more so, the output can change during this computation time even if the output ends up where it started!

Effect of Glitches Think back to EECS 370. Why don t glitches cause errors? The trick is that the inputs all change at the same time In this case, the ID/EX registers all change some time shortly after the rising edge of the clock. And we ve chosen the clock period such that the next edge doesn t happen until the combinational logic has stopped glitching. In fact, we use the worst-case combinational logic delay in the whole system when determining the clock period!

So, how can glitches hurt us? There are a handful of places: Asynchronous resets If you ve got a flip-flop that has an asynchronous reset (or preset ) you need to be sure the input can t glitch. Clocks That pretty much means you need a flipflop driving the input (which means you probably should have used a sync. reset!) If you are using combinational logic to drive a clock, you are likely going to get extra clock edges. Traditionally, CLR is used to indicate async reset. R or reset for sync. reset. If clk is high and cond glitches, you get extra edges!

Design rules 1. Thou shalt not use asynchronous resets 2. Thou shalt not drive a clock with anything other than a clock or directly off of a flip-flop s output X X

Really? Seriously? People do use asynchronous resets and clock gating! Yep. And people use goto in C programs. Sometimes they are the right thing. But you have to think really hard about them to insure that they won t cause you problems. Our simple bus used combinational logic for the clock Works because REQ goes low only after everything else has stopped switching So no glitch. Not fun to reason about Avoid unless you must Then think really carefully.

Setup and hold time The idea is simple. When the clock is changing if the data is also changing it is hard to tell what the data is. Hardware can t always tell And you can get meta-stable behavior too (very unlikely but ) So we have a guard band around the clock rising time during which we don t allow the data to change. See diagram. We call the time before the clockedge setup time and the time after hold time

So what happens if we violate set-up or hold time? Often just get one of the two values. And that often is just fine. Consider getting a button press from the user. If the button gets pressed at the same time as the clock edge, we might see the button now or next clock. Either is generally fine when it comes to human input. But bad things could happen. The flip-flop s output might not settle out to a 0 or a 1 That could cause later devices to mess up. More likely, if that input is going to two places, one might see a 0 the other a 1 Important: don t feed an async input to multiple places!

Example A common thing to do is reset a state machine using a button. User can reset the system. Because the button transition could violate setup or hold time, some state bits of the state machine might come out of reset at different times. And you quickly end up at a wrong or illegal state.

So Dealing with inputs not synchronized to our local clock is a problem. Likely to violate setup or hold time. That could lead to things breaking. So we need a clock synchronization circuit. First flip-flop might have problems. Second should be fine. Sometimes use a third if really paranoid Safety-critical system for example. Figure from http://www.eeweb.com/electronics-quiz/solving-metastability-design-issues, we use the same thing to deal with external inputs too!

Design rules 3. Thou shalt use a clock synchronization circuit when changing clock domains or using unclocked inputs! /* Synchonization of Asynchronous switch input */ always@(posedge clk) begin sw0_pulse[0] <= sw_port[0]; sw0_pulse[1] <= sw0_pulse[0]; sw0_pulse[2] <= sw0_pulse[1]; end always @(posedge clk) SSELr <= {SSELr[1:0], SSEL}; Also, be aware most FPGA libraries have resources to make dealing with multiple clock domains e Bi-directional queues generally.

MMIO review 20

Talking to MMIO locations via C. Write a C function clear_and_enable which takes a single external interrupt source as an argument. It clears the pending status for that register and enables interrupts from that source. It should return a 1 if the source was already enabled, otherwise it should return a 0. You need not check to see if x is a reasonable value. 21

So, what do we want to do? Idea (in English): Pseudo code: 22

Let s do it wrong. int clear_and_enable(int x) { int *s_en =0xE000E100; int *c_pend =0xE000E280; int index =x>>5; int offset =x & 5 b11111; int mask =1<<offset; int estatus =*(s_en+index) & mask; *(c_pend+index)&=mask; // clear pending if(estatus) //(would estatus==1 work here?) return(1); *(s_en+index) =mask; // set enable return(0); } (errors are described in the pptx notes) 23

Now try to do it right (without looking!) 24