| 1 |
(* |
| 2 |
* View a scheduler DDG constructed for basic block scheduling |
| 3 |
* |
| 4 |
* -- Allen |
| 5 |
*) |
| 6 |
functor BasicBlockSchedulerDDGViewer |
| 7 |
(structure GraphViewer : GRAPH_VIEWER |
| 8 |
structure DDG : SCHEDULER_DDG |
| 9 |
structure FormatInsn : FORMAT_INSTRUCTION |
| 10 |
sharing FormatInsn.I = DDG.I |
| 11 |
) : BASIC_BLOCK_SCHEDULER_DDG_VIEWER = |
| 12 |
struct |
| 13 |
|
| 14 |
structure DDG = DDG |
| 15 |
structure I = DDG.I |
| 16 |
structure L = GraphLayout |
| 17 |
|
| 18 |
val edgeColor = L.COLOR "red" |
| 19 |
|
| 20 |
val toString = FormatInsn.toString [] |
| 21 |
|
| 22 |
fun view ddg = |
| 23 |
GraphViewer.view |
| 24 |
(GraphLayout.makeLayout |
| 25 |
{graph = fn _ => [], |
| 26 |
node = fn (_,i) => [L.LABEL(toString i)], |
| 27 |
edge = fn (_,_,lat) => [L.LABEL(Int.toString lat),edgeColor] |
| 28 |
} |
| 29 |
ddg |
| 30 |
) |
| 31 |
|
| 32 |
end |