From d0c4aee0deae2bf38fbfe74f1d7680cbf73e2333 Mon Sep 17 00:00:00 2001 From: hlebleve Date: Fri, 12 Jan 2024 16:47:23 +0100 Subject: [PATCH 1/5] [ESPCN] Update of get_models.py to properly compute reference output and to use env variables instead of relative paths. Added extra verification scripts in the build to try to debunk where the problem lies. --- build/espcn/build.py | 3 ++- build/espcn/custom_steps.py | 7 +++++ build/espcn/models/get_model.py | 48 ++++++++++++++++++++++++++------- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/build/espcn/build.py b/build/espcn/build.py index 3aeb580e..33b93d32 100644 --- a/build/espcn/build.py +++ b/build/espcn/build.py @@ -37,6 +37,7 @@ espcn_build_steps = [ + custom_step_export_verification, custom_step_qonnx_tidy_up, custom_step_add_pre_proc, "step_qonnx_to_finn", @@ -69,7 +70,7 @@ fpga_part="xck26-sfvc784-2LV-c", shell_flow_type = build_cfg.ShellFlowType.VIVADO_ZYNQ, board = "KV260_SOM", - enable_build_pdb_debug=False, + enable_build_pdb_debug=True, verbose=False, split_large_fifos = True, folding_config_file = "folding_config_chrc_cap.json", diff --git a/build/espcn/custom_steps.py b/build/espcn/custom_steps.py index 153a8d84..2e688761 100644 --- a/build/espcn/custom_steps.py +++ b/build/espcn/custom_steps.py @@ -57,11 +57,17 @@ from finn.builder.build_dataflow_steps import verify_step from finn.util.pytorch import ToTensor +def custom_step_export_verification(model: ModelWrapper, cfg: DataflowBuildConfig): + model = model.transform(InferShapes()) + verify_step(model, cfg, "onnx_export", need_parent=False) + return model + def custom_step_qonnx_tidy_up(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) # QONNX transformations model = model.transform(SubPixelToDeconvolution()) model = model.transform(InferShapes()) + verify_step(model, cfg, "tidy_up", need_parent=False) return model @@ -86,6 +92,7 @@ def custom_step_add_pre_proc(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferDataTypes()) model = model.transform(RemoveStaticGraphInputs()) model = model.transform(RemoveUnusedTensors()) + verify_step(model, cfg, "pre_proc", need_parent=False) return model diff --git a/build/espcn/models/get_model.py b/build/espcn/models/get_model.py index bd70f4e5..82db2b09 100644 --- a/build/espcn/models/get_model.py +++ b/build/espcn/models/get_model.py @@ -1,3 +1,31 @@ +# Copyright (C) 2023, Advanced Micro Devices, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# * Neither the name of FINN nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + import brevitas_examples.super_resolution.models as models import brevitas_examples.super_resolution.utils as utils import os @@ -16,20 +44,20 @@ crop_size=256, download=True) -os.makedirs("../quant_espcn_x2_w4a4_base", exist_ok=True) +FINN_ROOT = os.getenv('FINN_ROOT') +path = os.path.realpath(FINN_ROOT+"/../espcn/quant_espcn_x2_w4a4_base/") +os.makedirs(path, exist_ok=True) -inp = testloader.dataset[0][0].unsqueeze(0) # NCHW -inp = torch.round(inp.to(device)*255) +inp = testloader.dataset[0][0].unsqueeze(0).to(device) # NCHW model = model.to(device) -with open(f"../quant_espcn_x2_w4a4_base/input.npy", "wb") as f: - np.save(f, inp.cpu().numpy()) -with open(f"../quant_espcn_x2_w4a4_base/output.npy", "wb") as f: +with open(path+"/input.npy", "wb") as f: + np.save(f, torch.round(inp*255).cpu().numpy()) +with open(path+"/output.npy", "wb") as f: np.save(f, model(inp).detach().cpu().numpy()) -print(f"Saved I/O to ../quant_espcn_x2_w4a4_base as numpy arrays") - +print(f"Saved I/O to "+path+" as numpy arrays") export_qonnx( model.cpu(), input_t=inp.cpu(), - export_path=f"../quant_espcn_x2_w4a4_base/qonnx_model.onnx", + export_path=path+"/qonnx_model.onnx", opset_version=13) -print(f"Saved QONNX model to ../quant_espcn_x2_w4a4_base/qonnx_model.onnx") +print(f"Saved QONNX model to"+path) From df01a4468a9c67f9fa7cd9cdcfae487555e4abbe Mon Sep 17 00:00:00 2001 From: hlebleve Date: Fri, 12 Jan 2024 16:57:26 +0100 Subject: [PATCH 2/5] [ESPCN] pre-commit hook fixes --- build/espcn/build.py | 26 +++++++++------- build/espcn/custom_steps.py | 7 +++-- build/espcn/folding_config_chrc_cap.json | 2 +- build/espcn/models/get_model.py | 39 ++++++++++++------------ 4 files changed, 39 insertions(+), 35 deletions(-) diff --git a/build/espcn/build.py b/build/espcn/build.py index 33b93d32..bc9770df 100644 --- a/build/espcn/build.py +++ b/build/espcn/build.py @@ -26,16 +26,20 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from custom_steps import * +from custom_steps import ( + custom_step_export_verification, + custom_step_qonnx_tidy_up, + custom_step_add_pre_proc, + custom_step_streamline, + custom_step_convert_to_hls, +) import finn.builder.build_dataflow as build import finn.builder.build_dataflow_config as build_cfg -from finn.builder.build_dataflow_steps import * model_name = "espcn-bsd300" - espcn_build_steps = [ custom_step_export_verification, custom_step_qonnx_tidy_up, @@ -68,16 +72,16 @@ synth_clk_period_ns=5.0, target_fps=10000, fpga_part="xck26-sfvc784-2LV-c", - shell_flow_type = build_cfg.ShellFlowType.VIVADO_ZYNQ, - board = "KV260_SOM", + shell_flow_type=build_cfg.ShellFlowType.VIVADO_ZYNQ, + board="KV260_SOM", enable_build_pdb_debug=True, verbose=False, - split_large_fifos = True, - folding_config_file = "folding_config_chrc_cap.json", - auto_fifo_depths = False, - rtlsim_batch_size = 100, - verify_input_npy = "quant_espcn_x2_w4a4_base/input.npy", - verify_expected_output_npy = "quant_espcn_x2_w4a4_base/output.npy", + split_large_fifos=True, + folding_config_file="folding_config_chrc_cap.json", + auto_fifo_depths=False, + rtlsim_batch_size=100, + verify_input_npy="quant_espcn_x2_w4a4_base/input.npy", + verify_expected_output_npy="quant_espcn_x2_w4a4_base/output.npy", verify_steps=[ build_cfg.VerificationStepType.QONNX_TO_FINN_PYTHON, build_cfg.VerificationStepType.TIDY_UP_PYTHON, diff --git a/build/espcn/custom_steps.py b/build/espcn/custom_steps.py index 2e688761..47d77015 100644 --- a/build/espcn/custom_steps.py +++ b/build/espcn/custom_steps.py @@ -50,18 +50,19 @@ from finn.transformation.streamline import Streamline from finn.transformation.streamline.round_thresholds import RoundAndClipThresholds from finn.transformation.streamline.reorder import MoveScalarMulPastConvTranspose -from finn.transformation.move_reshape import RemoveCNVtoFCFlatten from finn.transformation.fpgadataflow.infer_pixel_padding_deconv import InferPixelPaddingDeconv from finn.builder.build_dataflow_config import DataflowBuildConfig, VerificationStepType from finn.builder.build_dataflow_steps import verify_step from finn.util.pytorch import ToTensor + def custom_step_export_verification(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) verify_step(model, cfg, "onnx_export", need_parent=False) return model + def custom_step_qonnx_tidy_up(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) # QONNX transformations @@ -96,6 +97,7 @@ def custom_step_add_pre_proc(model: ModelWrapper, cfg: DataflowBuildConfig): return model + def custom_step_streamline(model: ModelWrapper, cfg: DataflowBuildConfig): """Run streamlining on given model. Streamlining involves moving floating point scale/shift parameters around, collapsing adjacent ones into a single parameter, @@ -114,7 +116,7 @@ def custom_step_streamline(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(LowerConvsToMatMul()) model = model.transform(absorb.AbsorbConsecutiveTransposes()) model = model.transform(absorb.AbsorbTransposeIntoMultiThreshold()) - + model = model.transform(Streamline()) model = model.transform(absorb.AbsorbConsecutiveTransposes()) model = model.transform(InferDataLayouts()) @@ -131,7 +133,6 @@ def custom_step_convert_to_hls(model: ModelWrapper, cfg: DataflowBuildConfig): layers. Which nodes and particular configurations can be converted to HLS is limited, see the source code of the `convert_to_hls` module for more.""" - mem_mode = cfg.default_mem_mode.value if cfg.standalone_thresholds: # doing this first causes all threshold layers to be standalone diff --git a/build/espcn/folding_config_chrc_cap.json b/build/espcn/folding_config_chrc_cap.json index cf9e630c..3a7d34f9 100644 --- a/build/espcn/folding_config_chrc_cap.json +++ b/build/espcn/folding_config_chrc_cap.json @@ -518,4 +518,4 @@ 0 ] } -} \ No newline at end of file +} diff --git a/build/espcn/models/get_model.py b/build/espcn/models/get_model.py index 82db2b09..198a4098 100644 --- a/build/espcn/models/get_model.py +++ b/build/espcn/models/get_model.py @@ -33,31 +33,30 @@ import numpy as np from brevitas.export import export_qonnx -model = models.get_model_by_name('quant_espcn_x2_w4a4_base', True) -device = 'cuda' if torch.cuda.is_available() else 'cpu' +model = models.get_model_by_name("quant_espcn_x2_w4a4_base", True) +device = "cuda" if torch.cuda.is_available() else "cpu" model = model.to(device) _, testloader = utils.get_bsd300_dataloaders( - "../data", - num_workers=0, - batch_size=1, - upscale_factor=model.upscale_factor, - crop_size=256, - download=True) + "../data", + num_workers=0, + batch_size=1, + upscale_factor=model.upscale_factor, + crop_size=256, + download=True, +) -FINN_ROOT = os.getenv('FINN_ROOT') -path = os.path.realpath(FINN_ROOT+"/../espcn/quant_espcn_x2_w4a4_base/") +FINN_ROOT = os.getenv("FINN_ROOT") +path = os.path.realpath(FINN_ROOT + "/../espcn/quant_espcn_x2_w4a4_base/") os.makedirs(path, exist_ok=True) inp = testloader.dataset[0][0].unsqueeze(0).to(device) # NCHW model = model.to(device) -with open(path+"/input.npy", "wb") as f: - np.save(f, torch.round(inp*255).cpu().numpy()) -with open(path+"/output.npy", "wb") as f: - np.save(f, model(inp).detach().cpu().numpy()) -print(f"Saved I/O to "+path+" as numpy arrays") +with open(path + "/input.npy", "wb") as f: + np.save(f, torch.round(inp * 255).cpu().numpy()) +with open(path + "/output.npy", "wb") as f: + np.save(f, model(inp).detach().cpu().numpy()) +print("Saved I/O to " + path + " as numpy arrays") export_qonnx( - model.cpu(), - input_t=inp.cpu(), - export_path=path+"/qonnx_model.onnx", - opset_version=13) -print(f"Saved QONNX model to"+path) + model.cpu(), input_t=inp.cpu(), export_path=path + "/qonnx_model.onnx", opset_version=13 +) +print("Saved QONNX model to" + path) From 54ea84961e6ac061a6f424facddd17852bd5948c Mon Sep 17 00:00:00 2001 From: Hugo Le Blevec Date: Fri, 8 Mar 2024 15:55:33 +0100 Subject: [PATCH 3/5] Updating for NNRC to Deconv build --- build/espcn/build.py | 24 +- build/espcn/custom_steps.py | 18 +- build/espcn/folding_config_nn_cap.json | 429 ++++++++++++++++ build/espcn/folding_config_rcnntdc_cap.json | 521 ++++++++++++++++++++ build/espcn/models/get_model.py | 3 +- build/get-finn.sh | 6 +- 6 files changed, 984 insertions(+), 17 deletions(-) create mode 100644 build/espcn/folding_config_nn_cap.json create mode 100644 build/espcn/folding_config_rcnntdc_cap.json diff --git a/build/espcn/build.py b/build/espcn/build.py index bc9770df..d1421a23 100644 --- a/build/espcn/build.py +++ b/build/espcn/build.py @@ -27,7 +27,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from custom_steps import ( - custom_step_export_verification, + # custom_step_export_verification, custom_step_qonnx_tidy_up, custom_step_add_pre_proc, custom_step_streamline, @@ -37,11 +37,11 @@ import finn.builder.build_dataflow as build import finn.builder.build_dataflow_config as build_cfg -model_name = "espcn-bsd300" +model_name = "espcn-bsd300-RCNNTDC" espcn_build_steps = [ - custom_step_export_verification, + # custom_step_export_verification, custom_step_qonnx_tidy_up, custom_step_add_pre_proc, "step_qonnx_to_finn", @@ -70,23 +70,27 @@ steps=espcn_build_steps, output_dir="output_%s_kriasom" % (model_name), synth_clk_period_ns=5.0, - target_fps=10000, + target_fps=30, fpga_part="xck26-sfvc784-2LV-c", shell_flow_type=build_cfg.ShellFlowType.VIVADO_ZYNQ, board="KV260_SOM", enable_build_pdb_debug=True, - verbose=False, + verbose=True, split_large_fifos=True, - folding_config_file="folding_config_chrc_cap.json", + folding_config_file="folding_config_rcnntdc_cap.json", auto_fifo_depths=False, + # auto_fifo_strategy = build_cfg.AutoFIFOSizingMethod.CHARACTERIZE, rtlsim_batch_size=100, + force_rtl_conv_inp_gen=False, + # start_step="step_hls_ipgen", + # stop_step = "step_generate_estimate_reports", verify_input_npy="quant_espcn_x2_w4a4_base/input.npy", verify_expected_output_npy="quant_espcn_x2_w4a4_base/output.npy", verify_steps=[ - build_cfg.VerificationStepType.QONNX_TO_FINN_PYTHON, - build_cfg.VerificationStepType.TIDY_UP_PYTHON, - build_cfg.VerificationStepType.STREAMLINED_PYTHON, - build_cfg.VerificationStepType.FOLDED_HLS_CPPSIM, + # build_cfg.VerificationStepType.QONNX_TO_FINN_PYTHON, + # build_cfg.VerificationStepType.TIDY_UP_PYTHON, + # build_cfg.VerificationStepType.STREAMLINED_PYTHON, + # build_cfg.VerificationStepType.FOLDED_HLS_CPPSIM,True ], generate_outputs=[ build_cfg.DataflowOutputType.ESTIMATE_REPORTS, diff --git a/build/espcn/custom_steps.py b/build/espcn/custom_steps.py index 47d77015..0a63dfdc 100644 --- a/build/espcn/custom_steps.py +++ b/build/espcn/custom_steps.py @@ -42,6 +42,7 @@ from qonnx.transformation.infer_shapes import InferShapes from qonnx.transformation.merge_onnx_models import MergeONNXModels from qonnx.transformation.subpixel_to_deconv import SubPixelToDeconvolution +from qonnx.transformation.resize_conv_to_deconv import ResizeConvolutionToDeconvolution from qonnx.transformation.lower_convs_to_matmul import LowerConvsToMatMul from qonnx.transformation.infer_data_layouts import InferDataLayouts @@ -49,7 +50,10 @@ import finn.transformation.fpgadataflow.convert_to_hls_layers as to_hls from finn.transformation.streamline import Streamline from finn.transformation.streamline.round_thresholds import RoundAndClipThresholds -from finn.transformation.streamline.reorder import MoveScalarMulPastConvTranspose +from finn.transformation.streamline.reorder import ( + MoveScalarMulPastConvTranspose, + MakeScaleResizeNHWC, +) from finn.transformation.fpgadataflow.infer_pixel_padding_deconv import InferPixelPaddingDeconv from finn.builder.build_dataflow_config import DataflowBuildConfig, VerificationStepType @@ -59,7 +63,7 @@ def custom_step_export_verification(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) - verify_step(model, cfg, "onnx_export", need_parent=False) + # verify_step(model, cfg, "onnx_export", need_parent=False) return model @@ -67,8 +71,9 @@ def custom_step_qonnx_tidy_up(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) # QONNX transformations model = model.transform(SubPixelToDeconvolution()) + model = model.transform(ResizeConvolutionToDeconvolution(maintain_bit_width=False)) model = model.transform(InferShapes()) - verify_step(model, cfg, "tidy_up", need_parent=False) + # verify_step(model, cfg, "tidy_up", need_parent=False) return model @@ -93,7 +98,7 @@ def custom_step_add_pre_proc(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferDataTypes()) model = model.transform(RemoveStaticGraphInputs()) model = model.transform(RemoveUnusedTensors()) - verify_step(model, cfg, "pre_proc", need_parent=False) + # verify_step(model, cfg, "pre_proc", need_parent=False) return model @@ -118,6 +123,8 @@ def custom_step_streamline(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(absorb.AbsorbTransposeIntoMultiThreshold()) model = model.transform(Streamline()) + model = model.transform(InferDataLayouts()) + model = model.transform(MakeScaleResizeNHWC()) model = model.transform(absorb.AbsorbConsecutiveTransposes()) model = model.transform(InferDataLayouts()) model = model.transform(RemoveUnusedTensors()) @@ -142,6 +149,9 @@ def custom_step_convert_to_hls(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferPixelPaddingDeconv()) model = model.transform(absorb.AbsorbTransposeIntoMultiThreshold()) model = model.transform(RoundAndClipThresholds()) + need_upsample = len(model.get_nodes_by_op_type("Resize")) > 0 + if need_upsample: + model = model.transform(to_hls.InferUpsample()) # needed for non-bipolar MatMul layers model = model.transform(to_hls.InferQuantizedMatrixVectorActivation(mem_mode)) # input quantization (if any) as standalone threshold diff --git a/build/espcn/folding_config_nn_cap.json b/build/espcn/folding_config_nn_cap.json new file mode 100644 index 00000000..0672c1b4 --- /dev/null +++ b/build/espcn/folding_config_nn_cap.json @@ -0,0 +1,429 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 174 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 174, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_rtl_0": { + "SIMD": 3, + "inFIFODepths": [ + 174 + ], + "outFIFODepths": [ + 15818 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 15818, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 15818 + ], + "outFIFODepths": [ + 52272 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_rtl_0": { + "SIMD": 1, + "parallel_window": 0, + "ram_style": "auto", + "inFIFODepths": [ + 52272 + ], + "outFIFODepths": [ + 767705 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 767705 + ], + "outFIFODepths": [ + 409600 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 8, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 409600 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_rtl_1": { + "SIMD": 64, + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 254 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 254, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 254 + ], + "outFIFODepths": [ + 8000 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 8000, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_rtl_1": { + "SIMD": 2, + "parallel_window": 0, + "ram_style": "auto", + "inFIFODepths": [ + 8000 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 40 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 40, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 16, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 40 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_rtl_2": { + "SIMD": 64, + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 252 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 252, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 252 + ], + "outFIFODepths": [ + 7330 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 7330, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_rtl_2": { + "SIMD": 2, + "parallel_window": 0, + "ram_style": "auto", + "inFIFODepths": [ + 7330 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 40 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 40, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 40 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_4": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_0": { + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_rtl_3": { + "SIMD": 32, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 790 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 790, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_5": { + "impl_style": "hls", + "inFIFODepths": [ + 790 + ], + "outFIFODepths": [ + 6416 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 6416, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_rtl_3": { + "SIMD": 4, + "parallel_window": 0, + "ram_style": "auto", + "inFIFODepths": [ + 6416 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 0 + ] + } +} diff --git a/build/espcn/folding_config_rcnntdc_cap.json b/build/espcn/folding_config_rcnntdc_cap.json new file mode 100644 index 00000000..e267397a --- /dev/null +++ b/build/espcn/folding_config_rcnntdc_cap.json @@ -0,0 +1,521 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "auto", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "auto", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 4, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "auto", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 8, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_4": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_5": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 2, + "ram_style": "auto", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_6": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_7": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_8": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "auto", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_9": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 16, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} diff --git a/build/espcn/models/get_model.py b/build/espcn/models/get_model.py index 198a4098..feb957c9 100644 --- a/build/espcn/models/get_model.py +++ b/build/espcn/models/get_model.py @@ -33,7 +33,8 @@ import numpy as np from brevitas.export import export_qonnx -model = models.get_model_by_name("quant_espcn_x2_w4a4_base", True) +# model = models.get_model_by_name("quant_espcn_x2_w4a4_base", True) +model = models.quant_espcn_nnrc(upscale_factor=2, weight_bit_width=4, act_bit_width=4) device = "cuda" if torch.cuda.is_available() else "cpu" model = model.to(device) _, testloader = utils.get_bsd300_dataloaders( diff --git a/build/get-finn.sh b/build/get-finn.sh index b89d1591..17cf20a6 100755 --- a/build/get-finn.sh +++ b/build/get-finn.sh @@ -28,9 +28,11 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # URL for git repo to be cloned -REPO_URL=https://github.com/Xilinx/finn +# REPO_URL=https://github.com/Xilinx/finn +REPO_URL="https://github.com/hleblevec/finn-fork.git" # commit hash for repo -REPO_COMMIT=e9985e66bbfefd4beca3e6bc6da6c9136e9a15b6 +# REPO_COMMIT=e9985e66bbfefd4beca3e6bc6da6c9136e9a15b6 +REPO_COMMIT="24615067e47d987bd6ea4254932324cab3c04f28" # directory (under the same folder as this script) to clone to REPO_DIR=finn From 96a58705dd0572e5e9b29bd5149be08bf5cb258d Mon Sep 17 00:00:00 2001 From: hleblevec Date: Thu, 4 Dec 2025 16:37:54 +0100 Subject: [PATCH 4/5] Update with all building configs --- build/espcn/build.py | 74 +- build/espcn/custom_steps.py | 10 +- .../espcn_x2_w3a3_d-nn_kriasom.json | 495 ++++++++++++ .../espcn_x2_w3a3_d-sp_kriasom.json} | 40 +- .../espcn_x2_w3a3_deconv_kriasom.json} | 62 +- .../espcn_x2_w3a3_nnrc_kriasom.json | 517 ++++++++++++ .../espcn_x2_w4a4_d-nn_kriasom.json | 495 ++++++++++++ .../espcn_x2_w4a4_d-sp_kriasom.json | 515 ++++++++++++ .../espcn_x2_w4a4_deconv_kriasom.json | 515 ++++++++++++ .../espcn_x2_w4a4_nnrc_kriasom.json} | 268 ++++--- .../espcn_x4-n1_w4a4_d-nn_zcu104.json | 435 ++++++++++ .../espcn_x4-n2_w4a4_d-nn_zcu104.json | 559 +++++++++++++ .../espcn_x4_n1_w4a4_d-sp_zcu104.json | 435 ++++++++++ .../espcn_x4_n1_w4a4_deconv_zcu104.json | 435 ++++++++++ .../espcn_x4_n1_w4a4_nnrc_zcu104.json | 453 +++++++++++ .../espcn_x4_n2_w4a4_d-sp_zcu104.json | 578 +++++++++++++ .../espcn_x4_n2_w4a4_deconv_zcu104.json | 578 +++++++++++++ .../espcn_x4_n2_w4a4_nnrc_zcu104.json | 595 ++++++++++++++ .../espcn_x8-n1_w4a4_d-nn_zcu104.json | 416 ++++++++++ .../espcn_x8-n3_w4a4_d-nn_zcu104.json | 664 +++++++++++++++ .../espcn_x8_n1_w4a4_d-sp_zcu104.json | 416 ++++++++++ .../espcn_x8_n1_w4a4_deconv_zcu104.json | 416 ++++++++++ .../espcn_x8_n1_w4a4_nnrc_zcu104.json | 453 +++++++++++ .../espcn_x8_n3_w4a4_d-sp_zcu104.json | 746 +++++++++++++++++ .../espcn_x8_n3_w4a4_deconv_zcu104.json | 746 +++++++++++++++++ .../espcn_x8_n3_w4a4_nnrc_zcu104.json | 756 ++++++++++++++++++ build/espcn/models/get_model.py | 68 +- build/get-finn.sh | 3 +- 28 files changed, 11531 insertions(+), 212 deletions(-) create mode 100644 build/espcn/folding_configs/espcn_x2_w3a3_d-nn_kriasom.json rename build/espcn/{folding_config_chrc_cap.json => folding_configs/espcn_x2_w3a3_d-sp_kriasom.json} (94%) rename build/espcn/{folding_config_rcnntdc_cap.json => folding_configs/espcn_x2_w3a3_deconv_kriasom.json} (90%) create mode 100644 build/espcn/folding_configs/espcn_x2_w3a3_nnrc_kriasom.json create mode 100644 build/espcn/folding_configs/espcn_x2_w4a4_d-nn_kriasom.json create mode 100644 build/espcn/folding_configs/espcn_x2_w4a4_d-sp_kriasom.json create mode 100644 build/espcn/folding_configs/espcn_x2_w4a4_deconv_kriasom.json rename build/espcn/{folding_config_nn_cap.json => folding_configs/espcn_x2_w4a4_nnrc_kriasom.json} (76%) create mode 100644 build/espcn/folding_configs/espcn_x4-n1_w4a4_d-nn_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4-n2_w4a4_d-nn_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4_n1_w4a4_d-sp_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4_n1_w4a4_deconv_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4_n1_w4a4_nnrc_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4_n2_w4a4_d-sp_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4_n2_w4a4_deconv_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x4_n2_w4a4_nnrc_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8-n1_w4a4_d-nn_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8-n3_w4a4_d-nn_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8_n1_w4a4_d-sp_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8_n1_w4a4_deconv_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8_n1_w4a4_nnrc_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8_n3_w4a4_d-sp_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8_n3_w4a4_deconv_zcu104.json create mode 100644 build/espcn/folding_configs/espcn_x8_n3_w4a4_nnrc_zcu104.json diff --git a/build/espcn/build.py b/build/espcn/build.py index d1421a23..fee49489 100644 --- a/build/espcn/build.py +++ b/build/espcn/build.py @@ -27,7 +27,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from custom_steps import ( - # custom_step_export_verification, + custom_step_export_verification, custom_step_qonnx_tidy_up, custom_step_add_pre_proc, custom_step_streamline, @@ -36,9 +36,7 @@ import finn.builder.build_dataflow as build import finn.builder.build_dataflow_config as build_cfg - -model_name = "espcn-bsd300-RCNNTDC" - +import argparse espcn_build_steps = [ # custom_step_export_verification, @@ -64,40 +62,38 @@ "step_deployment_package", ] -model_file = "quant_espcn_x2_w4a4_base/qonnx_model.onnx" -cfg = build_cfg.DataflowBuildConfig( - steps=espcn_build_steps, - output_dir="output_%s_kriasom" % (model_name), - synth_clk_period_ns=5.0, - target_fps=30, - fpga_part="xck26-sfvc784-2LV-c", - shell_flow_type=build_cfg.ShellFlowType.VIVADO_ZYNQ, - board="KV260_SOM", - enable_build_pdb_debug=True, - verbose=True, - split_large_fifos=True, - folding_config_file="folding_config_rcnntdc_cap.json", - auto_fifo_depths=False, - # auto_fifo_strategy = build_cfg.AutoFIFOSizingMethod.CHARACTERIZE, - rtlsim_batch_size=100, - force_rtl_conv_inp_gen=False, - # start_step="step_hls_ipgen", - # stop_step = "step_generate_estimate_reports", - verify_input_npy="quant_espcn_x2_w4a4_base/input.npy", - verify_expected_output_npy="quant_espcn_x2_w4a4_base/output.npy", - verify_steps=[ - # build_cfg.VerificationStepType.QONNX_TO_FINN_PYTHON, - # build_cfg.VerificationStepType.TIDY_UP_PYTHON, - # build_cfg.VerificationStepType.STREAMLINED_PYTHON, - # build_cfg.VerificationStepType.FOLDED_HLS_CPPSIM,True - ], - generate_outputs=[ - build_cfg.DataflowOutputType.ESTIMATE_REPORTS, - build_cfg.DataflowOutputType.STITCHED_IP, - build_cfg.DataflowOutputType.RTLSIM_PERFORMANCE, - build_cfg.DataflowOutputType.BITFILE, - ], -) -build.build_dataflow_cfg(model_file, cfg) +def main(model_file, output_dir, folding_config_file, board): + cfg = build_cfg.DataflowBuildConfig( + steps=espcn_build_steps, + output_dir=output_dir, + synth_clk_period_ns=5.0, + target_fps=42, + shell_flow_type=build_cfg.ShellFlowType.VIVADO_ZYNQ, + board=board, + split_large_fifos=True, + folding_config_file=folding_config_file, + auto_fifo_depths=False, + auto_fifo_strategy = build_cfg.AutoFIFOSizingMethod.CHARACTERIZE, + rtlsim_batch_size=100, + force_rtl_conv_inp_gen=False, + max_multithreshold_bit_width = 9, + generate_outputs=[ + build_cfg.DataflowOutputType.ESTIMATE_REPORTS, + # build_cfg.DataflowOutputType.STITCHED_IP, + # build_cfg.DataflowOutputType.RTLSIM_PERFORMANCE, + build_cfg.DataflowOutputType.BITFILE, + ], + ) + build.build_dataflow_cfg(model_file, cfg) + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('-f', '--model_file', type=str, required=True) + parser.add_argument('-o', '--output_dir', type=str, required=True) + parser.add_argument('-c', '--folding_config_file', type=str, required=False) + parser.add_argument('-b', '--board', choices=['KV260_SOM', 'ZCU104'],type=str, required=True) + args = parser.parse_args() + main(args.model_file, args.output_dir, args.folding_config_file, args.board) + diff --git a/build/espcn/custom_steps.py b/build/espcn/custom_steps.py index 0a63dfdc..a40c3308 100644 --- a/build/espcn/custom_steps.py +++ b/build/espcn/custom_steps.py @@ -63,18 +63,18 @@ def custom_step_export_verification(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) - # verify_step(model, cfg, "onnx_export", need_parent=False) + verify_step(model, cfg, "onnx_export", need_parent=False) return model def custom_step_qonnx_tidy_up(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(InferShapes()) + model = model.transform(GiveUniqueParameterTensors()) # QONNX transformations - model = model.transform(SubPixelToDeconvolution()) - model = model.transform(ResizeConvolutionToDeconvolution(maintain_bit_width=False)) + # model = model.transform(SubPixelToDeconvolution()) + # model = model.transform(ResizeConvolutionToDeconvolution(maintain_bit_width=False)) model = model.transform(InferShapes()) - # verify_step(model, cfg, "tidy_up", need_parent=False) - return model + #verify_step(model, cfg, "custom_tidy_up", need_parent=False) def custom_step_add_pre_proc(model: ModelWrapper, cfg: DataflowBuildConfig): diff --git a/build/espcn/folding_configs/espcn_x2_w3a3_d-nn_kriasom.json b/build/espcn/folding_configs/espcn_x2_w3a3_d-nn_kriasom.json new file mode 100644 index 00000000..29009f6d --- /dev/null +++ b/build/espcn/folding_configs/espcn_x2_w3a3_d-nn_kriasom.json @@ -0,0 +1,495 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 4, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "distributed", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 8, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_11": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_19": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 16, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 32, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_config_chrc_cap.json b/build/espcn/folding_configs/espcn_x2_w3a3_d-sp_kriasom.json similarity index 94% rename from build/espcn/folding_config_chrc_cap.json rename to build/espcn/folding_configs/espcn_x2_w3a3_d-sp_kriasom.json index 3a7d34f9..b7497f3a 100644 --- a/build/espcn/folding_config_chrc_cap.json +++ b/build/espcn/folding_configs/espcn_x2_w3a3_d-sp_kriasom.json @@ -75,13 +75,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_0": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_0": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_4": { @@ -120,13 +119,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_1": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_1": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_6": { @@ -160,13 +158,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_2": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_2": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_8": { @@ -201,13 +198,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_3": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_3": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_10": { @@ -246,13 +242,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_4": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_4": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_12": { @@ -286,13 +281,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_5": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_5": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_14": { @@ -327,7 +321,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_6": { + "StreamingDataWidthConverter_Batch_0": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -372,7 +366,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_7": { + "StreamingDataWidthConverter_Batch_1": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -432,7 +426,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_8": { + "StreamingDataWidthConverter_Batch_2": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -473,7 +467,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_9": { + "StreamingDataWidthConverter_Batch_3": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -518,4 +512,4 @@ 0 ] } -} +} \ No newline at end of file diff --git a/build/espcn/folding_config_rcnntdc_cap.json b/build/espcn/folding_configs/espcn_x2_w3a3_deconv_kriasom.json similarity index 90% rename from build/espcn/folding_config_rcnntdc_cap.json rename to build/espcn/folding_configs/espcn_x2_w3a3_deconv_kriasom.json index e267397a..b7497f3a 100644 --- a/build/espcn/folding_config_rcnntdc_cap.json +++ b/build/espcn/folding_configs/espcn_x2_w3a3_deconv_kriasom.json @@ -13,7 +13,7 @@ }, "Thresholding_Batch_0": { "PE": 1, - "ram_style": "auto", + "ram_style": "distributed", "mem_mode": "const", "runtime_writeable_weights": 0, "inFIFODepths": [ @@ -56,7 +56,7 @@ }, "ConvolutionInputGenerator_0": { "SIMD": 1, - "ram_style": "auto", + "ram_style": "distributed", "inFIFODepths": [ 2 ], @@ -75,17 +75,16 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_0": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_0": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_4": { - "ram_style": "auto", + "ram_style": "ultra", "depth": 16384, "impl_style": "vivado", "inFIFODepths": [ @@ -120,13 +119,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_1": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_1": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_6": { @@ -160,13 +158,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_2": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_2": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_8": { @@ -182,7 +179,7 @@ }, "ConvolutionInputGenerator_1": { "SIMD": 2, - "ram_style": "auto", + "ram_style": "distributed", "inFIFODepths": [ 2 ], @@ -201,17 +198,16 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_3": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_3": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_10": { - "ram_style": "auto", + "ram_style": "distributed", "depth": 16384, "impl_style": "vivado", "inFIFODepths": [ @@ -236,7 +232,7 @@ ] }, "StreamingFIFO_11": { - "ram_style": "auto", + "ram_style": "ultra", "depth": 16384, "impl_style": "vivado", "inFIFODepths": [ @@ -246,13 +242,12 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_4": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_4": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_12": { @@ -286,17 +281,16 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_5": { - "impl_style": "hls", + "StreamingDataWidthConverter_rtl_5": { "inFIFODepths": [ 2 ], "outFIFODepths": [ - 16384 + 2 ] }, "StreamingFIFO_14": { - "ram_style": "auto", + "ram_style": "ultra", "depth": 16384, "impl_style": "vivado", "inFIFODepths": [ @@ -308,7 +302,7 @@ }, "ConvolutionInputGenerator_2": { "SIMD": 2, - "ram_style": "auto", + "ram_style": "distributed", "inFIFODepths": [ 2 ], @@ -327,7 +321,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_6": { + "StreamingDataWidthConverter_Batch_0": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -372,7 +366,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_7": { + "StreamingDataWidthConverter_Batch_1": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -402,7 +396,7 @@ ] }, "StreamingFIFO_19": { - "ram_style": "auto", + "ram_style": "ultra", "depth": 16384, "impl_style": "vivado", "inFIFODepths": [ @@ -432,7 +426,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_8": { + "StreamingDataWidthConverter_Batch_2": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -454,7 +448,7 @@ }, "ConvolutionInputGenerator_3": { "SIMD": 16, - "ram_style": "auto", + "ram_style": "distributed", "inFIFODepths": [ 2 ], @@ -473,7 +467,7 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_9": { + "StreamingDataWidthConverter_Batch_3": { "impl_style": "hls", "inFIFODepths": [ 2 @@ -495,7 +489,7 @@ }, "MatrixVectorActivation_3": { "PE": 3, - "SIMD": 16, + "SIMD": 18, "ram_style": "auto", "resType": "lut", "mem_mode": "decoupled", @@ -518,4 +512,4 @@ 0 ] } -} +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x2_w3a3_nnrc_kriasom.json b/build/espcn/folding_configs/espcn_x2_w3a3_nnrc_kriasom.json new file mode 100644 index 00000000..7f1018c5 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x2_w3a3_nnrc_kriasom.json @@ -0,0 +1,517 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 174, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 15818, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 174 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 8, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 409600 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 15818 + ], + "outFIFODepths": [ + 52272 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 767705 + ], + "outFIFODepths": [ + 409600 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 254, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 40 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 8000, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 16, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 40 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 40, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 252 + ], + "outFIFODepths": [ + 7330 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 252, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 40 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 7330, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 40 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_4": { + "impl_style": "hls", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 40, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_0": { + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_5": { + "impl_style": "hls", + "inFIFODepths": [ + 790 + ], + "outFIFODepths": [ + 6416 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_6": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 790, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 4, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 6416, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x2_w4a4_d-nn_kriasom.json b/build/espcn/folding_configs/espcn_x2_w4a4_d-nn_kriasom.json new file mode 100644 index 00000000..a1d1e502 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x2_w4a4_d-nn_kriasom.json @@ -0,0 +1,495 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 4, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "distributed", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 8, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_11": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_19": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 16, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 32, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x2_w4a4_d-sp_kriasom.json b/build/espcn/folding_configs/espcn_x2_w4a4_d-sp_kriasom.json new file mode 100644 index 00000000..b7497f3a --- /dev/null +++ b/build/espcn/folding_configs/espcn_x2_w4a4_d-sp_kriasom.json @@ -0,0 +1,515 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 4, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "distributed", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 8, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_11": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_19": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x2_w4a4_deconv_kriasom.json b/build/espcn/folding_configs/espcn_x2_w4a4_deconv_kriasom.json new file mode 100644 index 00000000..b7497f3a --- /dev/null +++ b/build/espcn/folding_configs/espcn_x2_w4a4_deconv_kriasom.json @@ -0,0 +1,515 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 4, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "distributed", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 8, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_11": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 8, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_19": { + "ram_style": "ultra", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 18, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_config_nn_cap.json b/build/espcn/folding_configs/espcn_x2_w4a4_nnrc_kriasom.json similarity index 76% rename from build/espcn/folding_config_nn_cap.json rename to build/espcn/folding_configs/espcn_x2_w4a4_nnrc_kriasom.json index 0672c1b4..2f389648 100644 --- a/build/espcn/folding_config_nn_cap.json +++ b/build/espcn/folding_configs/espcn_x2_w4a4_nnrc_kriasom.json @@ -23,12 +23,24 @@ 0 ] }, - "StreamingDataWidthConverter_rtl_0": { + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", "inFIFODepths": [ 0 ], "outFIFODepths": [ - 174 + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 ] }, "StreamingFIFO_2": { @@ -42,13 +54,14 @@ 0 ] }, - "FMPadding_rtl_0": { - "SIMD": 3, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", "inFIFODepths": [ - 174 + 2 ], "outFIFODepths": [ - 15818 + 2 ] }, "StreamingFIFO_3": { @@ -62,12 +75,12 @@ 0 ] }, - "StreamingDataWidthConverter_rtl_1": { + "StreamingDataWidthConverter_rtl_0": { "inFIFODepths": [ - 15818 + 0 ], "outFIFODepths": [ - 52272 + 174 ] }, "StreamingFIFO_4": { @@ -81,15 +94,18 @@ 0 ] }, - "ConvolutionInputGenerator_rtl_0": { - "SIMD": 1, - "parallel_window": 0, + "MatrixVectorActivation_0": { + "PE": 8, + "SIMD": 3, "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, "inFIFODepths": [ - 52272 + 409600 ], "outFIFODepths": [ - 767705 + 0 ] }, "StreamingFIFO_5": { @@ -103,12 +119,12 @@ 0 ] }, - "StreamingDataWidthConverter_rtl_2": { + "StreamingDataWidthConverter_rtl_1": { "inFIFODepths": [ - 767705 + 15818 ], "outFIFODepths": [ - 409600 + 52272 ] }, "StreamingFIFO_6": { @@ -122,21 +138,19 @@ 0 ] }, - "MatrixVectorActivation_0": { - "PE": 8, - "SIMD": 3, - "ram_style": "auto", - "resType": "lut", - "mem_mode": "decoupled", - "runtime_writeable_weights": 0, + "FMPadding_Batch_1": { + "SIMD": 1, "inFIFODepths": [ - 409600 + 2 ], "outFIFODepths": [ - 0 + 2 ] }, - "StreamingDataWidthConverter_rtl_3": { + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", "inFIFODepths": [ 0 ], @@ -144,18 +158,17 @@ 0 ] }, - "FMPadding_rtl_1": { - "SIMD": 64, + "StreamingDataWidthConverter_rtl_2": { "inFIFODepths": [ - 0 + 767705 ], "outFIFODepths": [ - 254 + 409600 ] }, - "StreamingFIFO_9": { + "StreamingFIFO_8": { "ram_style": "auto", - "depth": 254, + "depth": 2, "impl_style": "rtl", "inFIFODepths": [ 0 @@ -164,18 +177,20 @@ 0 ] }, - "StreamingDataWidthConverter_rtl_4": { + "ConvolutionInputGenerator_1": { + "SIMD": 2, + "ram_style": "distributed", "inFIFODepths": [ - 254 + 2 ], "outFIFODepths": [ - 8000 + 2 ] }, - "StreamingFIFO_10": { + "StreamingFIFO_9": { "ram_style": "auto", - "depth": 8000, - "impl_style": "vivado", + "depth": 254, + "impl_style": "rtl", "inFIFODepths": [ 0 ], @@ -183,17 +198,6 @@ 0 ] }, - "ConvolutionInputGenerator_rtl_1": { - "SIMD": 2, - "parallel_window": 0, - "ram_style": "auto", - "inFIFODepths": [ - 8000 - ], - "outFIFODepths": [ - 0 - ] - }, "StreamingDataWidthConverter_Batch_0": { "impl_style": "hls", "inFIFODepths": [ @@ -203,10 +207,10 @@ 40 ] }, - "StreamingFIFO_12": { + "StreamingFIFO_10": { "ram_style": "auto", - "depth": 40, - "impl_style": "rtl", + "depth": 8000, + "impl_style": "vivado", "inFIFODepths": [ 0 ], @@ -228,6 +232,17 @@ 0 ] }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, "StreamingDataWidthConverter_Batch_1": { "impl_style": "hls", "inFIFODepths": [ @@ -237,18 +252,29 @@ 0 ] }, - "FMPadding_rtl_2": { - "SIMD": 64, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 40, + "impl_style": "rtl", "inFIFODepths": [ 0 ], "outFIFODepths": [ - 252 + 0 ] }, - "StreamingFIFO_15": { + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { "ram_style": "auto", - "depth": 252, + "depth": 2, "impl_style": "rtl", "inFIFODepths": [ 0 @@ -266,10 +292,10 @@ 7330 ] }, - "StreamingFIFO_16": { + "StreamingFIFO_14": { "ram_style": "auto", - "depth": 7330, - "impl_style": "vivado", + "depth": 2, + "impl_style": "rtl", "inFIFODepths": [ 0 ], @@ -277,12 +303,22 @@ 0 ] }, - "ConvolutionInputGenerator_rtl_2": { + "ConvolutionInputGenerator_2": { "SIMD": 2, - "parallel_window": 0, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { "ram_style": "auto", + "depth": 252, + "impl_style": "rtl", "inFIFODepths": [ - 7330 + 0 ], "outFIFODepths": [ 0 @@ -297,10 +333,10 @@ 40 ] }, - "StreamingFIFO_18": { + "StreamingFIFO_16": { "ram_style": "auto", - "depth": 40, - "impl_style": "rtl", + "depth": 7330, + "impl_style": "vivado", "inFIFODepths": [ 0 ], @@ -322,6 +358,17 @@ 0 ] }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, "StreamingDataWidthConverter_Batch_4": { "impl_style": "hls", "inFIFODepths": [ @@ -331,6 +378,17 @@ 0 ] }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 40, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, "UpsampleNearestNeighbour_Batch_0": { "inFIFODepths": [ 0 @@ -339,9 +397,9 @@ 32 ] }, - "StreamingFIFO_21": { + "StreamingFIFO_19": { "ram_style": "auto", - "depth": 32, + "depth": 2, "impl_style": "rtl", "inFIFODepths": [ 0 @@ -350,19 +408,19 @@ 0 ] }, - "FMPadding_rtl_3": { - "SIMD": 32, + "StreamingDataWidthConverter_Batch_5": { + "impl_style": "hls", "inFIFODepths": [ - 32 + 790 ], "outFIFODepths": [ - 790 + 6416 ] }, - "StreamingFIFO_22": { + "StreamingFIFO_20": { "ram_style": "auto", - "depth": 790, - "impl_style": "vivado", + "depth": 2, + "impl_style": "rtl", "inFIFODepths": [ 0 ], @@ -370,18 +428,38 @@ 0 ] }, - "StreamingDataWidthConverter_Batch_5": { + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_6": { "impl_style": "hls", "inFIFODepths": [ - 790 + 2 ], "outFIFODepths": [ - 6416 + 2 ] }, - "StreamingFIFO_23": { + "StreamingFIFO_22": { "ram_style": "auto", - "depth": 6416, + "depth": 790, "impl_style": "vivado", "inFIFODepths": [ 0 @@ -390,21 +468,20 @@ 0 ] }, - "ConvolutionInputGenerator_rtl_3": { + "ConvolutionInputGenerator_3": { "SIMD": 4, - "parallel_window": 0, - "ram_style": "auto", + "ram_style": "distributed", "inFIFODepths": [ - 6416 + 2 ], "outFIFODepths": [ - 32 + 2 ] }, - "StreamingFIFO_24": { + "StreamingFIFO_23": { "ram_style": "auto", - "depth": 32, - "impl_style": "rtl", + "depth": 6416, + "impl_style": "vivado", "inFIFODepths": [ 0 ], @@ -425,5 +502,16 @@ "outFIFODepths": [ 0 ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] } -} +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4-n1_w4a4_d-nn_zcu104.json b/build/espcn/folding_configs/espcn_x4-n1_w4a4_d-nn_zcu104.json new file mode 100644 index 00000000..e5a9f7f9 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4-n1_w4a4_d-nn_zcu104.json @@ -0,0 +1,435 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 4, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 16, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4-n2_w4a4_d-nn_zcu104.json b/build/espcn/folding_configs/espcn_x4-n2_w4a4_d-nn_zcu104.json new file mode 100644 index 00000000..fbc34871 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4-n2_w4a4_d-nn_zcu104.json @@ -0,0 +1,559 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 1, + "SIMD": 8, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_7": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 1, + "SIMD": 2, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4_n1_w4a4_d-sp_zcu104.json b/build/espcn/folding_configs/espcn_x4_n1_w4a4_d-sp_zcu104.json new file mode 100644 index 00000000..264ebf51 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4_n1_w4a4_d-sp_zcu104.json @@ -0,0 +1,435 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 32, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 32, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4_n1_w4a4_deconv_zcu104.json b/build/espcn/folding_configs/espcn_x4_n1_w4a4_deconv_zcu104.json new file mode 100644 index 00000000..db84e5fd --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4_n1_w4a4_deconv_zcu104.json @@ -0,0 +1,435 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 32, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 32, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4_n1_w4a4_nnrc_zcu104.json b/build/espcn/folding_configs/espcn_x4_n1_w4a4_nnrc_zcu104.json new file mode 100644 index 00000000..606e1994 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4_n1_w4a4_nnrc_zcu104.json @@ -0,0 +1,453 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 4, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4_n2_w4a4_d-sp_zcu104.json b/build/espcn/folding_configs/espcn_x4_n2_w4a4_d-sp_zcu104.json new file mode 100644 index 00000000..30a18687 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4_n2_w4a4_d-sp_zcu104.json @@ -0,0 +1,578 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "distributed", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 4, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 1, + "SIMD": 12, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_7": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_8": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 1, + "SIMD": 6, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4_n2_w4a4_deconv_zcu104.json b/build/espcn/folding_configs/espcn_x4_n2_w4a4_deconv_zcu104.json new file mode 100644 index 00000000..30a18687 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4_n2_w4a4_deconv_zcu104.json @@ -0,0 +1,578 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 32 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "distributed", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 4, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 1, + "SIMD": 12, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_7": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_8": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 1, + "SIMD": 6, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x4_n2_w4a4_nnrc_zcu104.json b/build/espcn/folding_configs/espcn_x4_n2_w4a4_nnrc_zcu104.json new file mode 100644 index 00000000..cf7fde82 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x4_n2_w4a4_nnrc_zcu104.json @@ -0,0 +1,595 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 1, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_7": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_8": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_9": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 1, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_28": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8-n1_w4a4_d-nn_zcu104.json b/build/espcn/folding_configs/espcn_x8-n1_w4a4_d-nn_zcu104.json new file mode 100644 index 00000000..abadcdae --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8-n1_w4a4_d-nn_zcu104.json @@ -0,0 +1,416 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 1, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 4, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 32, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 32, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8-n3_w4a4_d-nn_zcu104.json b/build/espcn/folding_configs/espcn_x8-n3_w4a4_d-nn_zcu104.json new file mode 100644 index 00000000..1cdfaab1 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8-n3_w4a4_d-nn_zcu104.json @@ -0,0 +1,664 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 2, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 1, + "SIMD": 8, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_7": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 1, + "SIMD": 2, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_5": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_28": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_8": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_29": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_5": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_30": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_5": { + "PE": 3, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_31": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8_n1_w4a4_d-sp_zcu104.json b/build/espcn/folding_configs/espcn_x8_n1_w4a4_d-sp_zcu104.json new file mode 100644 index 00000000..35bf34fe --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8_n1_w4a4_d-sp_zcu104.json @@ -0,0 +1,416 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 1, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 32, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 32, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8_n1_w4a4_deconv_zcu104.json b/build/espcn/folding_configs/espcn_x8_n1_w4a4_deconv_zcu104.json new file mode 100644 index 00000000..35bf34fe --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8_n1_w4a4_deconv_zcu104.json @@ -0,0 +1,416 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2259 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 1, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 4, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 32, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 32, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8_n1_w4a4_nnrc_zcu104.json b/build/espcn/folding_configs/espcn_x8_n1_w4a4_nnrc_zcu104.json new file mode 100644 index 00000000..259a97de --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8_n1_w4a4_nnrc_zcu104.json @@ -0,0 +1,453 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 4, + "SIMD": 6, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 2, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 16, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 16, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8_n3_w4a4_d-sp_zcu104.json b/build/espcn/folding_configs/espcn_x8_n3_w4a4_d-sp_zcu104.json new file mode 100644 index 00000000..35e68274 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8_n3_w4a4_d-sp_zcu104.json @@ -0,0 +1,746 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 2, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 8, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 4, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 6, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 3, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_28": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_29": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_30": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_5": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_31": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_4": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_32": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_5": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_33": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_5": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_34": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_5": { + "PE": 3, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_35": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8_n3_w4a4_deconv_zcu104.json b/build/espcn/folding_configs/espcn_x8_n3_w4a4_deconv_zcu104.json new file mode 100644 index 00000000..35e68274 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8_n3_w4a4_deconv_zcu104.json @@ -0,0 +1,746 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 2, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 8, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 4, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_0": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 3, + "SIMD": 6, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_1": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_2": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 3, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_28": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_3": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_29": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Pixel_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_30": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_5": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_31": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_4": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_32": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_5": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_33": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_Batch_5": { + "impl_style": "hls", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_34": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_5": { + "PE": 3, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 32 + ] + }, + "StreamingFIFO_35": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/folding_configs/espcn_x8_n3_w4a4_nnrc_zcu104.json b/build/espcn/folding_configs/espcn_x8_n3_w4a4_nnrc_zcu104.json new file mode 100644 index 00000000..832a4312 --- /dev/null +++ b/build/espcn/folding_configs/espcn_x8_n3_w4a4_nnrc_zcu104.json @@ -0,0 +1,756 @@ +{ + "Defaults": {}, + "StreamingFIFO_0": { + "ram_style": "auto", + "depth": 32, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "Thresholding_Batch_0": { + "PE": 1, + "ram_style": "distributed", + "mem_mode": "const", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_1": { + "ram_style": "auto", + "depth": 2259, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_0": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_2": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_0": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_3": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_4": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_0": { + "PE": 1, + "SIMD": 5, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_5": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_1": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_6": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_1": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_7": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_8": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_1": { + "PE": 4, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_9": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_10": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_2": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_11": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_2": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_12": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_3": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_13": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_2": { + "PE": 2, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_14": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_4": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_15": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_0": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_16": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_5": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_17": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_3": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_18": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_3": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_19": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_6": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_20": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_3": { + "PE": 1, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_21": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_7": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_22": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_1": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_23": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_8": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_24": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_4": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_25": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_4": { + "SIMD": 1, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_26": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_9": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_27": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_4": { + "PE": 1, + "SIMD": 3, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_28": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_10": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_29": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "UpsampleNearestNeighbour_Batch_2": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_30": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_11": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_31": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "FMPadding_Batch_5": { + "SIMD": 1, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_32": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_12": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_33": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "ConvolutionInputGenerator_5": { + "SIMD": 3, + "ram_style": "distributed", + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_34": { + "ram_style": "auto", + "depth": 2, + "impl_style": "rtl", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "StreamingDataWidthConverter_rtl_13": { + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 2 + ] + }, + "StreamingFIFO_35": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + }, + "MatrixVectorActivation_5": { + "PE": 1, + "SIMD": 9, + "ram_style": "auto", + "resType": "lut", + "mem_mode": "decoupled", + "runtime_writeable_weights": 0, + "inFIFODepths": [ + 2 + ], + "outFIFODepths": [ + 16384 + ] + }, + "StreamingFIFO_36": { + "ram_style": "auto", + "depth": 16384, + "impl_style": "vivado", + "inFIFODepths": [ + 0 + ], + "outFIFODepths": [ + 0 + ] + } +} \ No newline at end of file diff --git a/build/espcn/models/get_model.py b/build/espcn/models/get_model.py index feb957c9..4fac156f 100644 --- a/build/espcn/models/get_model.py +++ b/build/espcn/models/get_model.py @@ -32,32 +32,60 @@ import torch import numpy as np from brevitas.export import export_qonnx +import argparse -# model = models.get_model_by_name("quant_espcn_x2_w4a4_base", True) -model = models.quant_espcn_nnrc(upscale_factor=2, weight_bit_width=4, act_bit_width=4) -device = "cuda" if torch.cuda.is_available() else "cpu" -model = model.to(device) -_, testloader = utils.get_bsd300_dataloaders( + +def main(model_type, output_dir=None, upscale_factor=2, weight_bit_width=4, act_bit_width=4): + if model_type == "base": + model = models.quant_espcn_base(upscale_factor=upscale_factor, weight_bit_width=weight_bit_width, act_bit_width=act_bit_width) + elif model_type == "nnrc": + model = models.quant_espcn_nnrc(upscale_factor=upscale_factor, weight_bit_width=weight_bit_width, act_bit_width=act_bit_width) + elif model_type == "deconv": + model = models.quant_espcn_deconv(upscale_factor=upscale_factor, weight_bit_width=weight_bit_width, act_bit_width=act_bit_width) + else: + raise ValueError("Invalid model type") + device = "cpu" + model = model.to(device) + _, testloader = utils.get_bsd300_dataloaders( "../data", num_workers=0, batch_size=1, upscale_factor=model.upscale_factor, crop_size=256, download=True, -) + ) + if output_dir is not None: + path = os.path.realpath(output_dir) + os.makedirs(path, exist_ok=True) + else: + FINN_ROOT = os.getenv("FINN_ROOT") + path = os.path.realpath(f"{FINN_ROOT}/../espcn/quant_espcn_x{upscale_factor}_w{weight_bit_width}a{act_bit_width}_{model_type}/") + os.makedirs(path, exist_ok=True) -FINN_ROOT = os.getenv("FINN_ROOT") -path = os.path.realpath(FINN_ROOT + "/../espcn/quant_espcn_x2_w4a4_base/") -os.makedirs(path, exist_ok=True) + inp = testloader.dataset[0][0].unsqueeze(0).to(device) # NCHW + model = model.to(device) + with open(path + "/input.npy", "wb") as f: + np.save(f, torch.round(inp * 255).cpu().numpy()) + with open(path + "/output.npy", "wb") as f: + np.save(f, model(inp).detach().cpu().numpy()) + print("Saved I/O to " + path + " as numpy arrays") + export_qonnx( + model.cpu(), input_t=inp.cpu(), export_path=path + "/qonnx_model.onnx", opset_version=13 + ) + print("Saved QONNX model to" + path) -inp = testloader.dataset[0][0].unsqueeze(0).to(device) # NCHW -model = model.to(device) -with open(path + "/input.npy", "wb") as f: - np.save(f, torch.round(inp * 255).cpu().numpy()) -with open(path + "/output.npy", "wb") as f: - np.save(f, model(inp).detach().cpu().numpy()) -print("Saved I/O to " + path + " as numpy arrays") -export_qonnx( - model.cpu(), input_t=inp.cpu(), export_path=path + "/qonnx_model.onnx", opset_version=13 -) -print("Saved QONNX model to" + path) +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('-m', '--model', type=str, choices=['base', 'nnrc', 'deconv'], required=True) + parser.add_argument('-o', '--output_dir', type=str, required=False) + parser.add_argument('-u', '--upscale_factor', type=int, required=False, default=2) + parser.add_argument('-w', '--weight_bit_width', type=int, required=False, default=4) + parser.add_argument('-a', '--act_bit_width', type=int, required=False, default=4) + args = parser.parse_args() + main( + args.model, + args.output_dir, + args.upscale_factor, + args.weight_bit_width, + args.act_bit_width + ) \ No newline at end of file diff --git a/build/get-finn.sh b/build/get-finn.sh index 17cf20a6..f7074021 100755 --- a/build/get-finn.sh +++ b/build/get-finn.sh @@ -32,7 +32,8 @@ REPO_URL="https://github.com/hleblevec/finn-fork.git" # commit hash for repo # REPO_COMMIT=e9985e66bbfefd4beca3e6bc6da6c9136e9a15b6 -REPO_COMMIT="24615067e47d987bd6ea4254932324cab3c04f28" +# REPO_COMMIT="24615067e47d987bd6ea4254932324cab3c04f28" +REPO_COMMIT="7deb2969112f5f0e9c19c35db55e5a8cbb3f38e9" # directory (under the same folder as this script) to clone to REPO_DIR=finn From 3d1c72e66e6b983a2fdeec83d4f11392f2056f55 Mon Sep 17 00:00:00 2001 From: hleblevec Date: Thu, 4 Dec 2025 19:49:20 +0100 Subject: [PATCH 5/5] Updating to use a more recent FINN version --- build/espcn/build.py | 10 +++++----- build/espcn/custom_steps.py | 21 +++++++++------------ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/build/espcn/build.py b/build/espcn/build.py index fee49489..e32d1dd7 100644 --- a/build/espcn/build.py +++ b/build/espcn/build.py @@ -31,7 +31,7 @@ custom_step_qonnx_tidy_up, custom_step_add_pre_proc, custom_step_streamline, - custom_step_convert_to_hls, + custom_step_convert_to_hw, ) import finn.builder.build_dataflow as build @@ -45,14 +45,15 @@ "step_qonnx_to_finn", "step_tidy_up", custom_step_streamline, - custom_step_convert_to_hls, + custom_step_convert_to_hw, "step_minimize_bit_width", "step_create_dataflow_partition", + "step_specialize_layers", "step_target_fps_parallelization", "step_apply_folding_config", "step_generate_estimate_reports", - "step_hls_codegen", - "step_hls_ipgen", + "step_hw_codegen", + "step_hw_ipgen", "step_set_fifo_depths", "step_create_stitched_ip", "step_measure_rtlsim_performance", @@ -77,7 +78,6 @@ def main(model_file, output_dir, folding_config_file, board): auto_fifo_depths=False, auto_fifo_strategy = build_cfg.AutoFIFOSizingMethod.CHARACTERIZE, rtlsim_batch_size=100, - force_rtl_conv_inp_gen=False, max_multithreshold_bit_width = 9, generate_outputs=[ build_cfg.DataflowOutputType.ESTIMATE_REPORTS, diff --git a/build/espcn/custom_steps.py b/build/espcn/custom_steps.py index a40c3308..da66e251 100644 --- a/build/espcn/custom_steps.py +++ b/build/espcn/custom_steps.py @@ -47,7 +47,7 @@ from qonnx.transformation.infer_data_layouts import InferDataLayouts import finn.transformation.streamline.absorb as absorb -import finn.transformation.fpgadataflow.convert_to_hls_layers as to_hls +import finn.transformation.fpgadataflow.convert_to_hw_layers as to_hw from finn.transformation.streamline import Streamline from finn.transformation.streamline.round_thresholds import RoundAndClipThresholds from finn.transformation.streamline.reorder import ( @@ -75,6 +75,7 @@ def custom_step_qonnx_tidy_up(model: ModelWrapper, cfg: DataflowBuildConfig): # model = model.transform(ResizeConvolutionToDeconvolution(maintain_bit_width=False)) model = model.transform(InferShapes()) #verify_step(model, cfg, "custom_tidy_up", need_parent=False) + return model def custom_step_add_pre_proc(model: ModelWrapper, cfg: DataflowBuildConfig): @@ -135,15 +136,14 @@ def custom_step_streamline(model: ModelWrapper, cfg: DataflowBuildConfig): return model -def custom_step_convert_to_hls(model: ModelWrapper, cfg: DataflowBuildConfig): +def custom_step_convert_to_hw(model: ModelWrapper, cfg: DataflowBuildConfig): """Convert eligible nodes to `HLSCustomOp` subclasses that represent HLS layers. Which nodes and particular configurations can be converted to HLS - is limited, see the source code of the `convert_to_hls` module for more.""" + is limited, see the source code of the `convert_to_hw` module for more.""" - mem_mode = cfg.default_mem_mode.value if cfg.standalone_thresholds: # doing this first causes all threshold layers to be standalone - model = model.transform(to_hls.InferThresholdingLayer()) + model = model.transform(to_hw.InferThresholdingLayer()) need_convtranspose = len(model.get_nodes_by_op_type("ConvTranspose")) > 0 if need_convtranspose: model = model.transform(InferPixelPaddingDeconv()) @@ -151,18 +151,15 @@ def custom_step_convert_to_hls(model: ModelWrapper, cfg: DataflowBuildConfig): model = model.transform(RoundAndClipThresholds()) need_upsample = len(model.get_nodes_by_op_type("Resize")) > 0 if need_upsample: - model = model.transform(to_hls.InferUpsample()) + model = model.transform(to_hw.InferUpsample()) # needed for non-bipolar MatMul layers - model = model.transform(to_hls.InferQuantizedMatrixVectorActivation(mem_mode)) + model = model.transform(to_hw.InferQuantizedMatrixVectorActivation()) # input quantization (if any) as standalone threshold - model = model.transform(to_hls.InferThresholdingLayer()) + model = model.transform(to_hw.InferThresholdingLayer()) # needed for convolutions -- TODO always exec? need_conv = len(model.get_nodes_by_op_type("Im2Col")) > 0 if need_conv: - if cfg.force_rtl_conv_inp_gen: - model = model.transform(to_hls.InferConvInpGen(use_rtl_variant=True)) - else: - model = model.transform(to_hls.InferConvInpGen()) + model = model.transform(to_hw.InferConvInpGen()) # get rid of Tranpose -> Tranpose identity seq model = model.transform(absorb.AbsorbConsecutiveTransposes()) model = model.transform(absorb.AbsorbTransposeIntoMultiThreshold())