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