Download presentation
Presentation is loading. Please wait.
Published byWillis Elliott Modified over 9 years ago
1
Lab. 4 Demonstrating and understanding multi-processor boot TigerSHARC multi-processor system
2
What we want to do Design, develop, test and demonstrate a stand- alone real-time multi-processor system running on a TigerSHARC cluster Audio processing with DSP A performing A/D and D/A control, passing information to DSP B which is performing FIR filter operations on left and right channel Passes L + R audio values Receives processed values Passes push-button information on what filter to use 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 2
3
What we have available Lab. 1 – TigerSHARC libraries that will set up and use the push-buttons on TigerSHARC. Find notes on how to use Lab. 3 – Optimized assembly code for FIR filter Write tests so can make sure that code can handle processing of two channels at once 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 3
4
What we have available Analog Devices multiprocessor audio demo project with DSP-A performing audio processing under interrupt control and DSP-B idle How do we add new files and functions to this project – handling of LDF (loader descriptor file) is critical? How do we pass (any) information between DSP A and DSP B? How do we “properly” pass information between DSP A and DSP B? 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 4
5
Lab. 4 What is not demoed by the end of the laboratory is not going to be marked Come in prepared to go 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 5
6
Step 1 – Get Audio Demo to run Remember to bring “head-phones” and iPod equivalent to the lab. Find audio demo project in TS examples and make copy in ENCM515 directory Demonstrate operation 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 6
7
Step 2 – Demonstrate that can add functionality to DSP-A and DSP-B code Build file Hello-DSPa.cpp with function Hell0-DSPA( ) and add to project Build file Hello-DSPb.cpp and add to project Modify mainA.cpp (ditto mainB.cpp) from Setup-Code; while (1); to Setup code; Hello-DSPA( ); // Hello-DSPB( ); while( 1) ; 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 7
8
Step 3 – Demonstrate stand-alone system Burn Step 2 code into TigerSHARC flash memory Power-down VDSP Power-down TigerSHARC board Power-up TigerSHARC board The system should boot and run Step 2 code – does it? 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 8
9
Step 4 – Demonstrate button reading and light flashing Modify MainA.cpp from main( ) { … while (1) { }; } to int buttonA; main( ) { … while (1) { }; buttonA = ReadButton( ); WriteLED(buttonA) } 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 9
10
Ditto for MainB Modify MainB.cpp int buttonB; main( ) { … while (1) { }; buttonB = ReadButton( ); WriteLED(buttonB) } 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 10
11
Step 6 – Try simple communication between DSP A and B Can the linker handle this sort of code where buttons on A control lights on “B” via semaphore in processor ‘A’s memory extern int buttonA; int buttonB; main( ) { … while (1) { }; buttonB = ReadButton( ); WriteLED(buttonA) } 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 11
12
Step 7 – Problems with Step 6 Processor B is directly accessing Processor A memory at the same time processor A is trying to read processor B memory Sounds ripe for bus clashes, especially as later we want to pass lots of data Would this be better? 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 12
13
Step 7 – Try simple communication between DSP A and B Can the linker handle this sort of code where buttons on A control lights on “B” via semaphores in sdram extern int buttonA; section (“SDRAM”) int buttonB; main( ) { … while (1) { }; buttonB = ReadButton( ); WriteLED(buttonA) } 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 13
14
Step 8 -- 1 Can we get “DSPB” to do something with the DSP A audio stream Example – press button on DSP B turns off sound on DSP-A – release button on DSP B turns on sound 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 14
15
Audio interrupt From our understanding of TigerSHARC interrupts, we know that “C++ interrupt handler” will call a “call-back function” Call back-function will probably look something like this extern left_in, left_out, right_in, right_out; void CallBack(int callbackValue) { if (callbackValue != audioInterrupt) HandleError( ); leftout = left_in; right_out = right_in; } 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 15
16
Modified Audio interrupt Call back-function needs to be modified to something like this extern left_in, left_out, right_in, right_out; extern B_button void CallBack(int callbackValue) { if (callbackValue != audioInterrupt) HandleError( ); if (!B_button) { leftout = left_in; right_out = right_in; } } 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 16
17
Lab 4 Marking Demonstrate Step 8 code 30% Burn step 8 code into Flash memory to create a stand-alone system 20% Demonstrate FIR filter running on DSP B controlling audio signal on DSP A with buttons on DSP A controlling which FIR filter to run on DSP B 40% Burn multi-processor code into FLASH 10% Information on how to burn the code into flash memory is available on ENCM515 web A cheat sheet is available to help you through the stages of Lab. 4, but using the cheat sheet costs your lab. Group 20% of the laboratory 4 marks. 11/9/2015TigerSHARC Lab. 4, Copyright M. Smith, ECE, University of Calgary, Canada 17
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.