import "primitives/std.lib"; import "primitives/math.futil"; component main() -> () { cells { @external(1) x = std_mem_d2(32, 2, 4096, 2, 13); @external(1) x1 = std_mem_d2(32, 2, 4096, 2, 13); batch_flatten_2x4096_ = batch_flatten_2x4096(); } wires { } control { seq { invoke batch_flatten_2x4096_(x0_0_read_data=x.read_data, x10_0_done=x1.done, x10_0_read_data=x1.read_data)(x0_0_addr0=x.addr0, x0_0_addr1=x.addr1, x10_0_write_data=x1.write_data, x10_0_write_en=x1.write_en, x10_0_addr0=x1.addr0, x10_0_addr1=x1.addr1); } } } component batch_flatten_2x4096(x0_0_read_data: 32, x0_0_done: 1, x10_0_read_data: 32, x10_0_done: 1) -> (x0_0_write_data: 32, x0_0_write_en: 1, x0_0_addr0: 2, x0_0_addr1: 13, x10_0_write_data: 32, x10_0_write_en: 1, x10_0_addr0: 2, x10_0_addr1: 13) { cells { __i0 = std_reg(2); __j0 = std_reg(13); __k_0 = std_reg(13); add0 = std_add(13); add1 = std_add(13); add2 = std_add(2); const0 = std_const(13,0); const1 = std_const(2,0); const2 = std_const(2,1); const3 = std_const(13,0); const4 = std_const(13,4095); const5 = std_const(13,1); const6 = std_const(13,1); const7 = std_const(2,1); le0 = std_le(2); le1 = std_le(13); x_read0_0 = std_reg(32); } wires { group cond0<"static"=0> { cond0[done] = 1'd1; le0.left = __i0.out; le0.right = const2.out; } group cond1<"static"=0> { cond1[done] = 1'd1; le1.left = __j0.out; le1.right = const4.out; } group let0<"static"=1> { __k_0.in = const0.out; __k_0.write_en = 1'd1; let0[done] = __k_0.done; } group let1<"static"=1> { __i0.in = const1.out; __i0.write_en = 1'd1; let1[done] = __i0.done; } group let2<"static"=1> { __j0.in = const3.out; __j0.write_en = 1'd1; let2[done] = __j0.done; } group upd0<"static"=1> { x_read0_0.write_en = 1'd1; x0_0_addr1 = __j0.out; x0_0_addr0 = __i0.out; x_read0_0.in = 1'd1 ? x0_0_read_data; upd0[done] = x_read0_0.done ? 1'd1; } group upd1<"static"=1> { x10_0_addr1 = __k_0.out; x10_0_addr0 = __i0.out; x10_0_write_en = 1'd1; x10_0_write_data = 1'd1 ? x_read0_0.out; upd1[done] = x10_0_done ? 1'd1; } group upd2<"static"=1> { __k_0.write_en = 1'd1; add0.left = __k_0.out; add0.right = const5.out; __k_0.in = 1'd1 ? add0.out; upd2[done] = __k_0.done ? 1'd1; } group upd3<"static"=1> { __j0.write_en = 1'd1; add1.left = __j0.out; add1.right = const6.out; __j0.in = 1'd1 ? add1.out; upd3[done] = __j0.done ? 1'd1; } group upd4<"static"=1> { __i0.write_en = 1'd1; add2.left = __i0.out; add2.right = const7.out; __i0.in = 1'd1 ? add2.out; upd4[done] = __i0.done ? 1'd1; } } control { seq { let0; let1; @bound(2) while le0.out with cond0 { seq { let2; @bound(4096) while le1.out with cond1 { seq { upd0; upd1; upd2; upd3; } } upd4; } } } } }