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

Subversion Repositories systemcmd5

[/] [systemcmd5/] [trunk/] [bench/] [verilog/] [top.v] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jcastillo
//////////////////////////////////////////////////////////////////////
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 10ns/1ns
48
 
49
module top;
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 m1(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
     @(posedge clk);
72
     reset = #1 'b0;
73
     @(posedge clk);
74
     reset = #1 'b1;
75
     @(posedge clk);
76
     load_i = #1 'b1;
77
     @(posedge clk);
78
     load_i = #1 'b0;
79
     data_i= 128'h0;
80
     @(posedge clk);
81
     load_i = #1 'b1;
82
     @(posedge clk);
83
     @(posedge clk);
84
     load_i = #1 'b0;
85
     data_i= 128'h800000000;
86
     @(posedge clk);
87
     load_i =#1 'b1;
88
     @(posedge clk);
89
     load_i = #1 'b0;
90
 
91
 
92
     $display("Running test:");
93
     wait(ready_o);
94
     $display("Hash for \"a\":");
95
     $display("%H",data_o);
96
 
97
     @(posedge clk);
98
     newtext_i=#1'b1;
99
     @(posedge clk);
100
     newtext_i=#1'b0;
101
 
102
     @(posedge clk);
103
     data_i=128'h61616161616161616161616161616161;
104
     @(posedge clk);
105
     load_i = #1 'b1;
106
     @(posedge clk);
107
     @(posedge clk);
108
     @(posedge clk);
109
     @(posedge clk);
110
     load_i = #1 'b0;
111
     wait(ready_o);
112
 
113
     @(posedge clk);
114
     data_i=128'h61616161616161616161616161616161;
115
     @(posedge clk);
116
     load_i = #1 'b1;
117
     @(posedge clk);
118
     @(posedge clk);
119
     load_i = #1 'b0;
120
     data_i=128'h80000000000000000000000000;
121
     @(posedge clk);
122
     load_i = #1 'b1;
123
     @(posedge clk);
124
     load_i = #1 'b0;
125
     data_i=128'h30000000000;
126
     @(posedge clk);
127
     load_i = #1 'b1;
128
     @(posedge clk);
129
     load_i = #1 'b0;
130
     wait(ready_o);
131
     $display("Hash for two blocks full of \"a\":");
132
     $display("%H",data_o);
133
 
134
 
135
     $finish;
136
 
137
   end
138
 
139
   always #5 clk = !clk;
140
 
141
endmodule

powered by: WebSVN 2.1.0

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