forked from M-Labs/artiq
rtio/sed: min_space → buffer_space
This commit is contained in:
parent
d8aa75b742
commit
07d3f87c51
|
@ -13,7 +13,7 @@ __all__ = ["SED"]
|
||||||
class SED(Module):
|
class SED(Module):
|
||||||
def __init__(self, channels, glbl_fine_ts_width, mode,
|
def __init__(self, channels, glbl_fine_ts_width, mode,
|
||||||
lane_count=8, fifo_depth=128, enable_spread=True,
|
lane_count=8, fifo_depth=128, enable_spread=True,
|
||||||
quash_channels=[], interface=None, report_min_space=False):
|
quash_channels=[], interface=None, report_buffer_space=False):
|
||||||
if mode == "sync":
|
if mode == "sync":
|
||||||
lane_dist_cdr = lambda x: x
|
lane_dist_cdr = lambda x: x
|
||||||
fifos_cdr = lambda x: x
|
fifos_cdr = lambda x: x
|
||||||
|
@ -37,7 +37,7 @@ class SED(Module):
|
||||||
interface=interface))
|
interface=interface))
|
||||||
self.submodules.fifos = fifos_cdr(
|
self.submodules.fifos = fifos_cdr(
|
||||||
FIFOs(lane_count, fifo_depth,
|
FIFOs(lane_count, fifo_depth,
|
||||||
layouts.fifo_payload(channels), mode, report_min_space))
|
layouts.fifo_payload(channels), mode, report_buffer_space))
|
||||||
self.submodules.gates = gates_cdr(
|
self.submodules.gates = gates_cdr(
|
||||||
Gates(lane_count, seqn_width,
|
Gates(lane_count, seqn_width,
|
||||||
layouts.fifo_payload(channels),
|
layouts.fifo_payload(channels),
|
||||||
|
@ -52,8 +52,8 @@ class SED(Module):
|
||||||
for o, i in zip(self.gates.output, self.output_driver.input):
|
for o, i in zip(self.gates.output, self.output_driver.input):
|
||||||
self.comb += i.eq(o)
|
self.comb += i.eq(o)
|
||||||
|
|
||||||
if report_min_space:
|
if report_buffer_space:
|
||||||
self.comb += self.cri.o_buffer_space.eq(self.fifos.min_space)
|
self.comb += self.cri.o_buffer_space.eq(self.fifos.buffer_space)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def cri(self):
|
def cri(self):
|
||||||
|
|
|
@ -11,15 +11,15 @@ __all__ = ["FIFOs"]
|
||||||
|
|
||||||
|
|
||||||
class FIFOs(Module):
|
class FIFOs(Module):
|
||||||
def __init__(self, lane_count, fifo_depth, layout_payload, mode, report_min_space=False):
|
def __init__(self, lane_count, fifo_depth, layout_payload, mode, report_buffer_space=False):
|
||||||
seqn_width = layouts.seqn_width(lane_count, fifo_depth)
|
seqn_width = layouts.seqn_width(lane_count, fifo_depth)
|
||||||
self.input = [Record(layouts.fifo_ingress(seqn_width, layout_payload))
|
self.input = [Record(layouts.fifo_ingress(seqn_width, layout_payload))
|
||||||
for _ in range(lane_count)]
|
for _ in range(lane_count)]
|
||||||
self.output = [Record(layouts.fifo_egress(seqn_width, layout_payload))
|
self.output = [Record(layouts.fifo_egress(seqn_width, layout_payload))
|
||||||
for _ in range(lane_count)]
|
for _ in range(lane_count)]
|
||||||
|
|
||||||
if report_min_space:
|
if report_buffer_space:
|
||||||
self.min_space = Signal(max=fifo_depth+1)
|
self.buffer_space = Signal(max=fifo_depth+1)
|
||||||
|
|
||||||
# # #
|
# # #
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class FIFOs(Module):
|
||||||
fifo.re.eq(output.re)
|
fifo.re.eq(output.re)
|
||||||
]
|
]
|
||||||
|
|
||||||
if report_min_space:
|
if report_buffer_space:
|
||||||
if mode != "sync":
|
if mode != "sync":
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@ -81,4 +81,4 @@ class FIFOs(Module):
|
||||||
max_level_valid_counter.eq(max_level_valid_counter - 1)
|
max_level_valid_counter.eq(max_level_valid_counter - 1)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
self.comb += If(max_level_valid, self.min_space.eq(fifo_depth - max_level))
|
self.comb += If(max_level_valid, self.buffer_space.eq(fifo_depth - max_level))
|
||||||
|
|
Loading…
Reference in New Issue