mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
misoclib/cpu: merge git.py in identifier
This commit is contained in:
parent
da711ad5f1
commit
438a0856c5
3 changed files with 7 additions and 9 deletions
|
@ -1,6 +0,0 @@
|
||||||
import subprocess
|
|
||||||
|
|
||||||
|
|
||||||
def get_id():
|
|
||||||
output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii")
|
|
||||||
return int(output[:8], 16)
|
|
|
@ -1,7 +1,11 @@
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from migen.fhdl.std import *
|
from migen.fhdl.std import *
|
||||||
from migen.bank.description 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):
|
class Identifier(Module, AutoCSR):
|
||||||
|
@ -13,7 +17,7 @@ class Identifier(Module, AutoCSR):
|
||||||
###
|
###
|
||||||
|
|
||||||
if revision is None:
|
if revision is None:
|
||||||
revision = git.get_id()
|
revision = get_id()
|
||||||
|
|
||||||
self.comb += [
|
self.comb += [
|
||||||
self._sysid.status.eq(sysid),
|
self._sysid.status.eq(sysid),
|
||||||
|
|
|
@ -19,7 +19,7 @@ LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)ld
|
||||||
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy
|
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy
|
||||||
RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)ranlib
|
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)
|
ifeq ($(V),1)
|
||||||
CC = $(CC_normal)
|
CC = $(CC_normal)
|
||||||
|
|
Loading…
Reference in a new issue