[Benchmark] Add 8-bit counter benchmark using asynchronous reset to test fracff architectures

This commit is contained in:
tangxifan 2021-04-16 20:14:48 -06:00
parent b11d03f9c5
commit bbdc0e53af
2 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,
reset,
result
);
input clk;
input reset;
output [7:0] result;
reg [7:0] result;
always @(posedge clk or posedge reset)
begin
if (reset)
result = 0;
else
result = result + 1;
end
endmodule

View File

@ -0,0 +1,25 @@
module counter_tb;
reg clk, reset;
wire [7:0] result;
counter DUT(
.clk(clk),
.reset(reset),
.result(result)
);
initial begin
#0 reset = 1'b1; clk = 1'b0;
#100 reset = 1'b0;
end
always begin
#10 clk = ~clk;
end
initial begin
#5000 $stop;
end
endmodule