parent
6780c838b2
commit
0849e1af0b
4 changed files with 21 additions and 0 deletions
|
|
@ -731,6 +731,9 @@ class Const(Value):
|
|||
value |= part_value << width
|
||||
width += len(const)
|
||||
return Const(value, width)
|
||||
elif type(obj) is Slice:
|
||||
value = Const.cast(obj.value)
|
||||
return Const(value.value >> obj.start, unsigned(obj.stop - obj.start))
|
||||
else:
|
||||
raise TypeError(f"Value {obj!r} cannot be converted to an Amaranth constant")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue