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

Subversion Repositories csa

[/] [csa/] [trunk/] [bench/] [key_schedule_tb.v] - Blame information for rev 47

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 simon111
// the test bench module for key_schedule
2
`timescale 10ns/1ns
3
 
4
module key_schedule_tb;
5
reg     [8*8-1:0]  ck;
6 23 simon111
reg                clk;
7
reg                rst;
8
reg                start;
9 13 simon111
wire    [56*8-1:0] kk;
10 23 simon111
 
11 13 simon111
        initial
12
        begin
13 23 simon111
        clk<=1'h0;
14
        forever #5 clk=~clk;
15
        end
16 13 simon111
 
17 23 simon111
        initial
18
        begin
19
        @(posedge clk);
20
        rst<=1'h1;
21
        @(posedge clk);
22
        @(posedge clk);
23
        rst=1'h0;
24
        @(posedge clk);
25
        end
26
 
27
        initial
28
        begin
29
 
30
`ifdef ____DEBUG
31 13 simon111
        // read CK
32
        $read_data(
33
                                "../test_dat/key_schedule.in"
34
                               ,ck
35
                  );
36 15 simon111
`endif
37 23 simon111
        start=1'h0;
38
        ck=64'haf361916fd4b4b77;
39 13 simon111
 
40 23 simon111
        repeat (4) @(posedge clk);
41
        start=1'h1;
42
        @(posedge clk);
43
        start=1'h0;
44
        repeat (200) @(posedge clk);
45
 
46
        $display("ck=%h",ck);
47
        $display("kk=%h",kk);
48
 
49 13 simon111
        // output kk
50 23 simon111
 
51
        //$write_data(
52
        //                "../test_dat/key_schedule.out.v"
53
        //               ,"a"
54
        //               ,kk
55
        //           );
56 13 simon111
                $finish;
57
        end
58
 
59
        key_schedule ks(
60 23 simon111
                         .clk     (clk)
61
                        ,.rst     (rst)
62
                        ,.start   (start)
63
                        ,.i_ck    (ck)
64
                        ,.busy    ()
65
                        ,.done    ()
66
                        ,.o_kk    (kk)
67 13 simon111
                        );
68
endmodule

powered by: WebSVN 2.1.0

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