Developing a multi-thread product -- Introduction

Slides:



Advertisements
Similar presentations
Processor Architecture Needed to handle FFT algoarithm M. Smith.
Advertisements

This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Jan 28, 2004Blackfin Compute Unit REV B A comparison of DSP Architectures BlackFin ADSP-BFXXX Compute Unit Based on a ENEL white paper prepared by.
COIN-GPS: Indoor Localization from Direct GPS Receiving.
My attempt to multi-thread an audio talk-though program using batches of data M. Smith Electrical and Computer Engineering University of Calgary, Smithmr.
Implement a 2x2 MIMO OFDM-based channel measurement system (no data yet) at 2.4 GHz Perform baseband processing and digital up and down conversion on Nallatech.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
TigerSHARC CLU Closer look at the XCORRS M. Smith, University of Calgary, Canada
6/3/20151 Developing a multi-thread product – Introduction (ENCM491 – real time operating systems in 1 hr) M. Smith Electrical Engineering, University.
3/5/2004DSP Applied to GPS Algorithms1 of 14 DSP Applied to GPS Algorithms.
A SINGLE FREQUENCY GPS SOFTWARE RECEIVER
Connectivity Lab University of California, Berkeley Location and Timing with C/A code in GPS Wanbin Tang Jan 24, 2007.
TigerSHARC CLU Closer look at the XCORRS M. Smith, University of Calgary, Canada
Just enough information to program a Blackfin Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment.
7/14/20151 Introduction toVisual DSP Kernel VDK for Multi-threaded environment ENCM491 – Real Time (in 1 hour) M. Smith, Electrical and Computer Engineering,
How The GPS System Works. How the GPS System Works 24 satellites + spares 6 orbital planes 55° inclination Each satellite orbits twice every 24 hours.
Real time DSP Professors: Eng. Julian Bruno Eng. Mariano Llamedo Soria.
SVY 207: Lecture 4 GPS Description and Signal Structure
Processor Architecture Needed to handle FFT algoarithm M. Smith.
NAVSTAR GPS Mike Mickelson KD8DZ 08 Dec GPS BASICS.
Lab. 4 Demonstrating and understanding multi-processor boot TigerSHARC multi-processor system.
Support Across The Board ™ Visual DSP Kernel (VDK)
1 SVY 207: Lecture 5 The Pseudorange Observable u Aim of this lecture: –To understand how a receiver extracts a pseudorange measurement from a GPS signal.
What is GPS? GPS, which stands for Global Positioning System, is the only system today able to show you your exact position on the Earth anytime, in any.
Applied Research Laboratories The University of Texas at Austin Applied Research Laboratories The University of Texas at Austin Interfacing GPSTk to Existing.
GPS - Global Positioning System
EE 495 Modern Navigation Systems
DIGITAL SIGNAL PROCESSING ELECTRONICS
Global Positioning Systems (GPS) for Precision Farming
An introduction to programming Created by Dr. Randy Pausch
FFT-based filtering and the
Embedded Systems Design
VDK Concepts and Features How to Create a Project with VDK support
Chapter 4: Digital Transmission
Developing a multi-thread Simulation of GPS system You’ll only need to add the threads – all functions (except correlation( )) provided M. Smith Electrical.
Lab. 2 Overview – Earlier Tasks Prelaboratory T1, T3, T4 and T5
Software and Hardware Circular Buffer Operations
TigerSHARC processor General Overview.
The Global Positioning System (GPS) was designed for military applications. Its primary purpose was to allow soldiers to keep track of their position.
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Developing a multi-thread product -- Introduction
Off-Road Equipment Management TSM 262: Spring 2016
NAME : S.J.VIJAI CLASS : I – M.sc (C.S) ROLL NO : APU – 15
DMA example Video image manipulation
Overview of SHARC processor ADSP Program Flow and other stuff
Starting a project in VisualDSP++
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Chapter 21b Reference Frameworks
TigerSHARC processor and evaluation board
CSCI1600: Embedded and Real Time Software
Convolution, GPS and the TigerSHARC XCORRS instr.
The performance requirements for DSP applications continue to grow and the traditional solutions do not adequately address this new challenge Paradigm.
VisualDSP++ and Test Driven Development What happened last lecture?
Single Value Processing Multi-Threaded Process
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
HD44780 LCD programming From the Hardware Side
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Getting serious about “going fast” on the TigerSHARC
Concept of TDD Test Driven Development
Explaining issues with DCremoval( )
CSCI1600: Embedded and Real Time Software
DMA example Video image manipulation
VDK Concepts and Features How to Create a Project with VDK support
Overview of SHARC processor ADSP-2106X Memory Operations
VDK Concepts and Features How to Create a Project with VDK support
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Global Positioning System
M. Smith Electrical and Computer Engineering University of Calgary,
Working with the Compute Block
This presentation will probably involve audience discussion, which will create action items. Use PowerPoint to keep track of these action items during.
Presentation transcript:

