[Benchmark] Add more micro benchmarks for mac ranging from 8 bit to 32 bit
This commit is contained in:
parent
671394ec2c
commit
200b6d39a6
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue