build.run: implement SSH remote builds using Paramiko.
[nmigen.git] / nmigen / test / compat / test_run_simulation.py
1 import unittest
2 from ... import Signal, Module, Elaboratable
3 from .support import SimCase
4
5
6 class RunSimulation(SimCase, unittest.TestCase):
7 """ test for https://github.com/nmigen/nmigen/issues/344 """
8
9 class TestBench(Elaboratable):
10 def __init__(self):
11 self.a = Signal()
12
13 def elaborate(self, platform):
14 m = Module()
15 m.d.sync += self.a.eq(~self.a)
16 return m
17
18 def test_run_simulation(self):
19 def gen():
20 yield
21 for i in range(10):
22 yield
23 a = (yield self.tb.a)
24 self.assertEqual(a, i % 2)
25
26 self.run_with(gen())