litex/migScope/migLa.py

36 lines
859 B
Python
Raw Normal View History

2012-09-17 11:00:47 -04:00
from migen.fhdl.structure import *
from migen.bus import csr
from migen.bank import description, csrgen
from migen.bank.description import *
import sys
sys.path.append("../")
from migScope import trigger, recorder
class MigLa:
def __init__(self,address, trig, rec, interface=None):
self.address = address
self.trig = trig
self.rec = rec
self.interface = interface
2013-01-03 16:57:26 -05:00
self.in_trig = Signal(self.trig.trig_width)
self.in_dat = Signal(self.trig.trig_width)
2012-09-17 11:00:47 -04:00
self.trig.set_address(self.address)
self.rec.set_address(self.address + 0x0200)
self.trig.set_interface(self.interface)
self.rec.set_interface(self.interface)
def get_fragment(self):
comb = []
comb += [
self.trig.in_trig.eq(self.in_trig),
]
comb += [
self.rec.trig_dat.eq(self.in_dat),
self.rec.trig_hit.eq(self.trig.hit)
]
return Fragment(comb=comb)