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):
|
2013-11-16 10:27:21 -05:00
|
|
|
def __init__(self, sysid, frequency, l2_size, revision=None):
|
2015-02-27 04:36:09 -05:00
|
|
|
self._sysid = CSRStatus(16)
|
|
|
|
self._revision = CSRStatus(32)
|
|
|
|
self._frequency = CSRStatus(32)
|
|
|
|
self._l2_size = CSRStatus(8)
|
2014-10-17 05:14:35 -04:00
|
|
|
|
2013-03-10 14:32:38 -04:00
|
|
|
###
|
|
|
|
|
2013-11-09 10:38:44 -05:00
|
|
|
if revision is None:
|
|
|
|
revision = git.get_id()
|
|
|
|
|
2013-03-10 14:32:38 -04:00
|
|
|
self.comb += [
|
2015-02-27 04:36:09 -05:00
|
|
|
self._sysid.status.eq(sysid),
|
|
|
|
self._revision.status.eq(revision),
|
|
|
|
self._frequency.status.eq(frequency),
|
|
|
|
self._l2_size.status.eq(l2_size)
|
2012-05-16 19:41:41 -04:00
|
|
|
]
|