Remove features deprecated in version 0.3.
This commit is contained in:
parent
47551e8c71
commit
5a79c351e3
15 changed files with 21 additions and 319 deletions
|
|
@ -1083,39 +1083,6 @@ class ResetSignalTestCase(FHDLTestCase):
|
|||
ResetSignal("comb")
|
||||
|
||||
|
||||
class MockUserValue(UserValue):
|
||||
def __init__(self, lowered):
|
||||
super().__init__()
|
||||
self.lower_count = 0
|
||||
self.lowered = lowered
|
||||
|
||||
def lower(self):
|
||||
self.lower_count += 1
|
||||
return self.lowered
|
||||
|
||||
|
||||
class UserValueTestCase(FHDLTestCase):
|
||||
def test_shape(self):
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
uv = MockUserValue(1)
|
||||
self.assertEqual(uv.shape(), unsigned(1))
|
||||
self.assertIsInstance(uv.shape(), Shape)
|
||||
uv.lowered = 2
|
||||
self.assertEqual(uv.shape(), unsigned(1))
|
||||
self.assertEqual(uv.lower_count, 1)
|
||||
|
||||
def test_lower_to_user_value(self):
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
uv = MockUserValue(MockUserValue(1))
|
||||
self.assertEqual(uv.shape(), unsigned(1))
|
||||
self.assertIsInstance(uv.shape(), Shape)
|
||||
uv.lowered = MockUserValue(2)
|
||||
self.assertEqual(uv.shape(), unsigned(1))
|
||||
self.assertEqual(uv.lower_count, 1)
|
||||
|
||||
|
||||
class MockValueCastable(ValueCastable):
|
||||
def __init__(self, dest):
|
||||
self.dest = dest
|
||||
|
|
|
|||
|
|
@ -601,56 +601,3 @@ class TransformedElaboratableTestCase(FHDLTestCase):
|
|||
)
|
||||
)
|
||||
""")
|
||||
|
||||
|
||||
class MockUserValue(UserValue):
|
||||
def __init__(self, lowered):
|
||||
super().__init__()
|
||||
self.lowered = lowered
|
||||
|
||||
def lower(self):
|
||||
return self.lowered
|
||||
|
||||
|
||||
class UserValueTestCase(FHDLTestCase):
|
||||
def setUp(self):
|
||||
self.s = Signal()
|
||||
self.c = Signal()
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
self.uv = MockUserValue(self.s)
|
||||
|
||||
def test_lower(self):
|
||||
sync = ClockDomain()
|
||||
f = Fragment()
|
||||
f.add_domains(sync)
|
||||
f.add_statements(
|
||||
self.uv.eq(1)
|
||||
)
|
||||
for signal in self.uv._lhs_signals():
|
||||
f.add_driver(signal, "sync")
|
||||
|
||||
f = ResetInserter(self.c)(f)
|
||||
f = DomainLowerer()(f)
|
||||
self.assertRepr(f.statements, """
|
||||
(
|
||||
(eq (sig s) (const 1'd1))
|
||||
(switch (sig c)
|
||||
(case 1 (eq (sig s) (const 1'd0)))
|
||||
)
|
||||
(switch (sig rst)
|
||||
(case 1 (eq (sig s) (const 1'd0)))
|
||||
)
|
||||
)
|
||||
""")
|
||||
|
||||
|
||||
class UserValueRecursiveTestCase(UserValueTestCase):
|
||||
def setUp(self):
|
||||
self.s = Signal()
|
||||
self.c = Signal()
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(action="ignore", category=DeprecationWarning)
|
||||
self.uv = MockUserValue(MockUserValue(self.s))
|
||||
|
||||
# inherit the test_lower method from UserValueTestCase because the checks are the same
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue