Skip to content

Commit

Permalink
Rearrange files
Browse files Browse the repository at this point in the history
  • Loading branch information
polybeandip committed Jul 30, 2024
1 parent 432c8af commit a6de1ef
Show file tree
Hide file tree
Showing 59 changed files with 28 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
ocaml-compiler: 5
- name: Install ocamlformat
working-directory: dsl_lang
working-directory: dsl
run: opam install ocamlformat
- name: Check format
working-directory: dsl_lang
working-directory: dsl
run: |
[ $(opam exec -- dune fmt 2> >(wc -c)) -eq 0 ]
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
with:
ocaml-compiler: 5
- name: Install dependencies
working-directory: dsl_lang
working-directory: dsl
run: |
opam install . --deps-only
- name: DSL tests
working-directory: dsl_lang
working-directory: dsl
run: |
opam exec -- dune build
opam exec -- dune test
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*.cmxa

# ocamlbuild working directory
dsl_lang/_build/
dsl/_build/

# ocamlbuild targets
*.byte
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dsl_lang/bin/dune → dsl/bin/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(executable
(public_name dsl_lang)
(public_name dsl)
(name main)
(libraries dsl_core))
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions dsl_lang/dune-project → dsl/dune-project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(lang dune 3.16)

(name dsl_lang)
(name dsl)

(generate_opam_files true)

Expand All @@ -24,7 +24,7 @@
(using menhir 3.0)

(package
(name dsl_lang)
(name dsl)
(synopsis "DSL for Programmable Packet Scheduling")
(description "TBD")
(depends ocaml dune ounit2 menhir))
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion dsl_lang/lib/eval.ml → dsl/lib/eval.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ open Ast

exception UnboundVariable of var
exception UndeclaredClass of clss
exception IllformedExpression of string

(* A function to look up the binding for a variable in a store.
`lookup s x` returns `s(x)` or raises `UnboundVariable x` if `x` is not defined on `s`. *)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
40 changes: 20 additions & 20 deletions dsl_lang/test/well_formed.ml → dsl/test/well_formed.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
open Dsl_core
open OUnit2

let path_prefix = "../../../../"
let path_prefix = "../../../../progs/"

let eval_prog (filename : string) =
path_prefix ^ filename |> Parse.parse_file |> Eval.eval
Expand All @@ -20,45 +20,45 @@ let make_error_test (name : string) (filename : string) (exn : exn) =

let tests =
[
make_test "single class policy" "dsl/progs/now/drop_a_class.sched" "A";
make_test "fifo sugar 1 class" "dsl/progs/now/fifo_1_class_sugar.sched" "A";
make_test "fifo 1 class" "dsl/progs/now/fifo_1_class.sched" "A";
make_test "fifo of 3" "dsl/progs/now/fifo_n_classes.sched" "fifo[A, B, C]";
make_test "rr of 1" "dsl/progs/now/rr_1_class.sched" "rr[A]";
make_test "rr of 2" "dsl/progs/now/rr_2_classes.sched" "rr[A, B]";
make_test "multiple assignments" "dsl/progs/now/rr_hier_merge_sugar.sched"
make_test "single class policy" "work_conserving/drop_a_class.sched" "A";
make_test "fifo sugar 1 class" "work_conserving/fifo_1_class_sugar.sched" "A";
make_test "fifo 1 class" "work_conserving/fifo_1_class.sched" "A";
make_test "fifo of 3" "work_conserving/fifo_n_classes.sched" "fifo[A, B, C]";
make_test "rr of 1" "work_conserving/rr_1_class.sched" "rr[A]";
make_test "rr of 2" "work_conserving/rr_2_classes.sched" "rr[A, B]";
make_test "multiple assignments" "work_conserving/rr_hier_merge_sugar.sched"
"rr[fifo[BX, BY], rr[RP, RT]]";
make_test "2 assignments w/ substitutions" "dsl/progs/now/rr_hier.sched"
make_test "2 assignments w/ substitutions" "work_conserving/rr_hier.sched"
"rr[B, rr[RP, RT]]";
make_test "3 classes with substitutions"
"dsl/progs/soon/rr_n_class_hier.sched"
"work_conserving/rr_n_class_hier.sched"
"rr[A, B, rr[rr[CU, CV], rr[CW, CX]]]";
make_test "rr of 3" "dsl/progs/soon/rr_n_classes.sched" "rr[A, B, C]";
make_test "rr of 3" "work_conserving/rr_n_classes.sched" "rr[A, B, C]";
make_test "rr and strict substitutions"
"dsl/progs/soon/rr_strict_n_classes_hier.sched"
"work_conserving/rr_strict_n_classes_hier.sched"
"strict[A, B, rr[rr[CU, CV], strict[CW, CX]]]";
make_test "strict of 3" "dsl/progs/soon/strict_n_classes.sched"
make_test "strict of 3" "work_conserving/strict_n_classes.sched"
"strict[A, B, C]";
make_test "leaky bucket of 2" "dsl/progs/nwc/leaky_2_classes.sched"
make_test "leaky bucket of 2" "non_work_conserving/leaky_2_classes.sched"
"leaky[[A, B], width = 5, buffer = 10]";
make_test "token bucket of 2 round robins"
"dsl/progs/nwc/token_2_rr_children.sched"
"non_work_conserving/token_2_rr_children.sched"
"token[[rr[A, B], rr[C, D]], width = 20, time = 50]";
make_test "stop and go with 3 classes" "dsl/progs/nwc/sg_3_classes.sched"
make_test "stop and go with 3 classes" "non_work_conserving/sg_3_classes.sched"
"stopandgo[[stopandgo[[A, B], width = 10], stopandgo[[C], width = 10]], \
width = 5]";
make_test "rcsp for 4 classes" "dsl/progs/nwc/rcsp_4_classes.sched"
make_test "rcsp for 4 classes" "non_work_conserving/rcsp_4_classes.sched"
"rcsp[A, B, C, D]";
]

let error_tests =
[
make_error_test "undeclared class"
"dsl/progs/incorrect/undeclared_classes.sched" (Eval.UndeclaredClass "Z");
make_error_test "unbound variable" "dsl/progs/incorrect/unbound_var.sched"
"incorrect/undeclared_classes.sched" (Eval.UndeclaredClass "Z");
make_error_test "unbound variable" "incorrect/unbound_var.sched"
(Eval.UnboundVariable "policy");
make_error_test "unbound var in middle of list of assignments"
"dsl/progs/incorrect/unbound_var_hier.sched"
"incorrect/unbound_var_hier.sched"
(Eval.UnboundVariable "r_polic");
]

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.
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.
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.
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.

0 comments on commit a6de1ef

Please sign in to comment.