Skip to content

Commit

Permalink
Change: Add SVUT version, start/stop time at execution
Browse files Browse the repository at this point in the history
  • Loading branch information
dpretet committed Nov 12, 2021
1 parent c0ef16e commit db37cfd
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions svutRun.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import sys
import argparse
import filecmp
import subprocess
import datetime

SCRIPTDIR = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -228,12 +230,22 @@ def create_verilator(test):
print("INFO: Copy newest version of svut_h.sv")
os.system("cp " + org_hfile + " " + os.getcwd())

# The execute all commands

file_path = os.path.dirname(os.path.abspath(__file__))
curr_path = os.getcwd()
os.chdir(file_path)
git_tag = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"])
git_tag = git_tag.strip().decode('ascii')
os.chdir(curr_path)

print("")
print("------------------------------------------------")
print("SVUT", git_tag)
print("Start @", datetime.datetime.now().time().strftime('%H:%M:%S'))
print("------------------------------------------------")
print("")
print("--------")
print("< SVUT >")
print("--------")

# Then execute all commands
for CMD in CMDS:
if ARGS.dry:
print(CMD, flush=True)
Expand All @@ -243,7 +255,13 @@ def create_verilator(test):
cmdret = os.system(CMD)
if cmdret:
print("ERROR: Command failed: " + CMD)
print("------------------------------------------------")
print("Stop @", datetime.datetime.now().time().strftime('%H:%M:%S'))
print("-----------------------------------------------\n")
sys.exit(1)
print("")

print("------------------------------------------------")
print("Stop @", datetime.datetime.now().time().strftime('%H:%M:%S'))
print("------------------------------------------------\n")

sys.exit(0)

0 comments on commit db37cfd

Please sign in to comment.