From: Sebastien Bourdeauducq Date: Wed, 10 Apr 2013 20:15:28 +0000 (+0200) Subject: uio: remove Trampoline (Python 3.3 provides generator delegation instead) X-Git-Tag: 24jan2021_ls180~2099^2~613 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1cc4c8ee9f0943a231f75eff441fa1dc17699bc8;p=litex.git uio: remove Trampoline (Python 3.3 provides generator delegation instead) --- diff --git a/migen/uio/ioo.py b/migen/uio/ioo.py index e618c2c6..9257ad0b 100644 --- a/migen/uio/ioo.py +++ b/migen/uio/ioo.py @@ -5,7 +5,6 @@ from migen.flow.transactions import * from migen.actorlib.sim import TokenExchanger from migen.bus import wishbone, memory from migen.bus.transactions import * -from migen.uio.trampoline import Trampoline class UnifiedIOObject(Module): def __init__(self, dataflow=None, buses={}): @@ -20,7 +19,7 @@ class UnifiedIOObject(Module): class UnifiedIOSimulation(UnifiedIOObject): def __init__(self, generator, dataflow=None, buses={}): - self.generator = Trampoline(generator) + self.generator = generator UnifiedIOObject.__init__(self, dataflow, buses) callers = [] diff --git a/migen/uio/trampoline.py b/migen/uio/trampoline.py deleted file mode 100644 index 912427de..00000000 --- a/migen/uio/trampoline.py +++ /dev/null @@ -1,23 +0,0 @@ -import types - -class Trampoline: - def __init__(self, g): - self.stack = [g] - - def __iter__(self): - return self - - def __next__(self): - while True: - while True: - try: - r = next(self.stack[-1]) - break - except StopIteration: - self.stack.pop() - if not self.stack: - raise - if isinstance(r, types.GeneratorType): - self.stack.append(r) - else: - return r