Developing a multi-thread product -- Introduction M. Smith Electrical Engineering, University of Calgary Smithmr @ ucalgary.ca 12/4/2018

Tackled today GPS example of a multi-tasking DSP problem What is GPS and how does it fit into Lab. 4? Lab. 4 concepts VisualDSP VDK environment – 1 hour prelab. Adding a boot thread Adding (and then creating) free-running threads Adding Semaphore so threads communicate 12/4/2018

References Understanding GPS Principles and Applications, 1996, Elliott D. Kaplan Digital Signal Processing – A Practical Approach, 1993, Emmanuel C. Ifeachor, Barrie W. Jervis ADSP-TS101 TigerSHARC and Blackfin Processor Programming References, Analog Devices Articles submitted to Circuit Cellar magazine by M. Smith, March 2004 12/4/2018

Introduction GPS traditionally done with ASIC/Processor combination Looking at FPGA/DSP combination for low end GPS receivers Technological interest in software radio Cheaper, quicker development cycle. Customizations for special applications From a talk by Darrell Anklovitch for ENEL619.23 12/4/2018

What is GPS? Global Positioning System 24 satellite (SV) constellation Orbiting 20,000 km from the surface of the Earth in 12 hour cycles Orbits are set-up to give global coverage 24 hours a day Need at least 4 satellites in view to calculate a position (1) 12/4/2018

GPS Positioning Concepts (1) For now make 2 assumptions: We know the distance to each satellite We know where each satellite is Require 3 satellites for a 3-D position in this “ideal” scenario Requires 4 satellites to account for local receiver clock drift. 12/4/2018

GPS Signal Structure Each satellite transmits 2 carrier frequencies referred to as L1 (1575 MHz) and L2 (1227 MHz) Each carrier frequency is BPSK modulated with a unique PRN (pseudo random number) code The PRN code on L1 is called CA code (coarse acquisition), The PRN code on L2 is called P code (precise) CA code takes 1 ms for full PRN transmission at 1MHz chip (bit) rate. P code takes 1.5 s for full PRN transmission at ~10MHz chip rate Also modulated on each carrier is 50 Hz data that includes the current position of the satellite 12/4/2018

Determining Time Use the PRN code to determine time (1) Use the PRN code to determine time Use time to determine distance to the satellite distance = speed of light * time 12/4/2018

Algorithms to Find PRN Phase Time-domain Cross correlation: 1/N ∑ x1 (n) * x2(n) Coding equivalent to FIR filter, but need to filter N sets of data, each shifted by one data point Correlation of perfectly matching signals gives a maximum value Correlation of 2 random data sequences tends to 0 PRN code from different satellites are designed to correlate to 0. Frequency domain correlation: 1/N F-1[X1(k)X2(k)] where F-1 is the inverse Discrete Fourier Transform and the X’s are the Discrete Fourier Transforms of two sequences D 12/4/2018

Timing Frequency Domain 1/N F-1[X1(k)X2(k)] 1024 point FFT (2 * NLOG2N) 1024 MULTS (N) 1024 point INV FFT (NLOG2N) Time Domain 1/N ∑ x1 (n) * x2(n) n = 0 1024 MACs (N) 1024 Phases (N) 30,000 Complex operations N-1 1,048,576 operations (N2) 12/4/2018

TigerSHARC -- TS101 and TS201 TS101 TS201 Low-cost version $45 / chip Evaluation boards $950 each educational price 12/4/2018

Lab. 4 and Take-Home Quiz 4 Demonstrate developing a multi-threaded environment involving the receiving and analysis of 3 satellite signals Lab 4 VDK environment Use of current assembly FIR code for correlation analysis Take-home quiz (Done individually) Use Analog Devices provided FFT code Develop your own assembly language code using CLU functionality -- XCORRS 12/4/2018

