Skip to content

Commit

Permalink
Some bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ayakayorihiro committed Nov 19, 2024
1 parent 2d99688 commit d6672a8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
23 changes: 14 additions & 9 deletions calyx-opt/src/passes/profiler_instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,20 @@ impl Visitor for ProfilerInstrumentation {
}
}
if let ir::PortParent::Cell(cell_ref) = &dst_borrow.parent {
if dst_borrow.name == "go" {
let cell_name = cell_ref.upgrade().borrow().name();
match cell_invoke_map.get_mut(&group.name()) {
Some(vec_ref) => {
vec_ref.push(cell_name);
}
None => {
cell_invoke_map
.insert(group.name(), vec![cell_name]);
// we only want to add probes for cells that are non-primitive... for now.
if let ir::CellType::Component { name: _ } =
cell_ref.upgrade().borrow().prototype
{
if dst_borrow.name == "go" {
let cell_name = cell_ref.upgrade().borrow().name();
match cell_invoke_map.get_mut(&group.name()) {
Some(vec_ref) => {
vec_ref.push(cell_name);
}
None => {
cell_invoke_map
.insert(group.name(), vec![cell_name]);
}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions tools/profiler/new-parse-vcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

DELIMITER = "__"
INVISIBLE = "gray"
TREE_PICTURE_LIMIT=100
TREE_PICTURE_LIMIT=300

def remove_size_from_name(name: str) -> str:
""" changes e.g. "state[2:0]" to "state" """
Expand Down Expand Up @@ -281,6 +281,7 @@ def read_component_cell_names_json(json_file):
return full_main_component, full_cell_names_to_components

def create_traces(active_element_probes_info, call_stack_probes_info, cell_caller_probes_info, total_cycles, cells_to_components, main_component):

timeline_map = {i : set() for i in range(total_cycles)}
# first iterate through all of the profiled info
for unit_name in active_element_probes_info:
Expand Down Expand Up @@ -389,7 +390,7 @@ def create_tree(timeline_map):
break
# create nodes
if prefix != "":
new_nodes = stack[i:]
new_nodes = stack[stack_len - i:]
new_prefix = prefix
else:
new_nodes = stack
Expand Down
4 changes: 2 additions & 2 deletions tools/profiler/new-profiler-approach.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CALYX_DIR=$( dirname $( dirname ${SCRIPT_DIR} ) )
INPUT_FILE=$1
SIM_DATA_JSON=$2
name=$( echo "${INPUT_FILE}" | rev | cut -d/ -f1 | rev | cut -d. -f1 )
DATA_DIR=${SCRIPT_DIR}/new-data/${name}
DATA_DIR=${SCRIPT_DIR}/data/${name}
TMP_DIR=${DATA_DIR}/generated-data
OUT_CSV=${TMP_DIR}/summary.csv

Expand Down Expand Up @@ -47,7 +47,7 @@ if [ ! -d ${FLAMEGRAPH_DIR} ]; then
)
fi

CALYX_ARGS=" -p static-inline -p compile-static -p compile-repeat -p compile-invoke -p profiler-instrumentation -p all"
CALYX_ARGS=" -p static-inline -p compile-static -p compile-repeat -p compile-invoke -p dead-group-removal -p profiler-instrumentation -p all"

# Run component-cells backend to get cell information
echo "[${SCRIPT_NAME}] Obtaining cell information from component-cells backend"
Expand Down

0 comments on commit d6672a8

Please sign in to comment.