litex/miscope/mila.py

27 lines
720 B
Python
Raw Normal View History

2013-02-22 08:28:05 -05:00
from migen.fhdl.structure import *
2013-09-21 07:04:07 -04:00
from migen.flow.actor import *
from migen.flow.network import *
2013-02-22 08:28:05 -05:00
from migen.bus import csr
from migen.bank import description, csrgen
from migen.bank.description import *
2013-09-21 07:04:07 -04:00
class MiLa(Module, AutoCSR):
def __init__(self, trigger, recorder):
2013-02-22 08:28:05 -05:00
self.trigger = trigger
self.recorder = recorder
2013-03-21 07:23:44 -04:00
2013-09-21 07:04:07 -04:00
self.sink = trigger.sink
self.submodules += trigger, recorder
2013-03-21 07:23:44 -04:00
2013-09-21 07:04:07 -04:00
self.comb +=[
recorder.sink.stb.eq(trigger.source.stb),
2013-02-22 08:28:05 -05:00
2013-09-21 07:04:07 -04:00
recorder.sink.payload.hit.eq(trigger.source.payload.hit),
trigger.source.ack.eq(recorder.sink.ack)
2013-02-22 08:28:05 -05:00
]
2013-09-21 07:04:07 -04:00
# Todo; Insert configurable delay to support pipelined
# triggers elements
self.comb +=[
recorder.sink.payload.d.eq(self.sink.payload.d),
]