Software and System Development using Virtual Platforms (eBook)
366 Seiten
Elsevier Science (Verlag)
978-0-12-800813-3 (ISBN)
Daniel Aarno has been working with the Simics full system simulation product since 2006. His positions have ranged from software developer, customer project manager (including pre-sales) to engineering manager responsible for the modeling tools and model development in Simics at Intel. He has a number of publications, including journal and conference publications , book chapters and the book, Recognizing Intentions, on robotics and artificial intelligence.
Virtual platforms are finding widespread use in both pre- and post-silicon computer software and system development. They reduce time to market, improve system quality, make development more efficient, and enable truly concurrent hardware/software design and bring-up. Virtual platforms increase productivity with unparalleled inspection, configuration, and injection capabilities. In combination with other types of simulators, they provide full-system simulations where computer systems can be tested together with the environment in which they operate. This book is not only about what simulation is and why it is important, it will also cover the methods of building and using simulators for computer-based systems. Inside you'll find a comprehensive book about simulation best practice and design patterns, using Simics as its base along with real-life examples to get the most out of your Simics implementation. You'll learn about: Simics architecture, model-driven development, virtual platform modelling, networking, contiguous integration, debugging, reverse execution, simulator integration, workflow optimization, tool automation, and much more. - Distills decades of experience in using and building virtual platforms to help readers realize the full potential of virtual platform simulation- Covers modeling related use-cases including devices, systems, extensions, and fault injection- Explains how simulations can influence software development, debugging, system configuration, networking, and more- Discusses how to build complete full-system simulation systems from a mix of simulators
Front Cover 1
Software and System Development using Virtual Platforms 4
Copyright Page 5
Contents 6
Foreword 14
Acknowledgments 16
1 Introduction 18
Virtual Platforms 19
Terminology 20
Simulation and the System Development Lifecycle 21
Hardware Development and Design 22
Pre-Silicon 22
Platform Development 23
Application Development 24
Debugging 25
Testing and Integration 26
Deployment 28
Maintenance 28
Training 29
Longevity Support 31
Certifiable and Safety-Critical Systems 32
Model-Driven Development 33
Processor-in-the-Loop Testing 33
Hardware-in-the-Loop Testing 34
Integration Testing 34
Book Outline 35
Trademark Information 36
2 Simics fundamentals 38
Simics† Architecture and Terminology 38
Running Real Software Stacks 40
Interacting with Simics 40
Software Debugging 43
Scripting 43
Configurations and the Simics Object Model 45
Attributes 45
Interfaces 46
Haps 46
Ports 47
Documentation and Metadata 47
Call Chain and Locality 47
Changing the Configuration 47
Components 48
Time in Simics 49
Abstraction Levels 50
Event-Based Simulation 52
Multiprocessor Scheduling 54
Cycle-Accurate Simulation 55
Memory Maps 56
Hierarchical Memory Maps 57
RAM, ROM, and Flash 57
PCI and Other Memory-Mapped Interfaces 58
Multiprocessor Memory Maps 59
Memory Images 59
Checkpointing 61
Portability and Implementation Independence 62
Differential Checkpoints 63
Session State and Simulation State 63
Determinism and Repeatability 63
Reverse Execution 64
Recorders 65
Simics Performance Technology 66
Simulation Speed Measures 66
Multiprocessor Simulation Speed Measurement 67
Speed Variability 68
Temporal Decoupling 69
Performance Effects of Changing Target Timing 73
Models and Extensions 75
3 Develop and debug software on Simics 78
Development Means Testing 78
Agent-Based Debugger 80
Debugging Using Simics 81
System-Level Debugger 82
OS Awareness 82
Simics Breakpoints 85
Reverse Debugging 86
Navigating in Time 87
Debugging Hard-to-Talk-to Targets 89
Multicore Debugging 89
Low-Level Debug 93
UEFI BIOS Debugging 96
User-Level Debugging 96
Performance Analysis 98
Profiling Instruction Counts 98
Cache and Memory 98
Impact of Hardware Accelerators 99
Inspecting the Hardware State 100
Counting Hardware Events 100
Device Registers 100
Memory Mappings 101
System Panel 102
Fault-Injection and Boundary Conditions 103
Configuration Changes 103
Changing the Software State 105
Hardware Fault Injection 105
Test Result Check 108
Using Checkpoints 108
Save the Boot Time 108
Save Work and Continue Later 108
Positioning for Analysis 109
Share Setups 109
Nightly Boot 109
Adding Actions 110
Annotations 111
Bug Transportation 113
Cloning Setups 114
Record–Replay Debugging 114
Differential Checkpoint Saving 115
Gear Shift 116
Loading Software 117
Continuous Integration 120
Software Test Automation on Simics 121
Shortcuts in the Software Stack 122
Incomplete Software 123
Simulator-Aware Software 123
Backdoor Outputs 125
4 System configuration in Simics 128
Simics Component System 130
Preconfiguration Objects 130
Component Connectors 132
System Metadata 132
Setup Scripts 134
Hardware Setup Scripts 136
Software Setup Scripts 136
Script Parameters 138
Script Branches 138
System Panel 140
Automating Target Configuration and Boot 142
5 Networking 146
Network Simulation in Simics 146
Network Interfaces 146
Packet-Based Physical-Level Transport 148
Ethernet Modeling 148
Other Networks 150
Network Timing and Configuration Cells 151
Latency Management 154
Scheduling and Multithreading 155
Network Timing and Bandwidth Simulation 156
Simulated Network Nodes 157
Service Node 158
Sensors and Actuators 158
Traffic Generators 159
Network Testers 160
Rest-of-Network Simulation 160
Traffic Inspection and Modification 161
Traffic Modification 161
Ethernet Inspection with Wireshark 162
Scaling Up the Network Size 162
Infinite Inventory 163
Hypersimulation 163
Multithreading Simics 164
Distribution 164
Memory Page Sharing 166
Stubbing Network Nodes 166
Connecting the Real World 167
Dedicated Real-Network Modules 168
Availability of Hardware Ports 169
Timing Issues 169
Real-Time Mode 170
Ethernet Real-Network Variants 171
Network Address Translation and Port Forwarding 171
Ethernet Bridging 172
Host Access 173
Programming New Networks 175
6 Building virtual platforms 178
The Purpose of the Model 178
What to Model 179
How to Model 181
The Modeler 182
Virtual Platforms in Simics 182
Following the Hardware Structure 187
Device Modeling Language 189
Overview of DML 189
DML Compilation Process 189
Reactive Modeling Style 190
Model Performance 191
Reusing Existing Information 191
Register Maps 191
Device Functionality 192
DML Features 192
Inline Documentation 193
Register Maps 195
Templates 197
Bit Field Decoding 198
Endianness and Partial Accesses 200
C-like Core Language 201
Memory Layouts 201
Interfaces to Other Models 202
Simics Attributes 202
Functionality Templates 205
Creating Device Models 205
Setting Up the Environment 205
Test Methodology 205
Adding a Model to the Simulation 207
Completing the Device Model 208
Reserved Registers and Missed Accesses 214
Reserved Registers 216
Creating Models in Other Languages 217
Module Scanning 218
Module Loading 218
Class Registration 219
Objects 221
Attributes 221
Interfaces 223
Logging 226
Events 226
7 DMA: A concrete modeling example 228
DMA Device Description 228
Functional Description 229
Implementing the Basic DMA Device Model 231
Unit Testing 231
Simulating Time 232
Scatter-Gather List Support 239
Avoiding Deadlock 243
Creating a PCI EXPRESS (PCIe) Model 244
Creating a Component for the DMA Model 244
Creating a Device Driver 250
Driver Overview 251
Bring it all Together 251
8 Simulator extensions 254
Introduction 254
Applications of Extensions 254
Script or Extension 256
Device or Extension 256
Implementing Extensions 257
C or Python 257
Attribute Values 258
Callback Functions 258
Getting to a Safe Context 259
Special Concerns When Creating Extensions 260
On-the-Fly Python Objects 261
Cache and Memory Simulation 261
Simics’ Generic Cache Model 263
Fault Injection 266
Modifying Memory and Registers 267
Error Reporting Registers in Devices 267
Intercepting Traffic 267
Intercepting Memory Accesses 269
9 Simulator integration 274
Introduction 274
Physics and the Environment 274
Computer Architecture 275
Hardware Validation 278
Reusing Existing Models 278
Problems and Solutions 280
Run Control 280
Launching and Embedding 281
Embedding Simics 282
Time Management 282
Synchronization Intervals 283
Simics Temporal Decoupling 284
Simics and SystemC Time 284
Communications 286
Dedicated Communications Modules 286
Devices for I/O 287
Bypassing Devices 288
Push or Pull 289
Abstraction Level Change and Transactors 290
State Transfer in Checkpoints 291
Frontends 293
Running Simics from Other Programs 294
Virtual Lab Management 294
Record–Replay Debugging of Target Software 295
Running on a Simics Target 297
Multiple Simulator APIs 298
Simics Processor API 298
10 Intel® architecture bring-up 300
Pre-Silicon Process 300
Early Collaboration with Hardware Architects 301
New Instruction Set Support and Usage 302
Collecting Requirements from Customers 303
BIOS Development and Enabling Capabilities Using Simics 305
Software and Simulator Cross-Validation 305
UEFI BIOS Debug 306
JEDEC Memory Module Support 307
Fault Injection and RAS 307
Machine Check Errors 308
Device-Specific Faults 309
Early OS Enabling 310
Compatibility Hardware Level for Legacy Drivers 311
BIOS SATA Mode Switching 311
Common OS Installation Steps 312
Post-Silicon Process 312
Post-Silicon Modeling 313
Post-Silicon Case Study: PXE 317
PXE Overview 317
Server-Side Software Support 319
Service Node as Server 319
Virtual Platform as Server 320
Client-Side Software Support 320
Integrated BIOS Approach 320
NIC OpROM Approach 321
PXE Final Results 323
Appendix A: Source code 326
Chapter 6: Counter Device 326
Chapter 7: DMA Device 330
References 352
Index 358
Introduction
Chapter 1 explains why virtual platforms and full-system simulation like Simics is a critical tool for developing today’s complex computer-based systems. It describes how Simics helps deliver new solutions faster, and develop, debug, and maintain evermore complex systems throughout the lifecycle of a product. The chapter provides a high-level overview of why and where Simics is being applied to solve problems for software and system developers.
Keywords
virtual platform; product lifecycle; shift left; model-driven development; continuous integration; pre-silicon
Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.
—Alan Perlis, Epigrams on Programming, 1982
In just a few years, electronic systems have become significantly more complex. Now, even comparatively simple designs include multiple processors, a mixture of CPU types, digital signal processing (DSP), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), and other devices. Complementing the diverse combinations of hardware, today’s systems employ a variety of operating systems and application stacks that until recently would not have been combined within a single product or solution.
Unfortunately, however, as these systems have grown in complexity, the development tools and processes that were refined when single processors and basic client–server architectures were the rule have not kept pace. As a result, today’s system developers are challenged to find new ways to define system architectures, develop and integrate millions of lines of code, and deploy such complex systems. They must do this in ways that reduce risk and shorten the schedule while simultaneously resulting in a higher-quality product that is easier to support and maintain.
In addition to the growing complexity, the market also expects new systems to be delivered at a much higher pace. The product development lifecycle of most electronic systems has been significantly shortened over the last decade. Thus, today’s system developers are faced with two significant challenges: deliver new solutions faster, and develop, debug, and maintain ever more complex systems. Virtual platforms can help in addressing these two challenges.
The goal of this book is to inspire and educate the reader to find new ways to leverage the power of virtual platforms and full system simulation to improve their systems’ design and development activities. With this book we seek to share our experience, gathered over more than a decade, from working with our customers to help them realize the advantages of working in a simulation environment. This book is focused on virtual platforms created in Wind River Simics†, and although Simics offers many unique features, many of the techniques and challenges discussed apply to other virtual platform solutions as well.
At one level the book will address how to use Simics simulations to achieve your development goals as a leader of an organization. At another level, the book will discuss how to use Simics simulations to get actual tasks done. The book offers best practices along with real-life examples to help you understand how to get the most out of your Simics implementation. Design patterns and architectures that have been proven to work when building complex simulation systems involving many separate components are described. While the book is not intended to be a user manual, it is a comprehensive book on simulation using Simics, and we have tried to provide enough details for the book to be useful for someone trying to implement the concepts described.
This chapter introduces the reader to why virtual platforms and full-system simulation like Simics is a critical tool for developing today’s complex computer-based systems. The chapter defines the basic terminology and provides a high-level overview of why and where Simics is being applied to solve problems for software and system developers. The chapter concludes with an outline of the remaining chapters of the book.
Virtual Platforms
A virtual platform is a model of a hardware system that can run the same software as the hardware it models. The virtual platform is simulated on a host computer that may be different from the hardware modeled by the virtual platform. For example, a big-endian Power Architecture system with a controller area network (CAN) bus and other peripherals running VxWorks† can be simulated on a typical little-endian Intel® Architecture PC running a Linux† or Windows† operating system. A virtual platform is not limited to modeling a single processor or board, but can represent anything from a basic board with only a processor and memory to a complete system made up of network-connected boards, chassis, racks, and models of physical systems.
The key property of a virtual platform is its ability to run unmodified binaries of the software that will finally run on the real system, and run it fast enough to be useful for software developers. Such software includes low-level firmware and boot loaders, hypervisors, operating systems, drivers, middleware, and applications. Therefore, the virtual platform accurately models the aspects of the real system that are relevant for software, such as CPU instruction sets, device registers, memory maps, interrupts, and the functionality of the different devices. On the other hand, the virtual platform is typically not concerned with modeling the detailed implementation of the hardware, such as internal buses, clocks, pipelines, and caches.
By focusing the model on the hardware–software interface and functionality it is possible to achieve good performance and produce a virtual platform very early in the product lifecycle—two critical features required to address the aforementioned challenges.
Terminology
There are many terms in use for the kind of technology that Simics represents. This section defines some of the terminology the reader may come in contact with.
Simulation is a very broad term, used in many different fields. At its core, it means that you use computer software to build a model of some phenomenon you want to study and then run this simulator to understand the behavior of the modeled system. A simulation provides more flexibility than the real system, allows parameters to be set freely, provides better insight into the internal workings, and allows for the replay and repetition of scenarios. It also fundamentally avoids the need to build physical prototypes or experiments, which speeds up development. Simulation is used in every field of science and engineering. Simulations are used to predict weather, crash-test cars, design aircraft, understand economic mechanisms, and find new medicines. This book is primarily concerned with the simulation of a digital computer system (the target) using another digital computer system (the host).
Full-system simulation (FSS) is a term commonly used to describe Simics, and it captures the fact that the simulation targets an entire target system. Originally, the point of a full system was that the digital computer hardware model was sufficiently complete to run a real operating system (Magnusson et al., 1998). Over time, it has grown in scope, and today a full system often includes factors external to the digital computer hardware, such as models of the surrounding world and inputs and outputs from the outside. It also includes the use of the simulator to model collections of digital computer systems, such as multiple machines in a network or multiple boards in a rack. A simulation that cannot simulate more than a single system-on-chip (SoC) or board is not really a FSS today.
Virtual platform is the established term in the world of electronic design automation (EDA) for a piece of software that works like a piece of hardware and is capable of running software in lieu of the real hardware. Virtual platforms are used at many levels of abstraction, from cycle-accurate models that correctly emulate all pins and signals on buses and inside devices, to programmer’s view (PV) and transaction-level models (TLMs) that essentially work like Simics does. Virtual platforms are considered to be development tools.
Emulation is a term commonly used to indicate a software layer that lets a piece of software run on a platform it was not initially targeted to run on. Well-known examples are the Mac† 68k emulator that Apple† used in the migration from the 68k-family of processors to the PowerPC† family, and the Rosetta emulator that allowed PowerPC binaries to run on Intel® Architecture in Apple’s next architectural transition. Simulators for old videogame platforms, such as the Nintendo† Entertainment System (NES), are also known as emulators to the public. We thus consider emulation in the software realm to mean something that runs software by translating binaries and operating system calls, where the primary use is to run software, not to develop it.
Virtualization in the IT world means the use of virtual machines to run multiple software loads on a single host. Virtualization as a principle traces its beginnings back to the IBM System/360 line in the 1970s, and today there is a wealth of virtualization solutions available on standard Intel hardware such as KVM, VMware†, Xen, Hyper-V, Virtualbox, and many others. A virtual machine runs a real operating system, but often employs special drivers and input/output (I/O) mechanisms...
| Erscheint lt. Verlag | 17.9.2014 |
|---|---|
| Sprache | englisch |
| Themenwelt | Mathematik / Informatik ► Informatik ► Software Entwicklung |
| Mathematik / Informatik ► Informatik ► Theorie / Studium | |
| ISBN-10 | 0-12-800813-X / 012800813X |
| ISBN-13 | 978-0-12-800813-3 / 9780128008133 |
| Informationen gemäß Produktsicherheitsverordnung (GPSR) | |
| Haben Sie eine Frage zum Produkt? |
Kopierschutz: Adobe-DRM
Adobe-DRM ist ein Kopierschutz, der das eBook vor Mißbrauch schützen soll. Dabei wird das eBook bereits beim Download auf Ihre persönliche Adobe-ID autorisiert. Lesen können Sie das eBook dann nur auf den Geräten, welche ebenfalls auf Ihre Adobe-ID registriert sind.
Details zum Adobe-DRM
Dateiformat: EPUB (Electronic Publication)
EPUB ist ein offener Standard für eBooks und eignet sich besonders zur Darstellung von Belletristik und Sachbüchern. Der Fließtext wird dynamisch an die Display- und Schriftgröße angepasst. Auch für mobile Lesegeräte ist EPUB daher gut geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen eine
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen eine
Geräteliste und zusätzliche Hinweise
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich