-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ml
22 lines (17 loc) · 915 Bytes
/
main.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
open Hardcaml
open Lb_dataplane
module DataplaneCircuit = Circuit.With_interface (Dataplane.I) (Dataplane.O)
module LoadGeneratorCircuit = Circuit.With_interface (Load_generator.I) (Load_generator.O)
let gen_dataplane () =
let scope = Scope.create () in
let circuit = DataplaneCircuit.create_exn ~name:"lb_dataplane" (Dataplane.create_from_if scope) in
let output_mode = Rtl.Output_mode.To_file("out/dataplane.v") in
Rtl.output ~output_mode ~database:(Scope.circuit_database scope) Verilog circuit
let gen_load_generator () =
let scope = Scope.create ~flatten_design:true () in
let circuit = LoadGeneratorCircuit.create_exn ~name:"load_generator" (Load_generator.create_from_if scope) in
let output_mode = Rtl.Output_mode.To_file("out/load_generator.v") in
Rtl.output ~output_mode ~database:(Scope.circuit_database scope) Verilog circuit
let () =
gen_dataplane ();
gen_load_generator ()