From 200b6d39a6f17fda3e95c836960a4b7ba123f401 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 23 Apr 2021 20:36:28 -0600 Subject: [PATCH] [Benchmark] Add more micro benchmarks for mac ranging from 8 bit to 32 bit --- .../micro_benchmark/mac/mac_12/mac_12.v | 22 +++++++++++++++++++ .../micro_benchmark/mac/mac_16/mac_16.v | 22 +++++++++++++++++++ .../micro_benchmark/{ => mac}/mac_2/mac_2.v | 0 .../micro_benchmark/mac/mac_32/mac_32.v | 22 +++++++++++++++++++ .../micro_benchmark/{ => mac}/mac_4/mac_4.v | 0 .../micro_benchmark/{ => mac}/mac_6/mac_6.v | 0 .../micro_benchmark/{ => mac}/mac_8/mac_8.v | 0 7 files changed, 66 insertions(+) create mode 100644 openfpga_flow/benchmarks/micro_benchmark/mac/mac_12/mac_12.v create mode 100644 openfpga_flow/benchmarks/micro_benchmark/mac/mac_16/mac_16.v rename openfpga_flow/benchmarks/micro_benchmark/{ => mac}/mac_2/mac_2.v (100%) create mode 100644 openfpga_flow/benchmarks/micro_benchmark/mac/mac_32/mac_32.v rename openfpga_flow/benchmarks/micro_benchmark/{ => mac}/mac_4/mac_4.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => mac}/mac_6/mac_6.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => mac}/mac_8/mac_8.v (100%) diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac/mac_12/mac_12.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_12/mac_12.v new file mode 100644 index 000000000..ccbade6c0 --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_12/mac_12.v @@ -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 + + + + + + + + + diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac/mac_16/mac_16.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_16/mac_16.v new file mode 100644 index 000000000..3fc2270e5 --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_16/mac_16.v @@ -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 + + + + + + + + + diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac_2/mac_2.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_2/mac_2.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/mac_2/mac_2.v rename to openfpga_flow/benchmarks/micro_benchmark/mac/mac_2/mac_2.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac/mac_32/mac_32.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_32/mac_32.v new file mode 100644 index 000000000..e22fd596c --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_32/mac_32.v @@ -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 + + + + + + + + + diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac_4/mac_4.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_4/mac_4.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/mac_4/mac_4.v rename to openfpga_flow/benchmarks/micro_benchmark/mac/mac_4/mac_4.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac_6/mac_6.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_6/mac_6.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/mac_6/mac_6.v rename to openfpga_flow/benchmarks/micro_benchmark/mac/mac_6/mac_6.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/mac_8/mac_8.v b/openfpga_flow/benchmarks/micro_benchmark/mac/mac_8/mac_8.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/mac_8/mac_8.v rename to openfpga_flow/benchmarks/micro_benchmark/mac/mac_8/mac_8.v