OneTechnologyWay•P. O . Box9106•Norwood,MA02062-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
Page 2
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.
Page 3
Application Note AN-0975
Because these are bit-mapped files, they do not print at high
resolutions, and print with jaggies if scaled up to larger sizes.
They can, however, be edited easily in most software paint
programs.
The portable document format (PDF or .pdf) can be viewed
using any PDF viewer application, such as Adobe Acrobat®
Reader. Because this is a vector format, a PDF file can print at
high resolutions, can be scaled up, and remains free of jaggies.
Few applications can directly edit a PDF file; Adobe Illustrator®
is a notable exception. In general, if the diagram only needs to
be viewed and printed, then PDF is the best option.
The final format is scalable vector graphics (SVG or .svg). As the
name suggests, this is another vector format, so printing at high
resolutions and large sizes is not a problem. This format can also
be edited easily, using either commercial tools, such as Adobe
Illustrator, or other free SVG editor tools, such as Inkscape.
PRINTING STATE DIAGRAMS
The typical approach used when printing a state diagram is to
select the Fit to Page option so that the state diagram prints on
a single page. Unless a large format printer is available, this
means that as the number of states increases, the diagram text
becomes very small and illegible.
In order to print a complex state diagram with legible text, it is
necessary to print the state diagram output file using software
that supports Tiling or Poster output options. The Tiling and
Poster options allow a single page in a document to be scaled
up to a larger size and printed across mulitple single printer
pages, which can be joined together, effectively providing a
large format output.
To facilitate tiled or poster output, the state diagram should be
generated using the PDF file format output option. This is the
best choice because it offers the best quality printed output and
software is readily available to support the tiling function. Using
suitable software, it is possible to scale the state machine PDF file
such that it prints across two, three, or more pages.
In some cases, the tiling or poster function may be available as
part of the printer driver software for a given printer. In this
case, the user can use software, such as Adobe Acrobat Reader,
to print the state diagram PDF file, selecting the required
settings in the printer driver.
Alternatively, if the printer driver does not support the tiling
or poster function, another solution is to use a PDF viewer
application, such as PDF-XChange Viewer from Tracker
Software, which is capable of performing the tiling function to
create the larger format when printing.
Rev. A | Page 3 of 4
Page 4
AN-0975 Application Note
(T) IFVX5 (VX5) IS NOT HiAFTER 1 ms
(S) IF VX5 (V X 5) IS LoAF T ER 1 ms
(S) IF VX5 (VX5) IS HiAFTER 1 ms
(T) AFTER 1 ms
(S) IF SMBUS JU MP COMMAND A FTER 10 ms
(M) IF 11XX1 1111XX
(M) IF 11XX1 1111XX
Figure 4. Example of Graphviz Output for a Typical ADM1062 to ADM1069 State Machine
(M) IF 1XXXX 11X1XX
State15
(M) IF 11XXX1111X1
State16
(S) IF WARNING IS LoAFTER 1 ms
State17
(T) AFTER 10 ms
State18
State19
(T) AFTER 200 ms
(M) IF XXXXX 11X1XX
State4
(S) IF VX1 (VX1) IS OKAFTER 40 ms
State5
(S) IF VP3 (VP3 ) IS OKAFT ER 40 ms
State6
(S) IF VX2 (V X2) IS OKA FTER 200 ms
State7
(S) IFVX5 (VX5) IS HiAFTER 1 ms
State8
(T) IF VX5 (VX5) IS NOT LoAFTER 10 ms
(S) IFVX5 (VX5) IS HiAFTER 1 ms
(M) IF 11XX11111XX
(M) IF 11XX1 1111XXState20
State21
(M) IF XXXXX 1XX1XX
State3
(S) IF VP2 (VP 2) IS OKAF T ER 40 ms
(M) IF 11XXX1111X1
(M) IF 11XX0 1111XX
(S) IF VX5 (VX 5) IS LoAFT ER 1 ms
(M) IF 11XX1 1111XX
PowerBus Control
State0
(M) IF XXXXX 1XXXXX
State2
(S) IF VP4 (VP4 ) IS OKAFT ER 40 ms
State9
(S) IF WARNING IS LoAFTER 0 ms
State10
(M) IF 11XX0 1111XX
State14
(T) IFVX5 (VX5) IS NOT HiAFTER 10 ms
(S) IF VP1 (VP1) IS OKA FTER 40 ms(M) IF XXXXX 1XXXXX