Implement RFC 5: Remove Const.normalize.

Closes #754.
This commit is contained in:
Catherine 2023-11-25 01:47:02 +00:00
parent a2f3c544ee
commit 597b1b8839
2 changed files with 11 additions and 10 deletions

View file

@ -711,16 +711,6 @@ class Const(Value):
""" """
src_loc = None 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 @staticmethod
def cast(obj): def cast(obj):
"""Converts ``obj`` to an Amaranth constant. """Converts ``obj`` to an Amaranth constant.

View file

@ -4,6 +4,17 @@ Changelog
This document describes changes to the public interfaces in the Amaranth language and standard library. It does not include most bug fixes or implementation changes. This document describes changes to the public interfaces in the Amaranth language and standard library. It does not include most bug fixes or implementation changes.
Version 0.5 (unreleased)
========================
Language changes
----------------
.. currentmodule:: amaranth.hdl
* Removed: (deprecated in 0.4) :meth:`Const.normalize`. (`RFC 5`_)
Version 0.4 Version 0.4
=========== ===========