Associative Functions implemented on ClearSpeed CSX600 Mike Yuan.

Slides:



Advertisements
Similar presentations
Introduction to C Systems Programming Concepts. Introduction to C A simple C Program A simple C Program –Variable Declarations –printf ( ) Compiling and.
Advertisements

Week 4 Kyle Dewey. Overview New office hour location while / do-while / for loops break / continue Termination Exam recap.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Templates in C++. Generic Programming Programming/developing algorithms with the abstraction of types The uses of the abstract type define the necessary.
Introduction to Assembly language
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
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.
ECE Application Programming Instructor: Dr. Michael Geiger Spring 2012 Lecture 31: PE5.
Fields, Constructors, Methods
1 An Associative Program for the MST Problem using ClearSpeed Hassan AL-Maksousy
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
Chapter 4 Methods F Introducing Methods –Benefits of methods, Declaring Methods, and Calling Methods F Passing Parameters –Pass by Value F Overloading.
Introduction to C Systems Programming. Systems Programming: Introduction to C 2 Systems Programming: 2 Introduction to C  A ‘C’ Program –Variable Declarations.
ClearSpeed CSX620 Overview. References ClearSpeed Technical Training Slides for ClearSpeed Accelerator 620, software version 3.0, Slide Sets 1-6, Presentor:
ClearSpeed Programming Language C n. References Primary Reference: ClearSpeed Introductory Programming Manual, Version 3.0, January 2008 Additional References:
1 CS 162 Introduction to Computer Science Chapter 5 ASCII to Integer Conversion Herbert G. Mayer, PSU Status 11/9/2014.
CS140: Intro to CS An Overview of Programming in C by Erin Chambers.
Adding Parallelism to Undergraduate Algorithms Computational Models and Algorithms.
EPSII 59:006 Spring Introduction In this lecture  Formatted Input/Output scanf and printf  Streams (input and output) gets, puts, getchar, putchar.
Relationships of CREATED BY CANDACE SMALLEY
Object Oriented Design: Identifying Objects
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++ (4)
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 2.
1 COS 260 DAY 2 Tony Gauvin. 2 Agenda Questions? Class roll call Blackboard Web Resources Objects and classes 1 st Mini quiz on chap1 terms and concepts.
Random numbers in Alice 3. Create world, add character (“Red” in this example) Dragged walk tile to right onto Run method. Click on “??? “ part of Tile.
C++ Tutorial Hany Samuel and Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2006 by Douglas.
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
1 CSE1301 Computer Programming Lecture 12 Functions (Part 1)
Associative Functions implemented on ClearSpeed CSX600 Mike Yuan.
1 Implementing An Associative Processor on FPGAs.
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.
S OME USEFUL D EBUG C OMMANDS FOR C LEAR -S PEED S OFTWARE D EVELOPMENT K IT -- COMMANDS FROM CHAP.7 By: Pallav Laskar.
Introduction to Methods Shirley Moore CS 1401 Spring 2013 cs1401spring2013.pbworks.com April 1, 2013.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Method OverloadingtMyn1 Method overloading Methods of the same name can be declared in the same class, as long as they have different sets of parameters.
Arrays. Topics to be Covered... Arrays ◦ Declaration ◦ Assigning values ◦ Array manipulation using loops Multi-dimensional arrays ◦ 2D arrays ◦ Declaration.
2D Arrays Alina Solovyova-Vincent Department of Computer Science & Engineering University of Nevada, Reno Spring 2006.
Simple Data Types Chapter Constants Revisited t Three reasons to use constants –Constant is recognizable –Compiler prevents changes in value.
CMSC 341 Lecture 2. Announcements Tutors wanted Office hrs Project 1.
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.
C is a high level language (HLL)
C++ Templates 1. Why Use Templates? C++ requires variables, functions, classes etc with specific data types. However, many algorithms (quicksort for example)
Primitive Data Types. int This is the type you are familiar with and have been using Stores an integer value (whole number) between -2,147,483,648 (-2.
C++ Programming Lecture 13 Functions – Part V By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Dr. Sajib Datta Sep 8,  char type technically is an integer type  Computer uses numeric codes to represent characters, and store characters.
Objects as a programming concept
Java package classes Java package classes.
Sorting Algorithms.
ClearSpeed Programming Language Cn
Factoring if/else code
Pascal Winter 2010/ Course.
Associative Functions implemented on ClearSpeed CSX600
Increasing and Decreasing Functions and the First Derivative Test
null, true, and false are also reserved.
Lecture 8.
Machine-Level Programming: Control Flow
CNG 140 C Programming (Lecture set 8)
An Introduction to Java – Part I, language basics
CMSC 202 Templates.
Working With Arrays.
File Input and Output.
ClearSpeed CSX620 Overview
Data Types Imran Rashid CTO at ManiWeber Technologies.
Relational, Logical, and Equality Operators
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
Templates CMSC 202, Version 4/02.
Variables and Constants
Presentation transcript:

Associative Functions implemented on ClearSpeed CSX600 Mike Yuan

Introduction Important for ATC applications From Group website/ Spring 2008 RT Research/ Associative Functions: asc1-5.zip: asc.cn, asc.h, asc_asm.cn, carlot.h and carlot_next.cn Overview - Setscope - PickOne: get, next - AnyResponder: ascAny, 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

Setscope Mark the set of active PEs Do some operations only on enabled PEs

Setscope (cont) Example codes: //set the mask to only PE's with a 1991 model car. if (mycarlot.year == 1991) { mask = 1; } if (mask) { mycarlot.color = ‘R’; }

Setscope (cont) Results: only PEs with years of 1991 are enabled Color of 1991 cars all set to ‘R’

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

ascAny Signature: mono char ascAny (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(ascAny(mycarlot.color == 'R')) { //all cars turn to color T mycarlot.color = 'T'; }

ascAny 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 integers Signature of max: int max_int(poly int value) Return the maximum instance of a signed poly int value

Min for integers 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