def optimize_results_clock(ctx): """ Automatically generate results iterating over different clock periods TODO: allow for user selected ranges """ # Define the clock targets (in ns) that will be used to optimize latency and resources # optimize_clock_targets = [5, 10] optimize_clock_targets = [5, 6, 7, 8, 9, 10, 11] config = ctx.obj.config # no keep flag,iterate manually ctx.obj.solution_num = find_solution_num(ctx) + 1 # Iterate over the different clock targets click.secho("Optimizing current HLS design", bold=True) # Iterate over each one of the targets for clk_target in optimize_clock_targets: click.echo( click.style("Optimizing for clock=" + str(clk_target) + " ns @ solution" + str(ctx.obj.solution_num), fg='yellow')) # Setup the file ctx.obj.file = build_tcl_file(ctx, clk_target) # Add the syn step ctx.obj.file.write("csynth_design" + "\n") ctx.obj.file.write("exit" + "\n") ctx.obj.file.close() # Call the Vivado HLS process returncode = subprocess.call(["vivado_hls -f run_hls.tcl"], shell=True) # Check return status of the HLS process. if returncode < 0: raise click.Abort() elif returncode > 0: click.echo( "Warning: HLS Process returned an error, skipping report opening!" ) raise click.Abort() else: pass # Iterate over the solution number for the next loop iterations ctx.obj.solution_num += 1
def build(ctx, keep, report): """Runs the Vivado HLS tool and executes the specified build stages.""" ctx.obj.solution_num = find_solution_num(ctx) ctx.obj.file = do_start_build_stuff(ctx) pass
def status(ctx, stats): """Prints out a message detailing the current project status.""" check_for_project(ctx) ctx.obj.solution_num = find_solution_num(ctx) print_project_status(ctx, stats)
def report(ctx, stage): """Opens the Vivado HLS report for the chosen build stages.""" check_for_project(ctx) ctx.obj.solution_num = find_solution_num(ctx) for report in stage: open_report(ctx, report)