From 04512e5d0484f26b75cf7386facceb929fbf2536 Mon Sep 17 00:00:00 2001 From: Nolan Poe Date: Sat, 9 Mar 2024 13:44:25 -0800 Subject: [PATCH] Add custom version for verilator --version packaging (#4954) --- docs/CONTRIBUTORS | 1 + src/config_rev | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index fa22f84fd..82e6160b6 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -136,6 +136,7 @@ Mostafa Gamal Nandu Raj Nathan Kohagen Nathan Myers +Nolan Poe Oleh Maksymenko Patrick Stewart Paul Swirhun diff --git a/src/config_rev b/src/config_rev index 0640d85b1..bbbcf9b3f 100755 --- a/src/config_rev +++ b/src/config_rev @@ -22,7 +22,11 @@ Args = parser.parse_args() os.chdir(Args.directory) -rev = 'UNKNOWN_REV' +if 'VERILATOR_SRC_VERSION' in os.environ: + rev = os.environ['VERILATOR_SRC_VERSION'] +else: + rev = 'UNKNOWN_REV' + data = os.popen('git describe').read() match = re.search(r'^(v[0-9].*)', data)