88
99from .. import tracer
1010from .._utils import *
11+ from .._utils import _ignore_deprecated
1112from .._unused import *
1213
1314
@@ -1333,6 +1334,7 @@ def wrapper_memoized(self, *args, **kwargs):
13331334 return wrapper_memoized
13341335
13351336
1337+ # TODO(amaranth-0.5): remove
13361338@final
13371339class Sample (Value ):
13381340 """Value from the past.
@@ -1341,6 +1343,7 @@ class Sample(Value):
13411343 of the ``domain`` clock back. If that moment is before the beginning of time, it is equal
13421344 to the value of the expression calculated as if each signal had its reset value.
13431345 """
1346+ @deprecated ("instead of using `Sample`, create a register explicitly" )
13441347 def __init__ (self , expr , clocks , domain , * , src_loc_at = 0 ):
13451348 super ().__init__ (src_loc_at = 1 + src_loc_at )
13461349 self .value = Value .cast (expr )
@@ -1367,20 +1370,32 @@ def __repr__(self):
13671370 self .value , "<default>" if self .domain is None else self .domain , self .clocks )
13681371
13691372
1373+ # TODO(amaranth-0.5): remove
1374+ @deprecated ("instead of using `Past`, create a register explicitly" )
13701375def Past (expr , clocks = 1 , domain = None ):
1371- return Sample (expr , clocks , domain )
1376+ with _ignore_deprecated ():
1377+ return Sample (expr , clocks , domain )
13721378
13731379
1380+ # TODO(amaranth-0.5): remove
1381+ @deprecated ("instead of using `Stable`, create registers and comparisons explicitly" )
13741382def Stable (expr , clocks = 0 , domain = None ):
1375- return Sample (expr , clocks + 1 , domain ) == Sample (expr , clocks , domain )
1383+ with _ignore_deprecated ():
1384+ return Sample (expr , clocks + 1 , domain ) == Sample (expr , clocks , domain )
13761385
13771386
1387+ # TODO(amaranth-0.5): remove
1388+ @deprecated ("instead of using `Rose`, create registers and comparisons explicitly" )
13781389def Rose (expr , clocks = 0 , domain = None ):
1379- return ~ Sample (expr , clocks + 1 , domain ) & Sample (expr , clocks , domain )
1390+ with _ignore_deprecated ():
1391+ return ~ Sample (expr , clocks + 1 , domain ) & Sample (expr , clocks , domain )
13801392
13811393
1394+ # TODO(amaranth-0.5): remove
1395+ @deprecated ("instead of using `Fell`, create registers and comparisons explicitly" )
13821396def Fell (expr , clocks = 0 , domain = None ):
1383- return Sample (expr , clocks + 1 , domain ) & ~ Sample (expr , clocks , domain )
1397+ with _ignore_deprecated ():
1398+ return Sample (expr , clocks + 1 , domain ) & ~ Sample (expr , clocks , domain )
13841399
13851400
13861401@final
0 commit comments