Hello World : Running a basic program on two FPGAs Kermin Fleming Michael Adler Joel Emer.

Slides:



Advertisements
Similar presentations
1 Symbian Client Server Architecture. 2 Client, who (a software module) needs service from service provider (another software module) Server, who provide.
Advertisements

MicroKernel Pattern Presented by Sahibzada Sami ud din Kashif Khurshid.
MPI Message Passing Interface
Operating System Structures
COURSE: COMPUTER PLATFORMS
1 Lab 3 Objectives  Case study: “Hello world” program on motes  Write you first program on mote.
LEAP: Simplifying the construction of FPGA-based processor models Michael Adler Elliott Fleming Michael Pellauer Joel Emer.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
1 I/O Management in Representative Operating Systems.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
C++ fundamentals.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
CORBA Programming Using ACE/TAO
 Introduction Introduction  Definition of Operating System Definition of Operating System  Abstract View of OperatingSystem Abstract View of OperatingSystem.
Section 2.1 Identify hardware Describe processing components Compare and contrast input and output devices Compare and contrast storage devices Section.
A First Program Using C#
UNIX System Administration OS Kernal Copyright 2002, Dr. Ken Hoganson All rights reserved. OS Kernel Concept Kernel or MicroKernel Concept: An OS architecture-design.
Chapter 6 Operating System Support. This chapter describes how middleware is supported by the operating system facilities at the nodes of a distributed.
COMP 3438 – Part I - Lecture 4 Introduction to Device Drivers Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Threads and Processes.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
April 2000Dr Milan Simic1 Network Operating Systems Windows NT.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
© 2004 Mercury Computer Systems, Inc. FPGAs & Software Components Graham Bardouleau & Jim Kulp Mercury Computer Systems, Inc. High Performance Embedded.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
PART II OPERATING SYSTEMS LECTURE 8 SO TAXONOMY Ştefan Stăncescu 1.
OSes: 3. OS Structs 1 Operating Systems v Objectives –summarise OSes from several perspectives Certificate Program in Software Development CSE-TC and CSIM,
Processes Introduction to Operating Systems: Module 3.
CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment.
DSP/BIOS™ LINK The foundation for GPP-DSP solutions.
A. Frank - P. Weisberg Operating Systems Structure of Operating Systems.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Kernel Design & Implementation
Chapter 1: A Tour of Computer Systems
Chapter 2: System Structures
Operating System Structure
Introduction to Operating System (OS)
Lecture 1 Runtime environments.
Oracle Solaris Zones Study Purpose Only
KERNEL ARCHITECTURE.
CMPE419 Mobile Application Development
Chapter 3: Windows7 Part 4.
Chapter 2: The Linux System Part 2
Objective Understand the concepts of modern operating systems by investigating the most popular operating system in the current and future market Provide.
Analysis models and design models
Remote Procedure Call Hank Levy 1.
The Main Features of Operating Systems
Chapter 2: Operating-System Structures
Remote Procedure Call Hank Levy 1.
Objective Understand the concepts of modern operating systems by investigating the most popular operating system in the current and future market Provide.
CMPE419 Mobile Application Development
Remote Procedure Call Hank Levy 1.
Week 5 Computers are like Old Testament gods; lots of rules and no mercy. Joseph Campbell.
Advanced OS COMP 755.
Presentation transcript:

Hello World : Running a basic program on two FPGAs Kermin Fleming Michael Adler Joel Emer

1 Hello World in LEAP

2 Hello World in C int main (int argc, char* argv[]) { printf(“Hello, world!\n”); return 0; } What actions are taken by the system when compiling/executing this code?

3 Hello World in LEAP module [CONNECTED_MODULE] mkConnectedApplication (); Connection_Receive#(Bool) linkStarterStartRun <- mkConnectionRecv("vdev_starter_start_run"); Connection_Send#(Bit#(8)) linkStarterFinishRun <- mkConnectionSend("vdev_starter_finish_run"); STDIO#(Bit#(32)) stdio <- mkStdIO(); let msg <- getGlobalStringUID("Hello, world!\n”); rule hello(True); linkStarterStartRun.deq(); stdio.printf(msg, List::nil); linkStarterFinishRun.send(0); endrule endmodule This code is a complete LEAP program hello-world.bsv

4 Hello World in LEAP: Accessing the Code LEAP uses AWB as a code management-facility AWB is not essential to using LEAP’s core functionalities Collage and ACE, which resemble AWB in many ways, can also be used as a frontend AWB is used in DCG to build architectural models of processors AWB ‘Models’ are FPGA program/target pairings Use edit to see the code included in the FPGA program. More AWB Examples:

5 Hello World in LEAP: A view of the code Here, we see the complete nest of code needed to run a basic LEAP program Only the Hello World component is the user program, everything else is the LEAP OS.

