Simics Brief Introduction Presented By: Chunrong Lai Engineer Technology Center (STC), Software and Services Group

26 Oct, 2012 What is Simics?

Simics is a high-performance, full system simulator used by software developers to simulate large and complex electronic systems.

Wind River Simics • Simulate any size of target system • Run unmodified binaries • Other use cases as add-ons

Simics allows you to break the rules of embedded systems development

Software and Services Group ‹#› Simics History

Research project at SICS started in 1991

Virtutech was founded in Sweden in 1998 and incorporated in USA in 2003.

Acquired by in 2010

Marketed and sold through Wind River (subsidiary)

Software and Services Group ‹#› Simics Customers

Marketing, Field & Sales

Simics users

Simics Technology Center

Widley used acroos different Intel Simics External Customers, include groups/projects as an uniform network, communication, space, software platform simulator semiconductor and HPC field

Software and Services Group ‹#› What Wind River Simics Customers Say

Computing Server Networking Industrial Space

. Shortens bring-up . Finds and solves . Prevents the loss . Saves $6M in time from 22 weeks problems in 30 of $10M by getting target hardware to 29 days minutes instead the ASIC right labs of three weeks before and three people manufacturing . Configures complex labs in minutes instead of weeks

Software and Services Group ‹#› 5 Some Simics Features and Capabilities

• High performance • Modeling language for fast development • Synchronized System Stop • Models in any language • Save/restore of simulated state − DML, C/C++, SystemC, Python • Repeatability • Large collection of model interfaces • Dynamic reconfiguration • User developed simulator features • Large systems, hundreds of processors • Integrates with external tools • Runs all software unmodified • Scripting for automated sessions − Windows, , VxWorks, Hypervisor, etc • Operating System awareness • Heterogenous systems • Process tracking • Run simulation in reverse • Instruction and data profiling • C/C++ debugging • Supported, stable, well-documented API • Code coverage • Cache modeling • Trace generation • Advanced memory breakpoints • Non-intrusive inspection • Distributed simulation • Real-world connections • DHCP, DNS, FTP, TFTP services • Hardware-in-the-loop • Connections to remote debuggers • Record/replay of user input − E.g. GDB • Connections to hardware emulators • IP-XACT import/export • Gear shift to cycle accurate models • Import of SystemC models • Host virtualisation for native IA performance • Build kit for system panels • Binary translation for cross target simulation • Huge model library • Synchronize virtual time with external tools

Software and Services Group ‹#› Important Features for Full System Simulation

checkpointing

dynamic configuration

repeatability and reversibility

scripting

visibility

Features work extensibility together to form “super features” software abstraction

Software and Services Group ‹#› SIMICS USE CASES

Software and Services Group ‹#› The Challenges of Systems Development

Do More with Less • Target hardware Issues • Reduced staffing • Shorter Time-To-Market

Growing Complexity • Multi-core SoCs, accelerators • Heterogeneous systems • Networked, large systems

Global Teams • Engineering teams are no longer co-located • Multi-company collaboration • Collaboration and communication challenges

Software and Services Group ‹#› Shift Left – Or Shorter TTM

Product Life Cycle withTraditional virtual platforms Product Life Cycle Resources

Software

Reduced Time-to-Market Engineering Resources Engineering

Increased Revenue

Hardware

Integration and Testing Time

Software and Services Group ‹#› Repeated/Reverse Execution: On hardware, only some runs Do More with Less reproduce an error • Repeat any run trivially −No need to rerun and hope for bug to reoccur • Stop and go back in time −Instead of rerunning program from start −Breakpoints and watchpoints backwards in time With repeatability all runs reproduce −Investigate exactly what an error happened this time • This control and reliable repeatability is very powerful for parallel code! With reverse execution there is no need to iterate

Software and Services Group ‹#› The Challenges of Systems Development

Do More with Less • Target hardware Issues • Reduced staffing • Shorter Time-To-Market

Growing Complexity • Multi-core SoCs, accelerators • Heterogeneous systems • Networked, large systems

Global Teams • Engineering teams are no longer co-located • Multi-company collaboration • Collaboration and communication challenges

Software and Services Group ‹#› The System is a Network! Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore es s Boards

Software and Services Group ‹#› Control: A Lot Happens in a System Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore es s Boards

Software and Services Group ‹#› Control: A Single Component may stop …

Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore Boards es … but the rest of sthe system continues to run

Software and Services Group ‹#› … or a Single Component Stops … Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore Boards …es and the whole systems crashes. But where is the bug?

Software and Services Group ‹#› Control: Simics Synchronized System Stop

Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore Boards es … the whole systems freezes in an operational state

Software and Services Group ‹#› The Challenges of Systems Development

Do More with Less • Target hardware Issues • Reduced staffing • Shorter Time-To-Market

Growing Complexity • Multi-core SoCs, accelerators • Heterogeneous systems • Networked, large systems

Global Teams • Engineering teams are no longer co-located • Multi-company collaboration • Collaboration and communication challenges

