[Benchmark] Add micro benchmarks

This commit is contained in:
tangxifan 2020-11-17 13:55:47 -07:00
parent 39aa11c42c
commit 75db7b255b
8 changed files with 118 additions and 0 deletions

3
BENCHMARK/and2/and2.act Normal file
View File

@ -0,0 +1,3 @@
a 0.5 0.5
b 0.5 0.5
c 0.25 0.25

8
BENCHMARK/and2/and2.blif Normal file
View File

@ -0,0 +1,8 @@
.model and2
.inputs a b
.outputs c
.names a b c
11 1
.end

18
BENCHMARK/and2/and2.v Normal file
View File

@ -0,0 +1,18 @@
/////////////////////////////////////////
// Functionality: 2-input AND
// Author: Xifan Tang
////////////////////////////////////////
`timescale 1ns / 1ps
module and2(
a,
b,
c);
input wire a;
input wire b;
output wire c;
assign c = a & b;
endmodule

View File

@ -0,0 +1,6 @@
a 0.492800 0.201000
b 0.502000 0.197200
clk 0.500000 2.000000
d 0.240200 0.171200
c 0.240200 0.044100
n1 0.240200 0.044100

View File

@ -0,0 +1,14 @@
# Benchmark "and2_latch" written by ABC on Wed Mar 11 10:36:28 2020
.model and2_latch
.inputs a b clk
.outputs c d
.latch n1 d re clk 0
.names a b c
11 1
.names c n1
1 1
.end

View File

@ -0,0 +1,29 @@
/////////////////////////////////////////
// Functionality: 2-input AND with clocked
// and combinational outputs
// Author: Xifan Tang
////////////////////////////////////////
`timescale 1ns / 1ps
module and2_latch(
a,
b,
clk,
c,
d);
input wire clk;
input wire a;
input wire b;
output wire c;
output reg d;
assign c = a & b;
always @(posedge clk) begin
d <= c;
end
endmodule

View File

@ -0,0 +1,16 @@
module counter(clk_counter, q_counter, rst_counter);
input clk_counter;
input rst_counter;
output [7:0] q_counter;
reg [7:0] q_counter;
always @ (posedge clk_counter)
begin
if(rst_counter)
q_counter <= 8'b00000000;
else
q_counter <= q_counter + 1;
end
endmodule

View File

@ -0,0 +1,24 @@
module counter_tb;
reg clk_counter, rst_counter;
wire [7:0] q_counter;
counter_original C_1(
clk_counter,
q_counter,
rst_counter);
initial begin
#0 rst_counter = 1'b1; clk_counter = 1'b0;
#100 rst_counter = 1'b0;
end
always begin
#10 clk_counter = ~clk_counter;
end
initial begin
#5000 $stop;
end
endmodule