-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
1,215 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 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]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// BEGIN macro defintions | ||
|
||
define(N, 2) | ||
define(N_ur, 2) | ||
define(N_bw, ubit<4>) | ||
|
||
// END macro definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 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]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// BEGIN macro defintions | ||
|
||
define(N, 3) | ||
define(N_ur, 3) | ||
define(N_bw, ubit<4>) | ||
|
||
// END macro definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// BEGIN macro defintions | ||
|
||
|
||
|
||
|
||
|
||
// END macro definitions | ||
decl C_int: ubit<32>[4][4]; | ||
decl A_int: ubit<32>[4][4]; | ||
decl B_int: ubit<32>[4][4]; | ||
|
||
let C: ubit<32>[4 bank 4][4 bank 4]; | ||
let A: ubit<32>[4 bank 4][4]; | ||
let B: ubit<32>[4][4 bank 4]; | ||
|
||
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..4) { | ||
for (let j: ubit<4> = 0..4) { | ||
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..4) unroll 4 { | ||
// Loop order has to change since j is not defined in the combine | ||
// block otherwise. | ||
for (let j: ubit<4> = 0..4) unroll 4 { | ||
for (let k: ubit<4> = 0..4) { | ||
let v: ubit<32> = A[i][k] * B[k][j]; | ||
} combine { | ||
C[i][j] += v; | ||
} | ||
} | ||
} | ||
|
||
--- | ||
|
||
// Output interface. | ||
|
||
for (let i: ubit<4> = 0..4) { | ||
for (let j: ubit<4> = 0..4) { | ||
C_int[i][j] := C_sh[i][j]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// BEGIN macro defintions | ||
|
||
define(N, 4) | ||
define(N_ur, 4) | ||
define(N_bw, ubit<4>) | ||
|
||
// END macro definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 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]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// BEGIN macro defintions | ||
|
||
define(N, 6) | ||
define(N_ur, 6) | ||
define(N_bw, ubit<4>) | ||
|
||
// END macro definitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// BEGIN macro defintions | ||
|
||
|
||
|
||
|
||
|
||
// END macro definitions | ||
decl C_int: ubit<32>[8][8]; | ||
decl A_int: ubit<32>[8][8]; | ||
decl B_int: ubit<32>[8][8]; | ||
|
||
let C: ubit<32>[8 bank 8][8 bank 8]; | ||
let A: ubit<32>[8 bank 8][8]; | ||
let B: ubit<32>[8][8 bank 8]; | ||
|
||
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..8) { | ||
for (let j: ubit<4> = 0..8) { | ||
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..8) unroll 8 { | ||
// Loop order has to change since j is not defined in the combine | ||
// block otherwise. | ||
for (let j: ubit<4> = 0..8) unroll 8 { | ||
for (let k: ubit<4> = 0..8) { | ||
let v: ubit<32> = A[i][k] * B[k][j]; | ||
} combine { | ||
C[i][j] += v; | ||
} | ||
} | ||
} | ||
|
||
--- | ||
|
||
// Output interface. | ||
|
||
for (let i: ubit<4> = 0..8) { | ||
for (let j: ubit<4> = 0..8) { | ||
C_int[i][j] := C_sh[i][j]; | ||
} | ||
} |
Oops, something went wrong.