Software and Services Group ‹#› Today’s Teams are Geographically Dispersed

Support team

Testing team

Development Team

How to communicate and share artifacts, such as system configurations, reproduction steps etc?

Software and Services Group ‹#› Control: Taking a Check Point

Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore es s Boards

Software and Services Group ‹#› Control: Resume Identical Chassis and platforms Racks Interfaces:  Backplanes  RapidIO  PCI Express*  Shared memory

Network Connection hubs & to the switches World

Mixed Dedicated Architectur Subsystem Multicore es s Boards

Software and Services Group ‹#› Checkpoint Collaboration

Simics Virtual Platform: Simics Script: Exact configuration of Automate the actions the target system that that led to a bug. a bug was found on.

Simics Checkpoint: A snapshot of the full system that can be restarted on any machine anywhere.

Testing Team Development finds a bug Team Loads checkpoint and resumes execution to find the source of the bug.

Software and Services Group ‹#› Impact on Productivity

•Consider: −The time it takes to physically set up a system −The time it takes to boot a system −The time it takes to get a system to the exact state you want

•With Simics Full System Simulation: −Take a snapshot of it −Re-load it seconds later −Re-load it from any other place in the world!

•Start Simics: −http://www.windriver.com/products/simics/ −Supported through http://www.simics.net −Contact: [email protected]

Software and Services Group ‹#› SIMICS IN ACADEMIA

Software and Services Group ‹#› Computer Architecture

•Computer architecture research −Cache and memory hierarchies in MP systems − ACM Athena lecture “Shared Caches in MultiCores” in ISCA2010 •Add-ons −UW-Madison Multifacet GEMS >OOO processor models, memory hierarchies −CMU SimFlex >Timing-accurate processor, memory and interconnect −UIUC FeS2 >Timing-first multiprocessor simulator •Teaching case: −UC Berkeley: Graduate Computer Architecture Spring 2012 −UC Berkeley: Computer Architecture and Engineering Spring 2012 (undergraduate)

Software and Services Group ‹#› Operating Systems

•Teaching −Carnegie-Mellon University: Operating System Design and Implementation • Research

> useful simulate additional hardware support or novel hardware features, or novel hardware configurations and computer organizations.

Software and Services Group ‹#› Fault Injection, Reliable software

•Some publications using Simics for fault injection include −Myhrman and Svärd: Studying Fault Injection in WCDMA Base Station Processors Using Simics Simulator, MSc Thesis, Chalmers University of Technology, May 2005 −Bastien, A Technique for Performing Fault Injection in System Level Simulations for Dependability Assessment, Master's Thesis, University of Virginia, January 2004.

Software and Services Group ‹#› Workload characterization

•Software profile −profiling the amount of time spent in the OS kernel vs. the time spent in user mode •Cache behaviors •Instruction traces

Software and Services Group ‹#› Academic Use

•http://blogs.windriver.com/engblom/ −Blog posts about Simics −Information on Wind River academic program −Interviews with Simics users •Projects by interviewed researchers −Improved HW support for virtualization −Multicore partitioning for avionic systems −Fault injection in reliable embedded systems

Software and Services Group ‹#› WindRiver Academic Program

•Always been available at low or no cost •Available platforms −Simics 4.2, soon Simics 4.4 −ARM, PPC, SPARC V8, SPARC V9, X86 −Intel 440BX with several different processors, 486sx, II, , one x86-64 CPU •Apply the usage −http://www.windriver.com/universities/ −[email protected] −Supported through sub forums at http://www.simics.net

Software and Services Group ‹#› Intel Simics Academic Program

•Academic program by invitation only −To get serious, well-known participants −From an Intel individual, “sponsor” •Simics 4.6 −Most recent Simics version − i7 with X58 and ICH10 −Intel Tunnel Creek ( based) •Launch expected in early Q4, 2012 •Independent of Wind River Academic Program −Wind River provides non-Intel platforms •Same support process at http://www.simics.net •Licenses granted one year at a time

Software and Services Group ‹#› Software and Services Group ‹#› Free Discussion BACKUP

Software and Services Group ‹#› Case Study: ITP Integration With Simics

• Full hardware visibility • Binary image compatibility • Integration with ITP

Software and Services Group ‹#› Hybrid Simulation

•Integrate a detailed model with Simics −Timing −Power & thermal •Run real workload on fast Simics model •Switch to detailed for interesting part −Only replace units of interest •Requires model specific work

Software and Services Group ‹#› Controlled Environment

•Examine viruses, Trojans, cyber attack software •Run unmodified software •Full inspection capabilities •Sandboxed multi-machine environment

Software and Services Group ‹#› SIMICS FORUM SUPPORT FOR ACADEMIA USERS

Software and Services Group ‹#› SIMICS FORUM SUPPORT FOR ACADEMIA USERS

Software and Services Group ‹#› Virtual Platform Library

