global: replace Sink/Source with stream.Endpoint

This commit is contained in:
Florent Kermarrec 2016-03-15 21:01:20 +01:00
parent 88c4e2d126
commit 6d975fe388
5 changed files with 19 additions and 18 deletions

View File

@ -1,6 +1,7 @@
from litex.gen import *
from litex.soc.interconnect.csr import *
from litex.soc.interconnect import stream
from litex.soc.interconnect.stream import *

View File

@ -4,8 +4,8 @@ from litescope.common import *
class LiteScopeTermUnit(Module):
def __init__(self, dw):
self.dw = dw
self.sink = sink = Sink(data_layout(dw))
self.source = source = Source(hit_layout())
self.sink = sink = stream.Endpoint(data_layout(dw))
self.source = source = stream.Endpoint(hit_layout())
self.trig = Signal(dw)
self.mask = Signal(dw)
@ -36,8 +36,8 @@ class LiteScopeTerm(LiteScopeTermUnit, AutoCSR):
class LiteScopeRangeDetectorUnit(Module):
def __init__(self, dw):
self.dw = dw
self.sink = sink = Sink(data_layout(dw))
self.source = source = Source(hit_layout())
self.sink = sink = stream.Endpoint(data_layout(dw))
self.source = source = stream.Endpoint(hit_layout())
self.low = Signal(dw)
self.high = Signal(dw)
@ -68,8 +68,8 @@ class LiteScopeRangeDetector(LiteScopeRangeDetectorUnit, AutoCSR):
class LiteScopeEdgeDetectorUnit(Module):
def __init__(self, dw):
self.dw = dw
self.sink = sink = Sink(data_layout(dw))
self.source = source = Source(hit_layout())
self.sink = sink = stream.Endpoint(data_layout(dw))
self.source = source = stream.Endpoint(hit_layout())
self.rising_mask = Signal(dw)
self.falling_mask = Signal(dw)

View File

@ -3,8 +3,8 @@ from litescope.common import *
class LiteScopeSubSamplerUnit(Module):
def __init__(self, dw):
self.sink = sink = Sink(data_layout(dw))
self.source = source = Source(data_layout(dw))
self.sink = sink = stream.Endpoint(data_layout(dw))
self.source = source = stream.Endpoint(data_layout(dw))
self.value = Signal(32)
# # #
@ -45,8 +45,8 @@ class LiteScopeRunLengthEncoderUnit(Module):
self.dw = dw
self.length = length
self.sink = sink = Sink(data_layout(dw))
self.source = source = Source(data_layout(dw))
self.sink = sink = stream.Endpoint(data_layout(dw))
self.source = source = stream.Endpoint(data_layout(dw))
self.enable = Signal()
@ -116,8 +116,8 @@ class LiteScopeRecorderUnit(Module):
self.dw = dw
self.depth = depth
self.trigger_sink = trigger_sink = Sink(hit_layout())
self.data_sink = data_sink = Sink(data_layout(dw))
self.trigger_sink = trigger_sink = stream.Endpoint(hit_layout())
self.data_sink = data_sink = stream.Endpoint(data_layout(dw))
self.trigger = Signal()
self.qualifier = Signal()
@ -126,7 +126,7 @@ class LiteScopeRecorderUnit(Module):
self.done = Signal()
self.post_hit = Signal()
self.source = Source(data_layout(dw))
self.source = stream.Endpoint(data_layout(dw))
# # #

View File

@ -6,8 +6,8 @@ from litescope.common import *
class LiteScopeSumUnit(Module, AutoCSR):
def __init__(self, ports):
self.sinks = sinks = [Sink(hit_layout()) for i in range(ports)]
self.source = source = Source(hit_layout())
self.sinks = sinks = [stream.Endpoint(hit_layout()) for i in range(ports)]
self.source = source = stream.Endpoint(hit_layout())
self.prog_we = Signal()
self.prog_adr = Signal(ports)
@ -60,8 +60,8 @@ class LiteScopeTrigger(Module, AutoCSR):
def __init__(self, dw):
self.dw = dw
self.ports = []
self.sink = Sink(data_layout(dw))
self.source = Source(hit_layout())
self.sink = stream.Endpoint(data_layout(dw))
self.source = stream.Endpoint(hit_layout())
def add_port(self, port):
setattr(self.submodules, "port"+str(len(self.ports)), port)

View File

@ -23,7 +23,7 @@ class LiteScopeLogicAnalyzer(Module, AutoCSR):
self.with_input_buffer = with_input_buffer
self.with_subsampler = with_subsampler
self.sink = Sink(data_layout(self.dw))
self.sink = stream.Endpoint(data_layout(self.dw))
self.comb += [
self.sink.stb.eq(1),
self.sink.data.eq(self.data)