diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-10-21 03:21:18 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-10-21 03:21:18 -0600 |
| commit | d84718bf7955a6bba03aa44938f0f140c1a6390d (patch) | |
| tree | 58aca8052f775ae5697688c759ef24977db4f6a2 /rtl/gfx/mat_vec_mul.sv | |
| parent | 1b5eeb9a949272232ff543f684c7be62d31d0d40 (diff) | |
rtl/gfx: implement non-synthesizable matrix multiplier
Diffstat (limited to '')
| -rw-r--r-- | rtl/gfx/mat_vec_mul.sv | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/rtl/gfx/mat_vec_mul.sv b/rtl/gfx/mat_vec_mul.sv new file mode 100644 index 0000000..43860c9 --- /dev/null +++ b/rtl/gfx/mat_vec_mul.sv @@ -0,0 +1,34 @@ +`include "gfx/gfx_defs.sv" + +module mat_vec_mul +( + input logic clk, + rst_n, + + input logic start, + input mat4 a, + input vec4 x, + + output logic done, + output vec4 q +); + + logic dones[`FLOATS_PER_VEC]; + + assign done = dones[0]; + + genvar i; + generate + for (i = 0; i < `FLOATS_PER_VEC; ++i) begin: dots + vec_dot dot_i + ( + .a(a[i]), + .b(x), + .q(q[i]), + .done(dones[i]), + .* + ); + end + endgenerate + +endmodule |
