Implementing A Double-Buffered System

Slides:



Advertisements
Similar presentations
Chapter 19 Fast Fourier Transform
Advertisements

Very Large Fast DFT (VL FFT) Implementation on KeyStone Multicore Applications.
Chapter 5 Enhanced Direct Memory Access (EDMA). Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004 Chapter 5, Slide 2 Learning Objectives.
Analog-to-Digital Converter (ADC) And
Auto-tuning for Electric Guitars using Digital Signal Processing Pat Hurney, 4ECE 31 st March 2009.
EE 445S Real-Time Digital Signal Processing Lab Fall 2011 Lab #3.1 Digital Filters Debarati Kundu (With the help of Mr. Eric Wilbur, TI)
0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Audio.
EE 445S Real-Time Digital Signal Processing Lab Spring 2012 Lab #3.1 Digital Filters Some contents are from the book “Real-Time Digital Signal Processing.
"In the name of ALLAH, most Gracious, most Compassionate".
The 6713 DSP Starter Kit (DSK) is a low-cost platform which lets customers evaluate and develop applications for the Texas Instruments C67X DSP family.
S3.kth.se DSP Lecture 30/ Per Zetterberg. Agenda General. Starting CCS Comparing matlab and DSP results. Profiling when comparing matlab and DSP.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6748 DSP.
McBSP Copyright © 2012 Texas Instruments. All rights reserved. Technical Training Organization T TO C6657 Workshop.
EE 445S Real-Time Digital Signal Processing Lab Fall 2011 Lab #2 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6713 DSP.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
DSP C5000 Chapter 16 Adaptive Filter Implementation Copyright © 2003 Texas Instruments. All rights reserved.
DSP/BIOS Scheduling Chapter 9 C6000 Integration Workshop Copyright © 2005 Texas Instruments. All rights reserved. Technical Training Organization T TO.
Ultra sound solution Profiles and other optimizations.
1 DSP handling of Video sources and Etherenet data flow Supervisor: Moni Orbach Students: Reuven Yogev Raviv Zehurai Technion – Israel Institute of Technology.
Fast Algorithms for Slew Constrained Minimum Cost Buffering S. Hu*, C. Alpert**, J. Hu*, S. Karandikar**, Z. Li*, W. Shi* and C. Sze** *Dept of ECE, Texas.
Introduction to the C6713 Laurier Boulianne
EDMA3, QDMA and IDMA for the Keystone Platform
Introduction to Clock Tree Synthesis
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Using the McBSP Chapter 6 C6000 Integration Workshop Copyright © 2005 Texas Instruments. All rights reserved. Technical Training Organization T TO.
Basic Memory Management Chapter 3 C6000 Integration Workshop Copyright © 2005 Texas Instruments. All rights reserved. Technical Training Organization T.
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
DSP C 5000 Chapter 8 Direct Memory Access (DMA) Copyright © 2003 Texas Instruments. All rights reserved.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
EE 345S Real-Time Digital Signal Processing Lab Fall 2008 Lab #3 Generating a Sine Wave Using the Hardware & Software Tools for the TI TMS320C6713 DSP.
Two notions of performance
Direct Memory Access Controller
Behrouz A. Forouzan TCP/IP Protocol Suite, 3rd Ed.
TI Information – Selective Disclosure
Chapter 16 Adaptive Filter Implementation
Implementation of Convolution using C++
Chapter 4 C6000 Integration Workshop
Topic: Functions – Part 2
Cache Memory Presentation I
EE 445S Real-Time Digital Signal Processing Lab Spring 2017
Period Optimization for Hard Real-time Distributed Automotive Systems
Evaluation of Relational Operations
Digital Signal Processor
Implementation of IDEA on a Reconfigurable Computer
Chapter 9: Virtual-Memory Management
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013
Channel Sorting with the EDMA
Code Review for IPv4 Metarouter Header Format
Code Review for IPv4 Metarouter Header Format
CS222P: Principles of Data Management UCI, Fall 2018 Notes #09 External Sorting Instructor: Chen Li.
The performance requirements for DSP applications continue to grow and the traditional solutions do not adequately address this new challenge Paradigm.
Static Single Assignment Form (SSA)
Lab 3 Part II Instructions
Lecture 2- Query Processing (continued)
Error Detection Neil Tang 9/26/2008
Single Value Processing Multi-Threaded Process
Lab 2 Part II Instructions
CS222: Principles of Data Management Lecture #10 External Sorting
Chapter 12 Query Processing (1)
ECE 352 Digital System Fundamentals
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Chapter 19 Fast Fourier Transform
Data Structures & Algorithms
CS222P: Principles of Data Management Lecture #10 External Sorting
Chapter 6 Multi-channel Buffered Serial Port (McBSP)
Chapter 5 – Decisions Big Java by Cay Horstmann
CS222/CS122C: Principles of Data Management UCI, Fall 2018 Notes #09 External Sorting Instructor: Chen Li.
CSE 542: Operating Systems
Presentation transcript:

