Skip to content
Snippets Groups Projects
Commit 4390d5e9 authored by erwan's avatar erwan
Browse files

Change sligthly the naming conventions so that rdbgui4sasa works with salut output

nb: to use it
 lv6 lv6 dice5.lus -n dice5 -2c
 sh dice5.sh
 rdbgui4sasa -sut "./dice5.exec"

nb: requires
  - an up-to-data rdbg (available via git and opam)
  - an up-to-data sasa (git only)
enjoy :)
parent 400d9190
No related branches found
No related tags found
No related merge requests found
...@@ -117,26 +117,26 @@ let output_topology output (graph : Topology.t) name = ...@@ -117,26 +117,26 @@ let output_topology output (graph : Topology.t) name =
(List.fold_left concat prefix ns) ^ sufix in (List.fold_left concat prefix ns) ^ sufix in
Printf.fprintf output Printf.fprintf output
"\nnode %s(activations : bool^%s^card; initials : %s^card)\n" "\nnode %s(p : bool^%s^card; initials : %s^card)\n"
name action_number state_type; name action_number state_type;
Printf.fprintf output Printf.fprintf output
"returns (nodes : %s^card; enables : bool^%s^card);\n" "returns (p_c : %s^card; Enab_p : bool^%s^card);\n"
state_type action_number; state_type action_number;
output_string output "var\n"; output_string output "var\n";
Printf.fprintf output "\tprev_nodes : %s^card;\n\n" state_type; Printf.fprintf output "\tprev_p_c : %s^card;\n\n" state_type;
graph.nodes graph.nodes
|> List.iteri (fun i _ -> Printf.fprintf output "\tsel_%d : bool;\n" i); |> List.iteri (fun i _ -> Printf.fprintf output "\tsel_%d : bool;\n" i);
output_string output "let\n"; output_string output "let\n";
output_string output "\tprev_nodes = initials -> pre(nodes);\n\n"; output_string output "\tprev_p_c = initials -> pre(p_c);\n\n";
graph.nodes graph.nodes
|> List.iteri (fun i _ -> |> List.iteri (fun i _ ->
Printf.fprintf output Printf.fprintf output
"\tsel_%d = false -> boolred<<1,%s,%s>>(activations[%d]);\n" "\tsel_%d = false -> boolred<<1,%s,%s>>(p[%d]);\n"
i action_number action_number i); i action_number action_number i);
let index_of_id = make_index graph in let index_of_id = make_index graph in
...@@ -145,19 +145,19 @@ let output_topology output (graph : Topology.t) name = ...@@ -145,19 +145,19 @@ let output_topology output (graph : Topology.t) name =
let algo = algo_name n in let algo = algo_name n in
let neighbors = graph.succ n.id |> List.map (fun (_, id) -> index_of_id id) in let neighbors = graph.succ n.id |> List.map (fun (_, id) -> index_of_id id) in
let deg = List.length neighbors in let deg = List.length neighbors in
let nl = sprint_neighbor_list neighbors "nodes" in let nl = sprint_neighbor_list neighbors "p_c" in
let pnl = sprint_neighbor_list neighbors "prev_nodes" in let pnl = sprint_neighbor_list neighbors "prev_p_c" in
Printf.fprintf output Printf.fprintf output
"\n\tnodes[%d] =\n\t\tif not sel_%d then prev_nodes[%d]\n\t\telse " "\n\tp_c[%d] =\n\t\tif not sel_%d then prev_p_c[%d]\n\t\telse "
i i i; i i i;
if !clock then Printf.fprintf output if !clock then Printf.fprintf output
"current(%s_step<<%d>>(\n\t\t\tprev_nodes[%d], \n\t\t\t%s, \n\t\t\tdot2lus_action_of_activation(activations[%d])\n\t\t) when sel_%d);\n" "current(%s_step<<%d>>(\n\t\t\tprev_p_c[%d], \n\t\t\t%s, \n\t\t\tdot2lus_action_of_activation(p[%d])\n\t\t) when sel_%d);\n"
algo deg i pnl i i algo deg i pnl i i
else Printf.fprintf output else Printf.fprintf output
"%s_step<<%d>>(\n\t\t\tprev_nodes[%d], \n\t\t\t%s, \n\t\t\tdot2lus_action_of_activation(activations[%d])\n\t\t);\n" "%s_step<<%d>>(\n\t\t\tprev_p_c[%d], \n\t\t\t%s, \n\t\t\tdot2lus_action_of_activation(p[%d])\n\t\t);\n"
algo deg i pnl i; algo deg i pnl i;
Printf.fprintf output Printf.fprintf output
"\tenables[%d] = %s_enable<<%d>>(nodes[%d], %s);\n" "\tEnab_p[%d] = %s_enable<<%d>>(p_c[%d], %s);\n"
i algo deg i nl); i algo deg i nl);
output_string output "tel;\n" output_string output "tel;\n"
......
TOPOLOGY ?= clique3 TOPOLOGY ?= dice5
DOT2LUSFLAGS ?= DOT2LUSFLAGS ?=
SASA_ALGOS := p.ml SASA_ALGOS := p.ml
SASAFLAGS += --locally-central-daemon SASAFLAGS += --locally-central-daemon
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment