misoclib/cpu: merge git.py in identifier

This commit is contained in:
Florent Kermarrec 2015-05-02 18:42:33 +02:00
parent da711ad5f1
commit 438a0856c5
3 changed files with 7 additions and 9 deletions

View file

@ -1,6 +0,0 @@
import subprocess
def get_id():
output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii")
return int(output[:8], 16)

View file

@ -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),

View file

@ -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)