ast: fix const-castable expression handling in Signal(reset=).
The code to accept const-castable expressions was previously added in
0c4fda92fe, but it was untested and had
a few bugs.
Fixes #911.
This commit is contained in:
parent
11d5bb19eb
commit
05cb82b8fc
2 changed files with 9 additions and 2 deletions
|
|
@ -1053,6 +1053,10 @@ class SignalTestCase(FHDLTestCase):
|
|||
r"not <StringEnum\.FOO: 'a'>$"):
|
||||
Signal(1, reset=StringEnum.FOO)
|
||||
|
||||
def test_reset_const_castable(self):
|
||||
s1 = Signal(4, reset=Cat(Const(0, 1), Const(1, 1), Const(0, 2)))
|
||||
self.assertEqual(s1.reset, 2)
|
||||
|
||||
def test_reset_shape_castable_const(self):
|
||||
class CastableFromHex(ShapeCastable):
|
||||
def as_shape(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue