[Benchmark] Add microbenchmarks for mac with different sizes for DSP testing

This commit is contained in:
tangxifan 2021-04-23 20:33:43 -06:00
parent 5ce28158bd
commit 671394ec2c
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,22 @@
//-------------------------------------------------------
// Functionality: A 2-bit multiply-acculumate circuit
// Author: Xifan Tang
//-------------------------------------------------------
module mac_2(a, b, c, out);
parameter DATA_WIDTH = 2; /* declare a parameter. default required */
input [DATA_WIDTH - 1 : 0] a, b, c;
output [DATA_WIDTH - 1 : 0] out;
assign out = a * b + c;
endmodule

View File

@ -0,0 +1,22 @@
//-------------------------------------------------------
// Functionality: A 4-bit multiply-acculumate circuit
// Author: Xifan Tang
//-------------------------------------------------------
module mac_4(a, b, c, out);
parameter DATA_WIDTH = 4; /* declare a parameter. default required */
input [DATA_WIDTH - 1 : 0] a, b, c;
output [DATA_WIDTH - 1 : 0] out;
assign out = a * b + c;
endmodule

View File

@ -0,0 +1,22 @@
//-------------------------------------------------------
// Functionality: A 6-bit multiply-acculumate circuit
// Author: Xifan Tang
//-------------------------------------------------------
module mac_6(a, b, c, out);
parameter DATA_WIDTH = 6; /* declare a parameter. default required */
input [DATA_WIDTH - 1 : 0] a, b, c;
output [DATA_WIDTH - 1 : 0] out;
assign out = a * b + c;
endmodule