Setting up Visual DSP 1 0 environment Lab
Setting up Visual. DSP++ 1. 0 environment Lab. 0 M. Smith, Electrical and Computer Engineering, University of Calgary, Canada smithmr @ ucalgary. ca
ENCM 515 Lab. 0 -- Visual. DSP basics z Select partners -- 2 people per station and select station in ICT 210 with Summit ICE capability. y Some stations in A 305 have ICE capability, but it is a different ICE y Stations throughout the Department support the 20 floating licenses for Visual. DSP++1. 0 and the ADSP-21061 simulator z Build a Visual DSP project -- OFF_LINE source -- your own version (in C) of a DSP Temperature conversion algorithm. This will be used later in the course to demonstrate parallelism issues z Test out Visual. DSP software simulation environment z Set up and test out Visual. DSP hardware environment z Start/finish work on ‘C’ and assembly code version of FMSTEREO_DEMOD for Post-Lab 0 Quiz. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 2
Checking that the software exists z Select and run Programs | Visual. DSP | Debugger from the Windows START MENU 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 3
Testing the Visual. DSP++ V 1. 0 software and hardware environment z Links for the following files are found on the ENCM 515 Lab. 0 web pages z You should play the tutorial video on Visual DSP. Takes about 10 minutes. Will at least give you some familiarity with what it is you don’t understand z Build a directory g: yournameencm 515lab 0 z Download the following files from ENCM 515 Lab. 0 web page y. Either section 01. c or section 02. c y. ADSP 21061 ICE. ldf 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 4
Main Subroutine #define MAXSIZE 128 static dm float centigrade[MAXSIZE]; static dm float fahrenheit[MAXSIZE]; static pm float pm_fahrenheit[MAXSIZE]; void main(void) { dm float testarray[] = { -10. 0, 30. 0, 60. 0, 70. 0, -40. 0, -20. 0, 90. 0}; dm float *in_pt = ¢rigrade[0]; int count; for (count = 0; count < MAXSIZE; count++) { printf("%fn", testarray); *in_pt++ = testarray++; } PM_Convert. Using. Arrays( ); PM_Convert. Using. Unrolled. Loop. Using. Copies( ); } 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 5
“C” for a Harvard Architecture void PM_Convert. Using. Arrays(void) { int count; dm float *in_pt = ¢igrade[0]; pm float *out_pt = &pm_fahrenheit[0]; for (count = 0; count < MAXSIZE; count++) out_pt[count] = in_pt[count] * (9. 0 / 5. 0) + 32; } 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 6
Opportunities for DSP speed improvement void PM_Convert. Using. Unrolled. Loop. Using. Copies(void) { int count; dm float *in_pt = ¢igrade[0]; pm float *out_pt = &pm_fahrenheit[0]; for (count = 0; count < MAXSIZE; /* empty */) { out_pt[count] = in_pt[count] * (9. 0 / 5. 0) + 32; count++; } } OR would this be faster? for (count = 0; count < MAXSIZE; count = count + 2) { out_pt[count] = in_pt[count] * (9. 0 / 5. 0) + 32; out_pt[count + 1] = in_pt[count + 1] * (9. 0 / 5. 0) + 32; } } 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 7
Visual. DSP++ 1. 0 software Patch The Visual. DSP++ 1. 0 patches fix the following problems z. ADSP 21061 simulator will not properly simulate R 0 = trunc F 0 instruction for all values of F 0. z. Problem with View | Debug Windows | Plot x. If you accept the default value (100) and change it later (double or more) then debug environment used to crash. z. Problems with V 2. 0 -- yours to find and investigate 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 8
Test -- Visual. DSP++ 1. 0 -- 1 z. Windows -- Programs | Visual |Environment z. Visual. DSP -- File | New | Project y. Save as lab 0 VDSP 1. dpj in lab 0 directory. Visual. DSP V 2 uses a. dpj file which is not compatible with V 1. y. Project Options -- KEY x. Processor x. Type x. Configuration ADSP-21061 DSP executable Debug z. Adjusting. dbj Project Options later y. Visual DSP Project window -- right click on “. dpj” file name and select “Project Options” 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 9
Test -- Visual. DSP++ 1. 0 -- 2 z Add the files to the project ysection 0 X. c -- “C” source code -- Make sure that you do a code review on the code. This is a problem solving approach and I want you to get into good debugging habits for the rest of the course. Expectations -- need less than 50 LOC per lab. Should not take much time to review! yadsp 21061 ICE. ldf file -- This is the system architecture file for handling the ADSP 21061 using the ICE. You will need a different. ldf file if you debug using the ADSP 21061 over a serial connection (WAIL) y. Build the Project -- jigsaw keys z For more hints see 02 labs/02 Lab 0/projectbuild. htm 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 10
Test -- Visual. DSP++ 1. 0 -- 3 z After building the project -- click the Lady. Bird key to activate the ADSP 2106 X Family Simulator z This is known as “testing the code OFFLINE” -meaning without using the boards. y. All labs can be testing offline in this course. This is a key issue as the ICE hardware connections are only available in ICT 210 and A 305. The current labs will not run using the ADSP 21061 hardware over the serial connection because of an existing memory management conflict with the serial connection hardware. z Run the code to test that it works. For more hints see 02 labs/02 Lab 0/simulator_debugging. htm 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 11
Test -- Visual. DSP++ 1. 0 -- 4 z Your job is to ydetermine which data register (Rx) is being used for the loop counter ydetermine which index register (Ix) and/or modify register (Mx) is being used to step through the access of the temparray[ ] z. Use the register window to follow through the changes in the variables/arrays after setting appropriate breakpoints. The concept is equivalent to ENCM 415 so transfer your knowledge. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 12
Configuring ICE hardware --1 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! z Make sure that you have powered down the PC before connecting the ICE probes to be boards z Use a Proper wrist grounding strap to avoid electrostatic discharge. z Power down the EZ-LITE board and remove the two jumpers from the EZICE socket. Place the jumpers into the electrostatic bag. z Identify the ICE cable coming from the Lab. Station PC. These cables are connected to special hardware on the ICT 210 stations (Summit ICE). Slightly different hardware in A 305 (Mountain ICE). z There are more hints available on 02 labs/02 Lab 0/iceconfiguration. htm 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 13
Configuring ICE hardware -- 2 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z Identify the ICE cable coming from the Lab. Station PC. Connect the ICE Probe (from the lab. kit) to the ICE cable. y If you are having to force the probe onto the connector then you are connecting it the wrong way. The white PULL tag should on the top side of the plug and away from the daughter board. z Connect the ICE probe to the EZ-ICE socket on the board y There is a right and wrong way. The correct way will have the probe cable coming in from the top of the board and NOT over the top of the SHARC processor chip. The missing pin on the EZ-ICE header corresponds to the blocked pin on the probe connector. z Check that the board “input jumpers” (JP-8, JP-9) are set to “LINE” z Power up the board and then the PC z Check that the little yellow light on the probe IS NOT LIT. If it is lit PROCEED NO FURTHER, call me over as there is a problem with the set up. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 14
Configuring ICE hardware -- 3 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z Add your “stereo” head phones to Output Jack (J 22 - jack nearest corner) -- you should hear the dreaded “Peter Gunn” z Select and run Programs | Visual. DSP | JTAG ICE Configurator from the Windows START MENU 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 15
Configuring ICE hardware -- 4 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z In the configuration window y Select Summit ICE (A 305), Mountain ICE (A 305) y Select Copy y Change Type to EZ-ICE -- followed by OK. z You now have configured the system to accept the in-circuit emulator as one option for use during debugging code. You should not have to do this configuration again if YOU come back to the same laboratory station. z Use ICE Test Utility program to test out connections. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 16
To Power down ICE hardware -- 5 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z. Make sure that “little yellow light” on the probe is off y. This means exit “debugging environment” program y. If you have crashed the system, you may have to reactivate the debugging program and then exit again before the light goes off. z. Power down the 21061 board and PC -disconnect -- the probe is “very expensive” to replace. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 17
Test -- hard ware -- 5 z Reactivate Visual. DSP -- Select DEBUG button in the top menu (ladybird) z From new session list select y DSP 0 (ADSP-21061) Ez-kit ADSP-21061 ADSP-21 xxxx JTAG Emulator z Click OK on File could not be found window if it appears. y Download section 0 X. dxe file from lab 0 debug directory to the board. You may have to use the RESET option in the debug window or the RESET button on the evaluation board if the processor is “hung”. z We now need to display the input and output files associated with this executable y Select View | Debug Windows | Plot y Browse and Add the following arrays to the Plot window using Memory DM, count 128, stride 1, data float for each array xtemparray, centigrade. Use Memory PM for displaying fahrenheit array z Run the program -- should go a lot faster (if you are not still run the simulator by mistake (MFE -- my favourite error)). 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 18
Further hints z 02 labs/02 Lab 0/ice_debugging. htm z 02 labs/02 Lab 0/plotting. htm z 02 labs/02 Lab 0/filesneeded. htm z. I have not explained everything. It is your job to get familiar with the environment. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 19
ENCM 515 Lab. 0 -- Visual. DSP basics z Select partners -- 2 people per station and select station in ICT 210 with Summit ICE capability. y Some stations in A 305 have ICE capability, but it is a different ICE y Stations throughout the Department support the 20 floating licenses for Visual. DSP++1. 0 and the ADSP-21061 simulator z Build a Visual DSP project -- OFF_LINE source -- your own version (in C) of a DSP Temperature conversion algorithm. This will be used later in the course to demonstrate parallelism issues z Test out Visual. DSP software simulation environment z Set up and test out Visual. DSP hardware environment z Start/finish work on ‘C’ and assembly code version of FMSTEREO_DEMOD for Post-Lab 0 Quiz. 9/5/2021 ENCM 515 -- Setting up Visual. DSP++1. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 20
- Slides: 20