Commit 493cc597 authored by Jaco Hofmann's avatar Jaco Hofmann
Browse files

Add script to show progress of Vivado run

parent 12c72f68
Pipeline #780 passed with stage
in 6 minutes and 30 seconds
default_version = "v2017.4"
stages = {"v2017.4": ["Calling pre-header plugins", "Subsystem tapasco complete.", "Event pre-wrapper finished.", "Starting RTL Elaboration",
"Finished RTL Component Statistics ", "Starting Routing Task", "Phase 1", "Phase 2", "Phase 3", "Phase 4", "Phase 5", "Phase 6", "Phase 7", "Phase 8", "Phase 9", "Phase 10", "Routing Is Done.", "write_bitstream completed successfully"]}
import argparse
parser = argparse.ArgumentParser(description='Parse Vivado log and show progress information')
parser.add_argument('log_file', type=str, help='A Vivado log file')
args = parser.parse_args()
import re
import sys
from tqdm import tqdm
import time
def fetch_vivado_version(filename):
with open(filename, 'r') as f:
pattern = re.compile("# Vivado (v[0-9]+\.[0-9])")
for line in f:
m =
if m:
print("Failed to determine Vivado version in {}".format(filename))
version = fetch_vivado_version(args.log_file)
print("Found Vivado Version {}".format(version))
if version not in stages:
print("Vivado version {} is unknown. Resetting to default version {}".format(version, default_version))
version = default_version
current_line = 0
f = open(args.log_file, 'r')
stage = stages[version]
with tqdm(total=len(stage)) as pbar:
for p in stage:
searching = True
pattern = re.compile(".*" + p + ".*")
while searching:
line = f.readline()
while line == '': # Poor mans iNotify...
pos = f.tell()
f = open(args.log_file, 'r')
line = f.readline()
current_line += 1
pbar.set_description('Line {}'.format(current_line))
m =
if m:
searching = False
\ No newline at end of file
......@@ -65,7 +65,7 @@ class VivadoComposer()(implicit cfg: Configuration) extends Composer {
target = target,
composition = composition(bd, target))"Vivado starting run {}: output in {}", files.runName: Any, files.logFile)"Vivado starting run {}: show progress with `vivado_progress {}`", files.runName: Any, files.logFile)
cfg.verbose foreach { mode =>"verbose mode {} is active, starting to watch {}", mode: Any, files.logFile)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment