interconnect/stream: Minor review/cleanup.

This commit is contained in:
Florent Kermarrec 2023-08-28 16:02:41 +02:00
parent 8efcc4fdea
commit d29d2c09bb
1 changed files with 9 additions and 8 deletions

View File

@ -991,21 +991,22 @@ class BufferizeEndpoints(ModuleTransformer):
def transform_instance(self, submodule):
for name, direction in self.endpoint_dict.items():
endpoint = getattr(submodule, name)
# add buffer on sinks
# Add Buffer on Sinks.
if direction == DIR_SINK:
buf = Buffer(
endpoint.description,
layout = endpoint.description,
pipe_valid = pipe_valid,
pipe_ready=pipe_ready
pipe_ready = pipe_ready,
)
submodule.submodules += buf
setattr(submodule, name, buf.sink)
submodule.comb += buf.source.connect(endpoint)
# add buffer on sources
# Add Buffer on Sources.
elif direction == DIR_SOURCE:
buf = Buffer(endpoint.description,
buf = Buffer(
layout = endpoint.description,
pipe_valid = pipe_valid,
pipe_ready=pipe_ready
pipe_ready = pipe_ready,
)
submodule.submodules += buf
submodule.comb += endpoint.connect(buf.sink)