File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
extensions/rv32im/circuit/src Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -155,10 +155,7 @@ impl<AB: InteractionBuilder> VmAdapterAir<AB> for Rv32BaseAluAdapterAir {
155
155
) ;
156
156
self . bitwise_lookup_bus
157
157
. send_range ( rs2_limbs[ 0 ] . clone ( ) , rs2_limbs[ 1 ] . clone ( ) )
158
- . eval (
159
- builder,
160
- not ( local. rs2_as ) * ctx. instruction . is_valid . clone ( ) ,
161
- ) ;
158
+ . eval ( builder, ctx. instruction . is_valid . clone ( ) - local. rs2_as ) ;
162
159
163
160
self . memory_bridge
164
161
. read (
Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ impl<AB: InteractionBuilder> VmAdapterAir<AB> for Rv32LoadStoreAdapterAir {
216
216
// This constraint ensures that the memory write only occurs when `is_valid == 1`.
217
217
builder. assert_bool ( write_count) ;
218
218
builder. when ( write_count) . assert_one ( is_valid. clone ( ) ) ;
219
+
220
+ // Constrain that if `is_valid == 1` and `write_count == 0`, then `is_load == 1` and `rd_rs2_ptr == x0`
219
221
builder
220
222
. when ( is_valid. clone ( ) - write_count)
221
223
. assert_one ( is_load. clone ( ) ) ;
Original file line number Diff line number Diff line change @@ -232,7 +232,8 @@ where
232
232
// Note:
233
233
// - q_sum is guaranteed to be non-zero if q is non-zero since we've range checked each
234
234
// limb of q to be within [0, 2^LIMB_BITS) already.
235
- // - If q is zero and q_ext satisfies the constraint b = c * q + r, then q_sign must be 0.
235
+ // - If q is zero and q_ext satisfies the constraint
236
+ // sign_extend(b) = sign_extend(c) * sign_extend(q) + sign_extend(r), then q_sign must be 0.
236
237
// Thus, we do not need additional constraints in case q is zero.
237
238
let nonzero_q = q. iter ( ) . fold ( AB :: Expr :: ZERO , |acc, q| acc + * q) ;
238
239
builder. assert_bool ( cols. q_sign ) ;
Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ where
197
197
prev_data[ i]
198
198
}
199
199
+ opcode_when ( & [ StoreH2 ] )
200
- * if i + 2 < NUM_CELLS / 2 {
200
+ * if i - 2 < NUM_CELLS / 2 {
201
201
read_data[ i - 2 ]
202
202
} else {
203
203
prev_data[ i]
You can’t perform that action at this time.
0 commit comments