Associative Functions implemented on ClearSpeed CSX600

Slides:



Advertisements
Similar presentations
Time Measurement Topics Time scales Interval counting Cycle counters K-best measurement scheme time.ppt CS 105 Tour of Black Holes of Computing.
Advertisements

Operating Systems Part III: Process Management (Process Synchronization)
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Lecture 8 Restrictions on Resource Allocation Dining Philosophers - Havender's Linear Ordering.
Instruction-Level Parallel Processors {Objective: executing two or more instructions in parallel} 4.1 Evolution and overview of ILP-processors 4.2 Dependencies.
LCS Non-Dynamic Version int function lcs (x, y, i, j) begin if (i = 0) or (j = 0) return 0; else if (x[i] = y[j]) return lcs(x, y, i-1, j-1)+1; else return.
CSCI 160 Midterm Review Rasanjalee DM.
1 An Associative Program for the MST Problem using ClearSpeed Hassan AL-Maksousy
The Kernel Abstraction. Challenge: Protection How do we execute code with restricted privileges? – Either because the code is buggy or if it might be.
Computer Organization and Architecture 18 th March, 2008.
1 CS318 Project #3 Preemptive Kernel. 2 Continuing from Project 2 Project 2 involved: Context Switch Stack Manipulation Saving State Moving between threads,
ClearSpeed CSX620 Overview. References ClearSpeed Technical Training Slides for ClearSpeed Accelerator 620, software version 3.0, Slide Sets 1-6, Presentor:
Sorting Algorithms: Selection, Insertion and Bubble.
Lecture 3: Computer Performance
ClearSpeed Programming Language C n. References Primary Reference: ClearSpeed Introductory Programming Manual, Version 3.0, January 2008 Additional References:
CMSC 104, Version 8/061L22Arrays1.ppt Arrays, Part 1 of 2 Topics Definition of a Data Structure Definition of an Array Array Declaration, Initialization,
Presentation Timer Select a time to count down from the clock above 60 min 45 min 30 min 20 min 15 min 10 min 5 min or less.
Presentation Timer Select a time to count down from the clock above 60 min 45 min 30 min 20 min 15 min 10 min 5 min or less.
Adding Parallelism to Undergraduate Algorithms Computational Models and Algorithms.
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
Associative Functions implemented on ClearSpeed CSX600 Mike Yuan.
M. Smith University of Calgary.  Many people like to sing in the shower.  However, its rather boring as there is no accompaniment.  The McVASH device.
Computer Organization and Architecture Tutorial 1 Kenneth Lee.
1 Simulation Essentials Overview World System of Coordinates Device System of Coordinates Transformation Equations Projectile Motion Equations Randomization,
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
Associative Functions implemented on ClearSpeed CSX600 Mike Yuan.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
Lecture 2a: Performance Measurement. Goals of Performance Analysis The goal of performance analysis is to provide quantitative information about the performance.
System Software Design Colin Gatlin May 12, 2009 Western Washington University.
TinyOS Sandeep Gupta. Operating System (OS) What is an OS? Main functions  Process management  Memory management  Resource management Traditional OSs.
L19 a 1 Example Using Arrays Using Top-Down Design and Functions to Simplify Code and Create Modules.
CMSC 341 Lecture 2. Announcements Tutors wanted Office hrs Project 1.
Advanced loop controls. Loop Controls Recall from last week loop controls Event-controlled loops using sentinels repeats until a control variable takes.
A Play Core Timer Interrupts Acted by the Human Microcontroller Ensemble from ENCM415.
Arrays What is an array… –A data structure that holds a set of homogenous elements (of the same type) –Associate a set of numbers with a single variable.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 4 Loops.
Examples Lecture L2.2. // Example 1a: Turn on every other segment on 7-seg display #include /* common defines and macros */ #include /* derivative.
Low Power Management for CC2430 Jinho Son Real-Time System Lab.
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
TinyOS Sandeep Gupta. TinyOS basics TinyOS is  Single tasking OS  Interrupt driven Written using a Component based language A set of components put.
Chapter 5- Assembling , Linking, and Executing Programs
Neumann János Informatikai Kar
Introduction to the simulation model
Introduction to C++ Systems Programming.
4-Integrating Peripherals in Embedded Systems
4-Integrating Peripherals in Embedded Systems
Sorting Algorithms.
ClearSpeed Programming Language Cn
Programmazione I a.a. 2017/2018.
and Executing Programs
Lab. 2 Overview.
A Play Core Timer Interrupts
Chapter 5 Function Basics
CNG 140 C Programming (Lecture set 8)
An Introduction to Java – Part I, language basics
CMSC 202 Templates.
전자의료시스템 및 실습 System Configuration/Interrupt
Govt. Polytechnic,Dhangar
CSE 403 Lecture 17 Coding.
A Play Lab. 2 Task 8 Core Timer Interrupts
ClearSpeed CSX620 Overview
Single Value Processing Multi-Threaded Process
Tutorial: The Programming Interface
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
Templates I CMSC 202.
CSE 153 Design of Operating Systems Winter 19
Templates CMSC 202, Version 4/02.
Midterm Statistics.
and Functions to Simplify Code
Caches & Memory.
Presentation transcript:

