parent
a2f3c544ee
commit
597b1b8839
2 changed files with 11 additions and 10 deletions
|
|
@ -711,16 +711,6 @@ class Const(Value):
|
|||
"""
|
||||
src_loc = None
|
||||
|
||||
# TODO(amaranth-0.5): remove
|
||||
@staticmethod
|
||||
@deprecated("instead of `Const.normalize(value, shape)`, use `Const(value, shape).value`")
|
||||
def normalize(value, shape):
|
||||
mask = (1 << shape.width) - 1
|
||||
value &= mask
|
||||
if shape.signed and value >> (shape.width - 1):
|
||||
value |= ~mask
|
||||
return value
|
||||
|
||||
@staticmethod
|
||||
def cast(obj):
|
||||
"""Converts ``obj`` to an Amaranth constant.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue