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