Skip to content
Snippets Groups Projects
Commit 9c74af52 authored by icolbert's avatar icolbert
Browse files

Creating and adding build step to default finn flows

parent 88b00a9f
No related branches found
No related tags found
No related merge requests found
...@@ -119,6 +119,7 @@ default_build_dataflow_steps = [ ...@@ -119,6 +119,7 @@ default_build_dataflow_steps = [
"step_create_dataflow_partition", "step_create_dataflow_partition",
"step_target_fps_parallelization", "step_target_fps_parallelization",
"step_apply_folding_config", "step_apply_folding_config",
"step_minimize_bit_width",
"step_generate_estimate_reports", "step_generate_estimate_reports",
"step_hls_codegen", "step_hls_codegen",
"step_hls_ipgen", "step_hls_ipgen",
...@@ -140,6 +141,7 @@ estimate_only_dataflow_steps = [ ...@@ -140,6 +141,7 @@ estimate_only_dataflow_steps = [
"step_create_dataflow_partition", "step_create_dataflow_partition",
"step_target_fps_parallelization", "step_target_fps_parallelization",
"step_apply_folding_config", "step_apply_folding_config",
"step_minimize_bit_width",
"step_generate_estimate_reports", "step_generate_estimate_reports",
] ]
......
...@@ -118,6 +118,8 @@ from finn.util.basic import ( ...@@ -118,6 +118,8 @@ from finn.util.basic import (
from finn.util.pyverilator import verilator_fifosim from finn.util.pyverilator import verilator_fifosim
from finn.util.test import execute_parent from finn.util.test import execute_parent
from finn.transformation.fpgadataflow.minimize_accumulator_width import MinimizeAccumulatorWidth
from finn.transformation.fpgadataflow.minimize_weight_bit_width import MinimizeWeightBitWidth
def verify_step( def verify_step(
model: ModelWrapper, model: ModelWrapper,
...@@ -477,6 +479,14 @@ def step_generate_estimate_reports(model: ModelWrapper, cfg: DataflowBuildConfig ...@@ -477,6 +479,14 @@ def step_generate_estimate_reports(model: ModelWrapper, cfg: DataflowBuildConfig
return model return model
def step_minimize_bit_width(model: ModelWrapper, cfg: DataflowBuildConfig):
"""Tighten the weight and accumulator bit widths for each layer."""
if cfg.minimize_bit_width:
model = model.transform(MinimizeWeightBitWidth())
model = model.transform(MinimizeAccumulatorWidth())
return model
def step_hls_codegen(model: ModelWrapper, cfg: DataflowBuildConfig): def step_hls_codegen(model: ModelWrapper, cfg: DataflowBuildConfig):
"Generate Vivado HLS code to prepare HLSCustomOp nodes for IP generation." "Generate Vivado HLS code to prepare HLSCustomOp nodes for IP generation."
......
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