Phillip Stanley-Marbell
Foundations of Embedded Systems
Department of Engineering, University of Cambridge
http://physcomp.eng.cam.ac.uk
Fascicle 00: Sunflower Embedded System Emulator
(~30 minutes)
Version 0.2020
(Video)
14
Intended Learning Outcomes for This Tutorial
2
By the end of this session, you will be able to:
14
Intended Learning Outcomes for This Tutorial
2
By the end of this session, you will be able to:
Compile a program for execution on Sunflower’s SuperH and RISC-V processor cores
14
Intended Learning Outcomes for This Tutorial
2
By the end of this session, you will be able to:
Load a program into Sunflower, run it, and probe architectural state
Compile a program for execution on Sunflower’s SuperH and RISC-V processor cores
14
Intended Learning Outcomes for This Tutorial
2
Quantify the number of instructions executed in your program
By the end of this session, you will be able to:
Load a program into Sunflower, run it, and probe architectural state
Compile a program for execution on Sunflower’s SuperH and RISC-V processor cores
14
Intended Learning Outcomes for This Tutorial
2
Quantify the number of instructions executed in your program
By the end of this session, you will be able to:
Load a program into Sunflower, run it, and probe architectural state
Observe the effect of different cache configurations on performance (SuperH core)
Compile a program for execution on Sunflower’s SuperH and RISC-V processor cores
14
3
Mainframes (e.g., IBM
704): Predominantly batch
processing, batch I/O
Minicomputers (e.g.,
PDP-1): Timesharing,
interactive I/O
Personal Computers,
workstations,
servers: Interactive and
networked I/O, power and
thermal concerns
Networked Embedded
Computing Systems:
Real-time interactive I/O with
analog signals in environment,
networked, often battery
powered.
Trajectory of computing system architectures
I/O to memory,
disk, (display)
Computation
I/O to network
I/O to memory,
disk, display
Computation
Intermittent (soft)
errors and failures
Power
consumption
Thermals
I/O to network
I/O to memory,
disk, display
Computation
Real-time I/O to
sensors
Battery lifetime
Intermittent (soft)
errors and failures
Power
consumption
Thermals
Input / Output to
network
I/O to memory, disk,
display
Computation
System interactions relevant to performance
Trajectory of Computing System Architectures (Time)
Relevant Evaluation Criteria (Categories)
14
3
Mainframes (e.g., IBM
704): Predominantly batch
processing, batch I/O
Minicomputers (e.g.,
PDP-1): Timesharing,
interactive I/O
Personal Computers,
workstations,
servers: Interactive and
networked I/O, power and
thermal concerns
Networked Embedded
Computing Systems:
Real-time interactive I/O with
analog signals in environment,
networked, often battery
powered.
Trajectory of computing system architectures
I/O to memory,
disk, (display)
Computation
I/O to network
I/O to memory,
disk, display
Computation
Intermittent (soft)
errors and failures
Power
consumption
Thermals
I/O to network
I/O to memory,
disk, display
Computation
Real-time I/O to
sensors
Battery lifetime
Intermittent (soft)
errors and failures
Power
consumption
Thermals
Input / Output to
network
I/O to memory, disk,
display
Computation
System interactions relevant to performance
Trajectory of Computing System Architectures (Time)
Relevant Evaluation Criteria (Categories)
14
3
Mainframes (e.g., IBM
704): Predominantly batch
processing, batch I/O
Minicomputers (e.g.,
PDP-1): Timesharing,
interactive I/O
Personal Computers,
workstations,
servers: Interactive and
networked I/O, power and
thermal concerns
Networked Embedded
Computing Systems:
Real-time interactive I/O with
analog signals in environment,
networked, often battery
powered.
Trajectory of computing system architectures
I/O to memory,
disk, (display)
Computation
I/O to network
I/O to memory,
disk, display
Computation
Intermittent (soft)
errors and failures
Power
consumption
Thermals
I/O to network
I/O to memory,
disk, display
Computation
Real-time I/O to
sensors
Battery lifetime
Intermittent (soft)
errors and failures
Power
consumption
Thermals
Input / Output to
network
I/O to memory, disk,
display
Computation
System interactions relevant to performance
Trajectory of Computing System Architectures (Time)
Relevant Evaluation Criteria (Categories)
14
3
Mainframes (e.g., IBM
704): Predominantly batch
processing, batch I/O
Minicomputers (e.g.,
PDP-1): Timesharing,
interactive I/O
Personal Computers,
workstations,
servers: Interactive and
networked I/O, power and
thermal concerns
Networked Embedded
Computing Systems:
Real-time interactive I/O with
analog signals in environment,
networked, often battery
powered.
Trajectory of computing system architectures
I/O to memory,
disk, (display)
Computation
I/O to network
I/O to memory,
disk, display
Computation
Intermittent (soft)
errors and failures
Power
consumption
Thermals
I/O to network
I/O to memory,
disk, display
Computation
Real-time I/O to
sensors
Battery lifetime
Intermittent (soft)
errors and failures
Power
consumption
Thermals
Input / Output to
network
I/O to memory, disk,
display
Computation
System interactions relevant to performance
Trajectory of Computing System Architectures (Time)
Relevant Evaluation Criteria (Categories)
14
3
Mainframes (e.g., IBM
704): Predominantly batch
processing, batch I/O
Minicomputers (e.g.,
PDP-1): Timesharing,
interactive I/O
Personal Computers,
workstations,
servers: Interactive and
networked I/O, power and
thermal concerns
Networked Embedded
Computing Systems:
Real-time interactive I/O with
analog signals in environment,
networked, often battery
powered.
Trajectory of computing system architectures
I/O to memory,
disk, (display)
Computation
I/O to network
I/O to memory,
disk, display
Computation
Intermittent (soft)
errors and failures
Power
consumption
Thermals
I/O to network
I/O to memory,
disk, display
Computation
Real-time I/O to
sensors
Battery lifetime
Intermittent (soft)
errors and failures
Power
consumption
Thermals
Input / Output to
network
I/O to memory, disk,
display
Computation
System interactions relevant to performance
Trajectory of Computing System Architectures (Time)
Relevant Evaluation Criteria (Categories)
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
0
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
0
Analog Sensors
Microarchitecture
Simulation
Network
Interfaces
Power EstimationPower Estimation
Voltage Regulator Model
Battery Model
Failure Modeling
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
0
Analog Sensors
Microarchitecture
Simulation
Network
Interfaces
Power EstimationPower Estimation
Voltage Regulator Model
Battery Model
Failure Modeling
Analog
signal 1
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
0
Analog Sensors
Microarchitecture
Simulation
Network
Interfaces
Power EstimationPower Estimation
Voltage Regulator Model
Battery Model
Failure Modeling
Analog
signal 1
Network
Medium 1
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
0
Analog Sensors
Microarchitecture
Simulation
Network
Interfaces
Power EstimationPower Estimation
Voltage Regulator Model
Battery Model
Failure Modeling
Analog
signal 1
Network
Medium 1
Failure Modeling
Signal Propagation
Model
Data Transmission
Model
14
Sunflower Emulates Many Components of a Sensor-Driven System
4
14
Processor Cores and Commands in Sunflower
5
14
Processor Cores and Commands in Sunflower
5
newnode
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
14
Processor Cores and Commands in Sunflower
5
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
Additional commands: Connect a battery, setup a network, add a cache of given configuration, etc.
14
6
14
6
14
Compiling a Program for Sunflower (SuperH Core)
7
14
Compiling a Program for Sunflower (SuperH Core)
7
14
Running a Program and Probing Architectural State
8
14
Running a Program and Probing Architectural State
8
newnode
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
bpt
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
bpt
Set a breakpoint
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
bpt
Set a breakpoint
bptls
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
bpt
Set a breakpoint
bptls
List the breakpoints
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
bpt
Set a breakpoint
bptls
List the breakpoints
bptdel
14
Running a Program and Probing Architectural State
8
newnode
Create a new processor instance (think of this as an inchoate embedded system)
sizemem
Connect/resize memory for the processor
srecl
Load an S-record format binary into the processor
run
Mark this embedded system as runnable; If you have multiple, can mark subset as runnable
on
Turn on the simulator to start running all embedded systems marked as runnable
dumpregs
Display contents of registers
ni
Display number of instructions executed
showclock
Display number of emulated clock cycles elapsed
showpipe
Enable showing pipeline stages while simulating processor (different from dumpipe)
dumpipe
Show current contents of pipeline
bpt
Set a breakpoint
bptls
List the breakpoints
bptdel
Delete a breakpoint
14
9
14
9
14
Probing Microarchitectural State (SuperH)
10
14
Probing Microarchitectural State (SuperH)
10
cacheinit
14
Probing Microarchitectural State (SuperH)
10
cacheinit
Instantiate a cache man cacheinit (at Sunflower prompt) for more information
14
Probing Microarchitectural State (SuperH)
10
cacheinit
Instantiate a cache man cacheinit (at Sunflower prompt) for more information
cachestats
14
Probing Microarchitectural State (SuperH)
10
cacheinit
Instantiate a cache man cacheinit (at Sunflower prompt) for more information
cachestats
Get cache statistics
14
11
14
11
14
Probing Microarchitectural State and Instruction Statistics (RISC-V)
12
(Demo)
14
Probing Microarchitectural State and Instruction Statistics (RISC-V)
12
(Demo)
Browse through the Sunflower Embedded System Emulator Manual.
Further Reading:
14
Things to Do
13
Complete a “muddiest point” 2-question survey using this link
14
Things to Do
13
Complete a “muddiest point” 2-question survey using this link
Browse through the Sunflower Embedded System Emulator Manual.
14
14