@@ -153,11 +153,11 @@ def test_basic_signed_add(self):
153
153
# 0 1 2 3 -4 -3 -2 -1
154
154
self .check_trace ('-3 -2 -1 0 -7 -6 -5 -4' )
155
155
156
- def test_basic_signed_add (self ):
157
- self .o <<= pyrtl .signed_add (self .r , Const (- 3 , signed = True ))
156
+ def test_basic_signed_add_signed_const (self ):
157
+ self .o <<= pyrtl .signed_add (self .r , pyrtl . Const (- 3 , signed = True ))
158
158
self .check_trace ('-3 -2 -1 0 -7 -6 -5 -4' )
159
159
160
- def test_basic_signed_add (self ):
160
+ def test_basic_signed_add_neg_integer (self ):
161
161
self .o <<= pyrtl .signed_add (self .r , - 3 )
162
162
self .check_trace ('-3 -2 -1 0 -7 -6 -5 -4' )
163
163
@@ -169,21 +169,21 @@ def test_basic_signed_mult(self):
169
169
# extend the inputs, truncate to the last 4 digits and then sign extend,
170
170
# the output I assure that they are indeed correct. :)
171
171
172
- def test_basic_signed_mult (self ):
172
+ def test_basic_signed_mult_const_with_bitwidth (self ):
173
173
self .o <<= pyrtl .signed_mult (self .r , pyrtl .Const (- 2 , bitwidth = 3 ))
174
174
# 0 1 2 3 -4 -3 -2 -1
175
175
self .check_trace ('0 -2 -4 -6 -8 6 4 2' )
176
176
# this one is multiplies by -2 and the trend is easier to see (-4 x -3 does
177
177
# overflow the 4 bits though).
178
178
179
- def test_basic_signed_mult (self ):
179
+ def test_basic_signed_mult_signed_const (self ):
180
180
self .o <<= pyrtl .signed_mult (self .r , pyrtl .Const (- 2 , signed = True ))
181
181
self .check_trace ('0 -2 -4 -6 -8 6 4 2' )
182
182
183
- def test_basic_signed_mult (self ):
183
+ def test_basic_signed_mult_neg_integer (self ):
184
184
self .o <<= pyrtl .signed_mult (self .r , - 2 )
185
185
self .check_trace ('0 -2 -4 -6 -8 6 4 2' )
186
186
187
- def test_basic_signed_mult (self ):
187
+ def test_basic_signed_mult_commutative (self ):
188
188
self .o <<= pyrtl .signed_mult (- 2 , self .r )
189
189
self .check_trace ('0 -2 -4 -6 -8 6 4 2' )
0 commit comments