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

Subversion Repositories sha3

[/] [sha3/] [trunk/] [low_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 [31:0] in;
24
    reg [1:0] byte_num;
25
 
26
    // Outputs
27
    wire [31:0] out;
28
 
29
    reg [31: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 = 32'h90ABCDEF;
48
        byte_num = 0;
49
        wish = 32'h01000000;
50
        check;
51
        byte_num = 1;
52
        wish = 32'h90010000;
53
        check;
54
        byte_num = 2;
55
        wish = 32'h90AB0100;
56
        check;
57
        byte_num = 3;
58
        wish = 32'h90ABCD01;
59
        check;
60
        $display("Good!");
61
        $finish;
62
    end
63
 
64
    task check;
65
      begin
66
        #(`P);
67
        if (out !== wish)
68
          begin
69
            $display("E");
70
            $finish;
71
          end
72
      end
73
    endtask
74
endmodule
75
 
76
`undef P

powered by: WebSVN 2.1.0

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