Target CPU Architectures SoC's Modeled Target Devices PowerPC Architecture x86 Architecture AMCC Memory and system controllers AMCC PowerPC 440 Intel 80386 PowerPC405 & PowerPC440 Interrupt & DMA controllers Freescale e300 Intel 80486 Freescale Ethernet controllers Freescale e500 Intel Pentium QorIQ™ P4080 PCI and PCI Express Freescale e500-mc Intel P4 PowerQUICC II (MPC82xx ) Serial ports Freescale e600 Intel P4 with EM64T PowerQUICC II Pro (MPC83xx) USB devices and disks Freescale MPC603e Intel Core PowerQUICC III (MPC85xx) SCSI controllers and devices Freescale MPC750, MPC755 (“G3”) MPC8641/D I2C controllers and devices Freescale MPC74xx (“G4”) Intel Core 2 Duo Texas Instruments RapidIO controller and devices Communication devices such as IBM PowerPC 405 AMD Athlon TI C6414 those for Firewire, Spacewire, etc IBM PowerPC 403 core AMD Athlon64 TI C6455 IBM PowerPC 464FP core AMD Opteron HIREC Target Operating Systems IBM PowerPC 750(fx,gx) MIPS Architecture HR5000 Enea OSE IBM PowerPC 970, 970MP MIPS 4K Cavium GreenHills Integrity IBM POWER6 MIPS 5K Octeon 38xx/58xx IBM AIX IBM Cell Broadband Engine MIPS 5Kf In-house RTOSes Texas Instruments PMC RM7000 Virtual Platforms Linux C64 DSP PMC E9000 Freescale MPC8572E Windows (including Vista) C64+ DSP Cavium cnMIPS64 Freescale QorIQ P4080 Monta Vista Linux RMI MIPS64 Curtis Wright SVME183 (PPC7447A) NetBSD, FreeBSD ARM Architecture SPARC Architecture Freescale HPC-NET with MPC8641D QNX Neutrino ARM 5TE SPARC-V8 BAE RAD750 with Ethernet & MIL-STD-1553 RTEMS ARM 9EJ SPARC-V9 Wind River SBC750 (PPC750) Sun Solaris ARM 9E Renesas Sun SPARC Server Family Wind River VxWorks ARM 11 H8S Microcontroller Virtual PC (AMD x86-32 & x86-64) SuperH SH-4 Virtual PC (Intel x86-32 & x86-64) Not limited to any RTOS, OS, or exec Our list of CPU, SoC, device models and virtual platforms changes frequently. Please visit our online list at: www..com/products/simicsmodels

Software and Services Group ‹#› Section 1: Introduction to Simics

Henry Cook CS152 - Spring 2008 Familiarity survey

•C •Python •gdb •Unix/Linux/Solaris

1/28/2008 Henry CookSoftware and Services Group 43 ‹#› ©UCBerkeley What are we doing in labs?

•Giving you an environment to: − Run code on a variety of platforms >Not all of which are actually available to us − Benchmark and experiment − Change things about the hardware >Access to multiple abstraction layers − See how architectural mechanisms work in practice on real software

1/28/2008 Henry CookSoftware and Services Group 44 ‹#› ©UCBerkeley What is Simics?

•Efficient, instrumented, system level instruction set simulator −Run as fast, or faster than, target machine −Gather detailed information at run time −Model target at level at which OS acts −ISA-aware, simulates each instruction −Runs unmodified OSes and workloads

1/28/2008 Henry CookSoftware and Services Group 45 ‹#› ©UCBerkeley Why are we using Simics?

•Scripting capabilities •Academic licensing •Can run real software, quickly •Intro to functional/timing simulators •Outside relevance −Program analysis, computer architecture research, and kernel debugging

1/28/2008 Henry CookSoftware and Services Group 46 ‹#› ©UCBerkeley Terminology

•Host machine −Machine/OS on which Simics is running •Target machine −Machine/OS which Simics is simulating •Neither the architecture nor the OS of either machine need be the same •Steps vs. cycles vs. instructions

1/28/2008 Henry CookSoftware and Services Group 47 ‹#› ©UCBerkeley Environment

•Similar to gdb, command line interface •Simics CLI has built in scripting −Can also write scripts in Python •Checkpointing •Different modes of execution −Fast, stalls, MAI −Speed vs. accuracy

1/28/2008 Henry CookSoftware and Services Group 48 ‹#› ©UCBerkeley Major Components

•Functional −Modules >Written in C, Python, DML >Devices, components, boards, machines… −Attached by Simics or Python scripts

•Timing − Memory, caches, Simics MAI − Declare or calculate delay of modules

1/28/2008 Henry CookSoftware and Services Group 49 ‹#› ©UCBerkeley Demo!

1/28/2008 Henry CookSoftware and Services Group 50 ‹#› ©UCBerkeley Gritty details

•Might compile code in separate environment −E.g. compile on Solaris/SPARC, run on Linux •Need X11 at client machine −http://inst.eecs.berkeley.edu/connecting.html#xwindows •Instructional servers −http://inst.eecs.berkeley.edu/cgi- bin/clients.cgi?choice=13

1/28/2008 Henry CookSoftware and Services Group 51 ‹#› ©UCBerkeley