From: Florent Kermarrec Date: Sat, 2 May 2015 16:42:33 +0000 (+0200) Subject: misoclib/cpu: merge git.py in identifier X-Git-Tag: 24jan2021_ls180~2263 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=438a0856c545110b40af7b6f075723d90a0fdac3;p=litex.git misoclib/cpu: merge git.py in identifier --- diff --git a/misoclib/cpu/git.py b/misoclib/cpu/git.py deleted file mode 100644 index e92a6088..00000000 --- a/misoclib/cpu/git.py +++ /dev/null @@ -1,6 +0,0 @@ -import subprocess - - -def get_id(): - output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii") - return int(output[:8], 16) diff --git a/misoclib/cpu/identifier.py b/misoclib/cpu/identifier.py index 2c0d8211..7f24c612 100644 --- a/misoclib/cpu/identifier.py +++ b/misoclib/cpu/identifier.py @@ -1,7 +1,11 @@ +import subprocess + from migen.fhdl.std import * from migen.bank.description import * -from misoclib.cpu import git +def get_id(): + output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii") + return int(output[:8], 16) class Identifier(Module, AutoCSR): @@ -13,7 +17,7 @@ class Identifier(Module, AutoCSR): ### if revision is None: - revision = git.get_id() + revision = get_id() self.comb += [ self._sysid.status.eq(sysid), diff --git a/software/common.mak b/software/common.mak index b2aaf71b..b43ef657 100644 --- a/software/common.mak +++ b/software/common.mak @@ -19,7 +19,7 @@ LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)ld OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)ranlib -MSC_GIT_ID := $(shell cd $(MSCDIR) && python3 -c "from misoclib.cpu.git import get_id; print(hex(get_id()), end='')") +MSC_GIT_ID := $(shell cd $(MSCDIR) && python3 -c "from misoclib.cpu.identifier import get_id; print(hex(get_id()), end='')") ifeq ($(V),1) CC = $(CC_normal)