From 7f2607659bdd05b62ed58fe0511566a8cae5e3f9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 5 Apr 2019 09:06:20 +0100 Subject: [PATCH] move o_valid and o_ready (underscore them) and replace with properties o_ready now redirects to self._o_ready if stage_ctl is False likewise o_valid in NextControl redirects to self._o_valid --- src/add/singlepipe.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/add/singlepipe.py b/src/add/singlepipe.py index 50eba9dc..ef037fb9 100644 --- a/src/add/singlepipe.py +++ b/src/add/singlepipe.py @@ -171,11 +171,17 @@ class PrevControl: def __init__(self, i_width=1, stage_ctl=False): self.stage_ctl = stage_ctl self.i_valid = Signal(i_width, name="p_i_valid") # prev >>in self - self.o_ready = Signal(name="p_o_ready") # prev <> next + self._o_valid = Signal(name="n_o_valid") # self out>> next self.i_ready = Signal(name="n_i_ready") # self <> next + @property + def o_valid(self): + if self.stage_ctl: + return self.s_o_valid + return self._o_valid + def connect_to_next(self, nxt): """ helper function to connect to the next stage data/valid/ready. data/valid is passed *TO* nxt, and ready comes *IN* from nxt. -- 2.30.2