diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-10-26 04:37:38 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-10-26 04:37:38 -0600 |
| commit | ebd3ef9b8ebe6c19d0965c3d5ee741c725180f85 (patch) | |
| tree | bdc7dc8eb43838cad86f6f4f1bd949beb447350a /rtl/gfx/transpose.sv | |
| parent | 4d10617bd697114ecdc748cb638a10bd8159aeaa (diff) | |
rtl/gfx: implement matrix transpose
Diffstat (limited to 'rtl/gfx/transpose.sv')
| -rw-r--r-- | rtl/gfx/transpose.sv | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/rtl/gfx/transpose.sv b/rtl/gfx/transpose.sv new file mode 100644 index 0000000..1df68d5 --- /dev/null +++ b/rtl/gfx/transpose.sv @@ -0,0 +1,17 @@ +`include "gfx/gfx_defs.sv" + +module transpose +( + input mat4 in, + output mat4 out +); + + integer i, j; + + // Esto no tiene costo en hardware, es un renombramiento de seƱales + always_comb + for (i = 0; i < `VECS_PER_MAT; ++i) + for (j = 0; j < `FLOATS_PER_VEC; ++j) + out[i][j] = in[j][i]; + +endmodule |
