Associative Functions implemented on ClearSpeed CSX600 Mike Yuan.

Slides:



Advertisements
Similar presentations
Operating Systems Part III: Process Management (Process Synchronization)
Advertisements

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.
© 2013 IBM Corporation Use of Hierarchical Design Methodologies in Global Infrastructure of the POWER7+ Processor Brian Veraa Ryan Nett.
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
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,
FunctionsFunctions Systems Programming. Systems Programming: Functions 2 Functions   Simple Function Example   Function Prototype and Declaration.
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.
AVR Programming CS-212 Dick Steflik. ATmega328P I/O for our labs To get data into and out of our Arduino its a little trickier than using printf and.
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.
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
Beginning C for Engineers Fall 2005 Lecture 2 – Section 2 (9/7/05) Section 4 (9/8/05)
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
CUDA Programming continued ITCS 4145/5145 Nov 24, 2010 © Barry Wilkinson CUDA-3.
The Java Programming Language
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.
A Play Core Timer Interrupts Acted by the Human Microcontroller Ensemble from ENCM511.
Chapter 8 Iteration Dept of Computer Engineering Khon Kaen University.
Timer Timer is a device, which counts the input at regular interval (δT) using clock pulses at its input. The counts increment on each pulse and store.
Computer Organization and Architecture Tutorial 1 Kenneth Lee.
 2008 Pearson Education, Inc. All rights reserved Case Study: Random Number Generation C++ Standard Library function rand – Introduces the element.
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.
Chapter 1 Computer Abstractions and Technology. Chapter 1 — Computer Abstractions and Technology — 2 The Computer Revolution Progress in computer technology.
Tests of Random Number Generators
OPERATING SYSTEMS CS 3530 Summer 2014 Systems with Multi-programming Chapter 4.
The Cn Language over view The Cn language strongly on ANSI C. So if you are familiar with ANCI it is not so tough to deal with Cn language. Basic Data.
1 CSC241: Object Oriented Programming Lecture No 25.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
Hardware Benchmark Results for An Ultra-High Performance Architecture for Embedded Defense Signal and Image Processing Applications September 29, 2004.
PZAPR Parallel Zip Archive Password Recovery CSCI High Perf Sci Computing Univ. of Colorado Spring 2011 Neelam Agrawal Rodney Beede Yogesh Virkar.
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.
CSC 143A 1 CSC 143 Introduction to C++ [Appendix A]
Simple Data Types Chapter Constants Revisited t Three reasons to use constants –Constant is recognizable –Compiler prevents changes in value.
Computer Organization Instruction Set Architecture (ISA) Instruction Set Architecture (ISA), or simply Architecture, of a computer is the.
Lost Item Pager System Design Russ Kinley 5/6/6008.
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.
Simple Data Types Chapter Constants Revisited t Three reasons to use constants –Constant is recognizable –Compiler prevents changes in value.
Advanced loop controls. Loop Controls Recall from last week loop controls Event-controlled loops using sentinels repeats until a control variable takes.
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.
Neumann János Informatikai Kar
ClearSpeed Programming Language Cn
Programmazione I a.a. 2017/2018.
Associative Functions implemented on ClearSpeed CSX600
Chapter 5 Function Basics
An Introduction to Java – Part I, language basics
CMSC 202 Templates.
CSE 403 Lecture 17 Coding.
ClearSpeed CSX620 Overview
Tutorial: The Programming Interface
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
Templates CMSC 202, Version 4/02.
Midterm Statistics.
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 -bash-3.00$ csrun test1.csx

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 R H O T 0 After: 1990 L F M H O T 0

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 ONE = next(mask,ONE); //set the forth car with year 1991 to Z if (get_penum() == ONE) { mycarlot.color = 'Z'; }

Next results produced Before: 1991 G D L H Y D 1 After: 1991 N D L H 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 T D T H 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) Example codes: if(ascNany(mycarlot.color=='NONE')) { mycarlot.onlot = 0; } Results 1991 T H T D T H 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: MHz, Processor 1: MHz 6377/210M= 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*( )/RAND_MAX + 30));

Random number (cont) Problem: average is median: ( )/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