6 Hello World in LEAP: Opening the Code Right clicking Hello World gives the option to open the source code for the module For the next few slides we’ll consider hello.bsv Often, a README will be included along with the code

7 module [CONNECTED_MODULE] mkConnectedApplication (); Connection_Receive#(Bool) linkStarterStartRun <- mkConnectionRecv("vdev_starter_start_run"); Connection_Send#(Bit#(8)) linkStarterFinishRun <- mkConnectionSend("vdev_starter_finish_run"); STDIO#(Bit#(32)) stdio <- mkStdIO(); let msg <- getGlobalStringUID("Hello, world!\n”); rule hello(True); linkStarterStartRun.deq(); stdio.printf(msg, List::nil); linkStarterFinishRun.send(0); endrule endmodule Hello World in LEAP: Expected Behavior What do we expect when running Hello World ? A print to screen… The code does this by using the STDIO service and the starter service, which sends a single start message to the program Like software, this print should happen no matter what our execution target. Simulation Single FPGA Multiple FPGA LEAP’s operating system and compilation facilities enable this expected behavior Hello, World!

8 Hello World in LEAP: Latency-insensitive Modules LEAP programs are composed of latency- insensitive modules These modules communicate externally using latency-insensitive channels mkConnectedApplication is a latency insensitive module, and is similar in function to C’s main Sub-modules like stdio can have arbitrary interfaces, including LI channels. Three kinds of modules: LI Modules (channel interface only) Non-LI Modules (non-channel only) Hybrid (Both channel and non-channel interfaces) LI modules can have non-latency- insensitive components like Reg isters, wires, and arbitrary logic Hidden LI Interface Hidden LI Interface Arbitrary Wire Interface module [CONNECTED_MODULE] mkConnectedApplication (); Connection_Receive#(Bool) linkStarterStartRun <- mkConnectionRecv("vdev_starter_start_run"); Connection_Send#(Bit#(8)) linkStarterFinishRun <- mkConnectionSend("vdev_starter_finish_run"); STDIO#(Bit#(32)) stdio <- mkStdIO(); let msg <- getGlobalStringUID("Hello, world!\n”); rule hello(True); linkStarterStartRun.deq(); stdio.printf(msg, List::nil); linkStarterFinishRun.send(0); endrule endmodule

9 module [CONNECTED_MODULE] mkConnectedApplication (); Connection_Receive#(Bool) linkStarterStartRun <- mkConnectionRecv("vdev_starter_start_run"); Connection_Send#(Bit#(8)) linkStarterFinishRun <- mkConnectionSend("vdev_starter_finish_run"); STDIO#(Bit#(32)) stdio <- mkStdIO(); let msg <- getGlobalStringUID("Hello, world!\n”); rule hello(True); linkStarterStartRun.deq(); stdio.printf(msg, List::nil); linkStarterFinishRun.send(0); endrule endmodule Hello World in LEAP: Where are the Channels? We said mkConnected Application was a latency- insensitive module But where are the interface latency- insensitive channels? Channels are hidden by the SoftServices interface The LEAP compiler uses SoftServices to manage special kinds of interfaces like memory and communication. SoftServices modules are denoted with the [CONNECTED_MODULE] syntax mkConnectedApplication inherits the channels of STDIO The STDIO client uses a “chain”, the latency-insensitive broadcast primitive to talk to the STDIO server module [CONNECTED_MODULE] mkSTDIO (); Chain#(Bit#(64)) stdioNetwork <- mkChain(“STDIO”); endmodule

10 Hello World in LEAP: Handling Strings Hello World prints a string to terminal Strings are difficult to manage in hardware So we borrow from software and use pointers SoftServices gives each string a unique ID at compile time Here, msg is a pointer to the string “Hello, World!” These string IDs are exported to software as a table, just like in C At run time, STDIO calls like printf pass the string pointer module [CONNECTED_MODULE] mkConnectedApplication (); Connection_Receive#(Bool) linkStarterStartRun <- mkConnectionRecv("vdev_starter_start_run"); Connection_Send#(Bit#(8)) linkStarterFinishRun <- mkConnectionSend("vdev_starter_finish_run"); STDIO#(Bit#(32)) stdio <- mkStdIO(); let msg <- getGlobalStringUID("Hello, world!\n”); rule hello(True); linkStarterStartRun.deq(); stdio.printf(msg, List::nil); linkStarterFinishRun.send(0); endrule endmodule

