[Benchmark] Reorganize counter benchmarks. Move them to a directory and give specific naming regarding their functionality

This commit is contained in:
tangxifan 2021-07-02 10:39:07 -06:00
parent 3906497ef5
commit 0b6a9b06f5
15 changed files with 50 additions and 0 deletions

View File

@ -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

View File

@ -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