AN-0975
One Technology Way • P. O . Box 9106 • Norwood, MA 02062-9106, U.S.A. • Tel : 781.329.4700 • Fax : 781.461.3113 • www.analog.com
APPLICATION NOTE
Automatic Generation of State Diagrams for the ADM1062 to ADM1069
Using Graphviz
by Michael Bradley
GENERAL DESCRIPTION
TheADM1062, ADM1063, ADM1064, ADM1065, ADM1066
ADM1067, ADM1068, and ADM1069, hereafter referred to
as ADM1062 to ADM1069, are fully programmable supply
sequencers that can be used as complete supply management
solutions in systems utilizing multiple voltage supplies. Applications include line cards in telecommunications infrastructure
equipment (fo, r central offices and base stations) and blade cards
in servers.
One of the most powerful features of the ADM1062 to ADM1069
devices is their 63-state sequencing engine (SE). The SE is used
to control the power-up and power-down of sup
implement application-specific fault handling.
The evaluation software GUI for the ADM1062 to ADM1069
is used to define the behavior of the state machine. The definition
of the state machine is presented in a tabular form in the GUI.
This is not always the most natural method of understanding
the operation of the state machine; a more graphical state diagram is the usual representation.
With the release of Version 4.0.5 of the ADM1062 to ADM1
evaluation software, it is now possible to quickly and easily
generate state diagrams using an external graph visualization
software tool called Graphviz. These diagrams can be generate
in a number of different formats, and viewed, printed, and, i
some cases, edited, if required. This application note describes
Graphiz and how to use the new graphical output f
the ADM1062 to ADM1069 evaluation software.
For more details on the ADM1062 to ADM1069 devices, an
download the evaluation software, visit
www.analog.com.
plies and can
069
d
n
unction in
d to
WHAT IS GRAPHVIZ?
Graphviz is an open-source visualization tool. It is capable of
reading a state diagram definition provided in the form of a
specially formatted text file, and creating a graphical output file
showing each state and the relationships it has with other sta
A simple example of the type of output possible is shown i
Figure 1. A more complex example is shown in Figure 4.
The position and layout of the states, the relationship lines,
and all text labels are handled automatically by the Graphviz
tool. Graphviz attempts to optimize the layout to minimize the
crossing of lines, and tries to group related states close together.
Because the Graphviz installer is included as part of the ADM1062
to ADM106
necessary.
Additional documentation, tools, and examples of other ways
hat Graphviz can be used can be found online.
t
9 software installation, a separate download is not
Figure 1. Example of Graphviz Output
tes.
n
07666-001
Rev. A | Page 1 of 4
AN-0975 Application Note
USING THE STATE DIAGRAMS
The graphical state diagrams can be used to easily visualize
the different steps performed during a sequencing operation.
The diagrams can be used to check that the state machine is
doing what the designer intended. Viewing the state machine
in graphical form can help spot any unexpected or incorrect
transitions between different states.
When a comparison between two versions of a state machine
needs to be made, it can be useful to compare the versions
graphically, instead of attempting to compare them in the text
form provided in the GUI. It is possible to quickly find any
additional or missing states and get an idea of the nature of the
changes and their impact upon the sequencing operation.
The state diagram output is a useful and more meaningful
method of documenting the state machine and sequencing
behavior than the tabular view provided by the software. This
is particularly true if the graphical form of the state machine
is printed out and referred to during the debugging of a given
state machine. The Graphviz software is used by the ADM1062
to ADM1069 software to create graphical forms of the tabular
sequencing engine configuration. The ADM1062 to ADM1069
software creates an intermediate text file that Graphviz
processes to produce the state diagram.
Editing the state diagram or the intermediate text file and then
loading the modified file back into the ADM1062 to ADM1069
evaluation software is not supported.
INSTALLING GRAPHVIZ
The ADM1062 to ADM1069 software installer runs the Graphviz
installer once the ADM1062 to ADM1069 software is installed.
The Graphviz software should be installed at the default path, but
can be installed at a different location, if necessary. If the ADM1062
to ADM1069 software cannot locate the required Graphviz executable file when creating the state machine diagrams, the user is
prompted for the location.
GENERATING A SEQUENCE ENGINE DIAGRAM
The basic operation of the ADM1062 to ADM1069 software
remains unchanged. To access the new graphical output functionality, click the Create State Diagram button on the Sequence
Engine tab (see Figure 2) to display a settings window.
Title: A user can give the state machine a title that appears at
the bottom of the diagram.
Title Size: This is the font size used for the title text.
Sequence/Timeout/Monitor Transitions Color: There are
three possible exit routes from any given ADM1062 to ADM1069
state. These color boxes allow each type of transition to be
color-coded.
File Format: Various graphical file formats are supported. The
best format to use depends on how a user intends to use the file.
Some guidance on the choice of file formats is given.
State Node Shape: States can be shown enclosed in one of
several different shapes.
Include PDO Data: This checkbox, when enabled, includes an
extra line in each state node showing how the programmable
digital outputs (PDOs) are configured in that state.
Include ADC RR and Fault Write: This checkbox, when
enabled, includes an extra line in each state node showing if the
ADC round robin (RR) is active, or if the user enabled writing
to the fault registers.
Clicking Create State Diagram prompts the user for a file name
and location. When the name and location are set, click Save to
begin generating the state diagram.
The file name, with a .txt suffix, is used to create a Graphviz
format text file containing the state machine definition in the
location specified by the user. If a file already exists in the location with the same name, a software prompt inquires if you
want to replace the existing file. The same file name with a
suffix appropriate to the selected file format, for example, a
.jpg suffix for a JPEG file, is created by Graphviz as the output
graphical file in the same location.
Note: If a file already exists in the location with the same name,
the software overwrites the existing file without inquiring.
Figure 3. State Diagram Settings Window
07666-003
Figure 2. Configuration Tool, Sequence Engine Tab
The State Diagram Settings window (see Figure 3) provides
control over the format and nature of the diagram generated.
The configuration options are listed and described in this section.
FILE FORMAT CHOICES
07666-002
Rev. A | Page 2 of 4
Version 4.0.5 of the ADM106x evaluation software supports
four different output file formats: .jpg, .png, .pdf, and .svg. The
joint photographic experts group (JPEG or .jpg) and portable
network graphics (PNG or .png) formats are both bit-mapped
formats, which can be easily viewed directly from Windows®
Explorer.