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.

Slides:



Advertisements
Similar presentations
Chapter 5 Enhanced Direct Memory Access (EDMA). Dr. Naim Dahnoun, Bristol University, (c) Texas Instruments 2004 Chapter 5, Slide 2 Learning Objectives.
Advertisements

Yaron Doweck Yael Einziger Supervisor: Mike Sumszyk Spring 2011 Semester Project.
The Linux Kernel: Memory Management
Direct Memory Access Introduction to 8237
Computer System Overview
CS-334: Computer Architecture
KeyStone Training Multicore Navigator Overview. Overview Agenda What is Navigator? – Definition – Architecture – Queue Manager Sub-System (QMSS) – Packet.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Architectural Support for Operating Systems. Announcements Most office hours are finalized Assignments up every Wednesday, due next week CS 415 section.
1 Computer System Overview OS-1 Course AA
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Computer System Structures memory memory controller disk controller disk controller printer controller printer controller tape-drive controller tape-drive.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Multicore Navigator: Queue Manager Subsystem (QMSS)
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
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.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
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.
EDMA3 Keystone SoC Devices
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Using Direct Memory Access to Improve Performance
Interrupts By Ryan Morris. Overview ● I/O Paradigm ● Synchronization ● Polling ● Control and Status Registers ● Interrupt Driven I/O ● Importance of Interrupts.
KeyStone Training Multicore Navigator: Packet DMA (PKTDMA)
1 DSP handling of Video sources and Etherenet data flow Supervisor: Moni Orbach Students: Reuven Yogev Raviv Zehurai Technion – Israel Institute of Technology.
Hardware Interrupts (HWI) Chapter 5 C6000 Integration Workshop Copyright © 2005 Texas Instruments. All rights reserved. Technical Training Organization.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Module Introduction Purpose  This training module provides an overview of the peripherals.
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time System Design Considerations 3.Hardware.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
1 ARM University Program Copyright © ARM Ltd 2013 Using Direct Memory Access to Improve Performance.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
EDMA3, QDMA and IDMA for the Keystone Platform
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
DSP C 5000 Chapter 8 Direct Memory Access (DMA) Copyright © 2003 Texas Instruments. All rights reserved.
DMA Driver APIs DMA State Diagram Loading Driver and Opening Channel DMA Channel Attributes Loading Data to a Channel Unloading Data from a Channel.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edit9on Lecture 3 Chapter 1: Introduction Provided & Updated by Sameer Akram.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSL DAT Adapter CSL 2.x DAT Reference Implementation on EDMA3 hardware using EDMA3 Low level driver.
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.
1 load [2], [9] Transfer contents of memory location 9 to memory location 2. Illegal instruction.
After Mcasp_open completed
Chapter 4 C6000 Integration Workshop
RX Data Transfer Controller (DTC)
EE 445S Real-Time Digital Signal Processing Lab Spring 2017
The TMS320C6x Family of DSPs
Computer System Overview
8237 DMA CONTROLLER.
EE 445S Real-Time Digital Signal Processing Lab Fall 2013
Chapter 5 Enhanced Direct Memory Access (EDMA)
CPE 323 Introduction to Embedded Computer Systems: DMA Controller
Channel Sorting with the EDMA
8237 DMA CONTROLLER.
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
Chapter 13: I/O Systems.
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

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 (Continued) Debarati Kundu (with the help of Mr. Eric Wilbur, TI)

EDMA Idea is that, with EDMA, CPU can initiate data transfer and do other operations while transfer is in progress. More efficient than using regular I/O which keeps CPU occupied during entire transfer. EDMA controller:  Handles all data transfers between L2 cache and peripherals.  Can move data to and from any addressable memory spaces (internal memory, external memory and peripherals) independently of CPU operations.

What is “DMA” ?  When we say “DMA”, what do we mean? Well, there are MANY forms of “DMA” (Direct Memory Access) on this device: EDMA3 – “Enhanced” DMA handles 64 DMA CHs and 4 QDMA CHs DMA – 64 channels that can be triggered manually or by events/chaining QDMA – 4 channels of “Quick” DMA triggered by writing to a “trigger word” IDMA – 2 CHs of “Internal” DMA (Periph Cfg, Xfr L1 ↔ L2) Peripheral “DMA”s – Each master device hooked to the Switched Central Resource (SCR) has its own DMA (e.g. SRIO, EMAC, etc.) Ch0 L1D L2 PERIPH Ch1 L1L2 IDMA Q0 Q1 Q2 Q3 TC0 SCR QDMA EVTx Chain Manual EDMA3 DMA Trigger Word Switched Central Resource 64 4

