C to VHDL Translation Within the HybridThreads System Presented by: Fabrice Baijot Jim Stevens.

Slides:



Advertisements
Similar presentations
Vilmos Zsombori , Shanghai
Advertisements

Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
Programming Languages and Paradigms
ECE Synthesis & Verification - Lecture 2 1 ECE 667 Spring 2011 ECE 667 Spring 2011 Synthesis and Verification of Digital Circuits High-Level (Architectural)
High Level Languages: A Comparison By Joel Best. 2 Sources The Challenges of Synthesizing Hardware from C-Like Languages  by Stephen A. Edwards High-Level.
Digital Design with VHDL Presented by: Amir Masoud Gharehbaghi
Introduction to Advanced Topics Chapter 1 Mooly Sagiv Schrierber
Intermediate Representation I High-Level to Low-Level IR Translation EECS 483 – Lecture 17 University of Michigan Monday, November 6, 2006.
Intermediate Representations Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
Reference Book: Modern Compiler Design by Grune, Bal, Jacobs and Langendoen Wiley 2000.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
State Machines Timing Computer Bus Computer Performance Instruction Set Architectures RISC / CISC Machines.
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
Building An Interpreter After having done all of the analysis, it’s possible to run the program directly rather than compile it … and it may be worth it.
1 Chapter 7 Design Implementation. 2 Overview 3 Main Steps of an FPGA Design ’ s Implementation Design architecture Defining the structure, interface.
Compiled by Benjamin Muganzi 3.2 Functions and Purposes of Translators Computing 9691 Paper 3 1.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 15 Slide 1 Real-time Systems 1.
Introduction to High-Level Language Programming
CSET 4650 Field Programmable Logic Devices
2.2 A Simple Syntax-Directed Translator Syntax-Directed Translation 2.4 Parsing 2.5 A Translator for Simple Expressions 2.6 Lexical Analysis.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
COP4020 Programming Languages
Chapter 1. Introduction.
CS 363 Comparative Programming Languages
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
CST320 - Lec 11 Why study compilers? n n Ties lots of things you know together: –Theory (finite automata, grammars) –Data structures –Modularization –Utilization.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Array Synthesis in SystemC Hardware Compilation Authors: J. Ditmar and S. McKeever Oxford University Computing Laboratory, UK Conference: Field Programmable.
Hybridthreads Compiler Fabrice Baijot Jim Stevens.
Languages for HW and SW Development Ondrej Cevan.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
1.  10% Assignments/ class participation  10% Pop Quizzes  05% Attendance  25% Mid Term  50% Final Term 2.
Compiler Principles Fall Compiler Principles Lecture 0: Local Optimizations Roman Manevich Ben-Gurion University.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Overview of Previous Lesson(s) Over View  A program must be translated into a form in which it can be executed by a computer.  The software systems.
Theory of Programming Languages Introduction. What is a Programming Language? John von Neumann (1940’s) –Stored program concept –CPU actions determined.
Evaluating and Improving an OpenMP-based Circuit Design Tool Tim Beatty, Dr. Ken Kent, Dr. Eric Aubanel Faculty of Computer Science University of New Brunswick.
Introduction to Compiling
Introduction CPSC 388 Ellen Walker Hiram College.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
12/8/2015\course\cpeg323-07Fs\Topic2b-323.ppt1 Topic 2b High-Level languages and System Software (Languages) Introduction to Computer Systems Engineering.
Compiler Design Introduction 1. 2 Course Outline Introduction to Compiling Lexical Analysis Syntax Analysis –Context Free Grammars –Top-Down Parsing –Bottom-Up.
Compiler Introduction 1 Kavita Patel. Outlines 2  1.1 What Do Compilers Do?  1.2 The Structure of a Compiler  1.3 Compilation Process  1.4 Phases.
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
What is a compiler? –A program that reads a program written in one language (source language) and translates it into an equivalent program in another language.
COP4020 Programming Languages Introduction Prof. Robert van Engelen (modified by Prof. Em. Chris Lacher)
Presented by : A best website designer company. Chapter 1 Introduction Prof Chung. 1.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
CS 404 Introduction to Compiler Design
Concepts of Programming Languages
Chapter 1 Introduction.
CS 326 Programming Languages, Concepts and Implementation
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Chapter 1 Introduction.
课程名 编译原理 Compiling Techniques
CSE401 Introduction to Compiler Construction
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Lec00-outline May 18, 2019 Compiler Design CS416 Compiler Design.
Presentation transcript:

C to VHDL Translation Within the HybridThreads System Presented by: Fabrice Baijot Jim Stevens

Overview Goals Initial Research Hardware Thread Model C-- GCC HIF Future Work

