Simics - Break the Rules of Product Development


Published on

Presented at the 2013 MBSE Technical Forum in Huntsville, Alabama.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Simics - Break the Rules of Product Development

  1. 1. Wind River SimicsBreak the Rules ofProduct DevelopmentRory PatchinSimics Sales SpecialistTom WallSimics Technical Account Manager
  2. 2. Historical Background• Wind River founded 1981• Virtutech founded 1998• Q3 2009 Intel Acquires Wind River• Q1 2010 Intel Acquires Virtutech, Wind River becomessole Distributor2
  3. 3. Challenges with Debugging
  4. 4. 4Debugging Challenges• Limited visibility into hardware• Single debug port, multiple processors• High-speed, concurrent execution• Timing-sensitive chaotic behavior• Small changes in timing can radically altersystem behavior• Hardware variations can impact softwarebehavior• Lack of determinism• Re-running a program with different results• Hard to reproduce bugs• “Heisenbugs”• Altered behavior when inserting probes to tracebehavior• System keeps running even if one core stops
  5. 5. 5• Instrumented codechanges behavior toomuch• Multi-core bugs aresensitive to timingchanges so may bedifficult to recreate• It is hard to get atinternal hardwarestructuresTraditional DebugApproaches Don’t WorkWell
  6. 6. 6• Parallelism required to gain performance• Parallel hardware “Easy” to design• Parallel software hard to write• Fundamentally hard to grasp true concurrency• Complex software environments• Legacy software assumes single-processor• Might break in new and interesting ways• Multitasking not guaranteed to run onmultiprocessor• Difficult issues for software developers• Additional tool support required• Early access physical hardware often not the bestdevelopment platformMigration Issues
  7. 7. 7Imagine If You Could…Reduce yourtime-to-market by 66%.Reduce your debugtime by 35%.Reduce your developmenttarget costs by 45%.• Have target hardware forevery team member.• Try out several hardwareoptions before youcommitted to one.• Equip sales, marketing, andtech support withinexpensive targets.• Debug software beforehardware existed• Explore new silicon choicesbefore silicon existed.• Integrate and test yoursystem before the systemexisted.• Enable agile and iterativedevelopment• Easily manage largesystems-of-systems.• Easily debug largesystems-of-systems.
  8. 8. Wind River SimicsOverview
  9. 9. 9What is Wind River Simics?Wind River Simics is a full system simulator usedby software developers to simulate the hardware oflarge and complex electronic systems.• Simulate any sizeof target system• Run unmodifiedtarget binariesSimics allows you to break the rules of embedded product development.Wind RiverSimicsAnyTargetSystem
  10. 10. 10Simulate Any Size Embedded SystemProcessorand MemorySoC Devices Complete Boards Complete Systemsand NetworksDevices,Racks of Boards,and BackplanesSystem ComplexityCustomerValue
  11. 11. 11Simics Transforms the Product Life CycleSystemDefinitionPlatformCustomizationandStabilizationDeployandMaintainApplicationDevelopmentSystemIntegrationand TestTime-to-MarketTCOCapExOpExReusable Assets Enable Agileand Iterative Development• Use virtual target for architectural analysis• Pre-silicon architecture analysis using actual target software• Legacy system upgrade analysis using actual target software• Eliminate hardware availability and flaw issues• Hardware and software co-development• Develop target software before hardware is available• Utilize virtual target instead of host-based development• Advanced target hardware for everyone• Easy collaboration among entire team• Eliminate system availability issues• Iterative and incremental integration and test• Debugging at the system level• Utilize virtual platform even after development is complete• Maintenance of legacy products for five, 10, 20+ years• Support of many different customer configurations
  12. 12. Simics Impact on Time to Market & Risk• Simics shifts schedules left• Enables agile & iterative development by parallelizing work• Replace big-bang integration with incremental integrations• Management & debugging of system of systems12
  13. 13. REALITY: Everything Often Gated By Hardware13Pre-SiliconActivitiesHardwarePrototypesProduction,ManufactureStartApplicationDevelopmentEnd UserDocumentation& TranslationSystemIntegrationSystemTestHardwareDevelopmentSoftwareDevelopmentProductRequirementsMarketing /FeatureValidationPrototype H/WSpecifications
  14. 14. Simics Enables Agility14DevelopDefine DeploySystemsIntegration• Documents• Demos• Training• SupportToEcosystem &CustomersMultipleDesignSpinsArchitecturalInvestigationFirmware• Boot code• Diagnostics• DriversBSPApplicationDevelopmentFinal RevHWArchitectureDesignProductSpec.HWSpec.• Customers• Partners• Sales• Support• MarketingSWSpec.
  15. 15. 15Simics Impact on ConsolidationSimics Model ofLegacy SystemSimics Model ofMulti-core DesignOSFirmwareOSFirmwareHypervisor• Expedites consolidation• Replace paper analysis with real software on both designs• Reduce risks of moving to a new technology• Evaluate impact on complete systemApplicationSoftwareApplicationSoftware
  16. 16. 16Simics Impact on Costs• Reduces CapEx, OpEx, and developmental costs• Replace expensive labs with virtual labs• Replicate, assemble, and configure large systems of COTS components• Configure new systems-of-systems fasterSimics
  17. 17. 17• Systems on every Engineer’s Desk• Replace expensive system hardware with virtual systems• Debug more efficiently at system-of-systems level• Reduce number of iterations of physical prototypes neededSimics Impact on AvailabilitySimics
  18. 18. Simics in Short• Complete target simulation• Runs OS, drivers, all othersoftware• Models any system• Processor, SoCs, FPGA, ASICs• Multicore processors• Multiple boards• Multiple Networks• Targets• From single-core aerospacesystems• ... to multicore networkprocessors• ... to massive multiprocessorservers18SimicsSimicsUser application codeHost hardwareHost hardwareHost operating systemHost operating systemVirtual target hardwareTarget operating system (s)Middleware and libraries
  19. 19. Wind River SimicsSystem Level Capabilities
  20. 20. System-Level Features20Checkpoint and restore Multicore, processor, board Real-world connectionsRepeatable fault injection onany system componentScripting Mixed endianness, wordsizes, heterogeneitycon0.wait-for-string "$“con0.record-startcon0.input "./ptest.elf 5n"con0.wait-for-string "."$r = con0.record-stopif ($r == "fail.”) {echo ”test failed”}
  21. 21. Transporting bugs with CheckpointsVirtualplatformPPDThe software user finds abug and needs to report itto the developer.A developer D creates apiece of software andpasses it on for testingand useThe developer andsoftware user are bothusing the same virtualplatform to run softwareThe software user the virtual platform’scheckpointing to pass the bug to thedeveloper. This ensures perfectreproduction of the bug, as well ascomplete communication of the targetstate.21checkpointhardware configuration or reconfigurationsoftware package, load, or configuration
  22. 22. Session Comments and Recording22Comments in the timeline canalso be used to navigate tothat time when using reverseexecutionStarting a recording fromEclipse – it can also be donefrom scripts and the CLI
  23. 23. Fault Injection• Examples• 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 reportingoverheating• Error reporting registers flagged23• Simics target control• Access any part of target• Change any part of target state orconfiguration• Scripting for precise targeting andreplay of faults• No permanent damage to target• Purpose• Test system-level fault handling• Test fault low-level fault detection• Model failing hardware
  24. 24. Scripting• Simics command-line interface (CLI)• Easy and powerful for the most common tasks• Object-oriented, hierarchical naming of target components• Supports loops, conditionals, and parallel script branches• User can define custom commands using Python• Simics integrated Python interpreter• Access to Simics API, Python library, and host OS• Full object-oriented programming environment• Device models can be written in Python• CLI and Python are fully integrated24
  25. 25. Wind River SimicsSystem Inspection25
  26. 26. Simics System Editor• System editor• Inspect• Change• Configure• Reconfigure simulationas it is running• Add and removehardware units• Connect and disconnectunits• Shows hierarchicalsystem structure26
  27. 27. Simics Device Register Viewer• Inspect devices• Registers• Register banks• Bit fields in registers• Current value• Documentation anddescription strings27
  28. 28. Hardware unit front panelSimics System Panel28Simulation modelsSimulation feature controlTarget system stateShowing parts of statenow shown on physicalsystem front panelControl panel forsimulation extensions andfeatures not directly partof a hardware unitModeling lights anddisplays and buttonsfound on the front(typically) of a real systemShowing parts of state now shown on physicalsystem front panel
  29. 29. Debugging withWind River Simics
  30. 30. Simics Debugging Features30Synchronous stopfor the entire systemUltimate repeatability Reverse debuggingUnlimited and powerfulbreakpointsTrace everything Insight into all devicesbreak –x 0x0000 length 0x1F00break-io uart0break-exception int13break-log “spec violation”
  31. 31. 31Repeatability and Reverse Debugging• Repeat any run trivially• No need to re-run and hope for bug to reoccur• Stop and go back in time• No re-running program from start• Breakpoints and watchpoints backward in time• Investigation of exactly what happens each timeThis control andreliablerepeatability isvery powerful forparallel code.Discover BugRe-run: Bug Doesn’t Show UpRe-Run: Bug Doesn’t Show UpRerun: Different BugRe-run: Initial Bug OccursDiscover BugReverse Execute and FindSource of BugOn virtual hardware, debugging is much easier.On hardware, only some runs reproduce an error.
  32. 32. Simulation executes forward from the stateReverse execution in Simics• Take periodic checkpoints of system state as we execute• To go back to a point in time• Go back to the closest checkpoint and execute forward32Simulation executes forwardExecute forwardCheckpointLogical timeSimulation timeReverseExecute forwardRestore tocheckpoint,simulateforward
  33. 33. Unparalleled Breakpoints• Breakpoints areunintrusive and do notaffect target state• Code execution• Data access• No limits• Virtual addresses• Physical addresses• Arbitrarily large areas• Any number of breakpoints• Processor exceptions• Control register access• Devices access• Time• Console output• Network activity• Task switches• OS calls• System event (haps)• TLB, device action, …• Simulation log message33
  34. 34. Code is not just about CPUs34On a modern SoC, the processorcores are just one part of thesystemMuch application functionality isimplemented by using specialaccelerators... and you need to debugtheir interaction with the processors &softwareSimics can trace, log, and break on allhardware activities. Devices can reportsuspicious software actions andviolations of hardware programmingrules. Breakpoints on exceptions makesdebugging drivers and operating systemsmuch easier.
  35. 35. Fully-Featured Eclipse Debugger35Symbol browser lets you managedebug symbols and search forspecific symbol names in thedebug informationStop log shows you how you arrivedat the current point in time,including actions performed and thetime change they resulted in
  36. 36. Debug at System Level• Debug multiple target boards andmachines using a single debugconnection• Synchronized system• Global stop of target system• Single-step any code, any where• Reverse entire system• Relative speeds of targets modeled• Debug heterogeneous targets• Different processor architectures• Different operating systems• Hypervisor, SMP, AMP, single-core• Attach multiple debuggers to system• Debug code through all layers of thesoftware stack, down to hardware• Trace and log without effects causedby instrumented code36
  37. 37. Simics AnalyzerDemonstrating two differentways to handle a hardwaredevice. The red alternative isusing a regular Linux devicedriver and spends most of itstime in the kernelThe green alternative isaccessing the hardware directlyfrom user space using anmmap() setup, leading to verylittle kernel time (and betterlatency).Looking at different aspects ofthe target system state, such ashardware registers, device state,and software threads running.37
  38. 38. Wind River SimicsArchitecture
  39. 39. Wind River SimicsTarget Machine(s)Processor coreSimics ArchitectureModelLibraryDevicesDevicesDevicesProcessor coresDevicesDevicesNetworksand IOTarget operating systemTarget hardware driversUser program MiddlewareTarget boot codeUser programTarget ISA decoderJITCompilerInterpreterSimicsCoreConfigurationmanagementCore ServicesAPIInspectionControlFeaturesGUIScriptingBuilt-inDebuggerDevice NetworkProc.coreSoCInter-connectConfigscriptsVMPExternalI/OEthernetSerialKeyboardMouse….Event queueand timeMultithreadingand scalingDevicesDevicesMemoriesLibrariesExternalToolsWorkbenchEclipseTesting toolsDebuggers….39
  40. 40. Wind River SimicsModeling Your System40
  41. 41. Evolve and Iterate the Virtual Platform• Start with a virtual reference board or bare-bones system or QSP• Change virtual platform contents as hardware design evolves• Create new hardware versions faster & in less timeVirtual boardVirtual model of new SoCCPUTimerPICUARTCPURAMVirtual boardVirtual model of new SoCCPUPatternMatchingTimerPICUARTEthernetEthernetCPU CPURAMFlow controlVirtual boardVirtual model of new SoCCPUPatternMatchingTimerPIC MCUARTEthernetEthernetCPUCryptoBufferMemoryTCPOffloadBufferMemoryCPURTCRAM FLASHFlow control41
  42. 42. SystemSimics follows Real-World Structure• Simics models are built using thesame logical hierarchy ofcomponents as the physicalsystem• Fully supports systems ofsystems, and multiple levels ofsystem packaging• Easy for end users to manipulateBoard 1FlashEthernetPHYSoC 1DDR RAMFPGAPHYCPUCPU Eth EthPIC TimeSer PCIBoard 2FlashPHYSoC 2DDR RAMSCSICPUEthAccPIC TimeSerPCIHDDSystemBoard 1 Ethernet Board 2FPGAFlashDDRRAMSoC 1Eth linkPHY PHYCPU complexCPU CPU PICEthEth TimeSer PCIetc…42
  43. 43. Boards,Networks,Software loadsSystems,NetworksChips,Subsystems,IP blocks,Memory mapsDevices,Cores,Interconnects,MemoriesSystem Configuration Levels43Rack 2Board 1 Backplane Board 2FPGAFlashDDRRAMSoC 1Eth linkPHYCPUcomplexCPU CPU PIC EthUSB TimeSer PCIRack 1 Wide-areanetworkSystemDML, SystemC, C,C++, ISS tools,etc.Simics componentsSoftware SoftwareSimics scripts, Simicsscripts calling SimicsscriptsSimics components ,Simics scriptscreating components,Simics scripts addingsoftware
  44. 44. Modeling Support in Eclipse44DML editorExecute modelunit testsBrowse and accessexample code andmodel skeletons
  45. 45. Wind River SimicsProduct Portfolio
  46. 46. Simics 4.8 Product Portfolio46SimicsHindsightSimicsAnalyzerSimicsAcceleratorSimics ModelBuilderSimicsExtensionBuilderSimics Virtual PlatformsPCVPModelLibraryCSVP
  47. 47. Q & A
  48. 48. 49
  49. 49. Model Fidelity from this page – “P4080 SDK software components have beentested on Virtutech® Simics™ hybrid virtual platform for the Freescale QorIQP4080. ”50
  50. 50. Simics API• Wind River Simics 4.8 C++ Device API Programming Guide• Wind River Simics 4.8 Model Builder User’s Guide• Wind River Simics 4.8 Model Builder DML 1.2 Reference Manual• Wind River Simics 4.8 Reference Manual• Wind River Simics 4.8 Target API Application Note• Wind River Simics 4.8 Extension Builder User’s Guide• Wind River Simics 4.8 Hindsight User’s Guide51Simics exports two well-defined application programming interfaces (APIs)based on C available in C/C++. One for device modeling, the Device APIand one for extending the simulator, the Simulator API. Almost all functionsin the C APIs are also available in Python, and there is a small Python-onlyAPI in addition. There is also a Simics Eclipse API providing basic control ofa simulator session.
  51. 51. Simics CLI (Simics’ console)The Simics Command Line Interface (CLI), provided as part of SimicsHindsight, is an text based user interface with built-in help system,context sensitive tab-completion (on both commands and arguments),and scripting support which provides access to the Simics API usingPython.The user interface of a Simics module consists of three parts: itsattributes, its interfaces, and the commands it adds to the Simics CLI.The Simulation can also pass output to the CLI.load-module is used to add a components’ commands to the CLI52• Wind River Simics 4.8 Hindsight User’s Guide• Wind River Simics 4.8 Model Builder User’s Guide• Wind River Simics 4.8 P502x0 Reference Manual (complete list of all CLI commandsdefined by this package)
  52. 52. Simics ScriptingSimics has a built-in Python 2.6 interpreter that can be used for bothsimple and more advanced scripting. The command line interface (CLI)also supports writing simple scripts. Scripts can be triggered by eventsin the simulated machine, called haps.Scripts provide for –• Definition and manipulation• Print command return values to CLI console• Control flow• Integer conversion• Accessing configuration attributes• Script branching Wind River Simics 4.8 Hindsight User’s Guide Wind River Simics 4.8 Reference Manual53
  53. 53. 54