Skip to content

Commit

Permalink
Enable analysis report of post synthesis resource in json
Browse files Browse the repository at this point in the history
Note: This was already implemented, it was just not called from the
step_synthesize_bitfile.
  • Loading branch information
iksnagreb committed Apr 3, 2024
1 parent 766e9fb commit de1f024
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/finn/builder/build_dataflow_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
from finn.analysis.fpgadataflow.dataflow_performance import dataflow_performance
from finn.analysis.fpgadataflow.exp_cycles_per_layer import exp_cycles_per_layer
from finn.analysis.fpgadataflow.hls_synth_res_estimation import hls_synth_res_estimation
from finn.analysis.fpgadataflow.post_synth_res import post_synth_res
from finn.analysis.fpgadataflow.op_and_param_counts import (
aggregate_dict_keys,
op_and_param_counts,
Expand Down Expand Up @@ -801,6 +802,11 @@ def step_synthesize_bitfile(model: ModelWrapper, cfg: DataflowBuildConfig):
model.get_metadata_prop("vivado_synth_rpt"),
report_dir + "/post_synth_resources.xml",
)

post_synth_resources = model.analysis(post_synth_res)
with open(report_dir + "/post_synth_resources.json", "w") as f:
json.dump(post_synth_resources, f, indent=2)

vivado_pynq_proj_dir = model.get_metadata_prop("vivado_pynq_proj")
timing_rpt = (
"%s/finn_zynq_link.runs/impl_1/top_wrapper_timing_summary_routed.rpt"
Expand All @@ -825,6 +831,10 @@ def step_synthesize_bitfile(model: ModelWrapper, cfg: DataflowBuildConfig):
model.get_metadata_prop("vivado_synth_rpt"),
report_dir + "/post_synth_resources.xml",
)

post_synth_resources = model.analysis(post_synth_res)
with open(report_dir + "/post_synth_resources.json", "w") as f:
json.dump(post_synth_resources, f, indent=2)
else:
raise Exception("Unrecognized shell_flow_type: " + str(cfg.shell_flow_type))
print("Bitfile written into " + bitfile_dir)
Expand Down

0 comments on commit de1f024

Please sign in to comment.