Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania 18042 ECE 491 - Senior Design I Lecture 15 - Handshaking.

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

I2C bus Inter Integrated Circuits bus by Philips Semiconductors
INPUT-OUTPUT ORGANIZATION
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 10 - Communicating.
Serial I/O - Programmable Communication Interface
Crystal Inc. CS8900A-ISA Ethernet Controller Presented by Kallol Par April,
Local Asynchronous Communication and RS-232. Goals Explain how electric current can be used to transmit bits over short distances Present a popular mechanism.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 7 - Synchronizers.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 9 - ASM Diagrams.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 1 - Course Overview.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 23 - Course.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 11 - Data Communications.
Serial Input/Output Interface Outline –Serial I/O –Asynchronous serial I/O –6850 ACIA –68681 DUART –Synchronous serial I/OInterface Standards –68000 Serial.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 12 - Metastability.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 6 - Verilog Coding.
CS335 Networking & Network Administration Wednesday, April 7 PacketsPackets, Frames, and Error DetectionFramesError Detection.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 15 - Handshaking.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Network Data Organizational Communications and Technologies Prithvi N. Rao Carnegie Mellon University Web:
5-1 Data Link Layer r Today, we will study the data link layer… r This is the last layer in the network protocol stack we will study in this class…
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 4 - Verilog 2 (Sequential.
Transmission Modes Different ways of characterizing the transmission.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE VLSI System Design Lecture 4 - Advanced Verilog.
William Stallings Data and Computer Communications 7th Edition Chapter 6 Digital Data Communications Techniques.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 10 - Data Communications.
111/9/2005EE 108A Lecture 13 (c) 2005 W. J. Dally EE108A Lecture 13: Metastability and Synchronization Failure (or When Good Flip-Flops go Bad)
Local Asynchronous Communication
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
INPUT-OUTPUT ORGANIZATION
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
331: STUDY DATA COMMUNICATIONS AND NETWORKS.  1. Discuss computer networks (5 hrs)  2. Discuss data communications (15 hrs)
Computers in Surveying SVY2301 / E4006 Automated Surveying.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 17.
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 27 Omar Meqdadi Department of Computer Science and Software Engineering.
Chapter-4/5-1CS331- Fakhry Khellah Term 081 Chapter 4 (Only 4.2 – 4.3) Digital Transmission.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Universal Asynchronous Receiver/Transmitter (UART)
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
ECS 152A 4. Communications Techniques. Asynchronous and Synchronous Transmission Timing problems require a mechanism to synchronize the transmitter and.
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
Presenter : Ching-Hua Huang 2012/6/25 A High-Throughput, Metastability-Free GALS Channel Based on Pausible Clock Method Mohammad Ali Rahimian, Siamak Mohammadi,
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 16 - Ethernet Fall.
Universal Asynchronous Receiver/Transmitter (UART)
Data Link and Flow Control Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific.
FPGA firmware of DC5 FEE. Outline List of issue Data loss issue Command error issue (DCM to FEM) Command lost issue (PC with USB connection to GANDALF)
Spring 2009W. Rhett DavisNC State UniversityECE 406Slide 1 ECE 406 – Design of Complex Digital Systems Lecture 16: Introduction to Buses and Interfaces.
Unit 1 Lecture 4.
CSCI1600: Embedded and Real Time Software Lecture 16: Advanced Programming with I/O Steven Reiss, Fall 2015.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
ECE 554 Miniproject Spring
WINLAB Open Cognitive Radio Platform Architecture v1.0 WINLAB – Rutgers University Date : July 27th 2009 Authors : Prasanthi Maddala,
Networked Embedded Systems Pengyu Zhang EE107 Spring 2016 Lecture 8 Serial Buses.
8251 USART.
PC-based L0TP Status Report “on behalf of the Ferrara L0TP Group” Ilaria Neri University of Ferrara and INFN - Italy Ferrara, September 02, 2014.
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Serial mode of data transfer
DIGITAL DATA COMMUNICATION TECHNIQUES
Computer Organization and Design
Clock Domain Crossing Keon Amini.
DIGITAL DATA COMMUNICATION TECHNIQUES
Serial Communication Interface: Using 8251
Communications channels تقديم المهندس سنان محمد حسن
DIGITAL DATA COMMUNICATION TECHNIQUES
Layered Protocol Wrappers Design and Interface review
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
Presentation transcript:

Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 15 - Handshaking Fall 2006 Quiz Friday: ASM Diagrams, Ethernet Paper

ECE 491 Fall 2006Lecture 15 - Handshaking2 Where we are  Last Time:  ASM Diagrams - an alternative to “bubble and arrow” diagrams  System Design & Refinement  Today:  Discuss Lab 6 - Manchester Receiver  Handshaking for Communicating State Machines  Reference:  C. Cummings, “Synthesis and Scripting Techniques for Multi- Asynchronous Clock Designs”, SNUG 2002,

ECE 491 Fall 2006Lecture 15 - Handshaking3 Reiew - Manchester Code idle  Note addition of “idle” value - neither 1 or 0 cell Manchester

ECE 491 Fall 2006Lecture 15 - Handshaking4 Lab 5 - Manchester Transmitter

ECE 491 Fall 2006Lecture 15 - Handshaking5 Manchester Transmitter Operation Transmitter asserts ready during last bit User asserts data, start transmitter de-asserts rdy, asserts txe User asserts new data, start End of transmission

ECE 491 Fall 2006Lecture 15 - Handshaking6 Testing Your Design  Step 1: Self-Checking Testbench  Single byte  Multiple byte (with no gaps)  Step 2: Hardware in FPGA  Inputs allow transmission of 1-4 bytes  Instantiate with design on S3 board

ECE 491 Fall 2006Lecture 15 - Handshaking7 Hardware Test Module Available at foghorn.cadlab.lafayette.edu/ece491/examples/mxtest.v

ECE 491 Fall 2006Lecture 15 - Handshaking8 Goals of Handshaking  Reliably pass control information between systems  Reliably pass data between interacting systems  Systems may be driven by different clocks! SR SR DO_CMD DATA clk1clk2 clk1clk2

ECE 491 Fall 2006Lecture 15 - Handshaking9 Handshaking  Basic Idea:  Receiver performs “action” at request of sender Transfer data Perform a sub-computation  Want action to be performed once for each request  Types of Handshaking  1-way  2-way  3-way  4-way (fully interlocked)

ECE 491 Fall 2006Lecture 15 - Handshaking10 1-Way Handshake  R waits for CMD before starting action  S asserts CMD to start action CMD SR SCMD S1 SN-2 SN-1 SN SN-1 RWAIT CMD CLK S State R State SN RWAIT SCMD RWAIT S1 R1 S2 R2 CMD RWAIT R1 RM T F

ECE 491 Fall 2006Lecture 15 - Handshaking11 1-way Handshake: Observations  Not reliable - why?  Receiver can “miss” assertion of CMD if it isn’t in RWAIT  Receiver may see assertion of CMD twice if it runs on a faster clock than sender

ECE 491 Fall 2006Lecture 15 - Handshaking12 2-Way Handshake 1.Sender asserts CMD and waits for ACK before continuing 2.Receiver waits for CMD and then asserts ACK CMD SR ACK CMD SCMD F SN-2 SN-1 SN ACK CMD RWAIT R1 RM F T ACK SN-1 RWAIT SN RWAIT SCMD RWAIT SCMD R1 S1 R2 CMD CLK S State R State ACK

ECE 491 Fall 2006Lecture 15 - Handshaking13 2 Way Handshake - Observations  Reliable if S and R use same clock  Not reliable if S and R use different clocks  R could see CMD twice if R faster than S  S could see ACK twice if S faster than R

ECE 491 Fall 2006Lecture 15 - Handshaking14 3-Way Handshake 1.Sender asserts CMD and waits for ACK before continuing 2.Receiver waits for CMD and then asserts ACK 3.Receiver waits for CMD=0 before continuing CMD SR ACK CMD SCMD F SN-2 SN ACK CMD RW1 RW2 R1 F T ACK SN RWAIT SCMD RW1 CMD CLK S State R State ACK T T F CMD CMD’ SCMD RW2 S1 S2 R1

ECE 491 Fall 2006Lecture 15 - Handshaking15 3-Way Handshake - Comments  Use in some asynchronous bus interfaces  Not reliable if S is faster than R (see ACK twice)

ECE 491 Fall 2006Lecture 15 - Handshaking16 4-Way Handshake (Fully Interlocked) 1.Sender asserts CMD and waits for ACK before continuing 2.Receiver waits for CMD and then asserts ACK 3.Receiver waits for CMD=0 before continuing 4. Sender waits for ACK=0 before continuing CMD SR ACK RW1 RW2 SC1 RW1 CMD CLK S State R State ACK CMD R1 F T ACK T F CMD CMD’ SC1 RW2 SC2 R1 CMD SC1 F SN ACK T SC2 ACK T ACK’

ECE 491 Fall 2006Lecture 15 - Handshaking17 4-Way Handshaking  Works under all circumstances  Still need synchronizers if clocks are different! clk1 clk2 SR CMD ACK clk1 clk2

ECE 491 Fall 2006Lecture 15 - Handshaking18 Handshaking with Multiple Clocks  CMD, ACK must be synchronized!  Penalty: even more latency! S R CMD ACK.s1 DQDQ QDQD CMD.s2 ACK clk1clk2

ECE 491 Fall 2006Lecture 15 - Handshaking19 Handshaking ASMs with Different Clocks  Treat signals passing between S and R as asynchronous!  Important: never try to handshake on multiple bits  Use synchronizers when crossing clock domains

ECE 491 Fall 2006Lecture 15 - Handshaking20 Alternative to Handshaking: FIFOs  FIFO = First In / First Out Buffer  S writes data once each clock cycle unless FULL  R reads data once every clock cycle unless EMPTY SR SCLK FULL RCLK EMPTY

ECE 491 Fall 2006Lecture 15 - Handshaking21 FIFO Implementation - Software  Head pointer - marks where to add data  Tail pointer - marks where to remove data  Exceptional conditions: FULL, EMPTY Write Pointer (Head) FULL Read Pointer (Tail) EMPTY Array (RAM) 0x0 0x7

ECE 491 Fall 2006Lecture 15 - Handshaking22 FIFO Implementation - Hardware Dual-Port RAM WDATA WADDR WR RDATA RADDR Write Logic Read Logic CLK2CLK1 FULL DATA EMPTY DATA  Q: How do we calculate FULL & EMPTY? TAILHEAD

ECE 491 Fall 2006Lecture 15 - Handshaking23 FIFO Implementation - Hardware Dual-Port RAM WDATA WADDR WR RDATA RADDR Write Logic Read Logic CLK2CLK1 FULL DATA EMPTY DATA  Q: How do we calculate FULL & EMPTY?  A: Must compare head & tail pointers TAILHEAD

ECE 491 Fall 2006Lecture 15 - Handshaking24 FIFO Implementation - Hardware  Problem:  Read logic (clk1) needs to see Tail pointer (clk2)  Write logic (clk2) needs to see the Head pointer (clk1)  Proposed Solution:  Synchronize Head, Tail  Problem again! Multiple bits in Head, Tail  Synchronization won’t work on multiple bits!  Complete Solution:  Use Gray Code for Head, Tail (only 1 bit changes at a time!)  Translate to/from binary internally

ECE 491 Fall 2006Lecture 15 - Handshaking25 Lab 6 - Manchester Receiver

ECE 491 Fall 2006Lecture 15 - Handshaking26 Manchester RCVR - Details  Input is all high when idle  Each frame starts with a preamble/SFD  Initial part: 1’s & 0’s  End of SFD: 2 1’s  Data transmitted one bit at a time after SFD and copied to a buffer RAM  Frame ends with return to idle

ECE 491 Fall 2006Lecture 15 - Handshaking27 Manchester RCVR - Start of Frame

ECE 491 Fall 2006Lecture 15 - Handshaking28 Manchester RCVR - Middle of Frame

ECE 491 Fall 2006Lecture 15 - Handshaking29 Manchester RCVR - End of Frame

ECE 491 Fall 2006Lecture 15 - Handshaking30 Manchester Receiver - Design Ideas  Assume clock = 16x transmission rate  Locate preamble start by waiting for falling edge (detect and ignore spurious start)  Wait for end of SFD (1010…1011)  Re-synchronize on each successive data bit  Go to error state if any input bit is malformed

ECE 491 Fall 2006Lecture 15 - Handshaking31 Verifying the Manchester Receiver  Testbench 1 - Standalone  Short frame: Preamble/SFD followed by one byte  Longer frame: Preamble/SFD followed by multiple bytes  Spurious start - brief transistion on RxD  Input error - RxD remains low for entire bit period  Testbench 2 - With Manchester Transmitter  Use transmitter to transmit frames of multiple lengths  Verify that receiver successfully gets the same data  You must complete testbenches before attempting hardware testing

ECE 491 Fall 2006Lecture 15 - Handshaking32 Testing the Manchester Receiver  Hardware test configuration 1  Test sending preamble + ASCII characters  Test at varying data rates: 9.6kbaud - 100kbaud txtest test module Manchester transmitter Manchester receiver FIFO RS-232 transmitter PushbuttonHyperterminal

ECE 491 Fall 2006Lecture 15 - Handshaking33 Testing the Manchester Receiver  Hardware test configuration 2  Divide your circuit into transmitter and receiver  Test your receiver using another group’s transmitter txtest test module Manchester transmitter Manchester receiver FIFO RS-232 transmitter PushbuttonHyperterminal Connect between FPGA boards Group 1Group 2