digraph paint_fsm {
rankdir=TB;
node [shape = rectangle];
graph [splines = ortho];
nodesep = 2;
ranksep = 0.5;
// Define custom colors
lightblue = "#ADD8E6";
// Define legend box
subgraph cluster_legend {
label = "Legend";
shape = "none";
color = "gray";
// Define HTML label for legend table
legend_table [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr>
<td bgcolor="lightblue">raster_fetch_state</td>
</tr>
<tr>
<td bgcolor="palegreen">paint_fsm_state</td>
</tr>
</table>
>];
}
Idle [label="Idle", style=filled, fillcolor=palegreen];
PaintFullColour [label="PaintFullColour", style=filled, fillcolor=palegreen];
PaintMultiColour [label="PaintMultiColour", style=filled, fillcolor=palegreen];
PaintMono [label="PaintMono", style=filled, fillcolor=palegreen];
PaintMonoDrive [label="PaintMonoDrive", style=filled, fillcolor=palegreen];
PaintMonoBits [label="PaintMonoBits", style=filled, fillcolor=palegreen];
PaintMultiColourDrive [label="PaintMultiColourDrive", style=filled, fillcolor=palegreen];
PaintMultiColourBits [label="PaintMultiColourBits", style=filled, fillcolor=palegreen];
PaintMultiColourHold [label="PaintMultiColourHold", style=filled, fillcolor=palegreen];
PaintFullColourPixels [label="PaintFullColourPixels", style=filled, fillcolor=palegreen];
Paint4bitColourPixels [label="Paint4bitColourPixels", style=filled, fillcolor=palegreen];
# NOTE: This 'PaintFullColourDone' state wasn't really used by the system, so let's ignore it
# PaintFullColourDone [label="PaintFullColourDone", style=filled, fillcolor=palegreen];
cond1 [shape = diamond, label="[raster_fetch_state:PaintDispatch]\nif paint_ready='1'", style=filled, fillcolor=lightblue];
cond2 [shape = diamond, label="if glyph_goto='1'", style=filled, fillcolor=lightblue];
cond3 [shape = diamond, label="elsif glyph_full_colour='1'", style=filled, fillcolor=lightblue];
cond4 [shape = diamond, label="else", style=filled, fillcolor=lightblue];
cond5 [shape = diamond, label="if multicolour_mode='0'\nand extended_background_mode='0'", style=filled, fillcolor=lightblue];
cond6 [shape = diamond, label="elsif multicolour_mode='1'", style=filled, fillcolor=lightblue]
cond7 [shape = diamond, label="text_mode='1' and glyph_colour(3)='0'", style=filled, fillcolor=lightblue]
cond8 [shape = diamond, label="elsif extended_background_mode='1'", style=filled, fillcolor=lightblue]
cond9 [shape = diamond, label="[raster_fetch_state:EndOfChargen]\nif paint_ready='1'", style=filled, fillcolor=lightblue];
Idle -> cond1;
cond1 -> Idle [xlabel="no"];
cond1 -> cond2 [xlabel="yes"];
cond2 -> Idle [xlabel="yes"];
cond2 -> cond3 [xlabel="no"];
cond3 -> PaintFullColour [xlabel="yes"];
cond3 -> cond4 [xlabel="no"];
cond4 -> cond5;
cond5 -> PaintMono [xlabel="yes"];
cond5 -> cond6 [xlabel="no"];
cond6 -> cond7 [xlabel="yes"];
cond7 -> PaintMono [xlabel="yes"];
cond7 -> PaintMultiColour [xlabel="no"];
cond6 -> cond8 [xlabel="no"]
cond8 -> PaintMono [xlabel="yes"]
cond9 -> Idle [xlabel="yes"]
PaintFullColour -> Paint4bitColourPixels [xlabel="if paint_glyph_4bit='1'"];
PaintFullColour -> PaintFullColourPixels [xlabel="else"];
# Paint4bitColourPixels -> PaintFullColourDone [xlabel = "if not paint_bits_remaining > 0"]
Paint4bitColourPixels -> Idle [xlabel = "if paint_bits_remaining = 0"];
#PaintFullColourPixels -> PaintFullColourDone [xlabel = "if not paint_bits_remaining > 0"]
PaintFullColourPixels -> Idle [xlabel = "if paint_bits_remaining = 0"];
PaintMono -> PaintMonoDrive;
PaintMonoDrive -> PaintMonoBits;
PaintMonoBits -> Idle [xlabel="if paint_bits_remaining = 1\n or paint_bits_remaining = 0"];
PaintMultiColour -> PaintMultiColourDrive;
PaintMultiColourDrive -> PaintMultiColourBits;
PaintMultiColourBits -> PaintMultiColourHold;
PaintMultiColourHold -> Idle [xlabel="if paint_bits_remaining = 0"]
PaintMultiColourHold -> PaintMultiColourBits [xlabel="else"]
}
|