OpenCores

Subversion Repositories pairing

[/] [pairing/] [trunk/] [testbench/] [test_f3_add.v] - Blame information for rev 22

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 homer.xing
`timescale 1ns / 1ps
2
 
3
module test_f3_add;
4
 
5 22 homer.xing
    // Inputs
6
    reg [1:0] A;
7
    reg [1:0] B;
8 4 homer.xing
 
9 22 homer.xing
    // Outputs
10
    wire [1:0] C;
11 4 homer.xing
 
12 22 homer.xing
    // Instantiate the Unit Under Test (UUT)
13
    f3_add uut (
14
        .A(A),
15
        .B(B),
16
        .C(C)
17
    );
18 4 homer.xing
 
19
   task check;
20 22 homer.xing
      begin
21 4 homer.xing
         #10;
22 22 homer.xing
            if ((A+B) % 3 != C)
23
               begin
24
                   $display("Error"); $finish;
25
                end
26
      end
27
    endtask
28 4 homer.xing
 
29 22 homer.xing
    initial begin
30
        // Initialize Inputs
31
        A = 0;
32
        B = 0;
33 4 homer.xing
 
34 22 homer.xing
        // Wait 100 ns for global reset to finish
35
        #100;
36 4 homer.xing
 
37 22 homer.xing
        // Add stimulus here
38
        A = 0; B = 0; check;
39
        A = 0; B = 1; check;
40
        A = 0; B = 2; check;
41
        A = 1; B = 0; check;
42
        A = 1; B = 1; check;
43
        A = 1; B = 2; check;
44
        A = 2; B = 0; check;
45
        A = 2; B = 1; check;
46
        A = 2; B = 2; check;
47
        $finish;
48
    end
49 4 homer.xing
 
50
endmodule
51
 

powered by: WebSVN 2.1.0

© copyright 1999-2014 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.