AVEKSHA: A Hardware-Software Approach for Non-intrusive Tracing and Profiling of Wireless Embedded Systems SenSys 2011 Best Paper Matthew Tancreti, Mohammad.

Slides:



Advertisements
Similar presentations
Cortex-M3 Implementation Overview. Chapter 6 in the reference book.
Advertisements

System Integration and Performance
Computer System Organization Computer-system operation – One or more CPUs, device controllers connect through common bus providing access to shared memory.
Thread Criticality Predictors for Dynamic Performance, Power, and Resource Management in Chip Multiprocessors Abhishek Bhattacharjee Margaret Martonosi.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
1 SECURE-PARTIAL RECONFIGURATION OF FPGAs MSc.Fisnik KRAJA Computer Engineering Department, Faculty Of Information Technology, Polytechnic University of.
Microprocessor 8085/8086 Lecturer M A Rahim Khan Computer Engineering and Networks Deptt.
Sensor Network Platforms and Tools
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Overview: Chapter 7  Sensor node platforms must contend with many issues  Energy consumption  Sensing environment  Networking  Real-time constraints.
Helper Threads via Virtual Multithreading on an experimental Itanium 2 processor platform. Perry H Wang et. Al.
TOSSIM A simulator for TinyOS Presented at SenSys 2003 Presented by : Bhavana Presented by : Bhavana 16 th March, 2005.
Chapter 13 Embedded Systems
Zheming CSCE715.  A wireless sensor network (WSN) ◦ Spatially distributed sensors to monitor physical or environmental conditions, and to cooperatively.
1 Introduction to Wireless Sensor Networks. 2 Learning Objectives Understand the basics of Wireless Sensor Networks (WSNs) –Applications –Constraints.
Interrupts (contd..) Multiple I/O devices may be connected to the processor and the memory via a bus. Some or all of these devices may be capable of generating.
Feng-Xiang Huang A Low-Cost SOC Debug Platform Based on On-Chip Test Architectures.
TinyOS Meets Silicon Jason Hill NEST Retreat Summer 2002.
1: Operating Systems Overview
Generic Sensor Platform for Networked Sensors Haywood Ho.
Chapter 7 Interupts DMA Channels Context Switching.
TinyOS Software Engineering Sensor Networks for the Masses.
1 Presenter: Chien-Chih Chen Proceedings of the 2002 workshop on Memory system performance.
Dynamic Hardware Software Partitioning A First Approach Komal Kasat Nalini Kumar Gaurav Chitroda.
Evolution of Microcontroller Firmware Development David Benjamin.
Cortex-M3 Debugging System
- 1 - A Powerful Dual-mode IP core for a/b Wireless LANs.
The 6713 DSP Starter Kit (DSK) is a low-cost platform which lets customers evaluate and develop applications for the Texas Instruments C67X DSP family.
Shahin Farshchi, Member, IEEE, Aleksey Pesterev, Paul Nuyujukian, Eric Guenterberg, Istvan Mody, and Jack W. Judy, Senior Member, IEEE, ” Structure of.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
National Taiwan University JTAG and Multi-ICE Speaker : 沈文中.
A Fast On-Chip Profiler Memory Roman Lysecky, Susan Cotterell, Frank Vahid* Department of Computer Science and Engineering University of California, Riverside.
 Design model for a computer  Named after John von Neuman  Instructions that tell the computer what to do are stored in memory  Stored program Memory.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
