litex/misoclib/identifier/__init__.py

24 lines
577 B
Python
Raw Normal View History

2013-05-22 11:10:13 -04:00
from migen.fhdl.std import *
2012-05-16 19:41:41 -04:00
from migen.bank.description import *
2013-11-09 10:38:44 -05:00
from misoclib.identifier import git
2012-05-16 19:41:41 -04:00
2013-03-30 12:28:15 -04:00
class Identifier(Module, AutoCSR):
def __init__(self, sysid, frequency, l2_size, revision=None):
2013-03-30 12:28:15 -04:00
self._r_sysid = CSRStatus(16)
2013-11-09 10:38:44 -05:00
self._r_revision = CSRStatus(32)
2013-03-30 12:28:15 -04:00
self._r_frequency = CSRStatus(32)
self._r_l2_size = CSRStatus(8)
2012-05-16 19:41:41 -04:00
###
2013-11-09 10:38:44 -05:00
if revision is None:
revision = git.get_id()
self.comb += [
2013-03-30 12:28:15 -04:00
self._r_sysid.status.eq(sysid),
2013-11-09 10:38:44 -05:00
self._r_revision.status.eq(revision),
self._r_frequency.status.eq(frequency),
self._r_l2_size.status.eq(l2_size)
2012-05-16 19:41:41 -04:00
]