// BEGIN macro defintions // END macro definitions decl C_int: ubit<32>[6][6]; decl A_int: ubit<32>[6][6]; decl B_int: ubit<32>[6][6]; let C: ubit<32>[6 bank 6][6 bank 6]; let A: ubit<32>[6 bank 6][6]; let B: ubit<32>[6][6 bank 6]; view C_sh = C[_: bank 1][_: bank 1]; view A_sh = A[_: bank 1][_: bank 1]; view B_sh = B[_: bank 1][_: bank 1]; // Input interface. for (let i: ubit<4> = 0..6) { for (let j: ubit<4> = 0..6) { A_sh[i][j] := A_int[i][j]; B_sh[i][j] := B_int[i][j]; C_sh[i][j] := C_int[i][j]; } } --- for (let i: ubit<4> = 0..6) unroll 6 { // Loop order has to change since j is not defined in the combine // block otherwise. for (let j: ubit<4> = 0..6) unroll 6 { for (let k: ubit<4> = 0..6) { let v: ubit<32> = A[i][k] * B[k][j]; } combine { C[i][j] += v; } } } --- // Output interface. for (let i: ubit<4> = 0..6) { for (let j: ubit<4> = 0..6) { C_int[i][j] := C_sh[i][j]; } }