Associative Functions implemented on ClearSpeed CSX600 Mike Yuan

Introduction Important for ATC applications asc.cn, asc.h, asc_asm.cn, carlot.h and carlot_n Overview - PickOne: get, next - AnyResponder: any, ascNany - MAX/MIN: max_int, min_int, max_float, min_float Three versions Pure Cn (preferred): all functions in asc.cn Assembler: max, min in asc_asm.cn Mixed Cn and assembler: get, next, ascAny, ascNany in asc_asm.cn

Compile and run For Cn versions -bash-3.00$ cscn -o test1.csx carlot_next.cn asc.cn -bash-3.00$ csrun test1.csx For mixed and assembler versions -bash-3.00$ cscn -o test1.csx carlot_next.cn asc_asm.cn

Get Signature: mono short get (poly const char mask) Return the first PE number of the enabled PEs

Get example codes //set the mask to only PE's with a 1991 model car. if (mycarlot.year == 1991) { mask = 1; } //get first car with the year 1991 ONE = get(mask); //set the ONE to color M if (get_penum() == ONE) mycarlot.color = 'M';

Get results produced Before: 1990 L F 1 1991 R H 1 1992 O T 0 After: 1991 M H 1

Next Signature: mono short next (poly const char mask, short ONE) Return the PE number of the next PE in the mask

Next example codes //get NEXT car with 1991 year. ONE = next(mask,ONE); //set the second one to color N if (get_penum() == ONE) { mycarlot.color = 'N'; } //skip to the fourth carwith year 1991 //set the forth car with year 1991 to Z mycarlot.color = 'Z';

Next results produced Before: 1991 G D 1 19 91 L H 1 1991 Y D 1 After: 1991 N D 1 1991 L H 1 1991 Z D 1

any Signature: mono char any (poly int condition); Test the condition condition on all of the enabled PEs and returns true if any of the enabled PEs return true

Example codes //set mask if (mycarlot.year == 1991) { mask = 1; } //turn off PE's not in mask if (mask) //if there are any red and 1991 cars if(any(mycarlot.color == 'R')) //all cars turn to color T mycarlot.color = 'T';

any results Before there is a: 1991 R D 1 After 1991 T H 1 1991 T D 1

ascNany Signature: mono char ascNany (poly int condition); Test the condition condition on all of the enabled PEs and returns true if all of the enabled PEs return false

ascNany (cont) if(ascNany(mycarlot.color=='NONE')) Example codes: { mycarlot.onlot = 0; } Results 1991 T H 0 1991 T D 0

Max for int/float/short Signature of max: int max_int(poly int value) Return the maximum instance of a signed poly int value

Min for int/float/short Signature of min: int min_int(poly int value) Return the minimum instance of a signed poly int value

Max/Min (cont) Example codes poly int index = get_penum(); int max_index, min_index; max_index = max_int(index); printf ("The maximum of PE number is: %d\n", max_index); min_index = min_int(index); printf ("The minimum of PE number is: %d\n", min_index); Results The maximum of PE number is: 95 The minimum of PE number is: 0

Timing Record cycles of operations Example codes: // min_int start_time = get_cycles_ila(); min_int_result = min_int(int_value); elapsed_time = get_cycles_ila() - start_time; printf("min_int Result: %2d Time: %4u\n",min_int_result, elapsed_time);

Timing (cont) Results: min_int Result: 0 Time: 6377 run csreset -v and the frequency is displayed Core clock frequency: Processor 0: 210.0 MHz, Processor 1: 210.0 MHz 6377/210M=30.367 ms

Random function Generate random data in PE Randp() generates random numbers between 0 and RAND_MAX Example codes: poly int rand_num = 0; rand_num = randp(); plane.speed[i] = (scale * (rand_num*(600.0 - 30.0)/RAND_MAX + 30));

Random number (cont) Problem: average is median: (600-30)/2=285, not 250 Use Poisson distribution or Weibu distribution to get average=250

Handle timer Do timing in host for accuracy Two semaphores sem_start, sem_end between host and PE Host signals sem_start and records time PE waits for it and then execute PE signals sem_end Host waits for sem_end

Handle timer (cont) Host records time How much time spent? If > 0.5s, error Else if< 0.5s, wait for rest of time

Task scheduling One .csx file A count for every 0.5s If count=8, do terrain avoidance If count=16, do conflict detection and correlation