import "primitives/std.lib"; import "primitives/math.futil"; component main() -> () { cells { @external(1) data = std_mem_d4(32, 2, 2, 4, 4, 2, 2, 3, 3); @external(1) result = std_mem_d4(32, 2, 2, 2, 2, 2, 2, 2, 2); max_pool2d_2x2x2x2_ = max_pool2d_2x2x2x2(); } wires { } control { seq { invoke max_pool2d_2x2x2x2_(data0_0_0_0_read_data=data.read_data, result0_0_0_0_done=result.done, result0_0_0_0_read_data=result.read_data)(data0_0_0_0_addr0=data.addr0, data0_0_0_0_addr1=data.addr1, data0_0_0_0_addr2=data.addr2, data0_0_0_0_addr3=data.addr3, result0_0_0_0_write_data=result.write_data, result0_0_0_0_write_en=result.write_en, result0_0_0_0_addr0=result.addr0, result0_0_0_0_addr1=result.addr1, result0_0_0_0_addr2=result.addr2, result0_0_0_0_addr3=result.addr3); } } } component max_pool2d_2x2x2x2(data0_0_0_0_read_data: 32, data0_0_0_0_done: 1, result0_0_0_0_read_data: 32, result0_0_0_0_done: 1) -> (data0_0_0_0_write_data: 32, data0_0_0_0_write_en: 1, data0_0_0_0_addr0: 2, data0_0_0_0_addr1: 2, data0_0_0_0_addr2: 3, data0_0_0_0_addr3: 3, result0_0_0_0_write_data: 32, result0_0_0_0_write_en: 1, result0_0_0_0_addr0: 2, result0_0_0_0_addr1: 2, result0_0_0_0_addr2: 2, result0_0_0_0_addr3: 2) { cells { __b0 = std_reg(32); __c0 = std_reg(32); __current_0 = std_reg(32); __m0 = std_reg(32); __max_0 = std_reg(32); __n0 = std_reg(32); __pool_x_0 = std_reg(32); __pool_y_0 = std_reg(32); __stride_x_0 = std_reg(32); __stride_y_0 = std_reg(32); __x0 = std_reg(32); __y0 = std_reg(32); add0 = std_add(32); add1 = std_add(32); add2 = std_add(32); add3 = std_add(32); add4 = std_add(32); add5 = std_add(32); add6 = std_add(32); add7 = std_add(32); bin_read0_0 = std_reg(32); bin_read1_0 = std_reg(32); const0 = std_const(32,0); const1 = std_const(32,1); const10 = std_const(32,0); const11 = std_const(32,1); const12 = std_const(32,0); const13 = std_const(32,1); const14 = std_const(32,1); const15 = std_const(32,1); const16 = std_const(32,1); const17 = std_const(32,1); const18 = std_const(32,1); const19 = std_const(32,1); const2 = std_const(32,0); const3 = std_const(32,1); const4 = std_const(32,0); const5 = std_const(32,1); const6 = std_const(32,0); const7 = std_const(32,1); const8 = std_const(32,2); const9 = std_const(32,2); gt0 = std_sgt(32); le0 = std_le(32); le1 = std_le(32); le2 = std_le(32); le3 = std_le(32); le4 = std_le(32); le5 = std_le(32); mult_pipe0 = std_mult_pipe(32); mult_pipe1 = std_mult_pipe(32); slice0 = std_slice(32,2); slice1 = std_slice(32,2); slice10 = std_slice(32,2); slice11 = std_slice(32,2); slice2 = std_slice(32,3); slice3 = std_slice(32,3); slice4 = std_slice(32,2); slice5 = std_slice(32,2); slice6 = std_slice(32,3); slice7 = std_slice(32,3); slice8 = std_slice(32,2); slice9 = std_slice(32,2); } wires { group cond0<"static"=0> { cond0[done] = 1'd1; le0.left = __b0.out; le0.right = const1.out; } group cond1<"static"=0> { cond1[done] = 1'd1; le1.left = __c0.out; le1.right = const3.out; } group cond2<"static"=0> { cond2[done] = 1'd1; le2.left = __y0.out; le2.right = const5.out; } group cond3<"static"=0> { cond3[done] = 1'd1; le3.left = __x0.out; le3.right = const7.out; } group cond4<"static"=0> { cond4[done] = 1'd1; le4.left = __m0.out; le4.right = const11.out; } group cond5<"static"=0> { cond5[done] = 1'd1; le5.left = __n0.out; le5.right = const13.out; } group cond6<"static"=0> { cond6[done] = 1'd1; gt0.left = __current_0.out; gt0.right = __max_0.out; } group let0<"static"=1> { __b0.in = const0.out; __b0.write_en = 1'd1; let0[done] = __b0.done; } group let1<"static"=1> { __c0.in = const2.out; __c0.write_en = 1'd1; let1[done] = __c0.done; } group let10<"static"=1> { __pool_y_0.in = add0.out; __pool_y_0.write_en = 1'd1; let10[done] = __pool_y_0.done; add0.left = __stride_y_0.out; add0.right = __m0.out; } group let11<"static"=1> { __pool_x_0.in = add1.out; __pool_x_0.write_en = 1'd1; let11[done] = __pool_x_0.done; add1.left = __stride_x_0.out; add1.right = __n0.out; } group let2<"static"=1> { __y0.in = const4.out; __y0.write_en = 1'd1; let2[done] = __y0.done; } group let3<"static"=1> { __x0.in = const6.out; __x0.write_en = 1'd1; let3[done] = __x0.done; } group let4<"static"=4> { bin_read0_0.in = mult_pipe0.out; bin_read0_0.write_en = mult_pipe0.done; let4[done] = bin_read0_0.done; mult_pipe0.left = __y0.out; mult_pipe0.right = const8.out; mult_pipe0.go = !mult_pipe0.done ? 1'd1; } group let5<"static"=1> { __stride_y_0.in = bin_read0_0.out; __stride_y_0.write_en = 1'd1; let5[done] = __stride_y_0.done; } group let6<"static"=4> { bin_read1_0.in = mult_pipe1.out; bin_read1_0.write_en = mult_pipe1.done; let6[done] = bin_read1_0.done; mult_pipe1.left = __x0.out; mult_pipe1.right = const9.out; mult_pipe1.go = !mult_pipe1.done ? 1'd1; } group let7<"static"=1> { __stride_x_0.in = bin_read1_0.out; __stride_x_0.write_en = 1'd1; let7[done] = __stride_x_0.done; } group let8<"static"=1> { __m0.in = const10.out; __m0.write_en = 1'd1; let8[done] = __m0.done; } group let9<"static"=1> { __n0.in = const12.out; __n0.write_en = 1'd1; let9[done] = __n0.done; } group upd0<"static"=1> { __max_0.write_en = 1'd1; data0_0_0_0_addr3 = slice3.out; slice3.in = __stride_x_0.out; data0_0_0_0_addr2 = slice2.out; slice2.in = __stride_y_0.out; data0_0_0_0_addr1 = slice1.out; slice1.in = __c0.out; data0_0_0_0_addr0 = slice0.out; slice0.in = __b0.out; __max_0.in = 1'd1 ? data0_0_0_0_read_data; upd0[done] = __max_0.done ? 1'd1; } group upd1<"static"=1> { __current_0.write_en = 1'd1; data0_0_0_0_addr3 = slice7.out; slice7.in = __pool_x_0.out; data0_0_0_0_addr2 = slice6.out; slice6.in = __pool_y_0.out; data0_0_0_0_addr1 = slice5.out; slice5.in = __c0.out; data0_0_0_0_addr0 = slice4.out; slice4.in = __b0.out; __current_0.in = 1'd1 ? data0_0_0_0_read_data; upd1[done] = __current_0.done ? 1'd1; } group upd2<"static"=1> { __max_0.write_en = 1'd1; __max_0.in = 1'd1 ? __current_0.out; upd2[done] = __max_0.done ? 1'd1; } group upd3<"static"=1> { __n0.write_en = 1'd1; add2.left = __n0.out; add2.right = const14.out; __n0.in = 1'd1 ? add2.out; upd3[done] = __n0.done ? 1'd1; } group upd4<"static"=1> { __m0.write_en = 1'd1; add3.left = __m0.out; add3.right = const15.out; __m0.in = 1'd1 ? add3.out; upd4[done] = __m0.done ? 1'd1; } group upd5<"static"=1> { result0_0_0_0_addr3 = slice11.out; slice11.in = __x0.out; result0_0_0_0_addr2 = slice10.out; slice10.in = __y0.out; result0_0_0_0_addr1 = slice9.out; slice9.in = __c0.out; result0_0_0_0_addr0 = slice8.out; slice8.in = __b0.out; result0_0_0_0_write_en = 1'd1; result0_0_0_0_write_data = 1'd1 ? __max_0.out; upd5[done] = result0_0_0_0_done ? 1'd1; } group upd6<"static"=1> { __x0.write_en = 1'd1; add4.left = __x0.out; add4.right = const16.out; __x0.in = 1'd1 ? add4.out; upd6[done] = __x0.done ? 1'd1; } group upd7<"static"=1> { __y0.write_en = 1'd1; add5.left = __y0.out; add5.right = const17.out; __y0.in = 1'd1 ? add5.out; upd7[done] = __y0.done ? 1'd1; } group upd8<"static"=1> { __c0.write_en = 1'd1; add6.left = __c0.out; add6.right = const18.out; __c0.in = 1'd1 ? add6.out; upd8[done] = __c0.done ? 1'd1; } group upd9<"static"=1> { __b0.write_en = 1'd1; add7.left = __b0.out; add7.right = const19.out; __b0.in = 1'd1 ? add7.out; upd9[done] = __b0.done ? 1'd1; } } control { seq { let0; @bound(2) while le0.out with cond0 { seq { let1; @bound(2) while le1.out with cond1 { seq { let2; @bound(2) while le2.out with cond2 { seq { let3; @bound(2) while le3.out with cond3 { seq { par { seq { let4; let5; } seq { let6; let7; } } upd0; let8; @bound(2) while le4.out with cond4 { seq { let9; @bound(2) while le5.out with cond5 { seq { par { let10; let11; } upd1; if gt0.out with cond6 { upd2; } upd3; } } upd4; } } upd5; upd6; } } upd7; } } upd8; } } upd9; } } } } }