[Benchmark] Add microbenchmarks for mac with different sizes for DSP testing
This commit is contained in:
parent
5ce28158bd
commit
671394ec2c
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue