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

Subversion Repositories csa

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

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 48 simon111
wire               done;
11
wire               busy;
12 23 simon111
 
13 13 simon111
        initial
14
        begin
15 23 simon111
        clk<=1'h0;
16
        forever #5 clk=~clk;
17
        end
18 13 simon111
 
19 23 simon111
        initial
20
        begin
21
        @(posedge clk);
22
        rst<=1'h1;
23
        @(posedge clk);
24
        @(posedge clk);
25
        rst=1'h0;
26
        @(posedge clk);
27
        end
28
 
29
        initial
30
        begin
31
 
32 13 simon111
        // read CK
33
        $read_data(
34
                                "../test_dat/key_schedule.in"
35
                               ,ck
36
                  );
37 23 simon111
        start=1'h0;
38 13 simon111
 
39 23 simon111
        repeat (4) @(posedge clk);
40
        start=1'h1;
41
        @(posedge clk);
42
        start=1'h0;
43 48 simon111
        repeat (20) @(posedge clk);
44 23 simon111
 
45
        $display("ck=%h",ck);
46
        $display("kk=%h",kk);
47
 
48 13 simon111
        // output kk
49 23 simon111
 
50 48 simon111
        $write_data(
51
                        "../test_dat/key_schedule.out.v"
52
                       ,kk
53
                   );
54
        $stop;
55 13 simon111
        end
56
 
57 48 simon111
        key_schedule key_schedule(
58 23 simon111
                         .clk     (clk)
59
                        ,.rst     (rst)
60
                        ,.start   (start)
61 48 simon111
                        ,.ck      (ck)
62
                        ,.busy    (busy)
63
                        ,.done    (done)
64
                        ,.kk      (kk)
65 13 simon111
                        );
66
endmodule

powered by: WebSVN 2.1.0

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