Professional Documents
Culture Documents
Components
Components
Computer as Components
Embedded Systems Laboratory Dept. of Computer Science & Engineering National Sun Yat-Sen University
Chapter view
CPU bus, I/O devices, and interfacing The CPU system as a framework for understanding design methodology Development environments and debugging
2
4/9/2002 The Embedded Computing System C.-F. Kao
CPU
memory CPU bus bus interface device high-speed bus low-speed bus device
intr ctrl
DMA controller
timers
bus interface
3
4/9/2002 The Embedded Computing System C.-F. Kao
Introduction
Computer platform
Microprocessors I/O devices Memory
CPU
4
4/9/2002
device
device
wire
bus
Bus protocol
enq 1 3
data
ack
Action
time
The Embedded Computing System C.-F. Kao
6
4/9/2002
Clock
provides synchronization to the bus components
R/W
true when bus is reading
Address
a n1-bit bundle
Data
a n2-bit bundle
Data ready
The Embedded Computing System C.-F. Kao
7
4/9/2002
the CPU can read/write devices or memory, bus devices of memory cannot initiate a transfer
Device 1 Device 1
CPU
memory
8
4/9/2002 The Embedded Computing System C.-F. Kao
Timing diagrams
one A rising
zero
falling
10 ns stable
changing
Timing constraint C
time
9
4/9/2002 The Embedded Computing System C.-F. Kao
10
4/9/2002 The Embedded Computing System C.-F. Kao
11
4/9/2002 The Embedded Computing System C.-F. Kao
Get data
Done
Send data
Release ack
See ack
(start here)
Address
ack
(start here)
Address
Wait
Wait
CPU
12
4/9/2002 The Embedded Computing System C.-F. Kao
Device
See ack
(start here)
Address
Burst transfer
14
4/9/2002 The Embedded Computing System C.-F. Kao
enable
tri_out
15
4/9/2002
AGNTx1 AGNTx2
ASB Arbiter
AGNTx3
Response MUX
ASB Decoder
BERROR
select
BnRES/ BCLK
BLAST
Select-1 Select-2
[31:28]
Decoder
Slave(s)
Response (wait, last, error)
I/O techniques
Programmed I/O
data are exchanged between CPU and I/O
CPU must wait until the I/O operation is complete
Interrupt-driven I/O
CPU can continues to execute other instructions
17
4/9/2002 The Embedded Computing System C.-F. Kao
Cycle stealing
Control Logic
18
4/9/2002 The Embedded Computing System C.-F. Kao
DMA
I/O
. . .
I/O
MEM
CPU
module
DMA I/O
module
DMA
MEM
I/O
I/O
(b) Single-Bus, Integrated DMA-I/O System bus CPU DMA MEM I/O bus I/O
19
4/9/2002
module
I/O
The Embedded Computing System C.-F. Kao (c) I/O bus
I/O
CPU
Master BIU
AHB/ASB BUS
Timer
Slave BIU
Decoder
20
4/9/2002
LED
Slave BIU
AMBA features
Pipelining
only AHB or ASB
Burst transfers
1, 4, 8, 16-beat transfer
Split transactions
release the current transfer
21
4/9/2002 The Embedded Computing System C.-F. Kao
CPU
Master BIU
AHB/ASB BUS
Timer
Slave BIU
Decoder
LED
Slave BIU
22
4/9/2002 The Embedded Computing System C.-F. Kao
The most basic way to characterize a memory is by its capacity A 4-Mbit memory aspect ratio :
as a 1M x 4-bit array, MAX of 2
20
different
23
4/9/2002 The Embedded Computing System C.-F. Kao
24
4/9/2002 The Embedded Computing System C.-F. Kao
SRAM
SRAM
8 8
output enable
write enable
32K x 8
Data_out
Timing diagram
CS R/W Adrs Data
Data_in
From SRAM
The Embedded Computing System C.-F. Kao
From CPU
25
4/9/2002
DRAM
15
DRAM
Data_out
CPU address bus is split into a row and a column address NO clock Refreshed
CAS-before-RAS refresh
26
4/9/2002 The Embedded Computing System C.-F. Kao
Other DRAMs
FPM DRAM
fast page mode switch (burst)
EDO DRAM
extended data out
SDRAM
synchronous DRAM
27
4/9/2002 The Embedded Computing System C.-F. Kao
Read only, cannot write any data to ROMs ROMs can store data without any power ROM size
height: n input line, consists 2 addressable
n
A ROM can encode a collection of logic functions directly from the truth table
The Embedded Computing System C.-F. Kao
28
4/9/2002
ROMs
reprogrammed
reprogramming
29
4/9/2002
Flash ROM
The Embedded Computing System C.-F. Kao
I/O devices
Timers / counters A/D and D/A converters Keyboards LEDs Displays Touchscreens
30
4/9/2002 The Embedded Computing System C.-F. Kao
Very similar:
a timer is incremented by a periodic signal
a counter is incremented by an asynchronous,
occasional signal
31
4/9/2002 The Embedded Computing System C.-F. Kao
Watchdog timer
Watchdog timer is periodically reset by system timer If watchdog is not reset, it generates an interrupt to reset the host (CPU) reset
time-out
CPU
Watchdog Timer
32
4/9/2002 The Embedded Computing System C.-F. Kao
Analog/digital (A/D) or digital/analog (D/A) converters (ADC/DAC) To interface non-digital devices to embedded systems A typical A/D interface has two major digital inputs
a data port a clock input
33
4/9/2002 The Embedded Computing System C.-F. Kao
DAC
34
4/9/2002 The Embedded Computing System C.-F. Kao
ADC
35
4/9/2002 The Embedded Computing System C.-F. Kao
Keyboards
Switch de-bouncing
Encoded keyboard
An array of switches is read by an encoder
row
36
4/9/2002 The Embedded Computing System C.-F. Kao
LEDs
+5 V
37
4/9/2002 The Embedded Computing System C.-F. Kao
Displays
38
4/9/2002 The Embedded Computing System C.-F. Kao
Touchscreens
X
39
4/9/2002 The Embedded Computing System C.-F. Kao
Push
ADC conductive sheets
voltage
spacer ball
40
4/9/2002 The Embedded Computing System C.-F. Kao
The PC as a platform
Debugging Manufacturing testing
The Embedded Computing System C.-F. Kao
41
4/9/2002
Hardware elements
CPU
bus memory I/O devices: networking, sensors, etc.
42
4/9/2002 The Embedded Computing System C.-F. Kao
programmed loop
43
4/9/2002 The Embedded Computing System C.-F. Kao
Hardware design
cross debugger:
displays target state, allows target system to be controlled.
44
4/9/2002
Evaluation board
45
4/9/2002 The Embedded Computing System C.-F. Kao
The PC as a platform
Advantages:
cheap and easy to get
rich and familiar software environment
Disadvantages:
requires a lot of hardware resources not well-adapted to real-time high power consumption
46
4/9/2002 The Embedded Computing System C.-F. Kao
CPU
memory CPU bus bus interface device high-speed bus low-speed bus device
intr ctrl
DMA controller
timers
bus interface
47
4/9/2002 The Embedded Computing System C.-F. Kao
Typical busses
standard.
48
4/9/2002 The Embedded Computing System C.-F. Kao
Software elements
BIOS has become a generic term for the lowestlevel system software
49
4/9/2002 The Embedded Computing System C.-F. Kao
Challenges:
target system may be hard to observe
target may be hard to control may be hard to generate realistic inputs setup sequence may be complex
50
4/9/2002 The Embedded Computing System C.-F. Kao
Software debuggers
A monitor program residing on the target provides basic debugger functions Debugger should have a minimal footprint in memory User program must be careful not to destroy debugger program, but , should be able to recover from some damage caused by user code
51
4/9/2002 The Embedded Computing System C.-F. Kao
Breakpoints
A breakpoint allows the user to stop execution, examine system state, and change state Replace the breakpointed instruction with a subroutine call to the monitor program
52
4/9/2002 The Embedded Computing System C.-F. Kao
ARM breakpoints
uninstrumented code
53
4/9/2002 The Embedded Computing System C.-F. Kao
Save registers Allow user to examine machine Before returning, restore system state
safest way to execute the instruction is to replace
it and execute in place put another breakpoint after the replaced breakpoint to allow restoring the original breakpoint (pp. 222-223)
54
4/9/2002 The Embedded Computing System C.-F. Kao
In-circuit emulators
A microprocessor in-circuit emulator is a specially-instrumented microprocessor Allows you to stop execution, examine CPU state, modify registers
55
4/9/2002 The Embedded Computing System C.-F. Kao
Logic analyzers
56
4/9/2002 The Embedded Computing System C.-F. Kao
Manufacturing testing
Goal: ensure that manufacturing produces defect-free copies of the design Can test by comparing unit being tested to the expected behavior
but running tests is expensive
57
4/9/2002 The Embedded Computing System C.-F. Kao
Testing concepts
58
4/9/2002 The Embedded Computing System C.-F. Kao
Faults
Manufacturing problems can be caused by many thing Fault model: model that predicts effects of a particular type of fault Fault coverage: proportion of possible faults found by a set of test
having a fault model allows us to determine fault
coverage
59
4/9/2002 The Embedded Computing System C.-F. Kao
60
4/9/2002 The Embedded Computing System C.-F. Kao
01
61
4/9/2002 The Embedded Computing System C.-F. Kao
Combinational testing
Every gate can be stuck-at-0, stuck-at-1 Usually test for single stuck-at-faults
one fault at a time multiple faults can mask each other
62
4/9/2002 The Embedded Computing System C.-F. Kao
Sequential testing
every cycle fault behavior on one cycle can be masked by same fault on other cycles
63
4/9/2002 The Embedded Computing System C.-F. Kao
Scan chains
64
4/9/2002 The Embedded Computing System C.-F. Kao
Input pin
Scan output
EXTEST INTEST
SEL
MUX
scan
SEL
MUX
Shift clock
BSR
Update clock
PDR
Scan input
65
4/9/2002 The Embedded Computing System C.-F. Kao
Boundary scan
System interconnect
Embedded ICE
Microprocessor Core
mode external debug clock
address
data
Interface
breakpoint
ICE
BDU
Bypass Register
MUX
TDO
TDI
TMS TCK
67
4/9/2002
TAP Controller