From: Sebastien Bourdeauducq Date: Tue, 19 Feb 2013 16:26:02 +0000 (+0100) Subject: fhdl: TSTriple X-Git-Tag: 24jan2021_ls180~2099^2~696 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b18194b1d83345d0d163fd2446ece84917182e8;p=litex.git fhdl: TSTriple --- diff --git a/migen/fhdl/structure.py b/migen/fhdl/structure.py index fed0a3d9..321347c0 100644 --- a/migen/fhdl/structure.py +++ b/migen/fhdl/structure.py @@ -236,6 +236,15 @@ class Tristate: self.oe = oe self.i = i +class TSTriple: + def __init__(self, bits_sign=None, min=None, max=None, reset_o=0, reset_oe=0): + self.o = Signal(bits_sign, min=min, max=max, reset=reset_o) + self.oe = Signal(reset=reset_oe) + self.i = Signal(bits_sign, min=min, max=max) + + def get_tristate(self, target): + return Tristate(target, self.o, self.oe, self.i) + # extras class Instance(HUID):