| 1 |
(* |
| 2 |
* This signature describes the machine properties needed by the |
| 3 |
* global schedulers. |
| 4 |
* |
| 5 |
* -- Allen |
| 6 |
*) |
| 7 |
signature SCHEDULING_PROPERTIES = |
| 8 |
sig |
| 9 |
|
| 10 |
structure I : INSTRUCTIONS |
| 11 |
|
| 12 |
(* |
| 13 |
* Type reservation_table is used to represent the state |
| 14 |
* of the pipeline as a partial schedule is constructed. |
| 15 |
* Type resource represents the resources used by an instruction |
| 16 |
* during its execution. Normally this is represented by a |
| 17 |
* reservation table. These are kept abstract so that the |
| 18 |
* client can have freedom on how to implement these things. |
| 19 |
*) |
| 20 |
type reservation_table |
| 21 |
type pipeline |
| 22 |
type latency = int |
| 23 |
type time = int |
| 24 |
|
| 25 |
type cpu (* name identifying the implementaton *) |
| 26 |
|
| 27 |
(* special instructions *) |
| 28 |
val source : I.instruction |
| 29 |
val sink : I.instruction |
| 30 |
|
| 31 |
(* convert a name to a specific implementation *) |
| 32 |
val cpu : string -> cpu |
| 33 |
|
| 34 |
datatype cpu_info = |
| 35 |
CPU_INFO of |
| 36 |
{ (* maximum number of instructions issued per cycle *) |
| 37 |
maxIssues : int, |
| 38 |
(* |
| 39 |
* Definition/use. Definitions contain latencies. |
| 40 |
*) |
| 41 |
defUse : I.instruction -> (I.C.cell * latency) list * I.C.cell list, |
| 42 |
|
| 43 |
(* |
| 44 |
* Create a new reservation table of at most n time steps. |
| 45 |
* If the backward flag is on then we are actually building |
| 46 |
* the schedule in backwards manner. |
| 47 |
*) |
| 48 |
newTable : int -> reservation_table, |
| 49 |
|
| 50 |
(* |
| 51 |
* Extract the pipeline characteristics of an instruction |
| 52 |
*) |
| 53 |
pipeline : I.instruction -> pipeline, |
| 54 |
(* |
| 55 |
* Take a reservation table, a time step t, and an instruction. |
| 56 |
* Find a slot to insert the instruction into the reservation |
| 57 |
* table at the earliest (latest) feasible time no earlier (later) |
| 58 |
* than t. |
| 59 |
*) |
| 60 |
findSlot : reservation_table * time * pipeline -> time, |
| 61 |
insert : reservation_table * time * pipeline -> unit |
| 62 |
} |
| 63 |
|
| 64 |
(* This function takes an architecture name and returns |
| 65 |
* a bunch of properties specific to the architecture. |
| 66 |
* It is structured this way so that we can dynamically change the |
| 67 |
* architecture parameter. |
| 68 |
*) |
| 69 |
val info : {cpu:cpu, backward:bool (* backward scheduling? *)} -> cpu_info |
| 70 |
|
| 71 |
val splitCopies : (I.C.cell -> I.C.cell) -> |
| 72 |
I.instruction -> I.instruction list |
| 73 |
|
| 74 |
end |