testbench.v 855 Bytes
Newer Older
1
module testbench;
SergeyDegtyar committed
2
    reg [6:0] in;
3

SergeyDegtyar committed
4 5 6 7 8 9 10 11
	wire x;
	wire [2:0] y;
	wire [2:0] cin;

	wire patt_out = 0;
	wire patt_carry_out = 0;
	wire patt_out1 = 0;
	wire patt_carry_out1 = 0;
12 13
	wire out = 0;
    wire carryout = 0;
SergeyDegtyar committed
14 15
    wire control;
	wire control_patt;
16 17 18 19 20 21 22 23 24 25 26 27 28 29

    initial begin
        // $dumpfile("testbench.vcd");
        // $dumpvars(0, testbench);

        #5 in = 0;
        repeat (10000) begin
            #5 in = in + 1;
        end

        $display("OKAY");
    end

    top uut (
SergeyDegtyar committed
30 31 32
	.x(x),
	.y(y),
	.cin(cin),
33
	.A(out),
SergeyDegtyar committed
34 35
	.cout(carryout),
	.control(control)
36 37
	);

SergeyDegtyar committed
38 39
	wire A1,cout1;
	wire [2:0] n_y;
40

SergeyDegtyar committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54
	wire [2:0] n_cin;

//  initial begin
//     A = 0;
//     cout = 0;
//  end

assign x = in[0];
assign y = in[3:1];
assign cin = in[6:4];

assign control_patt = x & y & cin;

    assert_dff out_test(.clk(in[0]), .test(control),.pat(control_patt));
55 56

endmodule