Start of public OpenTitan development history
Code contributors:
Alex Bradbury <asb@lowrisc.org>
Cindy Chen <chencindy@google.com>
Eunchan Kim <eunchan@google.com>
Gaurang Chitroda <gaurangg@google.com>
Mark Hayter <mark.hayter@gmail.com>
Michael Schaffner <msf@google.com>
Miguel Osorio <miguelosorio@google.com>
Nils Graf <nilsg@google.com>
Philipp Wagner <phw@lowrisc.org>
Pirmin Vogel <vogelpi@lowrisc.org>
Ram Babu Penugonda <rampenugonda@google.com>
Scott Johnson <scottdj@google.com>
Shail Kushwah <kushwahs@google.com>
Srikrishna Iyer <sriyer@google.com>
Steve Nelson <Steve.Nelson@wdc.com>
Tao Liu <taliu@google.com>
Timothy Chen <timothytim@google.com>
Tobias Wölfel <tobias.woelfel@mailbox.org>
Weicai Yang <weicai@google.com>
diff --git a/util/reggen/version.py b/util/reggen/version.py
new file mode 100644
index 0000000..3539c46
--- /dev/null
+++ b/util/reggen/version.py
@@ -0,0 +1,24 @@
+# Copyright lowRISC contributors.
+# Licensed under the Apache License, Version 2.0, see LICENSE for details.
+# SPDX-License-Identifier: Apache-2.0
+r"""Standard version printing
+"""
+import os
+import subprocess
+import sys
+
+import pkg_resources # part of setuptools
+
+
+def show_and_exit(clitool, packages):
+ util_path = os.path.dirname(os.path.realpath(clitool))
+ os.chdir(util_path)
+ ver = subprocess.run(
+ ["git", "describe", "--always", "--dirty", "--broken"],
+ stdout=subprocess.PIPE).stdout.strip().decode('ascii')
+ if (ver == ''):
+ ver = 'not found (not in Git repository?)'
+ sys.stderr.write(clitool + " Git version " + ver + '\n')
+ for p in packages:
+ sys.stderr.write(p + ' ' + pkg_resources.require(p)[0].version + '\n')
+ exit(0)