OpenCores
URL https://opencores.org/ocsvn/pairing/pairing/trunk

Subversion Repositories pairing

[/] [pairing/] [trunk/] [testbench/] [test_f3_sub.v] - Diff between revs 4 and 22

Only display areas with differences | Details | Blame | View Log

Rev 4 Rev 22
`timescale 1ns / 1ps
`timescale 1ns / 1ps
 
 
module test_f3_sub;
module test_f3_sub;
 
 
        // Inputs
    // Inputs
        reg [1:0] A;
    reg [1:0] A;
        reg [1:0] B;
    reg [1:0] B;
 
 
        // Outputs
    // Outputs
        wire [1:0] C;
    wire [1:0] C;
 
 
        // Instantiate the Unit Under Test (UUT)
    // Instantiate the Unit Under Test (UUT)
        f3_sub uut (
    f3_sub uut (
                .A(A),
        .A(A),
                .B(B),
        .B(B),
                .C(C)
        .C(C)
        );
    );
 
 
   task check;
   task check;
          begin
      begin
         #10;
         #10;
                        if (A != (B+C) % 3)
            if (A != (B+C) % 3)
                           begin
               begin
                                   $display("Error A:%d B:%d C:%d", A, B, C); $finish;
                   $display("Error A:%d B:%d C:%d", A, B, C); $finish;
                                end
                end
          end
      end
        endtask
    endtask
 
 
        initial begin
    initial begin
                // Initialize Inputs
        // Initialize Inputs
                A = 0;
        A = 0;
                B = 0;
        B = 0;
 
 
                // Wait 100 ns for global reset to finish
        // Wait 100 ns for global reset to finish
                #100;
        #100;
 
 
                // Add stimulus here
        // Add stimulus here
                A = 0; B = 0; check;
        A = 0; B = 0; check;
                A = 0; B = 1; check;
        A = 0; B = 1; check;
                A = 0; B = 2; check;
        A = 0; B = 2; check;
                A = 1; B = 0; check;
        A = 1; B = 0; check;
                A = 1; B = 1; check;
        A = 1; B = 1; check;
                A = 1; B = 2; check;
        A = 1; B = 2; check;
                A = 2; B = 0; check;
        A = 2; B = 0; check;
                A = 2; B = 1; check;
        A = 2; B = 1; check;
                A = 2; B = 2; check;
        A = 2; B = 2; check;
                $finish;
        $finish;
        end
    end
 
 
endmodule
endmodule
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.