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

Subversion Repositories sha3

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

powered by: WebSVN 2.1.0

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