Skip to content

Commit 3775b1a

Browse files
committed
Implement RFC 5: Remove Const.normalize.
Closes #754.
1 parent a2f3c54 commit 3775b1a

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

amaranth/hdl/ast.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -711,16 +711,6 @@ class Const(Value):
711711
"""
712712
src_loc = None
713713

714-
# TODO(amaranth-0.5): remove
715-
@staticmethod
716-
@deprecated("instead of `Const.normalize(value, shape)`, use `Const(value, shape).value`")
717-
def normalize(value, shape):
718-
mask = (1 << shape.width) - 1
719-
value &= mask
720-
if shape.signed and value >> (shape.width - 1):
721-
value |= ~mask
722-
return value
723-
724714
@staticmethod
725715
def cast(obj):
726716
"""Converts ``obj`` to an Amaranth constant.

docs/changes.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Changelog
44
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.
55

66

7+
Version 0.5 (unreleased)
8+
========================
9+
10+
Language changes
11+
----------------
12+
13+
.. currentmodule:: amaranth.hdl
14+
15+
* Removed: (deprecated in 0.4) :meth:`Const.normalize`. (`RFC 5`_)
16+
17+
718
Version 0.4
819
===========
920

0 commit comments

Comments
 (0)