2012-09-12 16:19:42 -04:00
|
|
|
from migen.fhdl.structure import *
|
|
|
|
from migen.bank.description import *
|
|
|
|
|
2013-09-21 07:04:07 -04:00
|
|
|
class MiIo(Module, AutoCSR):
|
|
|
|
def __init__(self, width):
|
2012-09-12 16:19:42 -04:00
|
|
|
self.width = width
|
2013-09-21 07:04:07 -04:00
|
|
|
|
2014-05-20 03:02:35 -04:00
|
|
|
self.i = Signal(width)
|
|
|
|
self.o = Signal(width)
|
2013-09-21 07:04:07 -04:00
|
|
|
|
2014-05-20 03:02:35 -04:00
|
|
|
self._r_i = CSRStatus(width)
|
|
|
|
self._r_o = CSRStorage(width)
|
2013-09-21 07:04:07 -04:00
|
|
|
|
2014-08-03 02:38:37 -04:00
|
|
|
self.sync += [
|
2013-09-21 07:04:07 -04:00
|
|
|
self._r_i.status.eq(self.i),
|
|
|
|
self.o.eq(self._r_o.storage)
|
2014-08-03 02:38:37 -04:00
|
|
|
]
|