Why Use EDMA3? D0 D1 D2 D3 buf_0 buf_1  The primary function of EDMA3 is to move data without CPU intervention  What information does EDMA3 need to perform a transfer? Source address Destination address Length (or size)  What options might be available to perform the transfer? Do you want to interrupt the CPU when the transfer is complete? Is this transfer synchronized to an event (like the McBSP RCV buffer is full)? How do the source and destination addresses update? (same, +1, -1, +4 ?)

EDMA Features Has 64 channels that can be assigned priorities. Data transfers can be initiated by CPU or events. Programmable Transfer Burst Size: Transfers can be 8-bit bytes, 16-bit half-words, or 32-bit words. Can transfer 2-dimensional data blocks. When an event occurs its transfer parameters are read from the Parameters RAM (PaRAM) and then sent to the address generation hardware.

EDMA Features After an element transfer, addresses at source/destination can stay the same, get incremented or decremented. After a programmed transfer, EDMA can continue transfers by linking to another transfer programmed in the PaRAM for same channel, or chaining to a transfer for another channel Can generate transfer completion interrupts to the CPU along with a transfer complete code, for it to take desired action based on that code. EDMA has a Quick DMA mode (QDMA) for quick, one- time transfers.

EDMA3 Terminology Frame 1 ACNT Bytes Array1Array2Array BCNT Frame 2 Array1Array2Array BCNT Frame CCNT Array1Array2Array BCNT CCNT Frames BCNT Arrays  3-dimensional transfer consisting of ACNT, BCNT and CCNT: ACNT = Array = # of contiguous ACNT bytes (16-bit unsigned, ) BCNT = Frame = # of ACNT arrays (16-bit unsigned, ) CCNT = Block = # of BCNT frames (16-bit unsigned, )  Minimum transfer is an array of ACNT bytes  Total transfer count = ACNT * BCNT * CCNT

Example – How do you VIEW the transfer? ACNT = 2 BCNT = 2 CCNT = 3 ACNT = 1 BCNT = 4 CCNT = 3 ACNT = 12 BCNT = 1 CCNT = 1 8-bit  We need to transfer 12 bytes from “here” to “there”.  What is ACNT, BCNT and CCNT? Hmmm….  You can “view” the transfer several ways:  Which “view” is the best? Well, that depends on what your system needs and the type of synchronization… Note: these are contiguous memory locations

EDMA Channel/Parameter RAM Sets  EDMA3 has Parameter RAM sets (PSETs) that contain configuration information about a transfer  64 DMA CHs and 4 QDMA CHs can be mapped to any one of the 256 PSETs and then triggered to run (by various methods) PaRAM Set 0 PaRAM Set 1 PSET 63 PSET 64 PSET Options Source Destination CCNTRSVD ACNTBCNT SRCBIDXDSTBIDX LINKBCNTRLD SRCCIDXDSTCIDX  Each PSET contains 12 registers: Options (interrupt, chaining, sync mode, etc) SRC/DST addresses ACNT/BCNT/CCNT (size of transfer) 4 SRC/DST Indexes BCNTRLD (BCNT reload for 3D xfrs) LINK (pointer to another PSET) DMA CHs QDMA CHs Note: PSETs are dedicated EDMA RAM (not part of IRAM)

EDMA PaRAM: The OPT field:  Sets the priority,  Sets the element size: 8, 16, or 32 bits,  Defines sources as 1- or 2-dimensional,  Enables/disables transfer complete interrupt,  Defines transfer complete code,  Sets source/destination address update modes.

“A” – Synchronization  An event (like the McBSP receive register full), triggers the transfer of exactly 1 array of ACNT bytes (2 bytes)  Example: McBSP tied to a codec (you want to sync each transfer of a 16-bit word to the receive buffer being full or the transmit buffer being empty). Frame 1 Array1Array2Array BCNT Frame 2 Array1Array2Array BCNT Frame CCNT Array1Array2Array BCNT EVTx

“AB” – Synchronization  An event triggers a two-dimensional transfer of BCNT arrays of ACNT bytes (A*B)  Example: Line of video pixels (each line has BCNT pixels consisting of 3 bytes each – Y, Cb, Cr) Frame 1 Array1Array2Array BCNT Frame 2 Array1Array2Array BCNT Frame CCNT Array1Array2Array BCNT EVTx

Indexing – ‘BIDX, ‘CIDX  EDMA3 has two types of indexing: ‘BIDX and ‘CIDX  Each index can be set separately for SRC and DST (next slide…)  ‘BIDX = index in bytes between ACNT arrays (same for A-sync and AB-sync)  ‘CIDX = index in bytes between BCNT frames (different for A-sync vs. AB-sync)  ‘BIDX/’CIDX: signed 16-bit, to  ‘CIDX distance is calculated from the starting address of the previously transferred block (array for A-sync, frame for AB-sync) to the next frame to be transferred.. EVTx. ‘BIDX ‘CIDX A A-Sync. EVTx. ‘BIDX CIDX AB AB-Sync

