The Virtutech Simics Platform
Total Page:16
File Type:pdf, Size:1020Kb
Simulating Computer Systems Jakob Engblom, PhD Business Development Manager Virtutech [email protected] Simulation: Modeling + Execution • Simulation: a way to study the world • Build a model of a system • Try scenarios on this model – Experimental, not analytical approach • Understand the real system from the model 2 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulation Advantages • “Just software” • Inspectability • Availability – Any variable or property can be observed, even if – Easy to copy & distribute hidden in the real world – Requires no special lab – Good for global reach • Controllability • Flexibility – Any variable or property can be changed – A computer can be “any” – Controlled experiments, system, no fixed lab not real-world random setup • Turn-around time • Configurability – Easy to change – Virtual car crashes configuration and create – Virtual prototypes rather new configurations than physical prototypes – Easy to vary parameters 3 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulating Computer Systems Embedded Computer System Communications networks Software stack Applications Middleware, libraries Operating system BootROM, drivers, HAL Controlled Environment Human user interface 5 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulating Embedded Computer System Communications networks We willSoftware stack focus on Applications running the software Middleware, libraries today Operating system BootROM, drivers, HAL Simulation: “fake” one or Controlled Each piece has its more of the system Environment own simulation issues pieces to enable work on and specialized other pieces. Some parts simulation tools may be physical, while Human user interface others are virtual. 6 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Why? Avoiding Hardware • Some simulation work is motivated by the clear advantages of simulation over real hardware – Control, visibility, access – No damage to physical objects (testing a tank, for example) – Faster turn-around times for experiments – Early availability compresses development schedules • Much simulation work is motivated by the necessity of avoiding physical hardware – even when hardware is considered the ideal solution – Avoid inconvenience – Save costs – Get around slipping hardware schedules – Insufficient number of real systems available 7 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 User Interface Simulation • A category of tools of its own • Many different levels: • Part of many other – Virtual serial ports simulation tools – Virtual graphical screen & mouse like VmWare – Clickable simulation of touch screens – Clickable panels of buttons – LED panels – Full hardware mockups connected over CAN bus to PC • Software: – Simulated by scripts – Special code for special API – Actual target code in some form of other simulator 8 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Environment & Mechanical Simulation • Very large field in its own • Used in all industries right, largely independent of • History of 50 years computer systems • Commonly used for control • Largest players: algorithm development – Finite Element Methods Key part of the model-driven – MatLab/Simulink • – LabView/Matrixx architecture/model-driven design paradigm in automotive 9 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Network Simulation • Connections between • Move packets between abstracted nodes, to study simulated nodes communication patterns – No understanding of – Contains models of node protocols behavior, no actual code – Runs real code on all nodes – ns2 – Virtutech Simics • “Rest of network simulation” • Integrate physical and to provide environment for a simulated nodes single node – “Hardware in the loop” – Understands protocols • Networks: – Vector CANOE – Ethernet, AFDX, CAN, LIN, – Nethawk tools FlexRay, MOST, PCIe, I2C, • Dumb traffic generation LonWorks, ARINC 429, MIL-STD-1553, serial, RapidIO, VME, SpaceWire, USB, FireWire, ... 10 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Rest-of-Network Example This is from nethawk.fi: complete sim for UMTS, PSTN, GSM networks. All protocols and all nodes types. 400 employees to maintain. 11 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulating a Single Computer System Simulation Use Cases • Processor Design • System-on-Chip Design – Detailed models of – Combining processors, processor pipeline, caches accelerators, devices – Determine architecture of – Processors “fixed” next-generation processors – Architecture exploration – Classic field of comp sim – Sizing, performance, optimization of hardware • Running benchmarks is the – Focus on hardware primary goal designer needs – Needs system-level to handle modern workloads • Fidelity to target is primary – Multithreading on multicore driver for models processors – Timing – Many techniques to – Bandwidth increase speed to increase – Latency test breadth – Bus structure – Can get away with simplified system model • All components in the outside processor architectures are equals 13 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 System Simulation Use Cases • Hardware Verification • Timing-Sensitive Software – Devices in an SoC Development – Alternative to fixed tests – Depends on detailed – Use simulation to derive hardware timing test cases and determine – Small codes correct results – Close to hardware – Run system simulation – Optimized DSP kernels alongside VHDL/Verilog simulation of actual implementation • Execution time accuracy is the primary driver for model Test-Case Coverage and – Detailed timing model from • processor and outwards Realism are drivers – Execution speed secondary – Test cases generated – Insight into performance should cover real-world characteristics usage scenarios – Has to use quite a large system to be true to real- world behavior 14 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 System Simulation Use Cases • General Software • Production Use Development – Use simulated/virtual machines – Focus on general software to run software in production developer needs – VmWare, Xen, Parallels, etc. – Execute large workloads (OS, – Mac PPC emulation applications) – Little attempt so support debug – Debug & inspection features • Raw speed of execution is the • Speed of execution with fidelity key driver for simulator design is the primary driver for model – Usually no need to model a – Abstract as far as possible particular hardware, just – Approximate timing something that runs the right – JIT-compiling processor OS and application models – Typically not cross-target • Clear difference between – Pseudo-devices acceptable processors and devices in the system, processors dominate execution time 15 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Summary • The level of detail and what is being modeled varies greatly across use cases • Different roles have different needs 16 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Enough Detail is Enough • Computer games masters of sufficient abstraction • ”Life-like” action: – Momentum – Friction – Steering – Engine torque • But: not nuts & bolts of cars • Simulate only what is observable and relevant for the intended user Grand-Prix Legends 17 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulation Detail Levels • SystemC defines five levels of model abstractionNote: which production offer a use good map of abstraction levels for system modelingis not on this map Meaning Style Comments AL Algorithmic Level UML, SDL, Matlab Not concrete enough models to run software PV Programmer’s View Transaction-level 100+ MIPS, software with simple time development PVT Programmer’s View, Transactions with 10+ MIPS, Low-level with Timing precise time software devel, some SoC architecting CC Cycle-Callable Bit-level with <1 MIPS, Hardware precise timing validation, comp.arch RTL Implementation VHDL/Verilog <1 MIPS, Hardware implementation validation 18 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulating for Software Development “Virtual Software Development” Where are we? • In “Simulation for General Software Development” • For embedded systems mainly 20 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Electronics Is Software Electronics is software. Shipping a system is largely about identifying and removing defects from the software and keeping them from creeping back in as the product evolves. 21 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Traditional Software Development • Software development methodology creates production binary Application stack • Production binary runs on the real Operating system hardware Hardware-sensitive software Actual hardware 22 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Virtualized Software Development • Same binary runs inside virtualized Application stack software development environment Operating system Hardware-sensitive software Model of HW 23 Copyright © 1998-2005 Virtutech, All rights reserved. CONFIDENTIAL 3/15/2007 Simulating the Software Stack User program Goal: run your embedded software on a PC instead of Java VM DB Middleware on a physical target Operating