Lab. 4 – Parts 1, 2 and 3 – done as pre-laboratory tasks – about 1 hour Part 1 -- Create an Initialization Thread Use VDK::Sleep(200) sleep as a work load Part 2 – Launch (create) Satellite Receiver Tasks as free running tasks Use VDK::Sleep(X) as a work load ClearReceiverThread X = 100 ReceiveSatellite1 X = 10 ReceiveSatellite2 X = 20 ReceiveSatellite3 X = 30 Part 3 – Add semaphores to get satellite tasks running in proper time sequences 12/4/2018

Lab. 4 – Continued – details to be added Part 4 -- Add Satellite Receiver Tasks Payloads Download payload code from the web – code provided Part 5 – Generate E-TTD tests for correlation function designed using your existing FIR filter code Part 6 – Add analysis and reporting threads Part 7 – adjust task priorities to make realistic and working Demo and code hand-in with minor write-up 12/4/2018

Adding the initialization Thread Blackfin code (VisualDSP 3.5) can be found at http://www.enel.ucalgary.ca/People/Smith/2005webs/encm515_05/05Labs/05Lab4/04IntroductionVDK.ppt TigerSHARC VDK Different implementation for each version of processor (0.1 or 1.0) because of number of available timers on the chips Slightly different setup between Visual DSP 3.5 and 4.0 because of the silicon differences mentioned above. 12/4/2018

VDK set-up for TigerSHARC (3.5) 12/4/2018

VDK Setup – Visual DSP 4.0 12/4/2018

Adding the Initialization Thread 12/4/2018

Making the InitializationThread a Boot-Thread Automatically Generated Thread Code 12/4/2018

Adding a VDK::Sleep(200) work load to the Initialization Thread VDK-Thread activity window can be activated through VIEW | VDK window menu option – you can Zoom into find fine details of certain activities WARNINGL If the silicon option are incorrect – only the IDLE thread seen 12/4/2018

Thread window legend (Right click in thread window to activate) Running Sleeping Status change Tick (0.05 ms default) 12/4/2018

Now add the following threads with following VDK::Sleep( ) periods ReceiverControlThread -- 100 ticks ReceiverBufferClear -- 10 ticks Receive1Satellite -- 10 ticks Receive2Satellite -- 20 ticks Receive3Satellite -- 30 ticks 12/4/2018

Thread code automatically generated Example after running the code Problem – the threads have not been created – so they exist but don’t run 12/4/2018

Still problems All threads are launched But one thread has taken over all the resources of the system 12/4/2018

Reason for Problem Thread is just spinning its wheels Forgot to add the sleep? 12/4/2018

Solution Thread now all in existence – but free running Need to add “semaphores” to gain control 12/4/2018

Receiver Requirements On receipt of “Capture Signal” semaphore Clear ReceiverBuffer When receiver buffer is cleared Grab satellite signals 1, 2 and 3 12/4/2018

Requirements rephrased ReceiverControlThread VDK::PendSemaphore(kCaptureSignalSTART, 0); On receipt of “Capture Signal” semaphore VDK::PostSemaphore(kReceiverBufferClearSTART) Clear ReceiverBuffer VDK::PendSemaphore(kReceiverBufferClearDONE, 0); When receiver buffer is cleared VDK::PostSemaphore(kReceiver1SatelliteSTART); VDK::PostSemaphore(kReceiver2SatelliteSTART); VDK::PostSemaphore(kReceiver3SatelliteSTART); Grab satellite signals 1, 2 and 3 VDK::Sleep (200) VDK::PostSemaphore(kCaptureSignalDONE); 12/4/2018

Requirements rephrased ReceiverBufferClear VDK::PendSemaphore(ReceiverBufferClearSTART, 0); VDK::Sleep (10); // Will be replaced by process later VDK::PostSemaphore(ReceiverBufferClearDONE); Typical Satellite Thread VDK::PendSemaphore(ReceiverXSatelliteSTART, 0); VDK::Sleep (X); // Will be replaced by process later VDK::PostSemaphore(ReceiverXSatelliteDONE); What are the syntax errors in the code? 12/4/2018

Adding a semaphore 12/4/2018

Method code added Why does not anything work? What do you have to do to get this? 1 line change 12/4/2018

Some issues remaining Blue bar means what? Why is distance between Init Thread Green bar means what? and start of Receiver Control thread Grey bar means what? changing? Yellow arrow means what? Is it a problem that Satellite 3 task finishes after receiver control thread starts to sleep? 12/4/2018

Tackled today GPS example of a multi-tasking DSP problem What is GPS and how does it fit into Lab. 4? Lab. 4 concepts VisualDSP VDK environment – 1 hour prelab. Adding a boot thread Adding (and then creating) free-running threads Adding Semaphore so threads communicate 12/4/2018