Skip to content

Commit

Permalink
[Build] Fix missing step between config and build when passing vivado…
Browse files Browse the repository at this point in the history
… impl strategy
  • Loading branch information
johnnoel committed Oct 25, 2023
1 parent 600dda5 commit c58b3cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/finn/builder/build_dataflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class VitisOptStrategyCfg(str, Enum):
class VivadoImplStrategyCfg(str, Enum):
"Values applicable to VitisBuild Vivado implementation strategy"

ALL = "ALL"
DEFAULT = "'Vivado Implementation Defaults'"
PERFORMANCE_BALANCESLR = "Performance_BalanceSLRs"
PERFORMANCE_HIGHUTILSLR = "Performance_HighUtilSLRs"
Expand Down Expand Up @@ -414,6 +415,16 @@ def _resolve_vitis_opt_strategy(self):
}
return name_to_strategy[self.vitis_opt_strategy]

def _resolve_vivado_impl_strategy(self):
# convert human-readable enum to value expected by v++
name_to_strategy = {
VivadoImplStrategyCfg.ALL: VivadoImplStrategy.ALL,
VivadoImplStrategyCfg.DEFAULT: VivadoImplStrategy.DEFAULT,
VivadoImplStrategyCfg.PERFORMANCE_BALANCESLR: VivadoImplStrategy.PERFORMANCE_BALANCESLR,
VivadoImplStrategyCfg.PERFORMANCE_HIGHUTILSLR: VivadoImplStrategy.PERFORMANCE_HIGHUTILSLR, # noqa
}
return name_to_strategy[self.vivado_impl_strategy]

def _resolve_vitis_platform(self):
if self.vitis_platform is not None:
return self.vitis_platform
Expand Down
1 change: 1 addition & 0 deletions src/finn/builder/build_dataflow_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ def step_synthesize_bitfile(model: ModelWrapper, cfg: DataflowBuildConfig):
cfg.synth_clk_period_ns,
cfg._resolve_vitis_platform(),
strategy=cfg._resolve_vitis_opt_strategy(),
impl_strategy=cfg._resolve_vivado_impl_strategy(),
enable_debug=cfg.enable_hw_debug,
floorplan_file=cfg.vitis_floorplan_file,
partition_model_dir=partition_model_dir,
Expand Down
1 change: 1 addition & 0 deletions src/finn/transformation/fpgadataflow/vitis_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class VitisOptStrategy(Enum):
class VivadoImplStrategy(str, Enum):
"Values applicable to VitisBuild Vivado implementation strategy"

ALL = "ALL"
DEFAULT = "'Vivado Implementation Defaults'"
PERFORMANCE_BALANCESLR = "Performance_BalanceSLRs"
PERFORMANCE_HIGHUTILSLR = "Performance_HighUtilSLRs"
Expand Down

0 comments on commit c58b3cf

Please sign in to comment.