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

Subversion Repositories mod3_calc

[/] [mod3_calc/] [trunk/] [tb/] [mod3_tb.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 yanzixuan
module  mod3_tb ();
2
    reg [ 7: 0] dat_i;
3
    reg [ 1: 0] comp;
4
    reg [ 1: 0] err_cnt;
5
 
6
    wire    [ 1: 0] reminder;
7
 
8
    initial begin
9
        $display("------------------The self_check begin ------------------");
10
        dat_i   = 0;
11
        err_cnt = 0;
12
        repeat(256) begin
13
            comp    = dat_i % 3;
14
            #5;
15
            if (reminder != comp)   begin
16
                $display("comp = %d, calc data = %d", comp, reminder);
17
                err_cnt = err_cnt + 1;
18
            end
19
            dat_i   = dat_i + 1;
20
        end
21
 
22
        if (err_cnt == 0)
23
            $display("------------------The self_check passed------------------");
24
        else
25
            $display("------------------The self_check failed------------------");
26
        $stop;
27
 
28
    end
29
 
30
    mod3 M0(
31
        .dat_i(dat_i),
32
        .reminder(reminder)
33
    );
34
endmodule

powered by: WebSVN 2.1.0

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