Goals Develop a system to automatically generate hardware threads that can operate in the HybridThreads system Make it easier to for software engineers to take advantage of FPGA Keep the system as simple as possible Get it working – Implementation language – Constraints on model

Initial Research Programming Languages vs. HDLs – Similarities Both “compiled” (software compiler vs. logic compiler) Instructions and control flow – Differences HDLs for formal description of electronic circuits Programming language: CPU Explicit time and concurrency notations in HDLs

Initial Research Related Work – SPARK Their approach – Good or bad? – Others Their approach – Good or bad?

Initial Research Initial Considerations – C Starting point Most familiar among system programmers/designers – Context Hardware Threads HybridThreads System FPGA

Initial Research – Primitive Operations C’s Set of Operators – Arithmetic – Assignment – Logical/Relational – Bitwise Reduced Complexity – Integers and booleans only

Initial Research – Control Flow If-else Loops Switch – Side Effects ?

Initial Research Structural VHDL or FSMs? – Structural Methodology – Simple operations as entities or processes – Go/Done Signals Complexity – Complex compiler analysis – Go/Done introduces timing issues – Difficult to program

Initial Research – Finite State Machines Methodology – Parallelizable operations become one state – State transitions Complexity – Simple – Follows control flow – Overhead: storing state

Hardware Thread Model FSMs Function call model Use of hardware thread interface Compile-time analysis Limitations

Finite State Machines Selected because it is closer to C We are favoring thread level parallelism versus instruction level parallelism Operating under the assumption that C can only be parallelized up to a certain point due to its sequential programming model

Function Call Model Compiling C without functions is of limited usefulness Desire a general purpose function model to make porting applications to HybridThreads easier

Function Call Model (continued) Developed a stack-based model for run-time support of function calls Was done as a class project for EECS 700: Reconfigurable Computing (w/ Lance Feagan)

Use of Hardware Thread Interface Hardware Thread Interface provides two primary services: – Seemless abstraction of memory Local memory in BRAM Global memory in DDR – HybridThreads system calls

Compile Time Analysis Eventual goal is to have the compiler analyze the program and generate a custom architecture for that program

Limitations Very tedious to program by hand Large programs can take up too much FPGA real-estate Synthesis time is large – Compile-Test-Debug cycles take a long time

C-- QuickC-- Compiler – AST Parsed tokens including: – Scope information – Annotations Example Analysis – Redundant and superfluous information for our purposes – Need control flow information

C-- – CFG Tree format with nodes describing: – Operations inside functions – Stack and frame information – Control flow derived from edges Example Analysis – Hard to understand and parse – Does not include Variable names, declarations, types Function names! Stack and section data

C-- – Extras Further modification of the compiler yielded – Section names and data – Stack data – Local variables (names, types) – Function names – Example Example LCC – Translation from C to C-- – Written by Norman Ramsey

C-- Examples

C-- Limitations – Weak documentation – Messy compiler internals (3 different languages!) – Hard to parse – No PowerPC backend – Slow development – Unpredictable output from LCC

C-- Lessons Learned – Need easy access to variables – Need predictable intermediate form – Control flow information is valuable – Avoid redundancy – Keep it simple

GCC Capabilities/Advantages – Many languages C, C++, Objective-C, Fortran, Java, and Ada – Many platforms Alpha, Linux, MIPS, PowerPC, Microsoft, etc. – Get to pick compilation stage GENERIC, GIMPLE, RTL Anywhere inside and in between stages

GCC Flow of program through compiler Diagram goes here

GCC Compiler Internals – GIMPLE Nodes – SSA Annotations – Scope, size, type, length, etc. Macros – Traverse GIMPLE tree – Return important information

GCC Current Status – Supports: Primitive operations Control flow operations One-dimensional arrays Structs Function calls System calls Integers only!

GCC Examples

GCC Two-step HIF Generation – GCC HIF Generated from GIMPLE tree Limited by GIMPLE structure – Syntactically Correct HIF Generated from GCC HIF Python script Applies simple transformations

HIF Why a HIF HIF Specifications Expressive Power HIF2VHDL Examples

Why a HIF? Simple – The syntax is easy to parse – The semantics are closing related to the underlying state machine model while hiding the low-level details Stable starting point for back end – We have already moved from QC– to GCC – Back end is independent from the front end

C2VHDL Description – Flow – Interfaces – Assumptions Translator Status Examples Related Work – Compare and Contrast Publications References

Future Work Hifgen optimization and expansion – Redesign with efficiency in mind – Reduce the work of HIF preprocessor and translator – Support greater subset of GIMPLE Memory Model HIF to other HDLs Patches

Acknowledgements David Andrews Ron Sass Erik Anderson Jason Agron Wesley Peck Ed Komp Lance Feagan