Skip to content

Commit 438a085

Browse files
committedMay 2, 2015
misoclib/cpu: merge git.py in identifier
1 parent da711ad commit 438a085

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed
 

‎misoclib/cpu/git.py

-6
This file was deleted.

‎misoclib/cpu/identifier.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import subprocess
2+
13
from migen.fhdl.std import *
24
from migen.bank.description import *
35

4-
from misoclib.cpu import git
6+
def get_id():
7+
output = subprocess.check_output(["git", "rev-parse", "HEAD"]).decode("ascii")
8+
return int(output[:8], 16)
59

610

711
class Identifier(Module, AutoCSR):
@@ -13,7 +17,7 @@ def __init__(self, sysid, frequency, revision=None):
1317
###
1418

1519
if revision is None:
16-
revision = git.get_id()
20+
revision = get_id()
1721

1822
self.comb += [
1923
self._sysid.status.eq(sysid),

‎software/common.mak

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)ld
1919
OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy
2020
RANLIB_quiet = @echo " RANLIB " $@ && $(TARGET_PREFIX)ranlib
2121

22-
MSC_GIT_ID := $(shell cd $(MSCDIR) && python3 -c "from misoclib.cpu.git import get_id; print(hex(get_id()), end='')")
22+
MSC_GIT_ID := $(shell cd $(MSCDIR) && python3 -c "from misoclib.cpu.identifier import get_id; print(hex(get_id()), end='')")
2323

2424
ifeq ($(V),1)
2525
CC = $(CC_normal)

0 commit comments

Comments
 (0)