Skip to content
Snippets Groups Projects
Commit 346af6e2 authored by auphelia's avatar auphelia
Browse files

[Transformation] Change hls synth resource estimation to handle nodes that have no synthesis report

parent d3d47a22
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@
# 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 warnings
import os
import xml.etree.ElementTree as ET
......@@ -50,9 +50,16 @@ def hls_synth_res_estimation(model):
inst = registry.custom_op[op_type](node)
code_gen_dir = inst.get_nodeattr("code_gen_dir_ipgen")
if code_gen_dir == "":
raise Exception(
"""Please run "CodeGen_ipgen" transformation and
"HLSSynth_IPGen" first to generate the report files"""
res_dict[node.name] = dict()
res_dict[node.name]["BRAM_18K"] = 0
res_dict[node.name]["FF"] = 0
res_dict[node.name]["LUT"] = 0
res_dict[node.name]["DSP48E"] = 0
res_dict[node.name]["URAM"] = 0
warnings.warn(
"""Could not find report files, values will be set to zero
for this node. Please run "CodeGen_ipgen" transformation and
"HLSSynth_IPGen" first to generate the report files"""
)
else:
xmlfile = "{}/project_{}/sol1/syn/report/{}_csynth.xml".format(
......@@ -67,9 +74,16 @@ def hls_synth_res_estimation(model):
for child in item:
res_dict[node.name][child.tag] = child.text
else:
raise Exception(
"""Please run "HLSSynth_IPGen" first
to generate the report files"""
res_dict[node.name] = dict()
res_dict[node.name]["BRAM_18K"] = 0
res_dict[node.name]["FF"] = 0
res_dict[node.name]["LUT"] = 0
res_dict[node.name]["DSP48E"] = 0
res_dict[node.name]["URAM"] = 0
warnings.warn(
"""Could not find report files, values will be set to zero
for this node. Please run "HLSSynth_IPGen" first
to generate the report files"""
)
return res_dict
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment