Upload
lavaeee
View
223
Download
0
Embed Size (px)
Citation preview
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 1/18
Bubble Diagram Stratification
Rob ChapmanV1.4
March 30, 2006
Context Diagram Big Picture
Data Flow Diagrams
State Machine
Flow Chart
X DiagramMemory Map
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 2/18
This document describes a project annotation methodology which has evolved
from experience with all phases of many different projects. It is meant as a
central tool for documenting, brainstorming and describing projects from start to
finish and throughout the maintenance phase. The target audience is meant to be
all individuals involved in a project starting from project genesis with project
planners including managers and marketing people on through project builders
including designers, programmers, and technicians.
Copyright TimbreWorks Engineering 2000-2006
This work is licensed under a Creative Commons Attribution-NoDerivs 2.5
License.
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 3/18
Table of Contents
A. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Symbols
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Design Tips
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
General Notes
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
B. Summary of Stratification. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Context Diagram
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Big Picture
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Data Flows Diagrams
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
State Diagrams
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Flow Charts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
X-Diagrams
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Data Diagrams
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Memory Maps
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
C. Example Design: Super Cool Oven . . . . . . . . . . . . . . . . . . . . . . . . . 7
Context Diagram 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Big Picture 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Data Flow Diagram 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Data Flow Diagram 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
State Diagram 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
D. Other Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Memory Map 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Memory Map 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Flow Chart 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
State Diagram 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Data Flow Diagram 3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Data Diagram 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
X Diagram 1
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Context Diagram and Big Picture Together
. . . . . . . . . . . . . . . . . . . . . . . . . . 16
E. Prototypes for Bubble diagramming . . . . . . . . . . . . . . . . . . . . . . . . 17
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 4/18
3
A. Introduction
Design documentation is most easily captured in a hierarchy of 2-dimensional
bubble and line diagramming strategies left over from the last millennium
including:
• Context Diagram (CD)• Big Picture (BP)
• Data flow Diagrams (DFD)
• State Diagrams (SD)
• Flowcharts (FC)
• X-Diagrams (XD)
• Data Diagrams (DD)
• Memory Maps (MM)
This stratification document describes and organizes these visual documentationtools in a methodology that may be used to enhance your ability to document
projects and designs. Not all projects will use all tools and not all tools are for all
projects. The size and complexity of a project will dictate the choice of tools
employed to lay out and describe the framework of the project and its factored
components. At some point, the diagram is implemented directly in the
programming language for the target or as a hardware description.
The highest level diagram, the Context Diagram
, is useful for communicating
outside of the engineering realm and serves as the first stake in the ground or the
anchor point for the design and product. It should change, if ever, rarely. The design
details are in the different sub-diagrams.
The Big Picture
is the next level “down” in the diagram hierarchy. It is used as a
focal point for all engineering designs, including hardware and software. The
sources and sinks are listed explicitly and if there is a storage or process relevant to
this level, it is shown as well. In a simple design, this can sometimes be the same as
the Context Diagram.
The next level includes a breakdown of the data flow using data flow diagrams
.This relates the data that is stored and moved in the design. The processes involved
can be related through state diagrams
, further sub-diagrams or with a flow chart
.
Memory maps
and data diagrams
can be used to describe the storage elements
and data flows. X diagrams
can be used to describe interactive data flows or
protocol scenarios between entities.
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 5/18
4
Symbols
This table lists some of the more common notational graphic elements and their
uses.
Design Tips
• apply proper layering and factoring (hierarchy and modularity)• sources and sinks in lower diagrams should be accounted for in the big picture
• stores are introduced at the layer they are shared
• factor with the proper level of detail
General Notes
• diagrams span software and hardware boundaries
Symbol Used In Used for
DFD
a
a. Note: CD and BP are simple DFDs.
an external source or sink of data flow
FC an action
DFD where data flow is stored
DFD where data flows are processed and created
FC start/entry and end/exit point
DFD flow of data from one of the above to one of the above
SD used to represent a state of context in a state diagram
SD represents the transitions in a state diagram
FC shows sequence of actions and decisions
FCa decision point in a flow chart where one of manypaths is taken
DFD can be used to indicate timing
source/
sink
store
process
flow
s tate
transition
decision
250 ms
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 6/18
5
B. Summary of Stratification
The diagrams are briefly summarized here:
Context Diagram
• highest level diagram
• just sources, sinks and a thing
• should never change
• not hardware/software specific
• effective for interacting with non-technical personal – not everyone is an
engineer
Big Picture
• next level down
• detailed sources and sinks
• can include high level storage
• not hardware/software specific
• highest full technical level
Data Flows Diagrams
• connections and processing of data flow between sources, sinks and storage
• show the connections and where the data will flow; direction also
• task bubbles can become state diagrams or click into another data flow diagram
• flows always start and end at a source, sink or store
• mappable to code; code should reflect the diagram structure
o
good tool for reverse engineering as well
• 3 different items: sinks/stores, process, storage
State Diagrams
• effective for showing complex control
• control under different conditions
• bubbles and lines showing events causing change of state
• states of flows
• should include idle state
• mappable to code; code should reflect the diagram structure
• use mealy/moore for shorthand or SDLs for multi-page documentation
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 7/18
6
Flow Charts
• for diagramming complex algorithms
• more of a low level tool to help document code sequences but not overall
program structure
• not required if code is factored into simple enough pieces
• maps well to the serial programming model prevalent in software design unlikehardware which is widely parallel
X-Diagrams
• for documenting protocol exchanges
• left and right angled down labeled arrows represent protocol unit exchanges
Data Diagrams
• boxes and lines can be used to detail complex data structures such as records• protocol data units
• relative placement of boxes indicates relationships in storage
Memory Maps
• used to show regions or blocks of memory relevant to a program
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 8/18
7
C. Example Design: Super Cool Oven
As an example of a design, we will design a device about the size of a microwave
that heats as well as cools. We will use thermal actuators to realize a thermal profile.
The heating is from a coil heater and goes up to 500
°
C. The cooling is from a
metered, fan blown liquid nitrogen nozzle which takes it down to -200
°
C.
Context Diagram 1
Design starts at the beginning with a context diagram.This is the highest level of the
design, the most often drawn diagram and the best understood by all disciplines
involved in any product discussion. The context diagram at its simplest and highest
level consists of a central machine connected to various sources and sinks.
Figure 1: Context diagram for Super Cool Oven showing the relevant external sinks and
sources that are connected to the design. It is common practice to lump comment elementstogether such as lights, LEDs, LCDs as just Display to simplify the diagram.
Big Picture 1
Clicking into the context diagram to add more detail, is the top level diagram of all
the other diagrams or, the Big Picture.This gives an engineering context and lists all
the relevant high level components in the design. Most of the time this is a further
breakdown of the external components of the context diagram and the possiblefactoring of the one machine into more than one machine, or the possible inclusion
of a high level storage device.
Thermal
ActuatorsSensors
Keypad Display
uper Cool
Oven
Alarm
PrinterRemote
Computer
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 9/18
8
Figure 2: The Big Picture for the Super Cool Oven design giving an engineering context anddetail.
Data Flow Diagram 1
The next level of factoring will be showing the highest level of data flow between
different sources and sinks. The Big Picture, clicks into a multitude of data flow
diagrams.
Figure 3: Data flow diagram for temperature from sensors to visual display and internalrepresentation
This data flow diagram reads in values from two different sensors, converts the
digital values to an analog temperatures for internal use and displays the
Cool
Heater
Fan
SampleSensor
Chamber
SensorDoor
Sensor
Keypad
LCD
Display
ChamberTemp
SampleTemp
PrinterComputer
Port
IndicatorLights
Super Cool
Oven
Audible
Alarm
Sample
Sensor
Chamber
Sensor
Chamber
Temp
Display
Sample
Temp
Display
Read and
display
current
temperatures
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 10/18
9
temperatures. A more detailed diagram showing some timing and factoring can be
seen in Figure 4
. The timing value is an optional feature added for convenience.
Figure 4: Detailed data flow from temperature sensors to display.
Data Flow Diagram 2
Figure 5: The data flow diagram for the keypad input.
The state diagram describes the different states that need to be defined for proper
keypad entry, and key repeating for the state diagram Scan Keypad in the DFD.
Sensor
A/Dmachine
sensor reading
convert
machine
temperature
Displayshower
machine
567 ms
~333ms
300 ms
345 ms
alarms
Alarm
keypadScan
Keypad
key repeats
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 11/18
10
State Diagram 1
Figure 6: Bubbles represent stable states while the lines represent a transition. Only onestate is active at a time.
Keypad
wait for a
while
key hit
debounce
timeout
key not hit
wait for
release
key hit
key not hit
repeat
t imeout
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 12/18
11
D. Other Examples
These are a collection of examples for the other diagramming tools.
Memory Map 1
This diagram shows the relationship between the memory addresses, memory
components and areas of memory where things map to:
External
Memory
Registers
Internal
RAM 8K
Internal
Flash
128K
0
0x0080.0000
0x00C0.0000
0x0001.FFFF
0x0080.1FFF
0x8000.0000
0xFFFF.FFFF
boot loader
MaxForth or
Application0x0000.4000
serial loader
ports
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 13/18
12
Memory Map 2
This one shows a more complex relationship with overlaid memory regions:
Flow Chart 1
This is a simple algorithm for using an analog to digital converter documented using
a flow chart. It shows the PCC
1
loop quite plainly:
1. Program counter capture (PCC) loops are where the program flow becomes mired in one spot of the program
waiting on a slower device.
MaxRTOS
CRF
Application
Flash
128K Bytes
BatRAM
32K Bytes
Static RAM
32K Bytes
16K programwindow
page
MaxForth
registers
peripherals 400
64K memory
space0
1
8 0
8 1
8 2
8 7
Page 87FFF
00 0
00 0
000
4K EEPROM
1000
get A/D
reading
initialize
A/D
request
channel 0
channel
0?not yet
display
reading
Done.
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 14/18
13
State Diagram 2
This state diagram is for the user interface on a handheld unit with a 2 line LCD and
a few labeled keys. The state bubbles are the actual LCD messages displayed in that
state and the key presses map to the transitions.
Data Flow Diagram 3
This is style of DFD is used to describe a protocol stack or a layered communication
architecture. It uses hierarchy to indicate layers of an overall system and the
communication paths that exist within that system and possibly other systems. In
2 second delay
startup
CalibrateClear
Clear
End
Load
Calibrate
Calibrate
Calibrate
Cancel
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 15/18
14
this example for SFAP (Small Frame Asynchronous Protocol1), the C programming
interface is added to the diagram beside the flows.
Data Diagram 1
This data diagram shows the relationships between data elements in an SFAP frame
1. http://www.ee.ualberta.ca/~rchapman/Cmpe401/pdfs/sfap.pdf
conversation
layer
SFAP layer
serial layer
SC1
send_payload()
tx_type()
t x ( )
SC1DRL
SC1SR1
SC1DRL
SC1SR1
sfap_query()
get_frame()
rx_query()
rx( )
encryption
layer
SFAP layer
serial layer
SC1
Sending communication stack Receiving communicat ion stack
sync length rest of bytes check-byteFAP frame 1st byte
packet
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 16/18
15
X Diagram 1
This X diagram example shows the exchange of secure packets and
acknowledgements in SFAP between two peers. Time flows down and peer one is
on the left while peer two is on the right. Actions taken by the peer are listed.
process, Ack and goto Packet 2 wait
packet 1
Ack
process, ack and goto Packet 1 wait
packet 2
Ack
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 17/18
16
Context Diagram and Big Picture Together
Sometimes it is useful to merge diagrams together as in this case of a seismic
instrument, although probably more difficult to maintain:
Microphone
Battery
Timebase
Computer
Printer
Display
Seismograph
Charge
Seismicdata
Acousticdata
Timeevent
Report
Key
Displayinfo
Request
Record
Geophone
Data Capture
Data Display
Data Transfer
Life Monitor
Keypanel
8/7/2019 Bubble Diagram Stratification
http://slidepdf.com/reader/full/bubble-diagram-stratification 18/18
Source or Sink
Process
State
Store
Decision
time
E. Prototypes for Bubble diagrammingCopy these into your document or use your diagramming tool to
create them and use them to build up your bubble diagrams.