From 983ebf5b02043a75bc5f938212abcc10d613f2e1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 6 Apr 2019 03:02:49 +0100 Subject: [PATCH] i_valid simply needs override to include "data valid" --- src/add/singlepipe.py | 34 ++++++++++++++++++++++++---------- src/add/test_buf_pipe.py | 21 +++++++++++++-------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/add/singlepipe.py b/src/add/singlepipe.py index 1feb0f18..7196e1d6 100644 --- a/src/add/singlepipe.py +++ b/src/add/singlepipe.py @@ -188,12 +188,13 @@ class PrevControl: """ internal helper function to connect stage to an input source. do not use to connect stage-to-stage! """ - return [self.i_valid.eq(prev.i_valid), + return [self.i_valid.eq(prev.i_valid_test), prev.o_ready.eq(self.o_ready), eq(self.i_data, prev.i_data), ] - def i_valid_logic(self): + @property + def i_valid_test(self): vlen = len(self.i_valid) if vlen > 1: # multi-bit case: valid only when i_valid is all 1s @@ -217,10 +218,18 @@ class NextControl: * i_ready: input from next stage indicating that it can accept data * o_data : an output - added by the user of this class """ - def __init__(self): + def __init__(self, stage_ctl=False): + self.stage_ctl = stage_ctl self.o_valid = Signal(name="n_o_valid") # self out>> next self.i_ready = Signal(name="n_i_ready") # self <