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

Subversion Repositories sha3

[/] [sha3/] [trunk/] [high_throughput_core/] [testbench/] [test_padder1.v] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 homer.hsin
/*
2
 * Copyright 2013, 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
`define P 20
19
 
20
module test_padder1;
21
 
22
    // Inputs
23
    reg [63:0] in;
24
    reg [2:0] byte_num;
25
 
26
    // Outputs
27
    wire [63:0] out;
28
 
29
    reg [63:0] wish;
30
 
31
    // Instantiate the Unit Under Test (UUT)
32
    padder1 uut (
33
        .in(in),
34
        .byte_num(byte_num),
35
        .out(out)
36
    );
37
 
38
    initial begin
39
        // Initialize Inputs
40
        in = 0;
41
        byte_num = 0;
42
 
43
        // Wait 100 ns for global reset to finish
44
        #100;
45
 
46
        // Add stimulus here
47
        in = 64'h1234567890ABCDEF;
48
        byte_num = 0;
49
        wish = {8'h01, 56'h0};
50
        check;
51
        byte_num = 1;
52
        wish = 64'h1201000000000000;
53
        check;
54
        byte_num = 2;
55
        wish = 64'h1234010000000000;
56
        check;
57
        byte_num = 3;
58
        wish = 64'h1234560100000000;
59
        check;
60
        byte_num = 4;
61
        wish = 64'h1234567801000000;
62
        check;
63
        byte_num = 5;
64
        wish = 64'h1234567890010000;
65
        check;
66
        byte_num = 6;
67
        wish = 64'h1234567890AB0100;
68
        check;
69
        byte_num = 7;
70
        wish = 64'h1234567890ABCD01;
71
        check;
72
        $display("Good!");
73
        $finish;
74
    end
75
 
76
    task check;
77
      begin
78
        #(`P);
79
        if (out !== wish)
80
          begin
81
            $display("E");
82
            $finish;
83
          end
84
      end
85
    endtask
86
endmodule
87
 
88
`undef P

powered by: WebSVN 2.1.0

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