File tree 4 files changed +12
-8
lines changed
4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -994,8 +994,9 @@ def xor(self):
994
994
"""
995
995
return Operator ("r^" , [self ])
996
996
997
+ # TODO(amaranth-0.6): remove
998
+ @deprecated ("`a.implies(b)` is deprecated, use `~a | b` instead" )
997
999
def implies (self , conclusion ):
998
- # TODO: should we document or just deprecate this?
999
1000
return ~ self | conclusion
1000
1001
1001
1002
def __check_shamt (self ):
Original file line number Diff line number Diff line change @@ -566,7 +566,6 @@ Operation Description Notes
566
566
``a & b `` bitwise AND
567
567
``a | b `` bitwise OR
568
568
``a ^ b `` bitwise XOR
569
- ``a.implies(b) `` bitwise IMPLY _
570
569
``a >> b `` arithmetic right shift by variable amount [#opB1 ]_, [#opB2 ]_
571
570
``a << b `` left shift by variable amount [#opB2 ]_
572
571
``a.rotate_left(i) `` left rotate by constant amount [#opB3 ]_
@@ -575,7 +574,6 @@ Operation Description Notes
575
574
``a.shift_right(i) `` right shift by constant amount [#opB3 ]_
576
575
===================== ========================================== ======
577
576
578
- .. _IMPLY : https://en.wikipedia.org/wiki/IMPLY_gate
579
577
.. [#opB1 ] Logical and arithmetic right shift of an unsigned value are equivalent. Logical right shift of a signed value can be expressed by :ref: `converting it to unsigned <lang-convops >` first.
580
578
.. [#opB2 ] Shift amount must be unsigned; integer shifts in Python require the amount to be positive.
581
579
.. [#opB3 ] Shift and rotate amounts can be negative, in which case the direction is reversed.
Original file line number Diff line number Diff line change 6
6
with warnings .catch_warnings ():
7
7
warnings .filterwarnings (action = "ignore" , category = DeprecationWarning )
8
8
from amaranth .hdl .rec import *
9
+ from amaranth ._utils import _ignore_deprecated
9
10
10
11
from .utils import *
11
12
@@ -299,8 +300,9 @@ def test_operators(self):
299
300
self .assertEqual (repr (r1 .any ()), "(r| (cat (sig r1__a)))" )
300
301
self .assertEqual (repr (r1 .all ()), "(r& (cat (sig r1__a)))" )
301
302
self .assertEqual (repr (r1 .xor ()), "(r^ (cat (sig r1__a)))" )
302
- self .assertEqual (repr (r1 .implies (1 )), "(| (~ (cat (sig r1__a))) (const 1'd1))" )
303
- self .assertEqual (repr (r1 .implies (s1 )), "(| (~ (cat (sig r1__a))) (sig s1))" )
303
+ with _ignore_deprecated ():
304
+ self .assertEqual (repr (r1 .implies (1 )), "(| (~ (cat (sig r1__a))) (const 1'd1))" )
305
+ self .assertEqual (repr (r1 .implies (s1 )), "(| (~ (cat (sig r1__a))) (sig s1))" )
304
306
305
307
# bit_select, word_select, matches,
306
308
self .assertEqual (repr (r1 .bit_select (0 , 1 )), "(slice (cat (sig r1__a)) 0:1)" )
Original file line number Diff line number Diff line change @@ -156,12 +156,15 @@ def elaborate(self, platform):
156
156
gold .w_data .eq (dut .w_data ),
157
157
]
158
158
159
- m .d .comb += Assert (dut .r_rdy .implies (gold .r_rdy ))
160
- m .d .comb += Assert (dut .w_rdy .implies (gold .w_rdy ))
159
+ with m .If (dut .r_rdy ):
160
+ m .d .comb += Assert (gold .r_rdy )
161
+ with m .If (dut .w_rdy ):
162
+ m .d .comb += Assert (gold .w_rdy )
161
163
m .d .comb += Assert (dut .r_level == gold .r_level )
162
164
m .d .comb += Assert (dut .w_level == gold .w_level )
163
165
164
- m .d .comb += Assert (dut .r_rdy .implies (dut .r_data == gold .r_data ))
166
+ with m .If (dut .r_rdy ):
167
+ m .d .comb += Assert (dut .r_data == gold .r_data )
165
168
166
169
return m
167
170
You can’t perform that action at this time.
0 commit comments