Skip to content

Commit

Permalink
Merge pull request #1087 from hannahxy13/bugfix/verification_step_name
Browse files Browse the repository at this point in the history
Changed QONNX_TO_FINN_PYTHON verification step name to match build co…
  • Loading branch information
auphelia authored Jul 15, 2024
2 parents b50175c + 0133f23 commit 438a482
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/finn/builder/build_dataflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class VerificationStepType(str, Enum):
STREAMLINED_PYTHON = "streamlined_python"
#: verify after step_apply_folding_config, using C++ for each HLS node
FOLDED_HLS_CPPSIM = "folded_hls_cppsim"
#: verify after step_hw_ipgen
NODE_BY_NODE_RTLSIM = "node_by_node_rtlsim"
#: verify after step_create_stitched_ip, using stitched-ip Verilog
STITCHED_IP_RTLSIM = "stitched_ip_rtlsim"

Expand Down
7 changes: 6 additions & 1 deletion src/finn/builder/build_dataflow_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def step_qonnx_to_finn(model: ModelWrapper, cfg: DataflowBuildConfig):
)

if VerificationStepType.QONNX_TO_FINN_PYTHON in cfg._resolve_verification_steps():
verify_step(model, cfg, "qonnx_to_finn_python", need_parent=False)
verify_step(model, cfg, "finn_onnx_python", need_parent=False)

return model

Expand Down Expand Up @@ -527,6 +527,11 @@ def step_hw_ipgen(model: ModelWrapper, cfg: DataflowBuildConfig):
estimate_layer_resources_hls = model.analysis(hls_synth_res_estimation)
with open(report_dir + "/estimate_layer_resources_hls.json", "w") as f:
json.dump(estimate_layer_resources_hls, f, indent=2)

if VerificationStepType.NODE_BY_NODE_RTLSIM in cfg._resolve_verification_steps():
model = model.transform(PrepareRTLSim())
model = model.transform(SetExecMode("rtlsim"))
verify_step(model, cfg, "node_by_node_rtlsim", need_parent=True)
return model


Expand Down
1 change: 1 addition & 0 deletions src/finn/qnn-data/build_dataflow/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
build_cfg.VerificationStepType.TIDY_UP_PYTHON,
build_cfg.VerificationStepType.STREAMLINED_PYTHON,
build_cfg.VerificationStepType.FOLDED_HLS_CPPSIM,
build_cfg.VerificationStepType.NODE_BY_NODE_RTLSIM,
build_cfg.VerificationStepType.STITCHED_IP_RTLSIM,
],
save_intermediate_models=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"initial_python",
"streamlined_python",
"folded_hls_cppsim",
"node_by_node_rtlsim",
"stitched_ip_rtlsim"
],
"generate_outputs": [
Expand Down
1 change: 1 addition & 0 deletions tests/util/test_build_dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ def test_end2end_build_dataflow_directory():
assert os.path.isfile(verify_out_dir + f"/verify_initial_python_{i}_SUCCESS.npy")
assert os.path.isfile(verify_out_dir + f"/verify_streamlined_python_{i}_SUCCESS.npy")
assert os.path.isfile(verify_out_dir + f"/verify_folded_hls_cppsim_{i}_SUCCESS.npy")
assert os.path.isfile(verify_out_dir + f"/verify_node_by_node_rtlsim_{i}_SUCCESS.npy")
assert os.path.isfile(verify_out_dir + f"/verify_stitched_ip_rtlsim_{i}_SUCCESS.npy")
assert os.path.isfile(output_dir + f"/report/verify_rtlsim_{i}.vcd")

0 comments on commit 438a482

Please sign in to comment.