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

Subversion Repositories systemcdes

[/] [systemcdes/] [trunk/] [bench/] [systemc/] [checker.h] - Blame information for rev 12

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

Line No. Rev Author Line
1 2 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Checker                                                     ////
4
////                                                              ////
5
////  This file is part of the SystemC DES                        ////
6
////                                                              ////
7
////  Description:                                                ////
8
////  Check that the outputs from the RTL model and the C model   ////
9
////  used as golden model are the same                           ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - done                                                     ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Javier Castillo, jcastilo@opencores.org               ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47 6 jcastillo
// Revision 1.2  2004/08/30 16:55:54  jcastillo
48
// Used indent command on C code
49
//
50
// Revision 1.1.1.1  2004/07/05 17:31:18  jcastillo
51
// First import
52
//
53 2 jcastillo
 
54
 
55
#include "systemc.h"
56
 
57 6 jcastillo
SC_MODULE (checker)
58
{
59
 
60
  sc_in < bool > reset;
61
 
62
  sc_fifo_in < sc_uint < 64 > >rt_des_data_i;
63
  sc_fifo_in < sc_uint < 64 > >c_des_data_i;
64
 
65
  void check ()
66
  {
67
    sc_uint < 64 > rt_data_var, c_data_var;
68
 
69
    wait (reset->posedge_event ());
70
 
71
    while (1)
72
      {
73
        if (reset.read ())
74
          {
75
            rt_data_var = rt_des_data_i.read ();
76
            c_data_var = c_des_data_i.read ();
77
            if (rt_data_var != c_data_var)
78
              {
79
                cout << "Simulation mismatch: 0x" << (int) rt_data_var.range (63, 32) << (int) rt_data_var.range (31,0) << " 0x" << (int) c_data_var.range (63,32) << (int) c_data_var.range (31,0) <<" " << sc_time_stamp () << endl;
80
                exit (0);
81
              }
82
            else
83
              {
84
                cout << "OK: 0x" << (int) rt_data_var.range (63,32) << (int)rt_data_var.range (31,0) << " 0x" << (int) c_data_var.range (63, 32) << (int) c_data_var.range (31,0) << " " << sc_time_stamp () << endl;
85
              }
86
          }
87
        else
88
          wait (reset->posedge_event ());
89
      }
90
  }
91
 
92
  SC_CTOR (checker)
93
  {
94
    SC_THREAD (check);
95
  }
96
};

powered by: WebSVN 2.1.0

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