Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Welcome
Phone
Server
Network
IP Phone
PC
Internet
4
Simics/Phone
Simics/Phone
Simics/Phone
Simics/Server
Simics
Simics
Sim Network
Simics
Simics/PC
Simics
Simics/IP Phone
IP
Simics
Simics
5
Applications
RTOS
RTOS
HW Model
Hardware model
Simics/Phone
Simics/Phone
Simics/Phone
Simics/Server
Simics
Simics
Sim Network
Behavioral
simulation of
function
Simics
Simics/PC
Simics
Simics/IP Phone
IP
Simics
Simics
6
Expensive
Unwieldy environment for debugging
Not available early enough
Often, not every developer can have a test bed
Virtutech Simics
Virtualized Software Development
Simulates the system under development and its
immediate environment
Runs entire software image unchanged
Model peripheral devices
Customizable
Cheaper
Programmer-friendly
Scriptable & controllable
Available earlier
Runs binaries
from real target
User program
Server
Complete
production
software
Simulated
hardware
DB
Middleware
Operating system
Firmware
Drivers
CPU
CPU
Bus
PCI
RAM
I2C
ROM
Disk
Disk Ctrl
FLASH
Hardware
9
Network
LCD
ASIC
net
Complete Virtualization
All
All software:
software: arbitrary
arbitrary &
&
unmodified.
unmodified. Same
Same as
as on
on aa
real
real system.
system.
User program
Arbitrary;
Arbitrary; currently
currently supports
supports
Alpha,
Alpha, ARM,
ARM, IA64,
IA64, 32/64
32/64 bit
bit
x86,
x86, 32/64
32/64 bit
bit Sparc,
Sparc,
32/64
32/64 bit
bit MIPS,
MIPS, 32/64
32/64 bit
bit
PowerPC,
PowerPC, TI
TI C6400,
C6400, msp430
msp430
Simics
Linux,
Linux, Solaris,
Solaris,
Windows
Windows
PC
PC (32(32- &
& 64-bit)
64-bit)
or
or Sparc
Sparc
10
Getting Started
12
13
Or wait to be
automatically
logged-in as user
14
15
16
17
Starting Simics
Starting Simics
On Linux, Simics is a command-line app
Simics exposes a sophisticated commandline interface
And graphical or text windows for the displays
and serial ports of the target systems
19
Starting Simics
Linux command-line
Will be prefixed host$ in the following slides
What you type is going to be bold
So we do the following:
host$ cd simics-workspace
host$ ./simics target/ebony/ebony-linux-firststeps.simics
20
Target console,
output from
target machine
appears here
Simics prompt,
also called the
Simics console
21
Programs
Complete and unmodified
Linux
PowerPC 440
Simics
console
Simics
Host
Host
operating
OS: Linux
system
Host
Host:
hardware
PC
22
Simics Workspaces
Based on the eclipse concept
Provides a base location for:
checkpoints
machine configuration files
locally built simics modules
scripts
Structure of Workspace
simics-workspace/
modules/ -- stores user-developed hardware models
simpledma/ -- simple DMA controller
25
26
27
30
31
32
Use here:
host$ cd simics-workspace/
host$ compile-for-linux targets/ebony/helloworld-440
33
36
Network Simulation
Target System
Regular Linux
networking API for
the applications
Application
Application
Linux 2.4
Linux 2.6
Simics
Ethernet Link
Simulation
Simics
39
Dual-core e600
machine from
Freescale
40
Console on Ebony
Application
Application
Linux 2.4
Linux 2.6
Simics
Ethernet Link
Simulation
Console on
ArgoNavis
Simics
41
Take a Checkpoint
This boot took some time
Save the outcome as a checkpoint for later
reference and instant reboot
simics> write-configuration netbooted.ckpt
43
44
Application
Linux 2.4
Linux 2.6
10.10.0.50
10.10.0.40
Simics
Ethernet Link
Simulation
Simics
NAT
router
Simics
10.10.0.1
Host Linux
Host PC (VmWare)
46
Telnet
Quit Simics
simics> exit
47
targets/network/receiverserver.c
Simple daemon program
Waits for connections from sender, prints the
received string on the console
Argument: port to listen on
49
50
Start simulation
simics> c
51
Unmount /host to
maintain determinism in
the simulation. Typical
way things are done with
simicsfs.
argo$ cp /host/receiverserver .
argo$ ./receiverserver
argo$ ls -l
argo$ umount /host
simics> ctrl-C
simics> write-configuration netswloaded.ckpt
52
Try Programs
Argo navis: start receiver:
argo$ ./receiverserver 4000 &
argo$ ps
53
55
Single-Step Program
Watch the network traffic as we go
simics> link0.log-level 3
Single-step on Ebony
Note that argo is also stopped
simics> next
A few times to see when packets start flying
And to see the message displayed on argo
Lets Do It in Reverse
Stop Simics, enable backwards debugging
simics> set-bookmark start
simics> list-bookmarks
simics> c
ebony$ ./sender 10.10.0.40 4000 test reverse
...
simics> next
Until message has been delivered, and then
simics> rnext
To step backwards in the program execution
Notice that output disappears on argo
59
Free-Run Reverse
Stop Simics catching magic breakpoint and
reverse execution
simics> magic-break-disable
simics> reverse
63
A Machine with No OS
Target: targets/ppc-simple
Only a PPC603e CPU, memory, and serial-port
Device Modeling
We will add a simple DMA controller to ppcsimple and do a polled device driver for it
68
69
Fast
CPU Models
DML
User
Interface
Simulation
Infrastructure
Event Queue
Debug Features
Interface to 3rd Party Tools
70
Device Modeling
Language
Simics Architecture
Programs
Target Operating System
Processors
Standard Devices
Networks
Custom Devices
Simics Core
Multiprocessor
Checkpointing
Advanced
Breakpoints
Proven API
Configuration
Multiple
Machines
Determinism
Virtual Memory
Events
32/64-bit
Handling
Distribution
Visibility
Scalability
Virtual Time
Endianness
Handling
Profiling
Tracing
Timing Models
Real Network
Debugging
Fault Injection
Test Harnesses
Reverse Execution
Simics
71
Simics Architecture
Provided by
Virtutech
Added by Virtutech,
user, or third party
consultant
Programs
Target Operating System
Processors
Standard Devices
Networks
Custom Devices
Simics Core
Multiprocessor
Checkpointing
Advanced
Breakpoints
Proven API
Configuration
Multiple
Machines
Determinism
Virtual Memory
Events
32/64-bit
Handling
Distribution
Visibility
Scalability
Virtual Time
Endianness
Handling
Profiling
Tracing
Timing Models
Real Network
Debugging
Fault Injection
Test Harnesses
Reverse Execution
Simics
72
What is DML?
A simple declarative language for modeling
devices
So What is Modeled?
To start DMA:
DMA_control.SWT <- 0
DMA_source & DMA_dest updated
75
76
Statements
Terminate with a semi-colon
Literals
C style
Integers: 123 and 0b11110101 and 0x5ab3
Floating-point: 3.1415 and 6.6e-11
Strings: "hello world"
Booleans: true or false
77
78
79
Driver Software
The file targets/ppc-simple/dmadriver.c
Compile using compile-for-no-os script
host$ compile-for-no-os targets/ppc-simple/dmadriver
80
81
Processor
Memory access
Simics
Core
read()
implements
write()
connect
get()
connect
implements
get or set
attributes
CLI or Python
Script
set()
Device
Checkpointing
Register
Device
Simics
83
84
85
Memory contents of
destination before
copying using DMA
86
87
88
Thats It!
Summary
Simics models runs the real software
Single & multiple boards and processors
Models can be extended with new devices
Used as an alternative to physical hardware
What Now?
Feel free to play around with Simics using
the tools we have seen today
If you want to keep playing with Simics,
copy the VmWare player image you used
It is about 2GB in size, fits on a large USB stick
License is valid for about one more week
device simple_dma;
Declare the name of the class of the device
Multiple objects of the same class can be used
constant time_per_byte=...;
Declare symbolic constants for use in the code
94
field EN[31]
A single-bit field inside the register
We use little-endian bit order here, i.e the usual way with the leastsignificant bit being bit zero
PowerPC-attached devices often use big-endian bit numbering
since that is IBM standard
By default, registers and fields store values written
field TS[15:0]
16-bit field
method write(value) {
Called when the register is written to
Counterpoint is method read()->(value)
$this = value
Store value written as the value of the register
97
inline $complete_delay_ev.post(...)
post function is automatically generated for event
Post an event to complete the DMA operation later
Time computed from number of words to transfer
event complete_delay_ev {
Declares the event used to delay completion of the
DMA operation
method event(data) {
Called when event triggers, i.e. DMA is to complete
98
Remember!
Enter the evaluation form and be a part of making redev even better.
You will automatically be part of the evening lottery
100