Tutorial on Post Lab. 1 Quiz Practice for parallel operations

Slides:



Advertisements
Similar presentations
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Advertisements

Assembly Code Example Selection Sort.
Systematic development of programs with parallel instructions SHARC ADSP2106X processor M. Smith, Electrical and Computer Engineering, University of Calgary,
6/2/20151 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Systematic development of programs with parallel instructions SHARC ADSP2106X processor M. Smith, Electrical and Computer Engineering, University of Calgary,
Review of Blackfin Syntax Moves and Adds 1) What we already know and have to remember to apply 2) What we need to learn.
Process for changing “C-based” design to SHARC assembler ADDITIONAL EXAMPLE M. R. Smith, Electrical and Computer Engineering University of Calgary, Canada.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Generation of highly parallel code for TigerSHARC processors An introduction This presentation will probably involve audience discussion, which will create.
Generation of highly parallel code for 2106X processors An introduction Developed by M. R. Smith Presented by S. Lei SHARC2000 Workshop, Boston, September.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Squish-DSP Application of a Project Management Tool to manage low-level DSP processor resources M. Smith, University of Calgary, Canada ucalgary.ca.
Elements of Computing Systems, Nisan & Schocken, MIT Press, 2005, Chapter 11: Compiler II: Code Generation slide 1www.idc.ac.il/tecs.
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
THE BOOK BANK MAKERERE UNIVERSITY LIBRARY This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to.
How abstract components are returned when schema.getElementDeclarations() is called – an animation in 3 slides -- schemas that use and July 26, :00pm.
Systematic development of programs with parallel instructions SHARC ADSP21XXX processor M. Smith, Electrical and Computer Engineering, University of Calgary,
Generating a software loop with memory accesses TigerSHARC assembly syntax.
Continuous Random Variables
Final Project Presentation
واشوقاه إلى رمضان مرحباً رمضان
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Generating “Rectify( )”
Post-Lab 1 Quiz Digital Thermometer Digital Storage Oscilloscope
Microcoded CCU (Central Control Unit)
Continuous Random Variables
Program Flow on ADSP2106X SHARC Pipeline issues
Overview of SHARC processor ADSP and ADSP-21065L
Overview of SHARC processor ADSP Program Flow and other stuff
Generating a software loop with memory accesses
ENCM K Interrupts Theory and Practice
Comparing 68k (CISC) with 21k (Superscalar RISC DSP)
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
ENCM515 Standard and Custom FIR filters for Lab. 4
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
M. R. Smith, University of Calgary, Canada ucalgary.ca
* M. R. Smith, University of Calgary, Alberta,
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Extending the Embedded Software Process (ESP) to DSP applications
Comparing 68k (CISC) with 21k (Superscalar RISC DSP)
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Overview of TigerSHARC processor ADSP-TS101 Compute Operations
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
Lab. 2 Modeling an audio channel with delays on ADSP21061
-- Tutorial A tool to assist in developing parallel ADSP2106X code
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
* From AMD 1996 Publication #18522 Revision E
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
* 2000/08/1307/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these.
* L. E. Turner and M. R. Smith, University of Calgary, Alberta, Canada
Explaining issues with DCremoval( )
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
General Optimization Issues
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Overview of SHARC processor ADSP-2106X Compute Operations
Overview of SHARC processor ADSP-2106X Compute Operations
Overview of SHARC processor ADSP-2106X Memory Operations
Setting up VisualDSP environment Lab. 0
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
A first attempt at learning about optimizing the TigerSHARC code
Blackfin Syntax Moves and Adds
Blackfin Syntax Stores, Jumps, Calls and Conditional Jumps
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
* 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items.
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
ENCM515 Standard and Custom FIR filters
Presentation transcript:

Tutorial on Post Lab. 1 Quiz Practice for parallel operations * 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during your presentation In Slide Show, click on the right mouse button Select “Meeting Minder” Select the “Action Items” tab Type in action items as they come up Click OK to dismiss this box This will automatically create an Action Item slide at the end of your presentation with your points entered. Tutorial on Post Lab. 1 Quiz Practice for parallel operations M. R. Smith, Electrical and Computer Engineering University of Calgary, Canada smithmr @ ucalgary.ca *

