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

Subversion Repositories sha3

[/] [sha3/] [trunk/] [high_throughput_core/] [testbench/] [test_rconst2in1.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_rconst2in1;
21
 
22
    // Inputs
23
    reg [11:0] i;
24
 
25
    // Outputs
26
    wire [63:0] rc1;
27
    wire [63:0] rc2;
28
 
29
    // Instantiate the Unit Under Test (UUT)
30
    rconst2in1 uut (
31
        .i(i),
32
        .rc1(rc1),
33
        .rc2(rc2)
34
    );
35
 
36
    initial begin
37
        // Initialize Inputs
38
        i = 0;
39
 
40
        // Wait 100 ns for global reset to finish
41
        #100;
42
 
43
        // Add stimulus here
44
        i=0; i[0] = 1;
45
        #(`P/2);
46
        if(rc1 !== 64'h1) begin $display("E"); $finish; end
47
        if(rc2 !== 64'h8082) begin $display("E"); $finish; end
48
        i=0; i[1] = 1;
49
        #(`P/2);
50
        if(rc1 !== 64'h800000000000808a) begin $display("E"); $finish; end
51
        if(rc2 !== 64'h8000000080008000) begin $display("E"); $finish; end
52
        i=0; i[2] = 1;
53
        #(`P/2);
54
        if(rc1 !== 64'h808b) begin $display("E"); $finish; end
55
        if(rc2 !== 64'h80000001) begin $display("E"); $finish; end
56
        i=0; i[3] = 1;
57
        #(`P/2);
58
        if(rc1 !== 64'h8000000080008081) begin $display("E"); $finish; end
59
        if(rc2 !== 64'h8000000000008009) begin $display("E"); $finish; end
60
        i=0; i[4] = 1;
61
        #(`P/2);
62
        if(rc1 !== 64'h8a) begin $display("E"); $finish; end
63
        if(rc2 !== 64'h88) begin $display("E"); $finish; end
64
        i=0; i[5] = 1;
65
        #(`P/2);
66
        if(rc1 !== 64'h80008009) begin $display("E"); $finish; end
67
        if(rc2 !== 64'h8000000a) begin $display("E"); $finish; end
68
        i=0; i[6] = 1;
69
        #(`P/2);
70
        if(rc1 !== 64'h8000808b) begin $display("E"); $finish; end
71
        if(rc2 !== 64'h800000000000008b) begin $display("E"); $finish; end
72
        i=0; i[7] = 1;
73
        #(`P/2);
74
        if(rc1 !== 64'h8000000000008089) begin $display("E"); $finish; end
75
        if(rc2 !== 64'h8000000000008003) begin $display("E"); $finish; end
76
        i=0; i[8] = 1;
77
        #(`P/2);
78
        if(rc1 !== 64'h8000000000008002) begin $display("E"); $finish; end
79
        if(rc2 !== 64'h8000000000000080) begin $display("E"); $finish; end
80
        i=0; i[9] = 1;
81
        #(`P/2);
82
        if(rc1 !== 64'h800a) begin $display("E"); $finish; end
83
        if(rc2 !== 64'h800000008000000a) begin $display("E"); $finish; end
84
        i=0; i[10] = 1;
85
        #(`P/2);
86
        if(rc1 !== 64'h8000000080008081) begin $display("E"); $finish; end
87
        if(rc2 !== 64'h8000000000008080) begin $display("E"); $finish; end
88
        i=0; i[11] = 1;
89
        #(`P/2);
90
        if(rc1 !== 64'h80000001) begin $display("E"); $finish; end
91
        if(rc2 !== 64'h8000000080008008) begin $display("E"); $finish; end
92
        $display("Good!");
93
        $finish;
94
    end
95
 
96
endmodule
97
 
98
`undef P

powered by: WebSVN 2.1.0

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