170 likes | 352 Views
Project Proposal. Implementing library support for the Virgil programming language. Ryan Hall Advisor: Jens Palsberg January 23, 2007. The Problem. Sensor motes have very limited memory space on board (~few kb) Want to optimize memory space usage
E N D
Project Proposal Implementing library support for the Virgil programming language Ryan Hall Advisor: Jens Palsberg January 23, 2007
The Problem • Sensor motes have very limited memory space on board (~few kb) • Want to optimize memory space usage • Want to ease this dilemma off the programmer • Possible solution – place optimization in the programming language and compiler • Why not wait for Moore’s Law?
Current Solution nesC - Language designed at UC Berkeley to embody structure of TinyOs nesC compiler C - C programming language avr-gcc compiler AVR - Machine language that runs on motes Downloaded to mote Sensor Mote
Problems with nesC • Major Problem • Lack of space optimization when nesC is compiled into C • Minor Problems • not an Object Oriented language • not a type safe language
Proposed Solution • Design a language and compiler that optimize memory usage on the motes • Introduce object oriented principles into the language • Classes, methods, delegates, etc… • Introduce a strong type system • Problems? • Introduce all these abstractions, but still keep low-level interaction with hardware
Virgil • Designed by Ben Titzer (grad student at UCLA) • The Virgil compiler uses sophisticated memory optimization techniques • Uses several OO principles from Java and C# to make programming easier and cleaner • Strong type system to reduce common programming errors • Runs without OS, scheduler or garbage collector – runs on bare hardware
nesC Revisited nesC C AVR Sensor Mote
Now With Virgil Virgil nesC Memory Space Optimization! C AVR Sensor Mote
Current State of Virgil • Library support for the LEDs and timer of the motes has been written and tested on the AVRORA simulator • Still need support for the other three peripherals (Serial Port, Sensor and Radio) • Other language implementations still need to be completed
My Tasks on Virgil • First test the current library support on the actual motes • Become familiar with downloading code to the motes and running it • Expect to complete in a week (might not be the first task though)
My Tasks on Virgil • Next implement library support for the Serial Port, Sensor and Radio • All of these are already implemented in nesC • Plan to study these implementations and possibly reverse engineer those solutions • Become familiar with Virgil – probably will begin writing simple programs like BLINK • Spend a considerable time debugging the programs in AVRORA • Hopefully run on applications on the motes
Future of Virgil • The main goal behind Virgil is to make programming sensor networks easier and cleaner • Must maintain a sense of modularity when writing the libraries • Hopefully still maintain OO abstractions with the device drivers
Possible Problems • It is uncertain whether the design features of Virgil will allow a simple interaction with the devices on the mote • The language was designed before implementing any drivers • Possibly could have overlooked key problems when making design decisions • Only time will tell…
References • http://compilers.cs.ucla.edu/virgil • http://compilers.cs.ucla.edu/avrora