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

Subversion Repositories systemcaes

[/] [systemcaes/] [trunk/] [bench/] [systemc/] [aes192lowarea/] [checker.h] - Blame information for rev 28

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 23 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Checker                                                     ////
4
////                                                              ////
5
////  This file is part of the SystemC AES                        ////
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
// Revision 1.1  2005/02/14 16:18:23  jcastillo
48
// aes192 uploaded
49
//
50
 
51
 
52
#include "systemc.h"
53
 
54
SC_MODULE(checker){
55
 
56
        sc_in<bool> reset;
57
 
58
        sc_fifo_in<sc_biguint<128> > rt_aes_data_i;
59
        sc_fifo_in<sc_biguint<128> > c_aes_data_i;
60
 
61
        void check(){
62
         sc_biguint<128> rt_data_var,c_data_var;
63
 
64
          wait(reset->posedge_event());
65
 
66
          while(1){
67
                  if(reset.read()){
68
                   rt_data_var=rt_aes_data_i.read();
69
                   c_data_var=c_aes_data_i.read();
70
                   if(rt_data_var!=c_data_var){
71
                         cout << "Simulation mismatch: 0x"  << (int)(sc_uint<32>)rt_data_var.range(127,96) << (int)(sc_uint<32>)rt_data_var.range(95,64) << (int)(sc_uint<32>)rt_data_var.range(63,32) << (int)(sc_uint<32>)rt_data_var.range(31,0) << " 0x" << (int)(sc_uint<32>)c_data_var.range(127,96) << (int)(sc_uint<32>)c_data_var.range(95,64) << (int)(sc_uint<32>)c_data_var.range(63,32) << (int)(sc_uint<32>)c_data_var.range(31,0) << " " << sc_time_stamp() << endl;
72
                         exit(0);
73
                   }else{
74
                         cout << "OK: 0x"  << (int)(sc_uint<32>)rt_data_var.range(127,96) << (int)(sc_uint<32>)rt_data_var.range(95,64) << (int)(sc_uint<32>)c_data_var.range(63,32) << (int)(sc_uint<32>)rt_data_var.range(31,0) << " 0x" << (int)(sc_uint<32>)c_data_var.range(127,96) << (int)(sc_uint<32>)c_data_var.range(95,64) << (int)(sc_uint<32>)c_data_var.range(63,32) << (int)(sc_uint<32>)c_data_var.range(31,0) << " " << sc_time_stamp() << endl;
75
                   }
76
              }else
77
                     wait(reset->posedge_event());
78
          }
79
   }
80
 
81
         SC_CTOR(checker){
82
              SC_THREAD(check);
83
     }
84
 };

powered by: WebSVN 2.1.0

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