From 0b6a9b06f593b6eb5f29726a23147baad7b0c9ec Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 2 Jul 2021 10:39:07 -0600 Subject: [PATCH] [Benchmark] Reorganize counter benchmarks. Move them to a directory and give specific naming regarding their functionality --- .../counter_128bit_async_reset/counter.v | 0 .../counter_128bit_async_reset/counter_tb.v | 0 .../counter_128bit_async_resetb/counter.v | 0 .../counter_128bit_async_resetb/counter_tb.v | 0 .../counter4bit_2clock.act | 0 .../counter4bit_2clock.blif | 0 .../counter_4bit_2clock}/counter4bit_2clock.v | 0 .../counter4bit_2clock_post_yosys.v | 0 .../counter4bit_2clock_tb.v | 0 .../counter_8bit_async_reset}/counter.v | 0 .../counter_8bit_async_reset}/counter_tb.v | 0 .../counter_8bit_async_resetb/counter.v | 25 +++++++++++++++++++ .../counter_8bit_async_resetb/counter_tb.v | 25 +++++++++++++++++++ .../counter_8bit_sync_reset}/counter.v | 0 .../counter_8bit_sync_reset}/counter_tb.v | 0 15 files changed, 50 insertions(+) rename openfpga_flow/benchmarks/micro_benchmark/{ => counters}/counter_128bit_async_reset/counter.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => counters}/counter_128bit_async_reset/counter_tb.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => counters}/counter_128bit_async_resetb/counter.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{ => counters}/counter_128bit_async_resetb/counter_tb.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter4bit_2clock => counters/counter_4bit_2clock}/counter4bit_2clock.act (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter4bit_2clock => counters/counter_4bit_2clock}/counter4bit_2clock.blif (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter4bit_2clock => counters/counter_4bit_2clock}/counter4bit_2clock.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter4bit_2clock => counters/counter_4bit_2clock}/counter4bit_2clock_post_yosys.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter4bit_2clock => counters/counter_4bit_2clock}/counter4bit_2clock_tb.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter_async_reset => counters/counter_8bit_async_reset}/counter.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter_async_reset => counters/counter_8bit_async_reset}/counter_tb.v (100%) create mode 100644 openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter.v create mode 100644 openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter_tb.v rename openfpga_flow/benchmarks/micro_benchmark/{counter => counters/counter_8bit_sync_reset}/counter.v (100%) rename openfpga_flow/benchmarks/micro_benchmark/{counter => counters/counter_8bit_sync_reset}/counter_tb.v (100%) diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_reset/counter.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_reset/counter.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_reset/counter.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_reset/counter.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_reset/counter_tb.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_reset/counter_tb.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_reset/counter_tb.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_reset/counter_tb.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_resetb/counter.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_resetb/counter.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_resetb/counter.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_resetb/counter.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_resetb/counter_tb.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_resetb/counter_tb.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter_128bit_async_resetb/counter_tb.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_128bit_async_resetb/counter_tb.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock.act b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock.act similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock.act rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock.act diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock.blif b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock.blif similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock.blif rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock.blif diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock_post_yosys.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock_post_yosys.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock_post_yosys.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock_post_yosys.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock_tb.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock_tb.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter4bit_2clock/counter4bit_2clock_tb.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_4bit_2clock/counter4bit_2clock_tb.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter_async_reset/counter.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_reset/counter.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter_async_reset/counter.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_reset/counter.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter_async_reset/counter_tb.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_reset/counter_tb.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter_async_reset/counter_tb.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_reset/counter_tb.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter.v new file mode 100644 index 000000000..3d929091d --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter.v @@ -0,0 +1,25 @@ +/////////////////////////////////////////// +// Functionality: Counter with asynchronous reset +// Author: Xifan Tang +//////////////////////////////////////// + +module counter ( + clk, + resetb, + result +); + + input clk; + input resetb; + output [7:0] result; + + reg [7:0] result; + + always @(posedge clk or negedge resetb) + begin + if (!resetb) + result = 0; + else + result = result + 1; + end +endmodule diff --git a/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter_tb.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter_tb.v new file mode 100644 index 000000000..8813aa0c4 --- /dev/null +++ b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_async_resetb/counter_tb.v @@ -0,0 +1,25 @@ +module counter_tb; + + reg clk, resetb; + wire [7:0] result; + + counter DUT( + .clk(clk), + .resetb(resetb), + .result(result) + ); + + initial begin + #0 resetb = 1'b0; clk = 1'b0; + #100 resetb = 1'b1; + end + + always begin + #10 clk = ~clk; + end + + initial begin + #5000 $stop; + end + +endmodule diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter/counter.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_sync_reset/counter.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter/counter.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_sync_reset/counter.v diff --git a/openfpga_flow/benchmarks/micro_benchmark/counter/counter_tb.v b/openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_sync_reset/counter_tb.v similarity index 100% rename from openfpga_flow/benchmarks/micro_benchmark/counter/counter_tb.v rename to openfpga_flow/benchmarks/micro_benchmark/counters/counter_8bit_sync_reset/counter_tb.v