Skip to content

Commit

Permalink
Re-structure files
Browse files Browse the repository at this point in the history
  • Loading branch information
polybeandip committed Aug 5, 2024
1 parent e7fa42e commit 4973ac5
Show file tree
Hide file tree
Showing 32 changed files with 16 additions and 16 deletions.
4 changes: 0 additions & 4 deletions dsl/bin/dune

This file was deleted.

Empty file removed dsl/bin/main.ml
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions dsl/lib/dune → dsl/frontend/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name dsl_core)
(libraries core_kernel.fheap))
(name Frontend)
(public_name dsl.frontend))

(menhir
(modules parser))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions dsl/lib/control.ml → dsl/simulate/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let rec addr_to_string = function
| Cons (i, addr) -> Printf.sprintf "%d ∙ %s" i (addr_to_string addr)

let init_state p =
let rec init_state_aux (p : Policy.t) addr s =
let rec init_state_aux (p : Frontend.Policy.t) addr s =
let join plst addr s =
let f (i, s) p = (i + 1, init_state_aux p (Cons (i, addr)) s) in
match List.fold_left f (0, s) plst with _, s' -> s'
Expand Down Expand Up @@ -46,7 +46,7 @@ let init_state p =
init_state_aux p Eps (State.create 10)

let route_pkt_opt p pkt =
let rec route_pkt_opt_aux (p : Policy.t) pt pkt =
let rec route_pkt_opt_aux (p : Frontend.Policy.t) pt pkt =
match p with
| Class c -> if Packet.flow pkt = c then Some (List.rev pt) else None
| Fifo plst | RoundRobin plst | Strict plst ->
Expand All @@ -57,7 +57,7 @@ let route_pkt_opt p pkt =
route_pkt_opt_aux p [] pkt

let z_in p s pkt =
let rec z_in_aux (p : Policy.t) rank_less_path addr s pkt =
let rec z_in_aux (p : Frontend.Policy.t) rank_less_path addr s pkt =
let prefix = addr_to_string addr in

match (p, rank_less_path) with
Expand Down Expand Up @@ -104,7 +104,7 @@ let z_in p s pkt =
| None -> raise (RoutingError pkt)

let z_out p s pkt =
let rec z_out_aux (p : Policy.t) rank_less_path addr s pkt =
let rec z_out_aux (p : Frontend.Policy.t) rank_less_path addr s pkt =
let prefix = addr_to_string addr in

match (p, rank_less_path) with
Expand Down
2 changes: 1 addition & 1 deletion dsl/lib/control.mli → dsl/simulate/control.mli
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ type t = {
z_out : State.t -> Packet.t -> State.t;
}

val of_policy : Policy.t -> t
val of_policy : Frontend.Policy.t -> t
4 changes: 4 additions & 0 deletions dsl/simulate/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name Simulate)
(public_name dsl.sim)
(libraries dsl.frontend core_kernel.fheap))
File renamed without changes.
2 changes: 1 addition & 1 deletion dsl/lib/packet.mli → dsl/simulate/packet.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type t

val flow : t -> Ast.clss
val flow : t -> Frontend.Ast.clss
val time : t -> Time.t
val len : t -> float
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dsl/lib/topo.ml → dsl/simulate/topo.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type t = Star | Node of t list

let rec of_policy (p : Policy.t) =
let rec of_policy (p : Frontend.Policy.t) =
match p with
| Class _ -> Star
| Fifo plst | RoundRobin plst | Strict plst -> Node (List.map of_policy plst)
Expand Down
2 changes: 1 addition & 1 deletion dsl/lib/topo.mli → dsl/simulate/topo.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type t = Star | Node of t list

val of_policy : Policy.t -> t
val of_policy : Frontend.Policy.t -> t
val size : t -> int

(* A few topologies to play with. *)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dsl/test/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(tests
(names well_formed)
(libraries dsl_core ounit2))
(libraries dsl.frontend ounit2))
2 changes: 1 addition & 1 deletion dsl/test/well_formed.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Dsl_core
open Frontend
open OUnit2

let prefix = "../../../../progs/"
Expand Down

0 comments on commit 4973ac5

Please sign in to comment.