File: schedulerDDG.sig

package info (click to toggle)
mlton 20210117%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,464 kB
  • sloc: ansic: 27,682; sh: 4,455; asm: 3,569; lisp: 2,879; makefile: 2,347; perl: 1,169; python: 191; pascal: 68; javascript: 7
file content (72 lines) | stat: -rw-r--r-- 2,512 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(*
 * This interface describes a DDG for acyclic global scheduling 
 * (for non-predicated architectures.) 
 * Hyperblock scheduling uses another data structure.
 *
 * -- Allen
 *)
signature SCHEDULER_DDG =
sig

   structure I          : INSTRUCTIONS
   structure C          : CELLS
   structure SchedProps : SCHEDULING_PROPERTIES
      sharing SchedProps.I = I
      sharing I.C = C 

   (* Dependence type *)
   datatype dependence = 
        FLOW | OUTPUT | ANTI             (* register based dependence *)
      | MEM_FLOW | MEM_OUTPUT | MEM_ANTI (* memory based dependence *)
      | CTRL | CTRL_ANTI                 (* control dependence *)
      | LIVEIN | LIVEOUT

   type latency = SchedProps.latency
  
   datatype edge = EDGE of {l : latency,    (* latency *)
                            r : C.cell,     (* register *)
                            d : dependence  (* dependence type *)
                           }

   datatype node = NODE of {instr: I.instruction, b:int, 
                            defs:(C.cell * latency) list, uses:C.cell list}

   type ('node,'edge) info 

   (* The actual ddg is parameterized with respect to the node and edge type.
    * For local scheduling 'node = instruction and 'edge = latency 
    * For global scheduling 'node = node and 'edge = edge
    *)
   type ('node,'edge) ddg = ('node,'edge,('node,'edge) info) Graph.graph
   type block      = int 
   type blockMap   = block Array.array (* mapping from block id -> block *)
   type liveInMap  = node Graph.node IntHashTable.hash_table 
   type liveOutMap = node Graph.node IntHashTable.hash_table 

   type ('node,'edge) internalInfo = 
        {succ  : 'edge Graph.edge list Array.array,
         pred  : 'edge Graph.edge list Array.array,
         nodes : 'node option Array.array
        }

   type globalInfo =
        {liveInMap  : liveInMap,
         liveOutMap : liveOutMap,
         blockMap   : blockMap
        }

   (* Create an empty DDG with a maximum number of nodes.
    * At the same time return its internal adjlist representation.
    * Just in we want to make the scheduler work fast.
    *)  
   val newDDG       : int -> ('node,'edge) ddg
   val internalInfo : ('node,'edge) ddg -> ('node,'edge) internalInfo
   val globalInfo   : ('node,'edge) ddg -> globalInfo option ref

   (* pretty print an edge (useful for graphical display) *)
   val edgeToString : edge -> string

   (* liveness annotation *)
   val LIVENESS : {liveIn:C.cell list, liveOut:C.cell list} Annotations.property

end