From: Alain Péteut Date: Mon, 22 Apr 2019 09:57:12 +0000 (+0200) Subject: compat.fhdl.specials: fix Tristate, TSTriple. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=80d778a167b3c64c5d5a7d65d9ae2287f131c8b6;p=nmigen.git compat.fhdl.specials: fix Tristate, TSTriple. * fix TSTriple instance. * TSTriple, Tristate: tag as Elaboratable --- diff --git a/nmigen/compat/fhdl/specials.py b/nmigen/compat/fhdl/specials.py index b119990..cc9cc37 100644 --- a/nmigen/compat/fhdl/specials.py +++ b/nmigen/compat/fhdl/specials.py @@ -2,6 +2,7 @@ import warnings from ...tools import deprecated, extend from ...hdl.ast import * +from ...hdl.ir import Elaboratable from ...hdl.mem import Memory as NativeMemory from ...hdl.ir import Fragment, Instance from .module import Module as CompatModule @@ -10,7 +11,7 @@ from .module import Module as CompatModule __all__ = ["TSTriple", "Instance", "Memory", "READ_FIRST", "WRITE_FIRST", "NO_CHANGE"] -class TSTriple: +class TSTriple(Elaboratable): def __init__(self, bits_sign=None, min=None, max=None, reset_o=0, reset_oe=0, reset_i=0, name=None): self.o = Signal(bits_sign, min=min, max=max, reset=reset_o, @@ -30,7 +31,7 @@ class TSTriple: return Tristate(io, self.o, self.oe, self.i) -class Tristate: +class Tristate(Elaboratable): def __init__(self, target, o, oe, i=None): self.target = target self.triple = TSTriple() @@ -49,7 +50,7 @@ class Tristate: p_WIDTH=len(self.target), i_EN=self.triple.oe, i_A=self.triple.o, - o_Y=self.io, + o_Y=self.target, ) f = m.elaborate(platform)