diff --git a/src/finn/transformation/fpgadataflow/templates.py b/src/finn/transformation/fpgadataflow/templates.py index 7ad555ef7fd1f1a8708ced605020f67b5d04985b..e2a1cd17e51105215224353daa4178bd714a4734 100644 --- a/src/finn/transformation/fpgadataflow/templates.py +++ b/src/finn/transformation/fpgadataflow/templates.py @@ -91,7 +91,7 @@ cd %s pynq_driver_template = """ import argparse - +import os from pynq import Overlay import numpy as np from pynq import allocate @@ -207,6 +207,9 @@ if __name__ == "__main__": # for the remote execution the data from the input npy file has to be loaded, # packed and copied to the PYNQ buffer if exec_mode == "execute": + # remove old output file to prevent reusing old output + # in case execution fails + os.remove(outputfile) # load desired input .npy file ibuf_normal = np.load(inputfile) ibuf_folded = finnDriver.fold_input(ibuf_normal) @@ -217,6 +220,8 @@ if __name__ == "__main__": # for the throughput test the runtime of the network has to be measured if exec_mode == "throughput_test": + # remove old metrics file + os.remove("nw_metrics.txt") # measure runtime of network start = time.time() # dictionary for results of throughput test