Docsity

Using Streams in IOM: Interface and Driver Architecture, Slides of Network Programming

Partial preview of the text

Download Using Streams in IOM: Interface and Driver Architecture and more Slides Network Programming in PDF only on Docsity!

TMS320C6000 DSP

Integration Workshop

Chapter 12

IOM and Frameworks

.

Technical Training

Organization

T

TO

Objectives

System Block Diagram

Standard I/O (SIO) - Using Streams

Device Drivers (IOM)

Reference Frameworks (RF)

Lab 12/12a – Using SIO andModifying an IOM Driver

Technical Training

Organization

T

TO

System

System Software

H/W

(Peripherals)

Algorithm

Program = Code + DataEmbedded System = Program + Mem. Management + Init + H/W + I/O …`

X D A

I S

Data

Init

System Mem. Mgmt. Software

XDAIS provides a common interface to Algorithms

But, what common interface exists for hardware?

Let’s break it into two pieces: interface + driver

Technical Training

Organization

T

TO

Interface first…

BIOS I/O Interface Models

DSP/BIOS

provided

communications

interface

I/O Mini-Driver

(IOM)

SIO

PIP

GIO

DSP/BIOS

Thread Types

TSK or

SWI

SWI

TSK or

SWI

Any mini-driver can be used with

any DSP/BIOS I/O model

Technical Training

Organization

T

TO

All models pass pointers to buffers instead of copying data.

SIO and GIO provide blocking functions; PIP does not.

SIO is the most flexible and easiest to use with IOM drivers.

Let’s look at our lab’s system architecture…

SIO Concepts

Technical Training

Organization

T

TO

So, what does our code look like to create/use streams?

IOM Driver

TSK

Application

IN

OUT

“Streams”

issue

FULL buffer

reclaim

FULL buffer

issue

EMPTY buffer

reclaim

EMPTY buffer issue…

reclaim…

reclaim…

issue…

Communications protocol: issue =

give a buffer

reclaim =

take a buffer

TSK and IOM use a common interface (SIO) and are independent

Reclaim

blocks

(pends) until buffer is ready (has been issued)

Pointers

to the buffers are passed, not the buffers themselves (efficiency)

Multiple buffers can be issued – SIO maintains the queue

1. SIO – Creating the Streams

/ inStream and outStream are SIO handles created in main /SIO_Handle inStream, outStream;void createStreams(){

SIO_Attrs attrs;attrs = SIO_ATTRS;attrs.align = BUFALIGN;attrs.model = SIO_ISSUERECLAIM;attrs.segid = ISRAM;/ open the I/O streams /inStream = SIO_create("/dioCodec", SIO_INPUT, BUFFSIZE4, &attrs);outStream = SIO_create("/dioCodec", SIO_OUTPUT, BUFFSIZE4, &attrs);**

SIO Handles

Attributes ofthe streams

Create the streams with specificparameters: hookup, type, size, attr.

3. TSK Code Using SIO

**void processBuffer(void){ short source;short dest;createStreams();primeStreams();while(1) {

**SIO_reclaim(inStream,(Ptr )&source, NULL);SIO_reclaim(outStream,(Ptr )&dest, NULL);

// *** PROCESS ***

SIO_issue(outStream, dest, BUFFSIZE4,NULL);SIO_issue(inStream, source, BUFFSIZE4,NULL);}**

Create dummy pointers for the buffer exchange

Create and prime the streams (referenceprevious code)Reclaim FULL buffer from input stream(pends until ready, then process it)Reclaim EMPTY buffer from output stream(pends until ready, then fill it up)Issue FULL buffer to the output stream(and send it out)Issue EMPTY buffer to the input stream(to be re-filled again)

Objectives

System Block Diagram

Standard I/O (SIO) - Using Streams

Device Drivers (IOM)

Reference Frameworks (RF)

Lab 12/12a – Using SIO andModifying an IOM Driver

Technical Training

Organization

T

TO

IOM Driver Files

Technical Training

Organization

T

TO

DSK 6416 IOM Driver Files (from DDK)

dsk6416_aic23.cdsk6416_codec_devParams.cc6x1x_edma_mcbsp.cdsk6416_edma_aic23.c

Generic McBSP driver for theTMS320C6x1x series. Uses the EDMA.

AIC23 codec driver implementation specific to the DSK6416 board.

Defines the default parameters used forDSK6416_EDMA_AIC23 IOM driver

Driver for the aic23 codec on the 6416 DSK.Requires the generic TMS320C6x1x McBSP driver.

To add channel sorting to the EDMA, we need to modify thelast two files which contain the EDMA structures/initialization.

We will modify these files, then create our own library (outputa .lib file instead of .out) – myDriver.lib – to use in our project.

IOM files contain functions and data structures…

Note: 6713 DSK files are the same other than the generic driver

Mini-Driver Interface (IOM)

IOM Interface Consists Of:

Functions:

init function

IOM_mdBindDev

IOM_mdUnBindDev

IOM_mdControlChan

IOM_mdCreateChan

IOM_mdDeleteChan

IOM_mdSubmitChan

interrupt routine (isr)

Data Structures:

BIOS Device Table

IOM function table

Dev param’s

Global Data Pointer(device inst. obj.)

Channel Params

Channel Instance Obj.

IOM_Packet (aka IOP)

Technical Training

Organization

T

TO

What platforms does the DDK support?

You will get a chance to examine several of these functions in the lab

Objectives

System Block Diagram

Standard I/O (SIO) - Using Streams

Device Drivers (IOM)

Reference Frameworks (RF)

Lab 12/12a – Using SIO andModifying an IOM Driver

Technical Training

Organization

T

TO

Reference Frameworks

System

H/W

(Peripherals)

Algorithm

X D A

I S

I OM

Reference

Frameworks

Application Framework for systems which integrate:

XDAIS algorithms

IOM Drivers

Statically or Dynamically instantiates XDAIS algorithms

Provides the ALGRF module which uses BIOS MemoryManagement

Uses IOM to talk to codecs (or other hardware)

One problem RF's solve ...

Technical Training

Organization

T

TO

An Application Blueprint

Does something useful

Is easy to adapt and change

Creates modules that can be reused

Includes documentation and comments

Written in portable, high-level language

Has a well standardized file structure

Uses various tools together

(BIOS, IOM, RTA, etc)

Is NOT a blank page

Technical Training

Organization

T

TO

Reference Framework Characteristics^ 

Good Starterware

Design-ready, reusable, C language source code

Not demo code

A complete “generic” application running on TI DSK’s

Supplied with “FIR type” eXpressDSP compliant algorithms

Criteria to enable appropriate selection of RF level

System Budgeting

Memory footprint

Instruction cycles

Adaptation guide for adding algorithms, channels, and drivers

An API Reference Manual for new (library) modules

Consistent documentation in RF application notes

SPRA79x

eXpressDSP for Dummies

RF1, RF3, RF5: Licensed with every TMS320 device - royalty free