From 1b18194b1d83345d0d163fd2446ece84917182e8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 19 Feb 2013 17:26:02 +0100 Subject: [PATCH] fhdl: TSTriple --- migen/fhdl/structure.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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): -- 2.30.2