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

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [examples/] [subbytes.h] - Blame information for rev 28

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

Line No. Rev Author Line
1 13 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  AES subbytes module header                                  ////
4
////                                                              ////
5
////  This file is part of the SystemC AES                        ////
6
////                                                              ////
7
////  Description:                                                ////
8
////  Subbytes stage header for AES algorithm                     ////
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 28 jcastillo
// Revision 1.2  2005/03/16 18:12:25  jcastillo
47
//
48
// Style modifications
49
//
50
// Revision 1.1  2005/01/26 16:51:05  jcastillo
51
// New examples for 0.2.5 version
52
//
53 13 jcastillo
// Revision 1.2  2004/08/30 14:44:44  jcastillo
54
// Code Formater used to give better appearance to SystemC code
55
//
56
// Revision 1.1.1.1  2004/07/05 09:46:22  jcastillo
57
// First import
58
//
59
 
60
 
61
#include "systemc.h"
62
 
63
SC_MODULE(subbytes)
64
{
65
 
66
        sc_in<bool> clk;
67
        sc_in<bool> reset;
68
 
69
        sc_in<bool> start_i;
70
        sc_in<bool> decrypt_i;
71
        sc_in<sc_biguint <128> > data_i;
72
 
73
        sc_out<bool> ready_o;
74
        sc_out<sc_biguint<128> > data_o;
75
 
76
        //To sbox
77
        sc_out<sc_uint<8> > sbox_data_o;
78
        sc_in<sc_uint<8> > sbox_data_i;
79
        sc_out<bool>sbox_decrypt_o;
80
 
81
        void sub();
82
        void registers();
83
 
84
        sc_signal<sc_uint<5> > state, next_state;
85
        sc_signal<sc_biguint<128> > data_reg, next_data_reg;
86
        sc_signal<bool> next_ready_o;
87
 
88
        SC_CTOR(subbytes)
89
        {
90
 
91
                SC_METHOD(registers);
92
                sensitive_pos << clk;
93
                sensitive_neg << reset;
94
 
95
                SC_METHOD(sub);
96
                sensitive << decrypt_i << start_i << state << data_i << sbox_data_i << data_reg;
97
 
98
        }
99
};

powered by: WebSVN 2.1.0

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