Вы находитесь на странице: 1из 18

Bubble Diagram Stratification

Context Diagram Big Picture

Flow Chart
Data Flow Diagrams

Memory Map
State Machine X Diagram

Rob Chapman
V1.4
March 30, 2006


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.
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
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 documentation
tools 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.

3
Symbols
This table lists some of the more common notational graphic elements and their
uses.

Symbol Used In Used for

DFDa an external source or sink of data flow


source/
sink
FC an action

store DFD where data flow is stored

DFD where data flows are processed and created

process
FC start/entry and end/exit point

flow DFD flow of data from one of the above to one of the above

state SD used to represent a state of context in a state diagram

SD represents the transitions in a state diagram


transition
FC shows sequence of actions and decisions

a decision point in a flow chart where one of many


decision FC
paths is taken

250 ms DFD can be used to indicate timing

a. Note: CD and BP are simple DFDs.

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

4
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
5
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 unlike
hardware 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

6
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.

Keypad Display Alarm

uper Cool Thermal


Sensors
Oven Actuators

Remote
Printer
Computer

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 elements
together 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 possible
factoring of the one machine into more than one machine, or the possible inclusion
of a high level storage device.

7
Sample Chamber Indicator
Audible
Temp Temp Lights
Alarm
LCD
Display
Cool
Keypad
Super Cool
Oven
Heater
Sample
Sensor
Fan

Chamber
Sensor
Door Computer
Printer
Sensor Port

Figure 2: The Big Picture for the Super Cool Oven design giving an engineering context and
detail.

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.

Chamber
Chamber Temp
Sensor Display
Read and
display
Sample Sample
Sensor Temp
Display

current
temperatures

Figure 3: Data flow diagram for temperature from sensors to visual display and internal
representation

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

8
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.

Sensor

A/D
~333ms
machine

sensor reading

345 ms
convert
machine
567 ms

alarms

Alarm temperature

shower
Display 300 ms
machine

Figure 4: Detailed data flow from temperature sensors to display.

Data Flow Diagram 2

Scan
keypad
Keypad

key repeats

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.
9
State Diagram 1

wait for a
while
key hit

debounce
timeout
Keypad key not hit

key hit

key not hit

wait for
release

repeat
timeout

Figure 6: Bubbles represent stable states while the lines represent a transition. Only one
state is active at a time.

10
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:

0xFFFF.FFFF
External
Memory

0x8000.0000

Registers

ports
0x00C0.0000
0x0080.1FFF
Internal
RAM 8K serial loader
0x0080.0000
0x0001.FFFF
Internal
MaxForth or
Flash
Application
128K
0x0000.4000
boot loader
0

11
Memory Map 2
This one shows a more complex relationship with overlaid memory regions:

MaxForth 87

Flash 82
128K Bytes 8 1

80
CRF
Application
BatRAM 1 64K memory
MaxRTOS 32K Bytes 0 space
FFF
Page 87
000
16K program page
000 window
Static RAM 4K EEPROM
peripherals 400 1000
32K Bytes
registers 000

Flow Chart 1
This is a simple algorithm for using an analog to digital converter documented using
a flow chart. It shows the PCC1 loop quite plainly:

get A/D
reading

initialize
A/D

request
channel 0

channel not yet


0?

display
reading

Done.

1. Program counter capture (PCC) loops are where the program flow becomes mired in one spot of the program
waiting on a slower device. 12
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.

startup




2 second delay Cancel




Clear Calibrate

 
 

Clear Calibrate

 


End Calibrate
Load



Calibrate

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

13
this example for SFAP (Small Frame Asynchronous Protocol1), the C programming
interface is added to the diagram beside the flows.

conversation encryption
layer layer
sfap_query()
send_payload()
get_frame()

SFAP layer SFAP layer

tx_type() rx_query()
tx() rx()
serial layer serial layer
SC1DRL SC1DRL
SC1SR1 SC1SR1

SC1 SC1

Sending communication stack Receiving communication stack

Data Diagram 1
This data diagram shows the relationships between data elements in an SFAP frame.

packet

FAP frame sync length 1st byte rest of bytes check-byte

1. http://www.ee.ualberta.ca/~rchapman/Cmpe401/pdfs/sfap.pdf 14
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.
packet 1

process, Ack and goto Packet 2 wait

Ack

packet 2

process, ack and goto Packet 1 wait

Ack

15
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:
Data Capture

Microphone Geophone
Display

Display
Acoustic Seismic info
data data

Key
Time Keypanel
Timebase event Seismograph

Report

Charge
Record
Printer
Request

Data Display
Battery

Computer
Life Monitor

Data Transfer

16
E. Prototypes for Bubble diagramming
Copy these into your document or use your diagramming tool to
create them and use them to build up your bubble diagrams.

Source or Sink

Process

State

Store

Decision

time

Вам также может понравиться