@@ -41,9 +41,8 @@ use crate::tables::types::BusId;
4141use crate :: test_utils:: {
4242 E , F , VmAir , create_bitwise_air, create_branch_air, create_commit_air, create_cpu_air,
4343 create_decode_air, create_dvrm_air, create_halt_air, create_keccak_air, create_load_air,
44- create_lt_air, create_memw_air, create_memw_aligned_air, create_mul_air, create_page_air,
45- create_register_air,
46- create_shift_air,
44+ create_lt_air, create_memw_air, create_memw_aligned_air, create_memw_register_air,
45+ create_mul_air, create_page_air, create_register_air, create_shift_air,
4746} ;
4847
4948use stark:: proof:: options:: { GoldilocksCubicProofOptions , ProofOptions } ;
@@ -74,6 +73,7 @@ pub struct TableCounts {
7473 pub dvrm : usize ,
7574 pub shift : usize ,
7675 pub branch : usize ,
76+ pub memw_register : usize ,
7777}
7878
7979impl TableCounts {
@@ -92,6 +92,7 @@ impl TableCounts {
9292 + self . dvrm
9393 + self . shift
9494 + self . branch
95+ + self . memw_register
9596 }
9697
9798 /// Validate that all required tables have at least one chunk.
@@ -109,6 +110,7 @@ impl TableCounts {
109110 ( "dvrm" , self . dvrm ) ,
110111 ( "shift" , self . shift ) ,
111112 ( "branch" , self . branch ) ,
113+ ( "memw_register" , self . memw_register ) ,
112114 ] ;
113115 for ( name, count) in checks {
114116 if count == 0 {
@@ -197,6 +199,7 @@ pub(crate) struct VmAirs {
197199 pub register : VmAir ,
198200 pub keccak : VmAir ,
199201 pub pages : Vec < VmAir > ,
202+ pub memw_registers : Vec < VmAir > ,
200203}
201204
202205impl VmAirs {
@@ -245,6 +248,13 @@ impl VmAirs {
245248 for ( air, trace) in self . pages . iter ( ) . zip ( traces. pages . iter_mut ( ) ) {
246249 pairs. push ( ( air, trace, & ( ) ) ) ;
247250 }
251+ for ( air, trace) in self
252+ . memw_registers
253+ . iter ( )
254+ . zip ( traces. memw_registers . iter_mut ( ) )
255+ {
256+ pairs. push ( ( air, trace, & ( ) ) ) ;
257+ }
248258
249259 pairs
250260 }
@@ -290,6 +300,9 @@ impl VmAirs {
290300 for air in & self . pages {
291301 refs. push ( air) ;
292302 }
303+ for air in & self . memw_registers {
304+ refs. push ( air) ;
305+ }
293306
294307 refs
295308 }
@@ -363,6 +376,9 @@ impl VmAirs {
363376 )
364377 } )
365378 . collect ( ) ;
379+ let memw_registers: Vec < _ > = ( 0 ..table_counts. memw_register )
380+ . map ( |i| create_memw_register_air ( proof_options) . with_name ( & format ! ( "MEMW_R[{}]" , i) ) )
381+ . collect ( ) ;
366382
367383 #[ cfg( feature = "debug-checks" ) ]
368384 debug_report:: print_bus_legend ( ) ;
@@ -384,6 +400,7 @@ impl VmAirs {
384400 register,
385401 keccak,
386402 pages,
403+ memw_registers,
387404 }
388405 }
389406}
0 commit comments