From 91e1e53662c1fcf0d61208698d033efdd6947395 Mon Sep 17 00:00:00 2001 From: rowanG077 Date: Sun, 30 Jul 2023 00:24:26 +0200 Subject: [PATCH] soc/interconnect/stream: BufferizeEndpoints params BufferizeEndpoints params now includes parameters which to pipeline the valid/data or ready path --- litex/soc/interconnect/stream.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/litex/soc/interconnect/stream.py b/litex/soc/interconnect/stream.py index 1a05cc3e4..a0465a549 100644 --- a/litex/soc/interconnect/stream.py +++ b/litex/soc/interconnect/stream.py @@ -985,7 +985,7 @@ class Pipeline(Module): # Add buffers on Endpoints (can be used to improve timings) class BufferizeEndpoints(ModuleTransformer): - def __init__(self, endpoint_dict): + def __init__(self, endpoint_dict, pipe_valid=True, pipe_ready=False): self.endpoint_dict = endpoint_dict def transform_instance(self, submodule): @@ -993,13 +993,20 @@ class BufferizeEndpoints(ModuleTransformer): endpoint = getattr(submodule, name) # add buffer on sinks if direction == DIR_SINK: - buf = Buffer(endpoint.description) + buf = Buffer( + endpoint.description, + pipe_valid=pipe_valid, + pipe_ready=pipe_ready + ) submodule.submodules += buf setattr(submodule, name, buf.sink) submodule.comb += buf.source.connect(endpoint) # add buffer on sources elif direction == DIR_SOURCE: - buf = Buffer(endpoint.description) + buf = Buffer(endpoint.description, + pipe_valid=pipe_valid, + pipe_ready=pipe_ready + ) submodule.submodules += buf submodule.comb += endpoint.connect(buf.sink) setattr(submodule, name, buf.source)