VisualDSP++ and Test Driven Development Prelaboratory assignment information.
-
date post
20-Dec-2015 -
Category
Documents
-
view
213 -
download
0
Transcript of VisualDSP++ and Test Driven Development Prelaboratory assignment information.
![Page 1: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/1.jpg)
VisualDSP++ and Test Driven Development
Prelaboratory assignment information
![Page 2: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/2.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
2 / 28
Concepts
Stages in a conventional radio Stages in a software radio Goals for the “long term” project Building a VisualDSP project using TDD
See web for more specific details Demo if time is available
![Page 3: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/3.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
3 / 28
Test Driven Development
Customer Tests – personally find these hard to do Not clear if there is yet “a real process available”
Developer Tests – have found many advantages
DescribeRequirements
Design Solution
Build Solution Test Solution
WriteAcceptance Tests
WriteUnit Tests
CUSTOMER
DEVELOPER
![Page 4: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/4.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
4 / 28
Software “AM” radio concept
AntennaPickup
LocalOscillator
Mixer Low passFilter
Rectifier
Audio out
RF STAGE
IF STAGE
AUDIO STAGE
Most stages handled with high speed software
Low passFilter
+ amplifier
![Page 5: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/5.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
5 / 28
Rectification algorithm
Choices are C++ compiler in DEBUG mode
int *RectifyDEBUG(int initial[ ], int final, int N); float *RectifyDEBUG (float initial[ ], float final, int N);
C++ compiler in RELEASE mode int *RectifyRELEASE(int initial[ ], int final, int N); float *RectifyRELEASE(float initial[ ], float final, int N);
“US” in ASSEMBLY mode int *RectifyASM(int initial[ ], int final, int N); float *RectifyASM(float initial[ ], float final, int N);
“US” in OPTIMIZED ASSEMBLY mode int *RectifyOPTASM (int initial[ ], int final, int N); float *RectifyOPTASM (float initial[ ], float final, int N);
![Page 6: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/6.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
6 / 28
Files and directories neededTDD and many tests files available on web
ENCM515
TDDActivateTestsmain.cpp
Check web for updatesTS201_char8_TDDLib_4Dec04.dlbTDD_include25Nov04.hTDD_Tests25Nov04.h
TigerSHARC versions to comehardwareTDD.hdatastoreTDD.h
RectifyRectify.hRectifymain.cppCustomerRectifymain.cppTS201.ldfHalfWaveDebug.cpp
Rectify.prjHalfWaveRelease.cppHalfWaveASMint.asmHalfWaveASMfloat.asm
RectifyTestsHalfWaveDebugTests.cppHalfWaveReleaseTests.cppHalfWaveASMTests.cppHalfWaveTimingTests.cpp
Lab1 Lab1Tests
Lab2 Lab2Tests
LabX LabXTests
![Page 7: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/7.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
7 / 28
First unit test RectifyTests/Lab1HalfWaveDebugTests.cpp (on Web)
#include “../Rectify/Rectify.h”
![Page 8: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/8.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
8 / 28
Running the tests or customer code Lab1/Lab1main.cpp
![Page 9: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/9.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
9 / 28
Running the customer product code
Rectify/CustomerRectifymain.cpp
#include “Rectify.h”
int CustomerRectifymain(void);
![Page 10: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/10.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
10 / 28
Test code –TDD/ActivateTestsmain.cpp
Report all tests.Success and failures
Report successes only
![Page 11: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/11.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
11 / 28
Build a project -- Steps 1 and 2
HolddownCTRLKey
![Page 12: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/12.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
12 / 28
Build a project – Steps 3, 4, 5, 6
![Page 13: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/13.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
13 / 28
Build a project – Steps 8, 9, 10
![Page 14: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/14.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
14 / 28
Adding files to project
![Page 15: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/15.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
15 / 28
Build and run commands
Build THIS file
Build ANY CHANGED files (Use most of the time for speed reasons)
Build ALL files
Run the programHalt the program
![Page 16: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/16.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
16 / 28
Runs “slowly” in single cycle accurate Simulator modeRun on “real board” in ICT320 using Summit ICE JTAG
![Page 17: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/17.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
17 / 28
Some useful project menu options
About every 10 buildsor when things
“just are not going right”
CleanUpdate dependencies
Rebuild ALL
![Page 18: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/18.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
18 / 28
RectifyTests/HalfWaveDebug.cpp “works” but contains a hidden bug
#include “Rectify/Rectify.h”
![Page 19: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/19.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
19 / 28
Integer array tests ZERO-LENGTH ARRAY
Unspecified requirement – shown as part of test functionality Function return pointer = NULL if error
condition present
![Page 20: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/20.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
20 / 28
Fast generation of “Release Code/Tests”
Save a version of RectifyTests/ HalfWaveDebugTests.cpp as RectifyTests/ HalfWaveReleaseTests.cpp
Use editor to change function names from XXXDebug to XXXRelease
Save a version of Rectify/ HalfWaveDebug.cpp as Rectify/ HalfWaveRelease.cpp
Use editor to change function names from XXXDebug to XXXRelease
![Page 21: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/21.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
21 / 28
Fast generation of Release code/tests
Add RectifyTests/ HalfWaveReleaseTests.cpp and Rectify/ HalfWaveRelease.cpp to project
Compile and link to make sure that they work
Need to change “compile option” for Rectify/ HalfWaveRelease.cpp to optimized
![Page 22: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/22.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
22 / 28
Steps for changing options of “one file” to “optimized / release mode”
![Page 23: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/23.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
23 / 28
Float and assembly language tests-- Cut and paste versions of integer tests
![Page 24: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/24.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
24 / 28
Speed tests – integer code versions
![Page 25: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/25.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
25 / 28
Concepts covered
Stages in a conventional radio Stages in a software radio Goals for the “long term” project Concept of test driven development Digital rectification
Tests for integer array rectification Tests for float array rectification (C++
compiler) Tests for rectification in assembly code
More details of test driven development
![Page 26: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/26.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
26 / 28
Time for a demo
Need 1 student volunteer
![Page 27: VisualDSP++ and Test Driven Development Prelaboratory assignment information.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d4c5503460f94a2af7d/html5/thumbnails/27.jpg)
04/18/23 Concepts of TDD, M. Smith, ECE, University of Calgary, Canada
27 / 28
Concepts
Stages in a conventional radio Stages in a software radio Goals for the “long term” project Building a VisualDSP project using TDD
See web for more specific details Demo if time is available