OpenCores
URL https://opencores.org/ocsvn/fpga-cf/fpga-cf/trunk

Subversion Repositories fpga-cf

[/] [fpga-cf/] [trunk/] [hdl/] [md5/] [md5_tb.v] - Blame information for rev 8

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 peteralieb
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  MD5 main simulation file                                    ////
4
////                                                              ////
5
////  This file is part of the SystemC MD5                        ////
6
////                                                              ////
7
////  Description:                                                ////
8
////  MD5 main simulation file                                    ////
9
////                                                              ////
10
////  To Do:                                                      ////
11
////   - done                                                     ////
12
////                                                              ////
13
////  Author(s):                                                  ////
14
////      - Javier Castillo, jcastilo@opencores.org               ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
19
////                                                              ////
20
//// This source file may be used and distributed without         ////
21
//// restriction provided that this copyright statement is not    ////
22
//// removed from the file and that any derivative work contains  ////
23
//// the original copyright notice and the associated disclaimer. ////
24
////                                                              ////
25
//// This source file is free software; you can redistribute it   ////
26
//// and/or modify it under the terms of the GNU Lesser General   ////
27
//// Public License as published by the Free Software Foundation; ////
28
//// either version 2.1 of the License, or (at your option) any   ////
29
//// later version.                                               ////
30
////                                                              ////
31
//// This source is distributed in the hope that it will be       ////
32
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
33
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
34
//// PURPOSE.  See the GNU Lesser General Public License for more ////
35
//// details.                                                     ////
36
////                                                              ////
37
//// You should have received a copy of the GNU Lesser General    ////
38
//// Public License along with this source; if not, download it   ////
39
//// from http://www.opencores.org/lgpl.shtml                     ////
40
////                                                              ////
41
//////////////////////////////////////////////////////////////////////
42
//
43
// CVS Revision History
44
//
45
// $Log: not supported by cvs2svn $
46
 
47
`timescale 1ns/100ps
48
 
49
module md5_tb;
50
 
51
 
52
reg clk;
53
reg reset;
54
reg load_i;
55
wire ready_o;
56
reg newtext_i;
57
 
58
reg [127:0] data_i;
59
wire [127:0] data_o;
60
 
61
md5 DUT(clk,reset,load_i,ready_o,newtext_i,data_i,data_o);
62
 
63
   initial
64
 
65
   begin
66
     clk = 'b1;
67
     reset = 'b1;
68
     load_i = 'b0;
69
     newtext_i= 'b0;
70
     //data_i=128'h00008061000000000000000000000000;
71
          data_i = 128'h5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a;
72
     @(posedge clk);
73
     reset = #1 'b0;
74
     @(posedge clk);
75
     reset = #1 'b1;
76
     @(posedge clk);
77
     load_i = #1 'b1;
78
     @(posedge clk);
79
     load_i = #1 'b0;
80
     //data_i= 128'h0;
81
          data_i = 128'h5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a;
82
     @(posedge clk);
83
     load_i = #1 'b1;
84
     @(posedge clk);
85
     @(posedge clk);
86
     load_i = #1 'b0;
87
          //data_i = 128'h8000000000;
88
     data_i= 128'h00000080000000000000018000000000;
89
          //data_i = 128'h5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a;
90
     @(posedge clk);
91
     load_i =#1 'b1;
92
     @(posedge clk);
93
     load_i = #1 'b0;
94
 
95
 
96
     $display("Running test:");
97
     wait(ready_o);
98
     $display("Hash for \"a\":");
99
     $display("%H",data_o);
100
 
101
     @(posedge clk);
102
     newtext_i=#1'b1;
103
     @(posedge clk);
104
     newtext_i=#1'b0;
105
 
106
     @(posedge clk);
107
     data_i=128'h61616161616161616161616161616161;
108
     @(posedge clk);
109
     load_i = #1 'b1;
110
     @(posedge clk);
111
     @(posedge clk);
112
     @(posedge clk);
113
     @(posedge clk);
114
     load_i = #1 'b0;
115
     wait(ready_o);
116
 
117
     @(posedge clk);
118
     data_i=128'h61616161616161616161616161616161;
119
     @(posedge clk);
120
     load_i = #1 'b1;
121
     @(posedge clk);
122
     @(posedge clk);
123
     load_i = #1 'b0;
124
     data_i=128'h80000000000000000000000000;
125
     @(posedge clk);
126
     load_i = #1 'b1;
127
     @(posedge clk);
128
     load_i = #1 'b0;
129
     data_i=128'h10000000000;
130
     @(posedge clk);
131
     load_i = #1 'b1;
132
     @(posedge clk);
133
     load_i = #1 'b0;
134
     wait(ready_o);
135
     $display("Hash for two blocks full of \"a\":");
136
     $display("%H",data_o);
137
 
138
 
139
     $stop;
140
 
141
   end
142
 
143
   always #5 clk = !clk;
144
 
145
endmodule

powered by: WebSVN 2.1.0

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