litex/miscope/mila.py

34 lines
844 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-22 07:28:12 -04:00
from miscope.trigger import Trigger
from miscope.storage import Recorder
2013-09-21 07:04:07 -04:00
class MiLa(Module, AutoCSR):
2013-09-22 07:28:12 -04:00
def __init__(self, width, depth, ports):
self.width = width
trigger = Trigger(width, ports)
recorder = Recorder(width, depth)
self.submodules.trigger = trigger
self.submodules.recorder = recorder
2013-03-21 07:23:44 -04:00
2013-09-21 07:04:07 -04:00
self.sink = trigger.sink
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
recorder.sink.hit.eq(trigger.source.hit),
2013-09-21 07:04:07 -04:00
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.dat.eq(self.sink.dat),
2013-09-21 07:04:07 -04:00
]