litex/miscope/mila.py

38 lines
969 B
Python
Raw Normal View History

2013-02-22 08:28:05 -05:00
from migen.fhdl.structure import *
from migen.bus import csr
from migen.bank import description, csrgen
from migen.bank.description import *
from miscope import trigger, recorder
class MiLa:
def __init__(self, address, trigger, recorder, interface=None):
self.trigger = trigger
self.recorder = recorder
self.interface = interface
self.trig = Signal(self.trigger.trig_w)
self.dat = Signal(self.trigger.trig_w)
self.set_address(address)
self.set_interface(interface)
2013-03-21 07:23:44 -04:00
def set_address(self, address):
self.address = address
self.trigger.set_address(self.address)
self.recorder.set_address(self.address + 0x01)
2013-02-27 18:32:42 -05:00
def set_interface(self, interface):
self.interface = interface
self.trigger.set_interface(interface)
self.recorder.set_interface(interface)
2013-02-22 08:28:05 -05:00
def get_fragment(self):
comb =[
self.trigger.trig.eq(self.trig),
self.recorder.dat.eq(self.dat),
self.recorder.hit.eq(self.trigger.hit)
]
return Fragment(comb)