Indexed Transfers  EDMA3 has 4 indexes allowing higher flexibility for complex transfers: SRCBIDX = # bytes between arrays (Ex: SRCBIDX = 2) SRCCIDX = # bytes between frames (Ex: SRCCIDX A = 2, SRCCIDX AB = 4) Note: ‘CIDX depends on the synchronization used – “A” or “AB” DSTBIDX = # bytes between arrays (Ex: DSTBIDX = 3) DSTCIDX = # bytes between frames (Ex: DSTCIDX A = 5, DSTCIDX AB = 8) SRC (8-bit) DST (8-bit) SRCBIDX SRCCIDX A DSTBIDX DSTCIDX A Note: ACNT = 1, BCNT = 2, CCNT = ____ (contiguous)

Example – Using Indexing ACNT = 2 BCNT = 2 CCNT = 3 ACNT = 1 BCNT = 4 CCNT = 3 ACNT = 12 BCNT = 1 CCNT = 1 8-bit  Which “view” is the best? Well, that depends on what you are transferring from/to and which sync mode is used. ‘BIDX = 1 ‘CIDX A = 1 ‘CIDX AB = 4 ‘BIDX = 2 ‘CIDX A = 2 ‘CIDX AB = 4 ‘BIDX = N/A ‘CIDX A = N/A ‘CIDX AB = N/A Note: these are contiguous memory locations

EDMA Event Processing Registers:  Event Register (ER): when event n occurs, bit n of ER is set.  Event Enable Register (EER): setting bit n of EER enables processing of that event.  Event Clear Register (ECR): setting a bit in ECR clears corresponding bit in ER, used by CPU to clear event flags.  Event Set Register (ESR): setting a bit in ESR sets corresponding bit in ER, used by CPU to submit event requests and for debugging.

Generate EDMA Interrupt (Setting IER bit ) EDMA Channels Channel # TCINTEN=0 TCINTEN=1 TCINTEN=0 TCC=0 TCC=1 TCC=14 TCC= Options TCC TCINTEN EDMA Interrupt Generation IPR IER 0 = 0 IER 1 = 0 IER 14 = 1 IER 63 = 0 IER EDMA3CC_GINT TCC Use EDMA3 Low-Level Driver (LLD) to program EDMA’s IER bits IER – EDMA Interrupt Enable Register (NOT the CPU IER) IPR – EDMA Interrupt Pending Register (set by TCC)

EDMA Interrupt Dispatcher  Here’s the interrupt chain from beginning to end: Use EDMA3 LLD to program the proper callback fxn for this HWI. EDMA3CC_GINT (#24) 2. Interrupt Selector HWI_INT5 1. An interrupt occurs 3. HWI_INT5 Properties 4. HWI Dispatcher (ON + Arg)5. EDMA Interrupt Dispatcher Read IPR bits Determine which one is set Call corresponding handler (ISR) in Fxn Table 6. ISR (interrupt handler) void edma_rcv_isr (void) { SEM_post (&semaphore); }  How does the ISR Fxn Table (in #5 above) get loaded with the proper handler Fxn names?

Linking – “Action” – Overview T (xfer config) E (event) Done A (action) Options Source Destination Index Link AddrCnt Reload Transfer Count Index C Rsvd AB T (xfer config)  Need: auto-reload channel with new config  Ex1: do the same transfer again  Ex2: ping/pong system (covered later)  Solution: use linking to reload Ch config  Concept:  Linking two or more channels together allows the EDMA to auto-reload a new configuration when the current transfer is complete.  Linking still requires a “trigger” to start the transfer (manual, chain, event).  You can link as many PSETs as you like – it is only limited by the #PSETs on a device.  How does linking work?  User must specify the LINK field in the config to link to another PSET.  When the current xfr (0) is complete, the EDMA auto reloads the new config (1) from the linked PSET. 1 LINK Config 0 NULL LINK Config 1 reload

Chaining – “Action” & “Event” – Overview T (xfer config) E (event) Done A (action) Options Source Destination Index Link AddrCnt Reload Transfer Count Index C Rsvd AB T (xfer config)  Need: When one transfer completes, trigger another transfer to run  Ex: ChX completes, kicks off ChY  Solution: Use chaining to kick off next xfr  Concept:  Chaining actually refers to both both an action and an event – the completed ‘action’ from the 1 st channel is the ‘event’ for the next channel  You can chain as many Chan’s as you like – it is only limited by the #Ch’s on a device  Chaining does NOT reload current Chan config – that can only be accomplished by linking. It simply triggers another channel to run.  How does chaining work?  Set the TCC field to match the next (i.e. chained) channel #  Turn ON chaining  When the current xfr (X) is complete, it triggers the next Ch (Y) to run Y TCC Ch X EN Chain EN ? TCC Ch Y DIS Chain EN Done ? RUN Y