[Benchmark] Add more micro benchmarks for mac ranging from 8 bit to 32 bit

This commit is contained in:
tangxifan 2021-04-23 20:36:28 -06:00
parent 671394ec2c
commit 200b6d39a6
7 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,22 @@
//-------------------------------------------------------
// Functionality: A 12-bit multiply-acculumate circuit
// Author: Xifan Tang
//-------------------------------------------------------
module mac_12(a, b, c, out);
parameter DATA_WIDTH = 12; /* 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 16-bit multiply-acculumate circuit
// Author: Xifan Tang
//-------------------------------------------------------
module mac_16(a, b, c, out);
parameter DATA_WIDTH = 16; /* 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 32-bit multiply-acculumate circuit
// Author: Xifan Tang
//-------------------------------------------------------
module mac_32(a, b, c, out);
parameter DATA_WIDTH = 32; /* 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