Post-Lab 1 Quiz Concept is to re-use all of assignment 2 to avoid rewriting any new code This is a hardware quiz and not a software assignment Re-use all of assignment 2 so that can get oscilloscope operation Reuse all of assignment 2 so that can get temperature gauge 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Assignment 2 – main( ) long int known_array[MAX_LENGTH]; long int array_IN[MAX_LENGTH]; long int array_OUT[MAX_LENGTH]; long int max_amplitude, min_amplitude; long int first_nonzero; int main(void) { ProvideImpulses(known_array, MAX_LENGTH, MAX_AMPLITUDE, DISTANCE_BETWEEN, TRUE); DoIIR(known_array, array_IN, MAXLENGTH]); FindMaxMin(array_IN, MAX_LENGTH, &max_amplitude, &min_amplitude); BinarizeSignal(array_IN, array_OUT, MAX_LENGTH, max_amplitude); first_nonzero = FindFirst(array_OUT, MAX_LENGTH); if (first_nonzero != ALLZEROS) RepositionArray(known_array, array_OUT, MAX_LENGTH, first_nonzero); } 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Oscilloscope – main( ) } int main(void) { for( ; ; ) { ProvideImpulses(known_array, MAX_LENGTH, MAX_AMPLITUDE, DISTANCE_BETWEEN, CODEC); DoIIR(known_array, array_IN, MAXLENGTH]); FindMaxMin(array_IN, MAX_LENGTH, &max_amplitude, &min_amplitude); BinarizeSignal(array_IN, array_OUT, MAX_LENGTH, max_amplitude); first_nonzero = FindFirst(array_OUT, MAX_LENGTH, POSITIVE); if (first_nonzero != ALLZEROS) RepositionArray(known_array, array_OUT, MAX_LENGTH, first_nonzero); KnownLocationForBreakPoint(1); } 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Temperature – main( ) int main(void) { for( ; ; ) { ProvideImpulses(known_array, MAX_LENGTH, MAX_AMPLITUDE, DISTANCE_BETWEEN, CODEC); DoIIR(known_array, array_IN, MAXLENGTH]); FindMaxMin(array_IN, MAX_LENGTH, &max_amplitude, &min_amplitude); BinarizeSignal(array_IN, array_OUT, MAX_LENGTH, max_amplitude); first_nonzero = FindFirst(array_OUT, MAX_LENGTH, POSITIVE); second_nonzero = FindFirst(array_OUT + first_nonzero + 1, MAX_LENGTH, NEGATIVE); third_nonzero = FindFirst(array_OUT + second_nonzero + 1, MAX_LENGTH, POSITIVE); CalculateTemperature(third – second, second – first); KnownLocationForBreakPoint(1); } 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

ProvideImpulses( ) void ProvideImpulses(long int *known_array, long int data_length_required, long int max_amplitude, for (count = 0; count < data_length_required; count++) *temp_pt++ = 0; for (count = 0; count < data_length_required; count += rough_distance_between_impulses) { temp_pt[count] = dummy[which_dummy++]; } for (count = 0; count < data_length_required; count++) { for (decimate = 0; decimate < RATE; decimate++) ReadSource(&chan1_in, &chan2_in); *temp_pt++ = chan1_in; } 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Parallel code tutorial Memory operations and resource allocation 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Code review Sheet -- PSP Need to identify common errors -- CODE REVIEW Constructs to link to “C” Are all declarations at the start of subroutine -- #define etc CONSTANTS, variables, FunctionNames, EXPORT leading underscores, .segment declarations Assembly syntax Self documentating code, clanguage_register_defines.I Missing semicolons -- CODE REVIEW Conditional Delayed Branching properly handled -- DESIGN REVIEW Load/Store Architecture -- DESIGN REVIEW Can’t do R1 = R2 + 4 . Becomes temp = 4; R1 = R2 + temp; Register operations, volatile, order of I and M registers -- CODE REVIEW What is your favourite error to waste time? 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Example of array handling volatile pm int value; // VOLATILE MEANS WHAT void MakeSignal{ float re_array[ ], int num ) { int count; for (count = 0; count < num; count++) { re_array[count] = count + value ; } } THINGS TO WORRY ABOUT DURING TRANSLATION Prologue, Epilogue REVIEW How handle LOAD/STORE architecture How handle for-loop How handle = count operation (int to float conversion) How handle stepping through array -- post modify How handle how handle parameter passing 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Step 4 -- convert the for-loop volatile pm int value; VOLATILE MEANS WHAT void MakeSignal{ register float *re_array, register int num ) { register int count = GARBAGE; register float scratch = GARBAGE; register dm float *arraypt = re_array; count = 0; while (count < num) { scratch = (float) (count + value); *arraypt = scratch; arraypt++; count = count + 1; } } THINGS TO WORRY ABOUT DURING TRANSLATION Prologue, Epilogue REVIEW How handle for-loop -- 68K like -- NOT OPTIMIZED How handle how handle parameter passing 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Step 4A -- convert the for-loop void MakeSignal{ register float *re_array, register int num ) { register int count = GARBAGE; register float scratch = GARBAGE; register dm float *arraypt = re_array; count = num; if (num > 0) do { scratch = (float) (count + value); PROBLEM *arraypt = scratch; ALSO – how handle with HWL arraypt++ } while (--count > 0); } THINGS TO WORRY ABOUT DURING TRANSLATION Prologue, Epilogue REVIEW How handle for-loop -- 68K like -- NOT OPTIMIZED How handle how handle parameter passing 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

#define countR1 scratchR1 #define arraypt scratchDMpt .global _MakeSignal; _MakeSignal: #define countR1 scratchR1 #define arraypt scratchDMpt countR1 = 0; arraypt = re_arrayINPAR1; MR_WHILE: COMP(countR1, numINPAR2); if GT JUMP(PC, MR_ENDLOOP) (DB); nop; nop; #define tempF2 scratchF2 valueR0 = pm(VALUE); // better with scratchPMpt valueR0 = valueR0 + countR1; tempF2 = FLOAT countR0; dm(arraypt, 1) = tempF2; countR1 = countR1 + 1; JUMP(PC, MR_WHILE) (DB); nop; nop; MR_ENDLOOP: 5 magic lines of code for “C” return 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Parallel Put the previous exercise into a resource chart and then optimize MULT ADD DM PM 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Now convert to use hardware loop Place into resource chart and optimize 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca

Parallel Put the previous exercise into a resource chart and then optimize I think the loop can be made equal to 1 instruction MULT ADD DM PM 2/28/2019 ENEL515 -- Translating “C-based” design to 21061 code Copyright smithmr@ucalgary.ca