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

Subversion Repositories systemcmd5

[/] [systemcmd5/] [trunk/] [rtl/] [systemc/] [main.cpp] - 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
 
48
#include "systemc.h"
49
#include "iostream.h"
50
#include "md5.h"
51
#include "stimulus.h"
52
 
53
int
54
sc_main (int argc, char *argv[])
55
{
56
 
57
  sc_clock clk ("clk", 20);
58
 
59
  test *t;
60
  md5_transactor *tr;
61
  md5 *md51;
62
 
63
  t = new test ("testbench");
64
  tr = new md5_transactor ("md5_transactor");
65
  md51 = new md5 ("md5");
66
 
67
  t->transactor (*tr);
68
 
69
  sc_signal < bool > reset;
70
  sc_signal < bool > load_i;
71
  sc_signal < bool > newtext_i;
72
  sc_signal < sc_biguint < 128 > >data_i;
73
  sc_signal < sc_biguint < 128 > >data_o;
74
  sc_signal < bool > ready_o;
75
 
76
  md51->clk (clk);
77
  md51->reset (reset);
78
  md51->load_i (load_i);
79
  md51->newtext_i (newtext_i);
80
  md51->data_i (data_i);
81
  md51->data_o (data_o);
82
  md51->ready_o (ready_o);
83
 
84
  tr->clk (clk);
85
  tr->reset (reset);
86
  tr->load_i (load_i);
87
  tr->newtext_i (newtext_i);
88
  tr->data_i (data_i);
89
  tr->data_o (data_o);
90
  tr->ready_o (ready_o);
91
 
92
 
93
  sc_trace_file *tf = sc_create_vcd_trace_file ("md5");
94
 
95
  sc_trace (tf, clk, "clk");
96
  sc_trace (tf, reset, "reset");
97
 
98
  sc_trace (tf, load_i, "load_i");
99
  sc_trace (tf, data_i, "data_i");
100
 
101
  sc_trace (tf, data_o, "data_o");
102
  sc_trace (tf, ready_o, "ready_o");
103
 
104
  sc_trace (tf, md51->hash_generated, "hash_generated");
105
  sc_trace (tf, md51->generate_hash, "generate_hash");
106
 
107
  sc_trace (tf, md51->round64, "round64");
108
  sc_trace (tf, md51->round, "round");
109
  sc_trace (tf, md51->message, "message");
110
  sc_trace (tf, md51->getdata_state, "getdata_state");
111
 
112
  sc_trace (tf, md51->ar, "ar");
113
  sc_trace (tf, md51->br, "br");
114
  sc_trace (tf, md51->cr, "cr");
115
  sc_trace (tf, md51->dr, "dr");
116
  sc_trace (tf, md51->t, "t");
117
 
118
  sc_trace (tf, md51->func_out, "func_out");
119
 
120
  sc_start (20, SC_US);
121
 
122
  sc_close_vcd_trace_file (tf);
123
 
124
  return 0;
125
 
126
}

powered by: WebSVN 2.1.0

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