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

Subversion Repositories tiny_aes

[/] [tiny_aes/] [trunk/] [testbench/] [test_aes_256.v] - Blame information for rev 5

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

Line No. Rev Author Line
1 5 homer.hsin
/*
2
 * Copyright 2012, Homer Hsing <homer.hsing@gmail.com>
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
 
17
`timescale 1ns / 1ps
18
 
19
module test_aes_256;
20
 
21
        // Inputs
22
        reg clk;
23
        reg [127:0] state;
24
        reg [255:0] key;
25
 
26
        // Outputs
27
        wire [127:0] out;
28
 
29
        // Instantiate the Unit Under Test (UUT)
30
        aes_256 uut (
31
                .clk(clk),
32
                .state(state),
33
                .key(key),
34
                .out(out)
35
        );
36
 
37
        initial begin
38
                clk = 0;
39
                state = 0;
40
                key = 0;
41
 
42
                #100;
43
        @ (negedge clk);
44
        state = 128'h3243f6a8885a308d313198a2e0370734;
45
        key   = 256'h2b7e151628aed2a6abf7158809cf4f3c_762e7160f38b4da56a784d9045190cfe;
46
        #10;
47
        state = 128'h00112233445566778899aabbccddeeff;
48
        key   = 256'h000102030405060708090a0b0c0d0e0f_101112131415161718191a1b1c1d1e1f;
49
        #10;
50
        state = 128'h0;
51
        key   = 256'h0;
52
        #270;
53
        if (out !== 128'h1a6e6c2c_662e7da6_501ffb62_bc9e93f3)
54
          begin $display("E"); $finish; end
55
        #10;
56
        if (out !== 128'h8ea2b7ca_516745bf_eafc4990_4b496089)
57
          begin $display("E"); $finish; end
58
        $display("Good.");
59
        $finish;
60
        end
61
 
62
    always #5 clk = ~clk;
63
endmodule
64
 

powered by: WebSVN 2.1.0

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