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

Subversion Repositories sc2v

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

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
// Revision 1.2  2004/08/30 14:44:44  jcastillo
47
// Code Formater used to give better appearance to SystemC code
48
//
49
// Revision 1.1.1.1  2004/07/05 09:46:22  jcastillo
50
// First import
51
//
52
 
53
 
54
#include "systemc.h"
55
 
56
SC_MODULE(subbytes)
57
{
58
 
59
        sc_in<bool> clk;
60
        sc_in<bool> reset;
61
 
62
        sc_in<bool> start_i;
63
        sc_in<bool> decrypt_i;
64
        sc_in<sc_biguint <128> > data_i;
65
 
66
        sc_out<bool> ready_o;
67
        sc_out<sc_biguint<128> > data_o;
68
 
69
        //To sbox
70
        sc_out<sc_uint<8> > sbox_data_o;
71
        sc_in<sc_uint<8> > sbox_data_i;
72
        sc_out<bool>sbox_decrypt_o;
73
 
74
        void sub();
75
        void registers();
76
 
77
        sc_signal<sc_uint<5> > state, next_state;
78
        sc_signal<sc_biguint<128> > data_reg, next_data_reg;
79
        sc_signal<bool> next_ready_o;
80
 
81
        SC_CTOR(subbytes)
82
        {
83
 
84
                SC_METHOD(registers);
85
                sensitive_pos << clk;
86
                sensitive_neg << reset;
87
 
88
                SC_METHOD(sub);
89
                sensitive << decrypt_i << start_i << state << data_i << sbox_data_i << data_reg;
90
 
91
        }
92
};

powered by: WebSVN 2.1.0

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