From 91e245b52f640205a73a710486cd1be599b36c9e Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 22 Sep 2019 11:56:03 +0000 Subject: [PATCH] lib.fifo: add more compatibility shims. Some downstream code was broken by renames in da4b810f. --- nmigen/lib/fifo.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/nmigen/lib/fifo.py b/nmigen/lib/fifo.py index da7023c..638a77e 100644 --- a/nmigen/lib/fifo.py +++ b/nmigen/lib/fifo.py @@ -96,36 +96,72 @@ class FIFOInterface: def din(self): return self.w_data + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension + @din.setter + @deprecated("instead of `fifo.din = x`, use `fifo.w_data = x`") + def din(self, w_data): + self.w_data = w_data + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension @property @deprecated("instead of `fifo.writable`, use `fifo.w_rdy`") def writable(self): return self.w_rdy + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension + @writable.setter + @deprecated("instead of `fifo.writable = x`, use `fifo.w_rdy = x`") + def writable(self, w_rdy): + self.w_rdy = w_rdy + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension @property @deprecated("instead of `fifo.we`, use `fifo.w_en`") def we(self): return self.w_en + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension + @we.setter + @deprecated("instead of `fifo.we = x`, use `fifo.w_en = x`") + def we(self, w_en): + self.w_en = w_en + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension @property @deprecated("instead of `fifo.dout`, use `fifo.r_data`") def dout(self): return self.r_data + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension + @dout.setter + @deprecated("instead of `fifo.dout = x`, use `fifo.r_data = x`") + def dout(self, r_data): + self.r_data = r_data + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension @property @deprecated("instead of `fifo.readable`, use `fifo.r_rdy`") def readable(self): return self.r_rdy + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension + @readable.setter + @deprecated("instead of `fifo.readable = x`, use `fifo.r_rdy = x`") + def readable(self, r_rdy): + self.r_rdy = r_rdy + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension @property @deprecated("instead of `fifo.re`, use `fifo.r_en`") def re(self): return self.r_en + # TODO(nmigen-0.2): move this to nmigen.compat and make it a deprecated extension + @re.setter + @deprecated("instead of `fifo.re = x`, use `fifo.r_en = x`") + def re(self, r_en): + self.r_en = r_en + def _incr(signal, modulo): if modulo == 2 ** len(signal): -- 2.30.2