From 9806f76619b0bff703bffc2f790bf396fc39dc99 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 11 Apr 2022 09:50:00 +0200 Subject: [PATCH] soc/build: Remove Migen Git SHA1 from auto-generated headers/bios (Hasn't been useful). --- litex/build/tools.py | 16 +--------------- litex/soc/integration/export.py | 3 +-- litex/soc/software/bios/main.c | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/litex/build/tools.py b/litex/build/tools.py index 7aad5e21e..410d280c4 100644 --- a/litex/build/tools.py +++ b/litex/build/tools.py @@ -102,18 +102,6 @@ else: def cygpath(p): return p -def get_migen_git_revision(): - import migen - d = os.getcwd() - os.chdir(os.path.dirname(migen.__file__)) - try: - r = subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], - stderr=subprocess.DEVNULL)[:-1].decode("utf-8") - except: - r = "--------" - os.chdir(d) - return r - def get_litex_git_revision(): import litex d = os.getcwd() @@ -128,9 +116,7 @@ def get_litex_git_revision(): def generated_banner(line_comment="//"): r = line_comment + "-"*80 + "\n" - r += line_comment + " Auto-generated by Migen ({}) & LiteX ({}) on ".format( - get_migen_git_revision(), - get_litex_git_revision()) + r += line_comment + " Auto-generated by LiteX ({}) on ".format(get_litex_git_revision()) r += "{}\n".format(datetime.datetime.fromtimestamp(time.time()).strftime("%Y-%m-%d %H:%M:%S")) r += line_comment + "-"*80 + "\n" return r diff --git a/litex/soc/integration/export.py b/litex/soc/integration/export.py index 81798ef7e..1e9ab58a6 100644 --- a/litex/soc/integration/export.py +++ b/litex/soc/integration/export.py @@ -116,10 +116,9 @@ def get_linker_regions(regions): # C Export ----------------------------------------------------------------------------------------- def get_git_header(): - from litex.build.tools import get_migen_git_revision, get_litex_git_revision + from litex.build.tools import get_litex_git_revision r = generated_banner("//") r += "#ifndef __GENERATED_GIT_H\n#define __GENERATED_GIT_H\n\n" - r += f"#define MIGEN_GIT_SHA1 \"{get_migen_git_revision()}\"\n" r += f"#define LITEX_GIT_SHA1 \"{get_litex_git_revision()}\"\n" r += "#endif\n" return r diff --git a/litex/soc/software/bios/main.c b/litex/soc/software/bios/main.c index 4ba282923..05b6b06a9 100644 --- a/litex/soc/software/bios/main.c +++ b/litex/soc/software/bios/main.c @@ -113,7 +113,6 @@ __attribute__((__used__)) int main(int i, char **c) #endif crcbios(); printf("\n"); - printf(" Migen git sha1: "MIGEN_GIT_SHA1"\n"); printf(" LiteX git sha1: "LITEX_GIT_SHA1"\n"); printf("\n"); printf("--=============== \e[1mSoC\e[0m ==================--\n");