f185fbdf58bbb563d9b2726f84eafbb1cc5df8b6,hls4ml/writer/vivado_writer.py,VivadoWriter,write_test_bench,#VivadoWriter#Any#,320

Before Change


                    newline += "    " + inp.definition_cpp() + "\n"
                    newline += "    std::fill_n({}, {}, 0.);\n".format(inp.cppname, inp.size_cpp())
                for out in model.get_output_variables():
                    newline += "    " + out.definition_cpp() + "{};\n"
                    newline += "      std::fill_n({}, {}, 0.);\n".format(out.cppname, out.size())
            elif "//hls-fpga-machine-learning insert top-level-function" in line:
                newline = line

After Change


                    newline += "      in_begin = in_end;\n"
                for out in model.get_output_variables():
                    // brace-init zeros the array out because we use std=c++0x
                    newline += "      " + self.variable_definition_cpp(model, out) + "{};\n"
                    // but we can still explicitly zero out if you want
                    newline += "      std::fill_n({}, {}, 0.);\n".format(out.cppname, out.size())
            elif "//hls-fpga-machine-learning insert zero" in line:
                newline = line
                for inp in model.get_input_variables():
                    newline += "    " + self.variable_definition_cpp(model, inp) + "\n"
                    newline += "    std::fill_n({}, {}, 0.);\n".format(inp.cppname, inp.size_cpp())
                for out in model.get_output_variables():
                    newline += "    " + self.variable_definition_cpp(model, out) + "{};\n"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: f185fbdf58bbb563d9b2726f84eafbb1cc5df8b6
Time: 2020-07-11
Author: vloncar@users.noreply.github.com
File Name: hls4ml/writer/vivado_writer.py
Class Name: VivadoWriter
Method Name: write_test_bench


Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: f185fbdf58bbb563d9b2726f84eafbb1cc5df8b6
Time: 2020-07-11
Author: vloncar@users.noreply.github.com
File Name: hls4ml/writer/vivado_writer.py
Class Name: VivadoWriter
Method Name: write_test_bench


Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: f185fbdf58bbb563d9b2726f84eafbb1cc5df8b6
Time: 2020-07-11
Author: vloncar@users.noreply.github.com
File Name: hls4ml/writer/vivado_writer.py
Class Name: VivadoWriter
Method Name: write_project_header


Project Name: hls-fpga-machine-learning/hls4ml
Commit Name: f185fbdf58bbb563d9b2726f84eafbb1cc5df8b6
Time: 2020-07-11
Author: vloncar@users.noreply.github.com
File Name: hls4ml/writer/vivado_writer.py
Class Name: VivadoWriter
Method Name: write_project_cpp