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

Subversion Repositories tiny_aes

[/] [tiny_aes/] [trunk/] [testbench/] [test_aes_192.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 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_192;
20
 
21
        // Inputs
22
        reg clk;
23
        reg [127:0] state;
24
        reg [191:0] key;
25
 
26
        // Outputs
27
        wire [127:0] out;
28
 
29
        // Instantiate the Unit Under Test (UUT)
30
        aes_192 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 9 homer.hsin
        /*
44
         * TIMEGRP "key" OFFSET = IN 6.4 ns VALID 6 ns AFTER "clk" HIGH;
45
         * TIMEGRP "state" OFFSET = IN 6.4 ns VALID 6 ns AFTER "clk" HIGH;
46
         * TIMEGRP "out" OFFSET = OUT 2.2 ns BEFORE "clk" HIGH;
47
         */
48 6 homer.hsin
        @ (negedge clk);
49 9 homer.hsin
        #2;
50 6 homer.hsin
        state = 128'h3243f6a8885a308d313198a2e0370734;
51
        key   = 192'h2b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da5;
52
        #10;
53
        state = 128'h00112233445566778899aabbccddeeff;
54
        key   = 192'h000102030405060708090a0b0c0d0e0f1011121314151617;
55
        #10;
56
        state = 128'h0;
57
        key   = 192'h0;
58
        #230;
59
        if (out !== 128'hf9fb29aefc384a250340d833b87ebc00)
60
          begin $display("E"); $finish; end
61
        #10;
62
        if (out !== 128'hdda97ca4864cdfe06eaf70a0ec0d7191)
63
          begin $display("E"); $finish; end
64
        $display("Good.");
65
        $finish;
66
        end
67
 
68
    always #5 clk = ~clk;
69
endmodule
70
 

powered by: WebSVN 2.1.0

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