-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2babadc
commit 205401c
Showing
18 changed files
with
342 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ type t = { | |
} | ||
|
||
val of_policy : Frontend.Policy.t -> t | ||
val compile : t -> Topo.t * Topo.map -> t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
type t = (int * Rank.t) list | ||
(* The _foot_ of this list has should have `foot` (i.e. `-1`) in the int slot. | ||
We only care about the rank of the foot. | ||
Another way of writing this type is: | ||
`type t = (int * Rank.t) list * Rank.t` | ||
where the final rank is the singeton foot of the list. | ||
However, the existing version is a little easier to work with. | ||
*) | ||
We only care about the rank of the foot. *) | ||
|
||
let foot = -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
type t = Star | Node of t list | ||
type addr = int list | ||
type map = addr -> addr Option.t | ||
|
||
val of_policy : Frontend.Policy.t -> t | ||
val size : t -> int | ||
val lift_tilde : map -> t -> Path.t -> Path.t | ||
val build_d_ary : int -> t -> t * map |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
open Simulation | ||
open OUnit2 | ||
|
||
let fcfs_flow, two_then_three, wfq_flow, strict_flow = | ||
Util. | ||
( parse_pcap "pcaps/fcfs_generated.pcap", | ||
parse_pcap "pcaps/two_then_three.pcap", | ||
parse_pcap "pcaps/wfq_generated.pcap", | ||
parse_pcap "pcaps/strict_generated.pcap" ) | ||
|
||
let fifo, rr, strict, wfq = | ||
Util. | ||
( compute_control "progs/work_conserving/fifo_n_classes.sched", | ||
compute_control "progs/work_conserving/rr_n_classes.sched", | ||
compute_control "progs/work_conserving/strict_n_classes.sched", | ||
compute_control "progs/work_conserving/wfq_n_classes.sched" ) | ||
|
||
let run control flow name = | ||
Packet.write_to_csv | ||
(Simulate.simulate 30.0 0.001 0.25 flow control) | ||
(Util.prefix ^ "graphs/" ^ name ^ ".csv") | ||
|
||
let run_on_binary control flow name = | ||
let control' = | ||
Control.compile control (control.q |> Pieotree.to_topo |> Topo.build_d_ary 2) | ||
in | ||
run control' flow name | ||
|
||
let () = | ||
let dir = Util.prefix ^ "graphs" in | ||
if not (Sys.file_exists dir) then Sys.mkdir dir 0o777 else () | ||
|
||
let () = | ||
run fifo fcfs_flow "fcfs"; | ||
run rr two_then_three "rr"; | ||
run strict strict_flow "strict"; | ||
run wfq wfq_flow "wfq" | ||
|
||
let () = | ||
run_on_binary fifo fcfs_flow "fcfs_bin"; | ||
run_on_binary rr two_then_three "rr_bin"; | ||
run_on_binary strict strict_flow "strict_bin"; | ||
run_on_binary wfq wfq_flow "wfq_bin" | ||
|
||
let diff_test file file' = | ||
Printf.sprintf "%s = %s" file file' >:: fun ctxt -> | ||
assert_command ~ctxt "diff" [ Util.prefix ^ file; Util.prefix ^ file' ] | ||
|
||
let suite = | ||
"T2T compilation tests" | ||
>::: [ | ||
diff_test "graphs/fcfs.csv" "graphs/fcfs_bin.csv"; | ||
diff_test "graphs/rr.csv" "graphs/rr_bin.csv"; | ||
diff_test "graphs/strict.csv" "graphs/strict_bin.csv"; | ||
diff_test "graphs/wfq.csv" "graphs/wfq_bin.csv"; | ||
] | ||
|
||
let () = run_test_tt_main suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
(tests | ||
(names parsing simulate) | ||
(names parsing compilation) | ||
(libraries dsl.frontend dsl.simulation ounit2)) |
Oops, something went wrong.