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

Subversion Repositories apbtoaes128

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

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

Line No. Rev Author Line
1 2 redbear
//////////////////////////////////////////////////////////////////
2
////
3
////
4
////    AES CORE BLOCK
5
////
6
////
7
////
8
//// This file is part of the APB to I2C project
9
////
10
//// http://www.opencores.org/cores/apbi2c/
11
////
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
 
114
assign PREADY = 1'b1;
115
assign PSLVERR = 1'b0;
116
 
117
host_interface HOST_INTERFACE
118
(
119
        .key_en       ( key_en       ),
120
        .col_addr     ( addr         ),
121
        .col_wr_en    ( write_en     ),
122
        .col_rd_en    ( read_en      ),
123
        .key_sel      ( key_sel_rd   ),
124
        .iv_en        ( iv_en        ),
125
        .iv_sel       ( iv_sel_rd    ),
126
        .int_ccf      ( int_ccf      ),
127
        .int_err      ( int_err      ),
128
        .chmod        ( aes_mode     ),
129
        .mode         ( op_mode      ),
130
        .data_type    ( data_type    ),
131
        .disable_core ( disable_core ),
132
        .first_block  ( first_block  ),
133
        .dma_req_wr   ( dma_req_wr   ),
134
        .dma_req_rd   ( dma_req_rd   ),
135
        .start_core   ( start        ),
136
        .PRDATA       ( PRDATA       ),
137
        .PADDR        ( PADDR        ),
138
        .PWDATA       ( PWDATA       ),
139
        .PWRITE       ( PWRITE       ),
140
        .PENABLE      ( PENABLE      ),
141
        .PSEL         ( PSEL         ),
142
        .PCLK         ( PCLK         ),
143
        .PRESETn      ( PRESETn      ),
144
        .key_bus      ( key_out      ),
145
        .col_bus      ( col_out      ),
146
        .iv_bus       ( iv_out       ),
147
        .ccf_set      ( end_aes      )
148
);
149
 
150
aes_core AES_CORE
151
(
152
        .col_out      ( col_out      ),
153
        .key_out      ( key_out      ),
154
        .iv_out       ( iv_out       ),
155
        .end_aes      ( end_aes      ),
156
        .bus_in       ( PWDATA       ),
157
        .iv_en        ( iv_en        ),
158
        .iv_sel_rd    ( iv_sel_rd    ),
159
        .key_en       ( key_en       ),
160
        .key_sel_rd   ( key_sel_rd   ),
161
        .data_type    ( data_type    ),
162
        .addr         ( addr         ),
163
        .op_mode      ( op_mode      ),
164
        .aes_mode     ( aes_mode     ),
165
        .start        ( start        ),
166
        .disable_core ( disable_core ),
167
        .write_en     ( write_en     ),
168
        .read_en      ( read_en      ),
169
        .first_block  ( first_block  ),
170
        .rst_n        ( PRESETn      ),
171
        .clk          ( PCLK         )
172
);
173
endmodule

powered by: WebSVN 2.1.0

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