tigersharc processor and evaluation board
DESCRIPTION
TigerSHARC processor and evaluation board. Different capabilities Different functionality. Concepts tackled. Differences between “processor” and “evaluation board” Functionality present on TigerSHARC evaluation board Using the A/D and D/A during Lab. 1 - PowerPoint PPT PresentationTRANSCRIPT
TigerSHARCprocessor and evaluation board
Different capabilitiesDifferent functionality
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
2 / 2604/19/23
Concepts tackled
Differences between “processor” and “evaluation board” Functionality present on TigerSHARC evaluation board Using the A/D and D/A during Lab. 1 Developing the code for a C++ “Moving sound source”
and a C++ FIR filter using a test driven development approach (TDD) Assembly code and optimized assembly code versions of this
code will be developed during Lab. 2 and Lab. 3 and validated using the tests developed during Lab. 1.
A dual core version of the FIR filter will be attempted during Lab. 4. This is a “very” new laboratory to me – we will see.
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
3 / 2604/19/23
TS201S Evaluation board contains 2 processors P0 (DSPA) and P1 (DSPB)
TWO TS201S processors
Error messageswhen linking about P0 and P1 mean problems withcode on specificprocessor
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
4 / 2604/19/23
Evaluation board – Link Ports
Designed for “star”Configuration –Up to 8 processorsworking together
P0 to P7 (selectableby switches on backof evaluation board(Never tried – Don’tdestroy link ports)
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
5 / 2604/19/23
JTAG ONLY AVALIABLE IN 3rd floor labsHigher speed communication rates than USB (factor of 20 - 100)• ICT318 TigerSHARC (some stations).• ICT320 Blackfin (some stations).
Audio connectors.Max input voltage around 1 V p-pwith no DC.Too great a voltage destroys the board
Use MPEG or other players and keepVolume down
Damage and distortion issues
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
6 / 2604/19/23
Buttons and LEDs splitbetween processors
Much “stuff” on the boardshared between processors(but NOT all)
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
7 / 2604/19/23
Evaluation BoardArchitecture
P0
P1
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
8 / 2604/19/23
Two processor operations in ENCM515
Lab. 1, 2 and 3 During TESTS only 1 processor being used as we check the
functionality of various functions written in C++ (lab1), partially optimized assembly (Lab. 2), highly optimized but not ultimate (Lab. 3). Other processor is halted
WARNING: Make sure that you “run” the processor that you loaded the code into
When running the code, one processor is “idle” Lab. 4
Plans to have the work load split between two processors.
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
9 / 2604/19/23
Processorscan shareEXTERNALmemory
Memoryallocationdepends on ID #
Processorscan access each other’sINTERNALmemory and registers
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
10 / 2604/19/23
Note – labeled processor A and Brather than processor 0 and 1
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
11 / 2604/19/23
Note – labeled processor A and Brather than processor 0 and 1
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
12 / 2604/19/23
How to use the evaluation board capability Read a lot in the hardware manual
Modify some of the example programs provided in
C:\Program Files\Analog Devices\VisualDSP 4.5\TS\Examples\ADSP-TS201 EZ-Kit Lite
and then Read a lot in the hardware manual
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
13 / 2604/19/23
Laboratory 1
This makes use of the analog to digital converter and the digital to analogue converter to provide audio sound signals that we can process with the high speed algorithms we develop during the course
By the end of the course we will need to learn about Interrupts – which, how many, why, how? A2D, D2A – which, how many, why, how?
We need to learn about all this stuff before the end of the course – but not now – Now we just want to use it The C++ programming environment provides functions (interrupt( ),
interruptf( ), interrupts( ) that handle all the interrupt overhead, and then call our functions as a subroutine.
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
14 / 2604/19/23
ECE-ADI-Project Was asked to develop (as part of Analog Devices University
Ambassadorship) to develop demonstration programs and place on the web
Have now developed SHARC – ADSP-21061 (Previous 515)
Audio project utilities Blackfin – ADSP-BF533 (Current ENCM415 , ENCM417 in 2007)
Audio project utilities, Video Project utilities Blackfin – ADSP-BF533 (Current ENCM491 – Nygren)
Real time operating systems TigerSHARC – ADSP-TS201 (Current ENCM515, ENCM619.23) Embedded Test Driven Development Environment (E-TDD)
Blackfin, TigerSHARC, SHARC, Microsoft studio Find at http://www.enel.ucalgary.ca/People/Smith/
ECE-ADI-Project/Index/index.htm
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
15 / 2604/19/23
Using the Lab. 1 code You should have already done the Familiarization exercise Part of the Familiarization exercise involved loading the ENCM515Lab
directory onto your U:Drive An audio talk-through program is provided at Lab. 1
Audio-In signal is sampled (A/D) automatically and placed in known “input” location in memory
An interrupt is made to happen each time a sample occurs (44kHz) During the interrupt, the input value is “processed” and the processed value is
placed in a known “output” location in memory. The “output” value is then automatically moved to the D/A for reconstruction.
WARNING: NEVER START THE PROCESSOR WITH YOUR EAR-PHONES ON YOUR EARS. IF YOU HAVE THE PROCESSING INCORRECT, YOU CAN GET AN INFINITELY LARGE SIGNAL COME OUT WHICH HURTS YOUR EARS
Start the processor with the earphones on the desk, then bring the earphones near your ears ONLY when it is safe to do so.
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
16 / 2604/19/23
Lab. 1 Task 1 – conceptConcept idea exact, details inexact Run the (modified) audio-talk-through program Each time an interrupt occurs
1. ProcessData(INCBuffer OUTCBuffer); // Four circular buffers.// Lab. 1 Task 1 – ProcessData( ) is “just a copy”
2. The “oldest” processed sound sample is send to the “D/A”. There is a sound sample from both left and right channels (circular buffers) leftOUT = leftOUTCBuffer[ leftOUTIndex - 128]; rightOUT = rightOUTCBuffer[ rightOUTIndex - 128 ];
3. The “newest” input sound sample (from A/D) overwrites the oldest sound sample. leftINCBuffer[ leftINputIndex++ ] = sample = (leftIN + rightIN) / 2; rightINCBuffer[ rightINputIndex++ ] = sample = (leftIN + rightIN) / 2;
RESULT – You hear a slightly delayed version of the sound in each ear (delay = 128 / 44000 seconds). It will sound “normal”
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
17 / 2604/19/23
Lab. 1 Task 1 -- concept
Why “average the left and the right signals” rather than putting each signal into each own array.
The reason will be come obvious as we proceed through Labs. 1, 2 and 3 Basically the ProcessData( ) function gets too complicated to
handle. Current plan is, in Lab. 4, to finish with one TigerSHARC
core doing ProcessData( ) for the left channel and the other TigerSHARC core doing all the processing on the right channel
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
18 / 2604/19/23
Lab. 1 Task 2A – In C++Left – no delay, right with delay Run the (modified) audio-talk-through program Each time an interrupt occurs
1. ProcessData(INCBuffer OUTCBuffer); // Four circular buffers.// Lab. 1 Task 1 – ProcessData( ) is “just a copy”
2. The “oldest” processed sound sample is send to the “D/A”. There is a sound sample from both left and right channels (circular buffers) leftOUT = leftOUTCBuffer[ leftOUTIndex - 0] rightOUT = rightOUTCBuffer[ rightOUTIndex -256 ];
3. The “newest” input sound sample (from A/D) overwrites the oldest sound sample. leftINCBuffer[ leftINputIndex++ ] = sample = (leftIN + rightIN) / 2; rightINCBuffer[ rightINputIndex++ ] = sample = (leftIN + rightIN) / 2;
RESULT – With no delay on the sound going to the left ear , and delay on the sound going to the right ear, the brain “THINKS” the sound comes from close to the left ear
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
19 / 2604/19/23
Lab. 1 Task 2B – In C++Left –delay, right with no delay Run the (modified) audio-talk-through program Each time an interrupt occurs
1. ProcessData(INCBuffer OUTCBuffer); // Four circular buffers.// Lab. 1 Task 1 – ProcessData( ) is “just a copy”
2. The “oldest” processed sound sample is send to the “D/A”. There is a sound sample from both left and right channels (circular buffers) leftOUT = leftOUTCBuffer[ leftOUTIndex - 256] rightOUT = rightOUTCBuffer[ rightOUTIndex - 0 ];
3. The “newest” input sound sample (from A/D) overwrites the oldest sound sample. leftINCBuffer[ leftINputIndex++ ] = sample = (leftIN + rightIN) / 2; rightINCBuffer[ rightINputIndex++ ] = sample = (leftIN + rightIN) / 2;
RESULT – With delay on the sound going to the leftear , and no delay on the sound going to the right ear, the brain “THINKS” the sound comes from close to the right ear
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
20 / 2604/19/23
Lab. 1 Task 3 – ConceptLeft / right changing delays The “oldest” processed sound sample is send to the “D/A”. There is a sound
sample from both left and right channels (circular buffers) leftOUT = leftOUTCBuffer[ leftOUTIndex - 128 + LEFTIndex]rightOUT = leftOUTCBuffer[ rightOUTIndex – 128 + RIGHTIndex ];
LEFTIndex = LEFTIndex – 1;RIGHTIndex = RIGHTIndex + 1;
RESULT Sound seems to come from in front of you to start with With changing delays, the left sound will get more delayed, and the right
sound will get less delayed The sound will move from in front of you, over to your right ear. When the sound is at your right ear, the indexes “change direction” (right
increases, left decreases) till the sound “comes” from left side, and so on
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
21 / 2604/19/23
Lab. 1 Task 3. Use TDD approach to develop C++ code
DescribeRequirements
Design Solution
Build Solution Test Solution
WriteAcceptance Tests
WriteUnit Tests
CUSTOMER
DEVELOPER
Work with customer to check that the tests properly express what the customer wants done. Iterative process with customer “heavily involved” – “Agile” methodology.
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
22 / 2604/19/23
Lab. 1 Task 3. Use TDD approach to develop C++ codevoid AdjustDelayOffsetCPP (long *IndexOffset,
long *IndexOffsetDirection, long DelayLength);
You work in the “Lab1Tests DEVELOPERS” directory, with the code for AdjustDelayOffsetCPP( ) placed in the “LAB1 CUSTOMERS” directory.
The “customer” provides you information about how this function works to adjust the index so that the sound will move correctly
The information is in the form of a “case study” based on customer – developer consultation for a simple example.
The information is expressed as an “executable specification document” You get the code to work for the simple example, and add additional tests
(part of your report) as needed to confirm that the code will work
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
23 / 2604/19/23
Lab. 1 Task 4. -- 2 minutes maximumUse AdjustDelayOffsetCPP( ) “for real”
void AdjustDelayOffsetCPP (long *IndexOffset, long *IndexOffsetDirection, long DelayLength);
If you did the testing correctly, then this task simple means Recompiling the code in the “LAB1 CUSTOMERS”
directory – 2 minutes Demonstrate to T. A. and ask (politely) please give me
full marks. Note that the same tests will be used
Lab. 2 for AdjustDelayOffsetASM andLab. 3 for AdjustDelayOffsetOPtimizedASM
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
24 / 2604/19/23
Lab. 1 Tasks 5, 6 and 7float FIRDebugModeCPP(float *coeffs, float
*inputData, int index, int coeff_length); Task 5: Work with the customer to set up some tests for the FIR operation with is essentially SUM (*coeffs++) * (*inputData++)
Task 6: Another “2 minute job” – recompile the code in the “Lab 1 CUSTOMER DIRECTORY” and demonstrate.
Task 7: Another “2 minute job” The code will work with the arrays small (N <= 128) but not for larger
arrays – chronic sound distortion Recompile the code using the C++ optimizer and show your FIR
filter works – no sound distortion
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
25 / 2604/19/23
Later we will need to modify the timing tests from the Familiarization Laboratory so we can check the speed of the filters, and delay adjustment algorithms
We may not “HEAR” a lot of distortion, but all the processing must be completed in 1 / 44000 s
We must have efficient code as we increase the length of the data being processed
As one exercise we will examine the code for the Analog Devices Reverb program which simulates the sound of an opera filter using discrete Fourier transforms on 64000 points at a time! We will “look” at that code and say “oh my!” rather than writing it
Speed improvements when we use the “C++” optimizer
TigerSHARC Evaluation Board, M. Smith, ECE, University of Calgary, Canada
26 / 2604/19/23
Concepts tackled
Differences between “processor” and “evaluation board” Functionality present on TigerSHARC evaluation board Using the A/D and D/A during Lab. 1 Developing the code for a C++ “Moving sound source”
and a C++ FIR filter using a test driven development approach (TDD) Assembly code and optimized assembly code versions of this
code will be developed during Lab. 2 and Lab. 3 and validated using the tests developed during Lab. 1.
A dual core version of the FIR filter will be attempted during Lab. 4. This is a “very” new laboratory to me – we will see.