Skip to content

Commit

Permalink
fud2 support first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ayakayorihiro committed Nov 19, 2024
1 parent ca59ad4 commit 46aeb9b
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 10 deletions.
13 changes: 4 additions & 9 deletions fud2/scripts/profiler.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,9 @@ fn profiling_setup(e) {

// rules for postprocessing

// script to process vcd and attribute active cycles to every group/cell
e.var_("parse-vcd-script", "$calyx-base/tools/profiler/parse-vcd.py");
e.rule("parse-vcd", "python3 $parse-vcd-script $in $tdcc-json $cells summary.csv $out");

// script to produce trace and visuals
e.var_("create-visuals-script", "$calyx-base/tools/profiler/create-visuals.py");
e.rule("create-visuals", "python3 $create-visuals-script $in $cells timeline.json fsm-timeline.json $out fsm-flame.folded frequency.folded components.folded fsm-components.folded");
// script to process vcd and produce folded representation of flame graph
e.var_("parse-vcd-script", "$calyx-base/tools/profiler/profiler-process.py");
e.rule("parse-vcd", "python3 $parse-vcd-script $in $cells dot-out $out");

e.config_var("flamegraph-script", "flamegraph.script");
e.rule("produce-flame-graph", "$flamegraph-script $in > $out");
Expand Down Expand Up @@ -72,8 +68,7 @@ fn calyx_to_flamegraph(e, input, output) {
// vcd --> flamegraph
let elems_profiled_json = "elems-profiled.json";
let flamegraph_folded = "flamegraph.folded";
e.build_cmd([elems_profiled_json], "parse-vcd", [instrumented_vcd], []);
e.build_cmd([flamegraph_folded], "create-visuals", [elems_profiled_json], ["$cells"]);
e.build_cmd([flamegraph_folded], "parse-vcd", [instrumented_vcd], ["$cells"]);
e.build_cmd([output], "produce-flame-graph", [flamegraph_folded], []);
}

Expand Down
2 changes: 1 addition & 1 deletion tools/profiler/new-profiler-approach.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fi
echo "[${SCRIPT_NAME}] Using FSM info and VCD file to obtain cycle level counts"
(
set -o xtrace
python3 ${SCRIPT_DIR}/profiler-process.py ${VCD_FILE} ${CELLS_JSON} ${OUT_DIR}
python3 ${SCRIPT_DIR}/profiler-process.py ${VCD_FILE} ${CELLS_JSON} ${OUT_DIR} ${OUT_DIR}/flame.folded
set +o xtrace
) &> ${LOGS_DIR}/gol-process

Expand Down
Loading

0 comments on commit 46aeb9b

Please sign in to comment.