Implementing A Double-Buffered System Chapter 8 C6000 Integration Workshop Technical Training Organization T TO Copyright © 2005 Texas Instruments. All rights reserved.

Goals for Lab 8 McBSP EDMA CPU + Investigate System Timing Rcv RCVCHAN ADC gBufRcv R + COPY R Xmt XMTCHAN DAC gBufXmt L Investigate System Timing Implement a Double Buffered System Technical Training Organization T TO

Outline What is “Real Time” ? Examine System Timing Implement a Double-Buffered System Lab 8 – Double-Buffered Audio Pass Thru Technical Training Organization T TO

What is Real Time ? tS In-0 In-1 Process-0 tp Out-0 Definitions tp: Processing Time ts: Sample Period (time between input samples) Real Time: Generating an output before receiving the next input (tp < ts) Latency: Time from input to output (in this case…tp) This is a minimum latency system (no buffering), ideal for control systems, but is computationally inefficient. Technical Training Organization T TO What kind of system did we use in lab7?

Lab 7 – Single Buffer System Timing . . . In-0 In-15 In-16 tS Rcv Buffer 0-15 Process 0-15 tP Xmt Buffer 0-15 Latency . . . Out-0 Out-15 Block must be processed before In-16 arrives Processing time increases 16x due to buffer size Time constraint is the same: one sample period Computationally efficient, but increased latency Technical Training Organization T TO Why did we have to decrease our buffer size to get lab 7 to work?

Why Did the Last Lab Break? (tP > tS) . . . In-0 In-31 In-32 tS Rcv Buffer 0-31 Process 0-31 tp Xmt Buffer 0-31 Latency . . . Out-0 Out-31 Processing 32 samples takes longer than processing 16 The time to process the samples hasn’t changed (tS) There are 3 solutions to this problem Decrease buffer size (we did this at the end of lab 7) Decrease processing time (tP) with optimization Increase the amount of available time for processing Technical Training Organization T TO Let’s see what Solution 2 (optimization) can do for us…

Using Optimization to Buy Time Time needed to process 16 sine samples* No Opt Opt (-gp –o3) Fast RTS & Opt C6713 (225 MHz) 2400 cycles 10.7 μs 1024 cycles 4.5 μs Not Needed C6416 (1 GHz) 9600 cycles 9.6 μs 8000 cycles 8 μs 3600 cycles 3.6 μs Without Optimization, we don’t have enough time to process 32 samples (double the processing time) The C6713 is much more efficient because it is floating-point The Fast RTS (run-time support) library is an optimized floating point library for C64x and C62x So, what is the 3rd solution? * Approximate numbers obtained with CCS profiler. The time to copy the data is NOT included.

3. Double Buffer System Timing . . . In-0 In-15 In-31 tB = BUFFSIZE * tS tB Rcv Buffer (Ping) Rcv Buffer (Pong) Rcv Buffer (Ping) Process (Ping) Process (Pong) tp Xmt Buffer (Ping) Latency . . . Out-0 Out-15 Time constraint is now buffer length (tB) (NOT sample period (tS)) Processing is the same as the single buffer system Latency is increased, but it is deterministic Simultaneous receive, process, transmit Also called Ping/Pong buffering Technical Training Organization T TO How do we implement a double buffered system?

Implementing a Double Buffer System (1) Add a second buffer to receive and transmit: P i n g P i n g gBufferRcv gBufferXmt P o n g P o n g In the HWI, add a variable to check status of ping/pong: if (pingpong == 0) { copy RcvPing to XmtPing pingpong = 1; } else { copy RcvPong to XmtPong pingpong = 0; } Technical Training Organization T TO

Implementing a Double Buffer System (2) For the EDMA, we need to create two reload entries (ping and pong) for both receive and transmit (receive only shown below): Receive Ch (init) RcvPong RcvPing Opt (same) Opt (same) Opt (same) Src = DRR Src = DRR Src = DRR Cnt = BUFFSIZE Cnt = BUFFSIZE Cnt = BUFFSIZE Dst = Ping Dst = Pong Dst = Ping Index Index Index Cnt Rld Link=Pong Cnt Rld Link=Ping Cnt Rld Link=Pong Psuedo Code Allocate reload entries for Ping and Pong Src = DRR (McBSP0) EDMA_config (…) Link: channel  Pong, Pong  Ping, Ping  Pong Technical Training Organization T TO

Lab 8 – Double Buffer Audio Pass Thru McBSP EDMA CPU L Rcv RCVCHAN ADC gBufRcv R + COPY R Xmt XMTCHAN DAC gBufXmt L Technical Training Organization T TO Implement a Double Buffered System

Technical Training Organization TTO ti