(10, sigB.eq(1)),
(11, sigB.eq(0)),
])
- m = Module()
- m.submodules.timeline = timeline
def process():
# Test default value for unset signals
self.assertFalse((yield sigA))
self.assertFalse((yield sigB))
- runSimulation(m, process, "test_timeline.vcd")
+ runSimulation(timeline, process, "test_timeline.vcd")
class RoundRobinOutputMatchSpec(Elaboratable):
def __init__(self, dut):
class AntiStarvationTestCase(FHDLTestCase):
def test_duration(self):
def generic_test(timeout):
- m = Module()
- m.submodules = dut = _AntiStarvation(timeout)
+ dut = _AntiStarvation(timeout)
def process():
yield dut.en.eq(1)
self.assertTrue((yield dut.max_time))
- runSimulation(m, process, "test_core_multiplexer_antistarvation.vcd")
+ runSimulation(dut, process, "test_core_multiplexer_antistarvation.vcd")
def test_formal(self):
def generic_test(timeout):
class RefreshExecuterTestCase(FHDLTestCase):
def test_executer(self):
def generic_test(abits, babits, trp, trfc):
- m = Module()
- m.submodules.dut = dut = RefreshExecuter(abits=abits, babits=babits, trp=trp, trfc=trfc)
+ dut = RefreshExecuter(abits=abits, babits=babits, trp=trp, trfc=trfc)
def process():
yield dut.start.eq(1)
yield
self.assertEqual((yield dut.a), 0)
- runSimulation(m, process, "test_refreshexecuter.vcd")
+ runSimulation(dut, process, "test_refreshexecuter.vcd")
generic_test(20, 20, 5, 5)
generic_test(20, 20, 100, 5)
class RefreshPostponerTestCase(FHDLTestCase):
def test_init(self):
- m = Module()
- m.submodules.dut = dut = RefreshPostponer(1)
+ dut = RefreshPostponer(1)
def process():
self.assertFalse((yield dut.req_o))
- runSimulation(m, process, "test_refreshpostponer.vcd")
+ runSimulation(dut, process, "test_refreshpostponer.vcd")
def test_delay(self):
def generic_test(delay):
- m = Module()
- m.submodules.dut = dut = RefreshPostponer(delay)
+ dut = RefreshPostponer(delay)
def process():
yield dut.req_i.eq(1)
self.assertTrue((yield dut.req_o))
- runSimulation(m, process, "test_refreshpostponer.vcd")
+ runSimulation(dut, process, "test_refreshpostponer.vcd")
[generic_test(_) for _ in [1, 5, 10]]
def test_req_not_stuck(self):
def generic_test(delay):
- m = Module()
- m.submodules.dut = dut = RefreshPostponer(delay)
+ dut = RefreshPostponer(delay)
def process():
yield dut.req_i.eq(1)
self.assertFalse((yield dut.req_o))
- runSimulation(m, process, "test_refreshpostponer.vcd")
+ runSimulation(dut, process, "test_refreshpostponer.vcd")
[generic_test(_) for _ in [1, 5, 10]]
def test_init(self):
def generic_test(postponing):
- m = Module()
- m.submodules.dut = dut = Refresher(self.settings, 100e6, postponing)
+ dut = Refresher(self.settings, 100e6, postponing)
def process():
self.assertFalse((yield dut.cmd.valid))
- runSimulation(m, process, "test_refresher.vcd")
+ runSimulation(dut, process, "test_refresher.vcd")
[generic_test(_) for _ in [1, 2, 4, 8]]
yield
def test_multiple_reads(self):
- m = Module()
soc = DDR3SoC(clk_freq=100e6,
dramcore_addr=0x00000000,
ddr_addr=0x10000000)
- m.submodules += soc
def process():
yield from SocTestCase.init_seq(soc.bus)
yield
self.assertEqual(res, 0xACAB2020)
- runSimulation(m, process, "test_soc_multiple_reads.vcd")
+ runSimulation(soc, process, "test_soc_multiple_reads.vcd")
def test_interleaved_read_write(self):
- m = Module()
soc = DDR3SoC(clk_freq=100e6,
dramcore_addr=0x00000000,
ddr_addr=0x10000000)
- m.submodules += soc
def process():
yield from SocTestCase.init_seq(soc.bus)
res = yield from wb_read(soc.bus, 0x10000008 >> 2, 0xF, 128)
self.assertEqual(res, 0xCAFE1000)
- runSimulation(m, process, "test_soc_interleaved_read_write.vcd")
+ runSimulation(soc, process, "test_soc_interleaved_read_write.vcd")
def test_sequential_reads(self):
- m = Module()
soc = DDR3SoC(clk_freq=100e6,
dramcore_addr=0x00000000,
ddr_addr=0x10000000)
- m.submodules += soc
def process():
yield from SocTestCase.init_seq(soc.bus)
yield from wb_read(soc.bus, 0x10000018 >> 2, 0xF, 128)
yield from wb_read(soc.bus, 0x1000001C >> 2, 0xF, 128)
- runSimulation(m, process, "test_soc_sequential_reads.vcd")
+ runSimulation(soc, process, "test_soc_sequential_reads.vcd")
def test_random_memtest(self):
- m = Module()
soc = DDR3SoC(clk_freq=100e6,
dramcore_addr=0x00000000,
ddr_addr=0x10000000)
- m.submodules += soc
def process():
yield from SocTestCase.init_seq(soc.bus)
for i in range(n):
self.assertEqual(memtest_values[i], (yield from wb_read(soc.bus, (0x10000000 >> 2) + i, 0xF, 256)))
- runSimulation(m, process, "test_soc_random_memtest.vcd")
+ runSimulation(soc, process, "test_soc_random_memtest.vcd")
def test_continuous_memtest(self):
- m = Module()
soc = DDR3SoC(clk_freq=100e6,
dramcore_addr=0x00000000,
ddr_addr=0x10000000)
- m.submodules += soc
def process():
yield from SocTestCase.init_seq(soc.bus)
for i in range(n):
self.assertEqual(0xFACE0000 | i, (yield from wb_read(soc.bus, (0x10000000 >> 2) + i, 0xF, 256)))
- runSimulation(m, process, "test_soc_continuous_memtest.vcd")
+ runSimulation(soc, process, "test_soc_continuous_memtest.vcd")