From: Luke Kenneth Casson Leighton Date: Fri, 5 Apr 2019 08:06:20 +0000 (+0100) Subject: move o_valid and o_ready (underscore them) and replace with properties X-Git-Tag: ls180-24jan2020~1338 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f2607659bdd05b62ed58fe0511566a8cae5e3f9;p=ieee754fpu.git 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 --- 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.