1
Using Simulation to Develop and Maintain a System of Connected Devices Didier Poirot Simics Technical Account Manager
THE CHALLENGES OF DEVELOPING CONNECTED ELECTRONIC SYSTEMS 3
Mobile Networks Update - Lessons Learned Mobile Networks can be extremely complex: Huge number of deployed devices: > 1.000.000.000 Device and Infrastructure are heterogeneous Vendor Customization Complexity must be managed to be successful Roles and responsibilities have to be defined Role activities have to be decoupled Development cycles are shorter and shorter Cost of change must be low Introducing a change should have a low impact, No disruption of Service Must be scalable How can I manage change, test, validation, What if? 4 2010 2011 Wind River. All Rights Reserved.
What Is Wind River Simics? Wind River Simics is a full system simulator used by software developers to simulate the hardware of large and complex electronic systems. Any Target System Wind River Simics Simulate any size of target system. Run unmodified target binaries. Simics allows you to break the rules of embedded product development. 6
Complete Virtualization User program All software: arbitrary & unmodified. Same as on a real system. Target operating system & Middleware Simulated target hardware Arbitrary; ARM, x86, x86-64, SparcV8, SparcV9, MIPS32, MIPS64, PPC32, PPC64, H8, SH, C64, Simics Host operating system Linux, Windows Host hardware 32-bit and 64-bit PCs 7
Simulating the Electronic System Run your system software on your desktop The software can t tell the difference Java VM DB User program Runs binaries from real target Android HW/SW interface Complete production software Operating system Drivers Hardware abstraction layer Boot firmware Identical build tools chain Simulated (virtual) hardware CPU CPU RAM ROM Bus Disk PCI Disk Ctrl I 2 C Flash Simics Network User Intf device A/D 8
Simics Can Model Any System or Networked Systems Ethernet, wifi, serial, etc Simics Virtual Platform Simulate multiple networked devices Mixed architectures, mixed software Multi-core, multiprocessor, multi-board Control all boards as a single entity Breakpoint stops all Save and restore system state of all boards 9
COOL SIMICS FEATURES 10
System-Level Features Checkpoint and restore Multicore, Processor, Board Real-World Connections Repeatable fault injection on any system component Scripting con0.wait-for-string "$ con0.record-start con0.input "./ptest.elf 5\n" con0.wait-for-string "." $r = con0.record-stop if ($r == "fail. ) { echo test failed } Mixed endianness, word sizes, heterogeneity 11
Simulation provides cool debugging features Synchronous stop for entire system Determinism and repeatability Reverse execution Unlimited and powerful breakpoints Trace anything Insight into all devices break x 0x0000->0x1F00 break-io uart0 break-exception int13 12
Repeatability and Reverse Debugging Repeat any run trivially No need to rerun and hope for bug to reoccur Stop and go back in time No rerunning program from start Breakpoints and watchpoints backward in time Investigate exactly what happened this time This control and reliable repeatability is very powerful for parallel code. Discover Bug Rerun, bug doesn t show up Rerun, bug doesn t show up Rerun, different bug Discover Bug Reverse execute and find source of bug Rerun, initial bug occurs On hardware, only some runs reproduce an error. On virtual hardware, debugging is much easier. 13
EXAMPLE 14
A Simulated Networked Target System Three target machines running any Android stack, A management machine to push updates, All interconnected in a single network, with external world connectivity, All contained inside a single simulation session IP 10.10.0.20 Android App. IP 10.10.0.50 Android Server Software Manager Server OS PC Server IP 10.10.0.21 IP 10.10.0.22 My Android App. Android ARM926 Android App. Android ARM Cortex WindRiver PFA ARM1176 Ethernet Simics IP 10.10.0.1 Service node Host OS Host PC 15
Run the Simulation Run the simulation again Watch serial/graphic consoles as the machines start to boot On a multicore host, Simics will use multiple processor cores to run the simulation in parallel Note: The speed of this simulation is directly impacted by the horsepower of your laptop 16
Network Fault Injection Causing faults at the 10.10.0.22 machine s network interface Simics Ethernet probe attached to the network interface Fault injection module randomly dropping 20% of packets or corrupt packets randomly See how Software react IP 10.10.0.20 Android App. IP 10.10.0.50 Android Server Software Manager Server OS PC Server IP 10.10.0.21 My Android App. Android ARM926 Fault injection module Probe IP 10.10.0.22 Android App. Android ARM Cortex WindRiver PFA ARM1176 Ethernet Simics IP 10.10.0.1 Service node Host OS Host PC 17
Simics Fault Injection Simics target control Access any part of target Change any part of target state or configuration Scripting for precise targeting and replay of faults No permanent damage to target Purpose Test system-level fault handling Test fault low-level fault detection Model failing hardware Example fault actions: Dropping packets on networks Injecting bad checksums Network partitioning Delaying hardware replies Transient memory corruption Permanent memory corruption Transient register corruption Permanent register corruption Data bus transmission errors Address bus transmission errors Triggering spurious interrupts Permanent subsystem failures (disconnecting from system) Processor crash Temperature sensor reporting overheating Error reporting registers flagged 18
19