Commit 5dde6da5 authored by Tristan Gingold's avatar Tristan Gingold

gen_buildinfo: also works in simulation mode.

parent 6abae0c0
......@@ -7,16 +7,22 @@ with open("buildinfo_pkg.vhd", "w") as f:
["git", "log", "-1", "--format=%H"]).decode().strip()
userid = subprocess.check_output(
["git", "config", "--get", "user.name"]).decode().strip()
f.write("-- Buildinfo for project {}\n".format(syn_top))
if action == "simulation":
top = sim_top
tool = sim_tool
else:
top = syn_top
tool = syn_tool
f.write("-- Buildinfo for project {}\n".format(top))
f.write("--\n")
f.write("-- This file was automatically generated; do not edit\n")
f.write("\n")
f.write("package buildinfo_pkg is\n")
f.write(" constant buildinfo : string :=\n")
f.write(' "buildinfo:1" & LF\n')
f.write(' & "module:{}" & LF\n'.format(syn_top))
f.write(' & "module:{}" & LF\n'.format(top))
f.write(' & "commit:{}" & LF\n'.format(commitid))
f.write(' & "syntool:{}" & LF\n'.format(syn_tool))
f.write(' & "syntool:{}" & LF\n'.format(tool))
f.write(' & "syndate:{}" & LF\n'.format(
time.strftime("%A, %B %d %Y", time.localtime())))
f.write(' & "synauth:{}" & LF;\n'.format(userid))
......
Markdown is supported
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