11 module [CONNECTED_MODULE] mkConnectedApplication (); Connection_Receive#(Bool) linkStarterStartRun <- mkConnectionRecv("vdev_starter_start_run"); Connection_Send#(Bit#(8)) linkStarterFinishRun <- mkConnectionSend("vdev_starter_finish_run"); STDIO#(Bit#(32)) stdio <- mkStdIO(); let msg <- getGlobalStringUID("Hello, world!\n”); rule hello(True); linkStarterStartRun.deq(); stdio.printf(msg, List::nil); linkStarterFinishRun.send(0); endrule endmodule Hello World in LEAP: The Anatomy of a Service LEAP provides many useful services, which simplfy common programming tasks STDIO, locks, barriers, statistics, assertions, etc. Services take a client-server architecture Similar to SW operating system services User programs instantiate clients, like mkStdIO LEAP’s driver code instantiates a server which handles requests from clients Client are connected to the server by latency-insensitive channels Servers are often connected to SW by latency-insensitive channels. STDIO Server (HW) STDIO Server (SW) Non-LI IfcL! Ifc.Hybrid Ifc. FPGA CPU

12 Building on abstractions: STDIO Service Virtual Channel Multiplexing Kernel DriverFPGA Physical Drivers Virtual Channel Multiplexing FPGA CPU Marshalling STDIO Server STDIO Client User Module STDIO Client User Module STDIO Client User Module printf() LI Network stdio.printf(msg,List::nil);

13 Service Portability: Abstraction Across Different Platforms Virtual Channel Multplexing ACP Physical Devices Virtual Channel Multiplexing FPGACPU Marshaling STDIO Service STDIO Client User Module STDIO Client User Module STDIO Client User Module printf() stdio.printf(msg,List::nil); Simulator XUPV5 Physical Devices Simulation Physical DevicesACP Kernel DriverXUPV5 Kernel DriverSimulation Driver

14 Building Hello World for One FPGA

15 Hello World: Setting up the Build The ‘configure’ button in the ‘Models’ tab sets up a series of SCons scripts which will be used to construct the application. hello_hybrid_exe targets simulation, hello_hybrid_vc707 targets the VC707, etc.

16 Hello World: Setting Up the Build Runlog shows the command line tool invoked. Should have been leap-configure, which creates a build directory.

17 Hello World: Building the Code The ‘build’ button in the build option tab invokes ‘scons’ in the build tree created by the configure script.

18 Hello World: Setting Up a Run The ‘setup’ button in the ‘benchmarks’ tab invokes the proper benchmark setup tool as determined by the model type. (See apm-edit for details)

19 Hello World: Running Hello World The ‘run’ button in the ‘Run Options’ tab invokes the./run script in the benchmark directory created by the benchmark setup script. The run script manages loading the program targets (FPGAs, sw, etc)

20 Hello World: Running Hello World

21 Building Hello World for Multiple FPGAs

22 Building for Multiple FPGAs Building for a single FPGA is a special case of the multiple FPGA build. Multiple FPGA builds require two extra files Environment file specifies the target FPGA platforms and how they communicate Mapping File specifies how latency-insensitive modules map to the platforms In a single FPGA build, these files may be omitted.

23 Hello World: Side-by-side AWB view In a multiple FPGA build, the user code remains the same, but the nest code changes

24 Hello World: Visualizing a Multiple FPGA Implementation Environment File: specifies FPGA drivers and how FPGAs connect Mapping File: specifies where LI modules are placed – Current tool allows only one LI module of each type FPGA1FPGA0 drivers_fpga_0 drivers_fpga_1 common_services connected_application -> FPGA1; common_services -> FPGA0; Router SERDES Router SERDES FPGA drivers_fpga common_services Router PCI-e Router PCI-e Router SERDES platform FPGA0 “drivers_0.apm”; FPGA1 -> drivers.fromFPGA1; FPGA1 <- drivers.toFPGA1; endplatform platform FPGA1 “drivers_1.apm”; FPGA0 -> drivers.fromFPGA0; FPGA0 <- drivers.toFPGA0; endplatform connected_application Single FPGA Dual FPGA

25 Hello World: A view of FPGA drivers Each platform in the environment file has an associated apm This apm resembles the single FPGA apm, but with null application code At compile time, the application code will be filled in by the compiler This apm includes a pointer to the driver code apm

26 Hello World: A view of FPGA drivers Each platform in the environment file has an associated apm describing its drivers Physical Devices LEAP Services Build Code LEAP hides most of this complexity from the user code

27 Hello World: Building for Multiple FPGAs Multiple FPGA configure/build/run are the same as for single FPGA/simulation. Simply pick a different target No user code changes between targets or between single/multiple FPGA builds

28 Hello World: Area Usage LEAP is an operating system All operating systems add some degree of overhead to a program LEAP’s overhead tends to scale with the number of features used by the target program The following table summarizes LEAP’s overhead for Hello World Hello World itself uses almost no area. Using multiple FPGAs incurs overhead for inter-chip communications TargetLUTsRegistersBRAM VC7071.1%3.0%0.3% VC707 (0)2.9%4.2%0.9% VC707 (1)1.1%1.5%0.9%

29 Questions?