Antonio Cisternino & Diego Colombo VisualStorms Tools Another Brick in the Robot... Università degli Studi di Pisa.

Slides:



Advertisements
Similar presentations
Decompilation of.NET bytecode Stephen Horne Trinity Hall 10 th February 2004 Computer Science Part II Project Progress Report
Advertisements

Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
pa 1 Porting BETA to ROTOR ROTOR Projects Presentation Day, June by Peter Andersen.
Introduction to Assembly language
Chapter 1 IDE and Tools for Developing CLR-based Programs Yingcai Xiao.
Performance evaluation of plagiarism detection method based on the intermediate language Vedran Juričić Tereza Jurić Marija Tkalec.
Computer Basics. The Computer (Generic) Processor executes commands. Memory stores program and data. Input devices transfer information from outside world.
Lego RCX Assembler and a Case Study Luis Paris Dept. of Computer Science University of Mississippi.
22/06/2003http://dotnet.di.unipi.it/R2D2/ R2d2 project Università degli Studi di Pisa How to build a wheeled PC.
Embedded Systems Programming Introduction to cross development techniques.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
WEB-BASED LEARNING TOOLS ON MICROPROCESSOR FUNDAMENTALS FOR A FIRST-YEAR ENGINEERING COURSE By Jucain Butler.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Diego Colombo & Antonio Cisternino VisualStorms Tools Growth Another Brick in the Robot... Università degli Studi di Pisa.
Efficient Runtime Code Generation in Rotor Antonio Cisternino 23/4/2003 Università di Pisa Supported by Microsoft Research grant.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Introduction to the JDK Java for Computational Finance
Programming & Development of Mobile & Embedded Systems Lin Zhong ELEC424, Fall 2010.
Intro to Java The Java Virtual Machine. What is the JVM  a software emulation of a hypothetical computing machine that runs Java bytecodes (Java compiler.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
+ Java vs. Javascript Jessi Style. + Java Compiled Can stand on its own Written once, run anywhere Two-stage debugging Java is an Object Oriented Programming.
Programming Languages: Telling the Computers What to Do Chapter 16.
A First Program Using C#
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Programming. Objectives Look at why we write programs Describe some things it takes to learn to be a programmer Discuss some important.
WEB-BASED LEARNING TOOLS ON MICROPROCESSOR FUNDAMENTALS FOR A FIRST-YEAR ENGINEERING COURSE By Jucain Butler.
Financial Information Management Stefano Grazioli.
Introduction to Subroutines. All the combinations in which a subroutine can be written 1. The subroutine may be: a. Internal or b. External 2. The type.
COMP2011 Assembly Language Programming and Introduction to WRAMP.
Introduction to the Java Virtual Machine 井民全. JVM (Java Virtual Machine) the environment in which the java programs execute The specification define an.
What is.NET? CS 351 Ed Gellenbeck. Today What is.NET? What Problems Does.NET Solve? What are.NET Framework Components?
Chapter 11 An Introduction to Visual Basic 2008 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Roopa.T PESIT, Bangalore. Source and Credits Dalvik VM, Dan Bornstein Google IO 2008 The Dalvik virtual machine Architecture by David Ehringer.
Jan Benda Martin Maly Tomas Matousek Ladislav Prosek Pavel Novak Vaclav Novak Tomas Matousek Department of Software Engineering Faculty.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
CS 3131 Introduction to Programming in Java Rich Maclin Computer Science Department.
Chapter 11 An Introduction to Visual Basic 2005 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
SLego: A Squeak Implementation of Lego Mindstorms Alexandre Bergel Institut fuer Mathematik und Informatik University Bern
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
MSIL C#.NET Software Development. MSIL AKA CIL What all.NET languages compile to What all.NET languages compile to Binary Intermediate Language Binary.
Introduction to C# Programming Version 1.1. Objectives  Help you learn to read and follow instructions  Look at how and why we write programs  Describe.
Aspect Oriented Programming in.NET with CodeBricks Antonio Cisternino Academic Days Milan, 2004 Università di Pisa Supported by Microsoft Research grant.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
TOPICS WHAT YOU’LL LEAVE WITH WHO WILL BENEFIT FROM THIS TALK.NET library developers : with knowledge of async/await in C# / VB interested in low-level.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
C Programming Chapters 11, . . .
The Execution System1. 2 Introduction Managed code and managed data qualify code or data that executes in cooperation with the execution engine The execution.
© Stefano Grazioli - Ask for permission for using/quoting: Stefano Grazioli.
Introduction to Programming 1 1 2Introduction to Java.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Computer System Structures
The need for Programming Languages
Before You Begin Nahla Abuel-ola /WIT.
Foundations of .Net Programming with C#
Frank McCown TechLunch Old Dominion University March 28, 2007
Compiler Chapter 9. Intermediate Languages
CS360 Windows Programming
Chapter 1 IDE and Tools for Developing CLR-based Programs
Virtual Machine Emulator Tutorial
Computer Science 210 Computer Organization
Computer Terms Review from what language did C++ originate?
Frank McCown TechLunch Old Dominion University March 28, 2007
Foundations and Definitions
Presentation transcript:

Antonio Cisternino & Diego Colombo VisualStorms Tools Another Brick in the Robot... Università degli Studi di Pisa

Antonio Cisternino & Diego Colombo Introduction Lego MindStorms allow building small robots based on the popular Lego bricks A programmable brick allows controlling up to three devices (motors) and test up to three input sensors Programs are expressed in a bytecode interpreted by an interpreter in the brick’s ROM The execution model is concurrent (up to ten threads) and there is a (very) small amount of memory representing the state of the execution

Antonio Cisternino & Diego Colombo Programming the Brick Lego provides a visual programming system to program the brick Other tools have been developed to program MindStorms: a tiny JVM is being written (to replace the Lego VM), NQC is a C-Like language for programming the Brick We have written a library to program MindStorms with.NET and Visual Studio The library compiles Intermediate Language (IL) into Lego bytecode, in this way (almost) any.NET compiler can be used to program the Brick.

Antonio Cisternino & Diego Colombo Compilation Scheme VisualStorms bcI File Brick Downloader C# VB SML... IL

Antonio Cisternino & Diego Colombo Memory Organization The compilation process should map a stack based machine into a register based machine Class fields are mapped to global variables Stack of a method is mapped to local variables starting from index 47 towards 32 Local variables are mapped starting from 32 Thus maxstack + #locals < 32 Global variables (0-31) Task 0 (Main) Task 1 (32-47)Task 9 (32-47)... Stack sp V 1 V 2..

Antonio Cisternino & Diego Colombo Compilation: an Example using System; namespace StormTestAdvanced { public class AracnoBrickTop : VisualStormsTypes.RCX2 { public int x; public int y; [FunctionType(Function.Task, 0)] public void main() { int i = Sensor2(); while(Sensor1() == 0) if (i != 0) SetMotorsPower(VisualStormsTypes.Motor.A, Sensor3()); else SetMotorsPower(VisualStormsTypes.Motor.C, Sensor3()); }}} Inheritance to indicate the type of Brick Custom attribute to indicate tasks, subs and functions Inherited methods for I/O Global variables are expressed as fields

Antonio Cisternino & Diego Colombo Compilation Example: IL IL_0000: ldarg.0 IL_0001: call instance int32 VisualStormsTypes.LegoBrick::Sensor2() IL_0006: stloc.0 IL_0007: br.s IL_0028 IL_0009: ldloc.0 IL_000a: brfalse.s IL_001b IL_000c: ldarg.0 IL_000d: ldc.i4.1 IL_000e: ldarg.0 IL_000f: call instance int32 VisualStormsTypes.LegoBrick::Sensor3() IL_0014: call instance void LegoBrick::SetMotorsPower(Motor, int32) IL_0019: br.s IL_0028 IL_001b: ldarg.0 IL_001c: ldc.i4.4 IL_001d: ldarg.0 IL_001e: call instance int32 VisualStormsTypes.LegoBrick::Sensor3() IL_0023: call instance void LegoBrick::SetMotorsPower(Motor, int32) IL_0028: ldarg.0 IL_0029: call instance int32 VisualStormsTypes.LegoBrick::Sensor1() IL_002e: brfalse.s IL_0009 IL_0030: ret SetVar : LJump : (26 f) SetVar : LCheckDo : (9 f) SetPower : LJump : (6 f) SetPower : SetVar : LCheckDo : (35 b)

Antonio Cisternino & Diego Colombo Compilation Example: Output SetVar : LJump : (26 f) SetVar : LCheckDo : (9 f) SetPower : LJump : (6 f) SetPower : SetVar : LCheckDo : (35 b)

Antonio Cisternino & Diego Colombo Compilation Example: NQC int x; int y; task main () { int i = SENSOR_2; while(SENSOR_1 == 0) { if (i != 0) { SetPower (OUT_A,SENSOR_3); } else { SetPower (OUT_C,SENSOR_3); }

Antonio Cisternino & Diego Colombo Compilation Example: NQC’s output *** Var 0 = x *** Var 1 = y *** Var 47 = i *** Task 0 = main pwr ABC, 7 dir ABC, Fwd setv var[47], Input(1) jmpl 33 chkl 0 == var[47], 29 pwr A, Input(2) jmpl 33 pwr C, Input(2) chkl 0 == Input(0), 14 SetVar : LJump : (26 f) SetVar : LCheckDo : (9 f) SetPower : LJump : (6 f) SetPower : SetVar : LCheckDo : (35 b)

Antonio Cisternino & Diego Colombo Structure of the System VisualStorms AddIn VisualStormsCompiler SharpStormsLib CliFileReader SharpSerial Reflection AssemblyLoader VisualStudioUser

Antonio Cisternino & Diego Colombo Demo

Antonio Cisternino & Diego Colombo Applications Teaching: the ability of programming simple robots with real world languages allow a gentle introduction to programming Use of Lego to prototype robots controlled by remote programs running on a full fledged PC and radio controlled Application of extensible reflection provided by.NET It is Possibile to implement emulators and debug programs in Visual Studio (or guidbg) for.NET

Antonio Cisternino & Diego Colombo Conclusions and Future Work IL is a rich binary format that can be exploited for purposes different than execution The ability of compiling a subset of C# programs to the robot allows a neat environment for experimenting with easy-to-build robots In the future the compiler will recognize call to external methods generating RPC code and distributing a computation between the robot and the PC automatically