test: validate parametric 32x4 layer with parallelism 8

This commit is contained in:
2026-09-02 09:27:04 +02:00
commit d4ae2417a4
14 changed files with 14571 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
module mac_unit #(
parameter DATA_WIDTH = 16,
parameter ACC_WIDTH = 40
)(
input signed [DATA_WIDTH-1:0] x,
input signed [DATA_WIDTH-1:0] w,
input signed [ACC_WIDTH-1:0] acc_in,
output signed [ACC_WIDTH-1:0] acc_out
);
localparam PROD_WIDTH = 2 * DATA_WIDTH;
wire signed [PROD_WIDTH-1:0] product;
wire signed [ACC_WIDTH-1:0] product_ext;
assign product = x * w;
assign product_ext =
{{(ACC_WIDTH-PROD_WIDTH){product[PROD_WIDTH-1]}}, product};
assign acc_out = acc_in + product_ext;
endmodule