The variety Of Processors And Computational Engines CS – 355 Chapter- 4 `
Dhanshree Nimje Smita Khartad
System Architecture Directions for Networked Sensors Jason Hill, Robert Szewczyk, Alec Woo, Seth Hollar, David Culler, Kris Pister Presented by Yang Zhao.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
25 April 2000 SEESCOASEESCOA STWW - Programma Evaluation of on-chip debugging techniques Deliverable D5.1 Michiel Ronsse.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
PART 6: (1/2) Enhancing CPU Performance CHAPTER 16: MICROPROGRAMMED CONTROL 1.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced Debugging on the RX600.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Advanced E 2 Studio Topics.
MSP432™ MCUs Training Part 14: Serial Wire Output Trace
Operating System 1 COMPUTER SYSTEM OVERVIEW Achmad Arwan, S.Kom.
Simics: A Full System Simulation Platform Synopsis by Jen Miller 19 March 2004.
Xiong Junjie Node-level debugging based on finite state machine in wireless sensor networks.
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: 3L05I Advanced Debugging on the RX600 Fatih Peksenar.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
© GCSE Computing Computing Hardware Starter. Creating a spreadsheet to demonstrate the size of memory. 1 byte = 1 character or about 1 pixel of information.
IT3002 Computer Architecture
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
HCS12 Technical Training Module 15 – Break Module Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Software Architecture of Sensors. Hardware - Sensor Nodes Sensing: sensor --a transducer that converts a physical, chemical, or biological parameter into.
Introduction to Operating Systems Concepts
INTRODUCTION TO WIRELESS SENSOR NETWORKS
Programmable Logic Devices
Microcontrollers & GPIO
Difference Between SOC (System on Chip) and Single Board Computer
UNIT – Microcontroller.
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
Debugging Debug environments Debug via serial
2.C Memory GCSE Computing Langley Park School for Boys.
Wireless Embedded Systems
Embedded Development Tools
Presentation transcript:

AVEKSHA: A Hardware-Software Approach for Non-intrusive Tracing and Profiling of Wireless Embedded Systems SenSys 2011 Best Paper Matthew Tancreti, Mohammad Sajjad Hossain, Saurabh Bagchi, Vijay Raghunathan Purdue University Jeffrey

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Introduction It is important to get an idea of the events occurring in an embedded wireless node – when it is deployed in the field – away from the convenience of an interactive debugger Such visibility can be useful for – post-deployment testing – replay-based debugging – for performance and energy profiling of various software components

Software-based Solutions Prior software-based solutions to address this problem have incurred – high execution overhead – Intrusiveness The intrusiveness changes the intrinsic timing behavior of the application – thereby reducing the fidelity of the collected profile

Hardware-based Solutions Prior hardware-based solutions have involved the use of – dedicated ASICs – other tightly coupled changes to the embedded node’s processor Significantly limits their applicability

AVEKSHA In this paper, AVEKSHA is proposed – a hardware-software approach for achieving the above goals – in a non-intrusive manner Based on the key insight that most embedded processors have an on-chip debug module (OCDM) – has traditionally been used for interactive debugging – provides significant visibility into the internal state of the processor

Debug Board A debug board is designed – interfaces with the on-chip debug module of an embedded node’s processor – through the JTAG port Provides three modes of event logging and tracing – Breakpoint – Watchpoint – Program counter polling

Triggers Using expressive triggers that the on-chip debug module supports AVEKSHA can watch for, and record, a variety of programmable events of interest

Key Features of AVEKSHA The target processor does not have to be stopped during event logging – in the last two of the three modes – subject to a limit on the rate at which logged events occur AVEKSHA also performs power monitoring of the embedded wireless node – enables power consumption data to be correlated to events of interest

Key Features of AVEKSHA AVEKSHA is an operating system-agnostic solution Functionality and performance has been demonstrated using three applications running on Telos motes – Two in TinyOS – One in Contiki

Key Features of AVEKSHA Can trace tasks and other generic events at the function and task-level granularity AVEKSHA can be used to find a subtle bug in the TinyOS low power listening protocol

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

TDB Hardware and Firmware Telos Debug Board (TDB) – provides execution tracing and energy monitoring of the Telos Rev B mote An MCU and an FPGA provide the programmability of the TDB

Telos and TDB

Telos

Hardware Architecture of the TDB

Energy Monitoring Circuit

Powering the Mote through the TDB

Timing Example for Shift IR

FPGA Pipeline in PC Polling Mode

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Using AVEKSHA for Tracing and Profiling Types of Triggers Available Breakpoint Mode Watchpoint Mode PC Polling Mode

Types of Triggers Available

Breakpoint Mode Any of the 8 concurrent triggers available can be set as a breakpoint When a breakpoint is reached, the application processor halts execution AVEKSHA performs a continuous poll of the CPU state of the application processor

Breakpoint Mode When AVEKSHA sees that the CPU is halted – it retrieves the state of the application processor (e.g., the value of the PC) – sends the JTAG command to resume execution

Time Taken

Watchpoint Mode Any of the 8 triggers can be set as watchpoints rather than breakpoints The JTAG interface has an 8-entry circular buffer – where memory address bus (MAB) and memory data bus (MDB) are stored – when a watchpoint is hit

PC Polling Mode The final approach to trace generation – is to forego using triggers entirely Instead poll the program counter of the application processor With this approach, each polled PC value is used to determine – what section of the code the application processor is executing in

Advantage The advantage of PC polling is that – it is about 19 times faster than the watchpoint mode Hence can keep pace with a higher frequency of events – such as every function transition

Challenge Implementing PC polling presents a practical challenge – synchronizing the TDB and the application mote This is because the TDB is reading the PC values while the mote is executing To achieve this synchronization – we replace the mote’s external crystal oscillator with a wire from the FPGA

TinyOS Clock Module Setup

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Experiments Microbenchmarks Application Setup Watchpoints PC Polling Overhead of a Simple Software Profiler

Microbenchmarks Objective – to evaluate the performance of the building blocks of AVEKSHA How many clock cycles it takes to perform event monitoring for each of the three modes – breakpoint, watchpoint, and PC polling

Microbenchmarks The accuracy of the energy monitoring – by comparing it with measurements obtained using a Fluke multimeter a dedicated power monitor from Monsoon Inc The energy consumption of the TDB itself

Time Taken

Accuracy of Power and Energy Monitoring

Power Consumption of TDB It is important that the TDB itself consume a small amount of power Because the typical usage scenario is – the TDB coupled to the application processor board when deployed in the field

Energy Saving A large source of energy saving on the application processor comes from entering a low-power sleep state when not in use With a small modification of the application processor’s code – to signal when it is in sleep mode – it is also possible for the TDB to enter a low-power sleep state

Application Setup Our experiments use both TinyOS and Contiki applications – without needing any extra programming effort – since AVEKSHA is OS-agnostic by design Two TinyOS applications – TestNetworkLpl and TestFtsp An object tracking application in Contiki

Watchpoints One application for the TDB is to monitor various state variables Monitoring state variables and transitions is useful because – they can be correlated to power consumption – they can aid in understanding the behavior of applications

Watchpoints In TestNetworkLpl, we have instrumented the following to monitor state changes – application layer – low-power-listening layer – radio layer The instrumentation is simply to place a nop instruction which can be used as a trigger in the watchpoint mode

Watchpoint trace of states when sending a message in TestNetworkLpl

Watchpoint trace of task executions during a radio start event

Watchpoint trace of task executions with the startRadio bug fixed

Watchpoint trace of application level functions and threads of a sender node - in the Contiki tracking application

PC Polling Sampling the PC counter is a quick and non- intrusive operation It does not have the flexibility of setting watchpoint triggers for specific conditions However, it has the advantage of being able to measure events – with greater timing accuracy than watchpoint polling

PC Polling This is because – it is faster to take a sample of the PC – it does not have to do buffer management A useful application of PC polling is for statistical profiling of an application – say to determine what parts of the code are most active

Call graph of the local2Global function in FTSP

Trace of the functions invoked in one execution of the local2Global function

Overhead of a Simple Software Profiler Software profiling is used to collect and arrange different statistics about function calls in a program – such as the time spent in each function, how many times a function was called, etc

A function with additional code

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Discussion

Processors For the purpose of creating a flexible prototype – more powerful processors are used than are required for the current implementation The MCU firmware uses 8.7kB program ROM and 5kB RAM – Which are 18% and 49% of the MSP430’s total capacity respectively

FPGA The FPGA firmware uses the following of the Actel FPGA – 35% of the core logic – 2.8kB or 62% of the RAM

Where to store the logged events The target mode of operation – the TDB coupled with the application processor board in field deployments There is the consideration of where to store the logged events For debugging, it is sometime sufficient to have a history of the last few events before some condition in the application was reached

Where to store the logged events For example, the OCDM of the MSP430 provides a history of the last 8 watchpoint events with this type of debugging in mind If this is the case, the TDB’s main processor can maintain a circular buffer of events in RAM

Where to store the logged events If a larger history is required it is possible to store events into the TDB MCU’s flash memory For very long term storage – an external USB storage host could be attached to the TDB – a compressed trace can even be sent to a computing platform over wireless communication

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Conclusions In this paper, AVEKSHA has been presented A hardware-software solution to the problem of tracing events at runtime – in an embedded wireless node – without slowing down the application AVEKSHA can trace a variety of events – particular PC addresses – reads from peripherals – entry and exits from tasks and interrupt service routines – arbitrary user-defined events

Conclusions We have shown through two applications in TinyOS and one in Contiki – such tracing is useful for profiling the execution times of different tasks and event handlers While the watchpoint mode of operation is capable of capturing a practically limitless variety of events – it cannot keep pace with events that occur more frequently than 122 clock cycles – on a sustained basis

Conclusions The PC polling mode of operation is restricted in the kinds of events that it can detect – but being faster it can keep pace with events that occur at a rate less than every 7 clock cycles AVEKSHA has the ability to do energy monitoring over the μA to mA range – coupling it to execution regions between two events of interest

Conclusions This work points to the feasibility of tracing a wide variety of events of interest in a low-cost and non-intrusive manner – while the embedded node is deployed in the field – Do not have to rely on expensive and custom-built hardware to achieve this The events provided by AVEKSHA can be used by a variety of existing and yet-to-be-developed solutions – such as replay-based debugging, performance profiling, and energy monitoring

Outline Introduction TDB Hardware and Firmware Using AVEKSHA for Tracing and Profiling Experiments Discussion Conclusions Comments

Strength – Very good writing – Very complete work Weakness – The other researchers might need to make quite a few efforts to replicate their system – Especially for the “reversed engineering” part

Thanks a lot for your attentions! Any questions?