Skip to content

Commit

Permalink
misoclib/cpu: merge git.py in identifier
Browse files Browse the repository at this point in the history
enjoy-digital committed May 2, 2015
1 parent da711ad commit 438a085
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 0 additions & 6 deletions misoclib/cpu/git.py

This file was deleted.

8 changes: 6 additions & 2 deletions misoclib/cpu/identifier.py
Original file line number Diff line number Diff line change
@@ -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 @@ def __init__(self, sysid, frequency, revision=None):
###

if revision is None:
revision = git.get_id()
revision = get_id()

self.comb += [
self._sysid.status.eq(sysid),
2 changes: 1 addition & 1 deletion software/common.mak
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 438a085

Please sign in to comment.