From: whitequark Date: Sun, 22 Sep 2019 11:56:03 +0000 (+0000) Subject: lib.fifo: add more compatibility shims. X-Git-Tag: v0.1rc1~77 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6414c80b82c959d5cb895586324f5bc05629b2c7;p=nmigen.git lib.fifo: add more compatibility shims. Some downstream code was broken by renames in da4b810f. --- 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):