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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [rtl/] [aes_ip.v] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 redbear
//////////////////////////////////////////////////////////////////
2
////
3
////
4
////    AES CORE BLOCK
5
////
6
////
7
////
8 7 redbear
//// This file is part of the APB to I2C project
9 2 redbear
////
10 7 redbear
//// http://www.opencores.org/cores/apbi2c/
11 2 redbear
////
12
////
13
////
14
//// Description
15
////
16
//// Implementation of APB IP core according to
17
////
18
//// aes128_spec IP core specification document.
19
////
20
////
21
////
22
//// To Do: Things are right here but always all block can suffer changes
23
////
24
////
25
////
26
////
27
////
28
//// Author(s): - Felipe Fernandes Da Costa, fefe2560@gmail.com
29
////              Julio Cesar 
30
////
31
///////////////////////////////////////////////////////////////// 
32
////
33
////
34
//// Copyright (C) 2009 Authors and OPENCORES.ORG
35
////
36
////
37
////
38
//// This source file may be used and distributed without
39
////
40
//// restriction provided that this copyright statement is not
41
////
42
//// removed from the file and that any derivative work contains
43
//// the original copyright notice and the associated disclaimer.
44
////
45
////
46
//// This source file is free software; you can redistribute it
47
////
48
//// and/or modify it under the terms of the GNU Lesser General
49
////
50
//// Public License as published by the Free Software Foundation;
51
//// either version 2.1 of the License, or (at your option) any
52
////
53
//// later version.
54
////
55
////
56
////
57
//// This source is distributed in the hope that it will be
58
////
59
//// useful, but WITHOUT ANY WARRANTY; without even the implied
60
////
61
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
62
////
63
//// PURPOSE. See the GNU Lesser General Public License for more
64
//// details.
65
////
66
////
67
////
68
//// You should have received a copy of the GNU Lesser General
69
////
70
//// Public License along with this source; if not, download it
71
////
72
//// from http://www.opencores.org/lgpl.shtml
73
////
74
////
75
///////////////////////////////////////////////////////////////////
76
module aes_ip
77
(
78
        //OUTPUTS
79
        output int_ccf,
80
        output int_err,
81
        output dma_req_wr,
82
        output dma_req_rd,
83
        output PREADY,
84
        output PSLVERR,
85
        output [31:0] PRDATA,
86
        //INPUTS
87
        input  [ 3:0] PADDR,
88
        input  [31:0] PWDATA,
89
        input PWRITE,
90
        input PENABLE,
91
        input PSEL,
92
        input PCLK,
93
        input PRESETn
94
);
95
 
96
wire [31:0] col_out;
97
wire [31:0] key_out;
98
wire [31:0] iv_out;
99
wire end_aes;
100
wire [ 3:0] iv_en;
101
wire [ 3:0] iv_sel_rd;
102
wire [ 3:0] key_en;
103
wire [ 1:0] key_sel_rd;
104
wire [ 1:0] data_type;
105
wire [ 1:0] addr;
106
wire [ 1:0] op_mode;
107
wire [ 1:0] aes_mode;
108
wire start;
109
wire disable_core;
110
wire write_en;
111
wire read_en;
112
wire first_block;
113 7 redbear
//wire pwdata_host_interface;
114 2 redbear
 
115
assign PREADY = 1'b1;
116
assign PSLVERR = 1'b0;
117 7 redbear
//assign pwdata_host_interface = PWDATA[12:0];
118 2 redbear
 
119
host_interface HOST_INTERFACE
120
(
121
        .key_en       ( key_en       ),
122
        .col_addr     ( addr         ),
123
        .col_wr_en    ( write_en     ),
124
        .col_rd_en    ( read_en      ),
125
        .key_sel      ( key_sel_rd   ),
126
        .iv_en        ( iv_en        ),
127
        .iv_sel       ( iv_sel_rd    ),
128
        .int_ccf      ( int_ccf      ),
129
        .int_err      ( int_err      ),
130
        .chmod        ( aes_mode     ),
131
        .mode         ( op_mode      ),
132
        .data_type    ( data_type    ),
133
        .disable_core ( disable_core ),
134
        .first_block  ( first_block  ),
135
        .dma_req_wr   ( dma_req_wr   ),
136
        .dma_req_rd   ( dma_req_rd   ),
137
        .start_core   ( start        ),
138
        .PRDATA       ( PRDATA       ),
139
        .PADDR        ( PADDR        ),
140 7 redbear
        .PWDATA       ( PWDATA[12:0] ),
141 2 redbear
        .PWRITE       ( PWRITE       ),
142
        .PENABLE      ( PENABLE      ),
143
        .PSEL         ( PSEL         ),
144
        .PCLK         ( PCLK         ),
145
        .PRESETn      ( PRESETn      ),
146
        .key_bus      ( key_out      ),
147
        .col_bus      ( col_out      ),
148
        .iv_bus       ( iv_out       ),
149
        .ccf_set      ( end_aes      )
150
);
151
 
152
aes_core AES_CORE
153
(
154
        .col_out      ( col_out      ),
155
        .key_out      ( key_out      ),
156
        .iv_out       ( iv_out       ),
157
        .end_aes      ( end_aes      ),
158
        .bus_in       ( PWDATA       ),
159
        .iv_en        ( iv_en        ),
160
        .iv_sel_rd    ( iv_sel_rd    ),
161
        .key_en       ( key_en       ),
162
        .key_sel_rd   ( key_sel_rd   ),
163
        .data_type    ( data_type    ),
164
        .addr         ( addr         ),
165
        .op_mode      ( op_mode      ),
166
        .aes_mode     ( aes_mode     ),
167
        .start        ( start        ),
168
        .disable_core ( disable_core ),
169
        .write_en     ( write_en     ),
170
        .read_en      ( read_en      ),
171
        .first_block  ( first_block  ),
172
        .rst_n        ( PRESETn      ),
173
        .clk          ( PCLK         )
174
);
175
endmodule

powered by: WebSVN 2.1.0

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