mirror of
https://github.com/myhdl/myhdl.git
synced 2025-01-24 21:52:56 +08:00
added test for issue169
This commit is contained in:
parent
7f068bb0ea
commit
eb770a199d
56
myhdl/test/bugs/test_issue_169.py
Normal file
56
myhdl/test/bugs/test_issue_169.py
Normal file
@ -0,0 +1,56 @@
|
||||
from myhdl import Signal, block, delay, instance
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
class Test1:
|
||||
def __init__(self):
|
||||
self.clock = Signal(bool(0))
|
||||
|
||||
@block
|
||||
def test(self):
|
||||
|
||||
@instance
|
||||
def func():
|
||||
while True:
|
||||
yield delay(10)
|
||||
self.clock.next = not self.clock
|
||||
|
||||
return func
|
||||
|
||||
|
||||
class Test2:
|
||||
def __init__(self):
|
||||
self.clock = Signal(bool(1))
|
||||
|
||||
@block
|
||||
def test(self):
|
||||
|
||||
@instance
|
||||
def func():
|
||||
while True:
|
||||
yield delay(10)
|
||||
self.clock.next = not self.clock
|
||||
|
||||
return func
|
||||
|
||||
|
||||
@block
|
||||
def test_bench():
|
||||
inst1 = Test1()
|
||||
inst2 = Test2()
|
||||
|
||||
# Two instances are created
|
||||
ins1 = inst1.test()
|
||||
ins2 = inst2.test()
|
||||
|
||||
return ins1, ins2
|
||||
|
||||
@pytest.mark.xfail
|
||||
def test_issue_169():
|
||||
test_inst = testbench()
|
||||
assert test_inst.verify_convert() == 0
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_issue_169()
|
||||
|
Loading…
x
Reference in New Issue
Block a user