summaryrefslogtreecommitdiff
path: root/rtl/gfx/mat_vec_mul.sv
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2023-10-21 03:21:18 -0600
committerAlejandro Soto <alejandro@34project.org>2023-10-21 03:21:18 -0600
commitd84718bf7955a6bba03aa44938f0f140c1a6390d (patch)
tree58aca8052f775ae5697688c759ef24977db4f6a2 /rtl/gfx/mat_vec_mul.sv
parent1b5eeb9a949272232ff543f684c7be62d31d0d40 (diff)
rtl/gfx: implement non-synthesizable matrix multiplier
Diffstat (limited to 'rtl/gfx/mat_vec_mul.sv')
-rw-r--r--rtl/gfx/mat_vec_mul.sv34
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