From 4d4577bb835779a90578d65b902ac1aa9f058d6a Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 30 Jun 2021 15:13:47 -0600 Subject: [PATCH] [Benchmark] Added multiple adder benchmarks to have better coverage in testing FPGA arch with adders --- .../micro_benchmark/adder/adder_16/adder_16.v | 21 ++++++ .../micro_benchmark/adder/adder_4/adder_4.v | 21 ++++++ .../micro_benchmark/adder/adder_6/adder_6.v | 21 ++++++ .../{ => adder}/adder_8/adder_8.act | 0 .../{ => adder}/adder_8/adder_8.eblif | 0 .../{ => adder}/adder_8/adder_8.v | 0 .../{ => adder}/adder_8/adder_8_out.v | 0 .../adder/adder_8/adder_8_post_synthesis.v | 65 +++++++++++++++++++ 8 files changed, 128 insertions(+) create mode 100644 openfpga_flow/benchmarks/micro_benchmark/adder/adder_16/adder_16.v create mode 100644 openfpga_flow/benchmarks/micro_benchmark/adder/adder_4/adder_4.v create mode 100644 openfpga_flow/benchmarks/micro_benchmark/adder/adder_6/adder_6.v rename openfpga_flow/benchmarks/micro_benchmark/{ => adder}/adder_8/adder_8.act (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => adder}/adder_8/adder_8.eblif (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => adder}/adder_8/adder_8.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => adder}/adder_8/adder_8_out.v (100%) create mode 100644 openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8_post_synthesis.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder/adder_16/adder_16.v b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_16/adder_16.v new file mode 100644 index 000000000..2e7d31076 --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_16/adder_16.v @@ -0,0 +1,21 @@ +// Creating a scaleable adder + +module adder_16(cout, sum, a, b, cin); +parameter size = 6; /* declare a parameter. default required */ +output cout; +output [size-1:0] sum; // sum uses the size parameter +input cin; +input [size-1:0] a, b; // 'a' and 'b' use the size parameter + +assign {cout, sum} = a + b + cin; + +endmodule + + + + + + + + + diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder/adder_4/adder_4.v b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_4/adder_4.v new file mode 100644 index 000000000..b444bfa3a --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_4/adder_4.v @@ -0,0 +1,21 @@ +// Creating a scaleable adder + +module adder_4(cout, sum, a, b, cin); +parameter size = 4; /* declare a parameter. default required */ +output cout; +output [size-1:0] sum; // sum uses the size parameter +input cin; +input [size-1:0] a, b; // 'a' and 'b' use the size parameter + +assign {cout, sum} = a + b + cin; + +endmodule + + + + + + + + + diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder/adder_6/adder_6.v b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_6/adder_6.v new file mode 100644 index 000000000..74a09005d --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_6/adder_6.v @@ -0,0 +1,21 @@ +// Creating a scaleable adder + +module adder_6(cout, sum, a, b, cin); +parameter size = 6; /* declare a parameter. default required */ +output cout; +output [size-1:0] sum; // sum uses the size parameter +input cin; +input [size-1:0] a, b; // 'a' and 'b' use the size parameter + +assign {cout, sum} = a + b + cin; + +endmodule + + + + + + + + + diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8.act b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8.act similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8.act rename to openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8.act diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8.eblif b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8.eblif similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8.eblif rename to openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8.eblif diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8.v b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8.v rename to openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8_out.v b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8_out.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/adder_8/adder_8_out.v rename to openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8_out.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8_post_synthesis.v b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8_post_synthesis.v new file mode 100644 index 000000000..1e7069e8c --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/adder/adder_8/adder_8_post_synthesis.v @@ -0,0 +1,65 @@ +/* Generated by Yosys 0.9+2406 (git sha1 3a9968de, gcc 8.4.0 -fPIC -Os) */ + +module adder_8(\a[0] , \a[1] , \a[2] , \a[3] , \a[4] , \a[5] , \a[6] , \a[7] , \b[0] , \b[1] , \b[2] , \b[3] , \b[4] , \b[5] , \b[6] , \b[7] , cin, cout, \sum[0] , \sum[1] , \sum[2] , \sum[3] , \sum[4] , \sum[5] , \sum[6] , \sum[7] ); + wire _00_; + wire _01_; + wire _02_; + wire _03_; + wire _04_; + wire _05_; + wire _06_; + wire _07_; + wire _08_; + wire _09_; + wire _10_; + wire _11_; + wire _12_; + input \a[0] ; + input \a[1] ; + input \a[2] ; + input \a[3] ; + input \a[4] ; + input \a[5] ; + input \a[6] ; + input \a[7] ; + input \b[0] ; + input \b[1] ; + input \b[2] ; + input \b[3] ; + input \b[4] ; + input \b[5] ; + input \b[6] ; + input \b[7] ; + input cin; + output cout; + output \sum[0] ; + output \sum[1] ; + output \sum[2] ; + output \sum[3] ; + output \sum[4] ; + output \sum[5] ; + output \sum[6] ; + output \sum[7] ; + assign cout = 8'h8e >> { _00_, \a[7] , \b[7] }; + assign _08_ = 4'h8 >> { \a[5] , \b[5] }; + assign \sum[0] = 8'h96 >> { \a[0] , \b[0] , cin }; + assign \sum[1] = 8'h69 >> { _05_, \a[1] , \b[1] }; + assign \sum[2] = 16'h6a56 >> { _05_, \a[1] , \b[1] , _04_ }; + assign \sum[3] = 16'h9996 >> { _03_, _06_, \a[3] , \b[3] }; + assign \sum[4] = 8'h69 >> { _02_, \a[4] , \b[4] }; + assign \sum[5] = 8'h69 >> { _09_, \a[5] , \b[5] }; + assign _09_ = 8'h71 >> { _02_, \a[4] , \b[4] }; + assign \sum[6] = 16'h9996 >> { _01_, _08_, \a[6] , \b[6] }; + assign \sum[7] = 8'h69 >> { _00_, \a[7] , \b[7] }; + assign _00_ = 16'h011f >> { \a[6] , \b[6] , _01_, _08_ }; + assign _01_ = 16'h4054 >> { _02_, \a[4] , \b[4] , _07_ }; + assign _02_ = 16'h011f >> { \a[3] , \b[3] , _03_, _06_ }; + assign _03_ = 16'h80a8 >> { _05_, \a[1] , \b[1] , _04_ }; + assign _04_ = 4'h6 >> { \a[2] , \b[2] }; + assign _05_ = 8'h17 >> { \a[0] , \b[0] , cin }; + assign _06_ = 4'h8 >> { \a[2] , \b[2] }; + assign _07_ = 4'h1 >> { \a[5] , \b[5] }; + assign _10_ = 1'h0; + assign _11_ = 1'h1; + assign _12_ = 1'hx; +endmodule