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

Subversion Repositories aemb

[/] [aemb/] [branches/] [DEV_SYBREON/] [rtl/] [verilog/] [aeMB2_edk32.v] - Blame information for rev 191

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 92 sybreon
/* $Id: aeMB2_edk32.v,v 1.8 2007-12-18 18:54:36 sybreon Exp $
2 76 sybreon
**
3
** AEMB2 HI-PERFORMANCE CPU
4
**
5
** Copyright (C) 2004-2007 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
6
**
7
** This file is part of AEMB.
8
**
9
** AEMB is free software: you can redistribute it and/or modify it
10
** under the terms of the GNU Lesser General Public License as
11
** published by the Free Software Foundation, either version 3 of the
12
** License, or (at your option) any later version.
13
**
14
** AEMB is distributed in the hope that it will be useful, but WITHOUT
15
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
17
** Public License for more details.
18
**
19
** You should have received a copy of the GNU Lesser General Public
20 78 sybreon
** License along with AEMB. If not, see <http://www.gnu.org/licenses/>.
21 76 sybreon
*/
22
 
23 78 sybreon
module aeMB2_edk32 (/*AUTOARG*/
24
   // Outputs
25 81 sybreon
   iwb_wre_o, iwb_tga_o, iwb_stb_o, iwb_adr_o, dwb_wre_o, dwb_tga_o,
26
   dwb_stb_o, dwb_sel_o, dwb_dat_o, dwb_cyc_o, dwb_adr_o, cwb_wre_o,
27
   cwb_tga_o, cwb_stb_o, cwb_sel_o, cwb_dat_o, cwb_adr_o,
28 78 sybreon
   // Inputs
29
   sys_rst_i, sys_int_i, sys_clk_i, iwb_dat_i, iwb_ack_i, dwb_dat_i,
30
   dwb_ack_i, cwb_dat_i, cwb_ack_i
31
   );
32 82 sybreon
   parameter IWB = 32; // instruction wishbone address space
33
   parameter DWB = 32; // data wishbone address space
34 78 sybreon
 
35 82 sybreon
   parameter TXE = 1; // thread execution extension
36 78 sybreon
 
37 82 sybreon
   parameter MUL = 1; // enable multiply instruction
38
   parameter BSF = 1; // enable barrel shift instructions
39
   parameter FSL = 1; // enable get/put instructions
40 78 sybreon
 
41
   /*AUTOOUTPUT*/
42
   // Beginning of automatic outputs (from unused autoinst outputs)
43
   output [6:2]         cwb_adr_o;              // From aslu of aeMB2_aslu.v
44
   output [31:0] cwb_dat_o;              // From regf of aeMB2_regf.v
45
   output [3:0]          cwb_sel_o;              // From aslu of aeMB2_aslu.v
46
   output               cwb_stb_o;              // From sysc of aeMB2_sysc.v
47
   output [1:0]          cwb_tga_o;              // From aslu of aeMB2_aslu.v
48
   output               cwb_wre_o;              // From sysc of aeMB2_sysc.v
49
   output [DWB-1:2]     dwb_adr_o;              // From aslu of aeMB2_aslu.v
50
   output               dwb_cyc_o;              // From sysc of aeMB2_sysc.v
51
   output [31:0] dwb_dat_o;              // From regf of aeMB2_regf.v
52
   output [3:0]          dwb_sel_o;              // From aslu of aeMB2_aslu.v
53
   output               dwb_stb_o;              // From sysc of aeMB2_sysc.v
54 81 sybreon
   output               dwb_tga_o;              // From aslu of aeMB2_aslu.v
55 78 sybreon
   output               dwb_wre_o;              // From sysc of aeMB2_sysc.v
56
   output [IWB-1:2]     iwb_adr_o;              // From bpcu of aeMB2_bpcu.v
57
   output               iwb_stb_o;              // From sysc of aeMB2_sysc.v
58 81 sybreon
   output               iwb_tga_o;              // From aslu of aeMB2_aslu.v
59 78 sybreon
   output               iwb_wre_o;              // From sysc of aeMB2_sysc.v
60
   // End of automatics
61
   /*AUTOINPUT*/
62
   // Beginning of automatic inputs (from unused autoinst inputs)
63
   input                cwb_ack_i;              // To sysc of aeMB2_sysc.v, ...
64
   input [31:0]          cwb_dat_i;              // To regf of aeMB2_regf.v
65
   input                dwb_ack_i;              // To sysc of aeMB2_sysc.v, ...
66
   input [31:0]          dwb_dat_i;              // To regf of aeMB2_regf.v
67
   input                iwb_ack_i;              // To sysc of aeMB2_sysc.v, ...
68
   input [31:0]          iwb_dat_i;              // To bpcu of aeMB2_bpcu.v
69
   input                sys_clk_i;              // To sysc of aeMB2_sysc.v
70
   input                sys_int_i;              // To sysc of aeMB2_sysc.v
71
   input                sys_rst_i;              // To sysc of aeMB2_sysc.v
72
   // End of automatics
73
   /*AUTOWIRE*/
74
   // Beginning of automatic wires (for undeclared instantiated-module outputs)
75
   wire                 clk_i;                  // From sysc of aeMB2_sysc.v
76
   wire                 ena_i;                  // From sysc of aeMB2_sysc.v
77
   wire                 pha_i;                  // From sysc of aeMB2_sysc.v
78
   wire [10:0]           rALT_IF;                // From bpcu of aeMB2_bpcu.v
79 85 sybreon
   wire [2:0]            rALU_OF;                // From ofid of aeMB2_ofid.v
80 78 sybreon
   wire [1:0]            rBRA;                   // From bpcu of aeMB2_bpcu.v
81
   wire [15:0]           rIMM_IF;                // From bpcu of aeMB2_bpcu.v
82 85 sybreon
   wire [15:0]           rIMM_OF;                // From ofid of aeMB2_ofid.v
83 78 sybreon
   wire                 rINT;                   // From sysc of aeMB2_sysc.v
84
   wire                 rMSR_BE;                // From aslu of aeMB2_aslu.v
85
   wire                 rMSR_BIP;               // From aslu of aeMB2_aslu.v
86
   wire                 rMSR_IE;                // From aslu of aeMB2_aslu.v
87
   wire [31:0]           rMUL_MA;                // From aslu of aeMB2_aslu.v
88 85 sybreon
   wire [31:0]           rOPA_OF;                // From ofid of aeMB2_ofid.v
89
   wire [31:0]           rOPB_OF;                // From ofid of aeMB2_ofid.v
90 78 sybreon
   wire [5:0]            rOPC_IF;                // From bpcu of aeMB2_bpcu.v
91 85 sybreon
   wire [5:0]            rOPC_OF;                // From ofid of aeMB2_ofid.v
92
   wire [2:0]            rOPD_EX;                // From ofid of aeMB2_ofid.v
93
   wire [2:0]            rOPD_MA;                // From ofid of aeMB2_ofid.v
94
   wire [31:0]           rOPM_OF;                // From ofid of aeMB2_ofid.v
95
   wire [31:0]           rOPX_OF;                // From ofid of aeMB2_ofid.v
96 78 sybreon
   wire [31:2]          rPC_IF;                 // From bpcu of aeMB2_bpcu.v
97
   wire [31:2]          rPC_MA;                 // From bpcu of aeMB2_bpcu.v
98
   wire [4:0]            rRA_IF;                 // From bpcu of aeMB2_bpcu.v
99 85 sybreon
   wire [4:0]            rRA_OF;                 // From ofid of aeMB2_ofid.v
100 78 sybreon
   wire [4:0]            rRB_IF;                 // From bpcu of aeMB2_bpcu.v
101 85 sybreon
   wire [4:0]            rRD_EX;                 // From ofid of aeMB2_ofid.v
102 78 sybreon
   wire [4:0]            rRD_IF;                 // From bpcu of aeMB2_bpcu.v
103 85 sybreon
   wire [4:0]            rRD_MA;                 // From ofid of aeMB2_ofid.v
104
   wire [4:0]            rRD_OF;                 // From ofid of aeMB2_ofid.v
105 78 sybreon
   wire [31:0]           rREGA_OF;               // From regf of aeMB2_regf.v
106
   wire [31:0]           rREGB_OF;               // From regf of aeMB2_regf.v
107
   wire [31:0]           rREGD_OF;               // From regf of aeMB2_regf.v
108
   wire [31:0]           rRES_EX;                // From aslu of aeMB2_aslu.v
109
   wire [31:0]           rRES_MA;                // From aslu of aeMB2_aslu.v
110
   wire [3:0]            rSEL_MA;                // From aslu of aeMB2_aslu.v
111
   wire                 rXCE;                   // From sysc of aeMB2_sysc.v
112
   wire                 rst_i;                  // From sysc of aeMB2_sysc.v
113
   // End of automatics
114 76 sybreon
 
115 78 sybreon
   /* aeMB2_sysc AUTO_TEMPLATE (
116
    .clk_o(clk_i),
117
    .rst_o(rst_i),
118
    .ena_o(ena_i),
119
    .pha_o(pha_i),
120
    )*/
121
 
122
   /* System/Interrupt Control */
123 76 sybreon
 
124 78 sybreon
   aeMB2_sysc
125
     #(/*AUTOINSTPARAM*/
126
       // Parameters
127 80 sybreon
       .TXE                             (TXE),
128
       .FSL                             (FSL))
129 78 sybreon
   sysc (/*AUTOINST*/
130
         // Outputs
131 81 sybreon
         .rINT                          (rINT),
132
         .rXCE                          (rXCE),
133
         .pha_o                         (pha_i),                 // Templated
134
         .clk_o                         (clk_i),                 // Templated
135
         .rst_o                         (rst_i),                 // Templated
136
         .ena_o                         (ena_i),                 // Templated
137 78 sybreon
         .iwb_stb_o                     (iwb_stb_o),
138
         .iwb_wre_o                     (iwb_wre_o),
139
         .dwb_cyc_o                     (dwb_cyc_o),
140
         .dwb_stb_o                     (dwb_stb_o),
141
         .dwb_wre_o                     (dwb_wre_o),
142
         .cwb_stb_o                     (cwb_stb_o),
143
         .cwb_wre_o                     (cwb_wre_o),
144
         // Inputs
145 80 sybreon
         .rIMM_OF                       (rIMM_OF[15:0]),
146 78 sybreon
         .rOPC_OF                       (rOPC_OF[5:0]),
147
         .rRA_OF                        (rRA_OF[4:0]),
148
         .rMSR_BE                       (rMSR_BE),
149
         .rMSR_BIP                      (rMSR_BIP),
150
         .rMSR_IE                       (rMSR_IE),
151 81 sybreon
         .rOPC_IF                       (rOPC_IF[5:0]),
152
         .iwb_ack_i                     (iwb_ack_i),
153
         .dwb_ack_i                     (dwb_ack_i),
154
         .cwb_ack_i                     (cwb_ack_i),
155 78 sybreon
         .sys_int_i                     (sys_int_i),
156
         .sys_clk_i                     (sys_clk_i),
157
         .sys_rst_i                     (sys_rst_i));
158
 
159
   /* Register file */
160
 
161
   aeMB2_regf
162
     #(/*AUTOINSTPARAM*/
163
       // Parameters
164 81 sybreon
       .TXE                             (TXE),
165
       .MUL                             (MUL))
166 78 sybreon
   regf (/*AUTOINST*/
167
         // Outputs
168
         .dwb_dat_o                     (dwb_dat_o[31:0]),
169
         .cwb_dat_o                     (cwb_dat_o[31:0]),
170
         .rREGD_OF                      (rREGD_OF[31:0]),
171
         .rREGA_OF                      (rREGA_OF[31:0]),
172
         .rREGB_OF                      (rREGB_OF[31:0]),
173
         // Inputs
174
         .dwb_dat_i                     (dwb_dat_i[31:0]),
175
         .dwb_ack_i                     (dwb_ack_i),
176
         .cwb_dat_i                     (cwb_dat_i[31:0]),
177
         .cwb_ack_i                     (cwb_ack_i),
178
         .rRA_IF                        (rRA_IF[4:0]),
179
         .rRB_IF                        (rRB_IF[4:0]),
180
         .rRD_IF                        (rRD_IF[4:0]),
181
         .rRD_MA                        (rRD_MA[4:0]),
182
         .rOPM_OF                       (rOPM_OF[31:0]),
183
         .rOPA_OF                       (rOPA_OF[31:0]),
184
         .rOPC_OF                       (rOPC_OF[5:0]),
185
         .rPC_MA                        (rPC_MA[31:2]),
186
         .rMUL_MA                       (rMUL_MA[31:0]),
187
         .rRES_MA                       (rRES_MA[31:0]),
188
         .rOPD_MA                       (rOPD_MA[2:0]),
189
         .rSEL_MA                       (rSEL_MA[3:0]),
190
         .clk_i                         (clk_i),
191
         .rst_i                         (rst_i),
192
         .ena_i                         (ena_i),
193
         .pha_i                         (pha_i));
194
 
195
   /* Branch/Programme Counter Unit */
196 76 sybreon
 
197 78 sybreon
   aeMB2_bpcu
198
     #(/*AUTOINSTPARAM*/
199
       // Parameters
200
       .IWB                             (IWB),
201 80 sybreon
       .TXE                             (TXE))
202 78 sybreon
   bpcu (/*AUTOINST*/
203
         // Outputs
204
         .iwb_adr_o                     (iwb_adr_o[IWB-1:2]),
205
         .rPC_MA                        (rPC_MA[31:2]),
206
         .rPC_IF                        (rPC_IF[31:2]),
207
         .rIMM_IF                       (rIMM_IF[15:0]),
208
         .rALT_IF                       (rALT_IF[10:0]),
209
         .rOPC_IF                       (rOPC_IF[5:0]),
210
         .rRD_IF                        (rRD_IF[4:0]),
211
         .rRA_IF                        (rRA_IF[4:0]),
212
         .rRB_IF                        (rRB_IF[4:0]),
213
         .rBRA                          (rBRA[1:0]),
214
         // Inputs
215
         .iwb_dat_i                     (iwb_dat_i[31:0]),
216
         .iwb_ack_i                     (iwb_ack_i),
217
         .rOPX_OF                       (rOPX_OF[31:0]),
218
         .rOPC_OF                       (rOPC_OF[5:0]),
219
         .rRA_OF                        (rRA_OF[4:0]),
220
         .rRD_OF                        (rRD_OF[4:0]),
221
         .rRES_EX                       (rRES_EX[31:0]),
222
         .rRD_EX                        (rRD_EX[4:0]),
223
         .rOPD_EX                       (rOPD_EX[2:0]),
224
         .clk_i                         (clk_i),
225
         .rst_i                         (rst_i),
226
         .ena_i                         (ena_i),
227
         .pha_i                         (pha_i));
228
 
229
   /* Operand Fetch Mux */
230
 
231 85 sybreon
   aeMB2_ofid
232 78 sybreon
     #(/*AUTOINSTPARAM*/
233
       // Parameters
234 85 sybreon
       .TXE                             (TXE),
235
       .MUL                             (MUL),
236
       .BSF                             (BSF),
237
       .FSL                             (FSL))
238
   ofid (/*AUTOINST*/
239 78 sybreon
         // Outputs
240
         .rOPM_OF                       (rOPM_OF[31:0]),
241
         .rOPX_OF                       (rOPX_OF[31:0]),
242
         .rOPA_OF                       (rOPA_OF[31:0]),
243
         .rOPB_OF                       (rOPB_OF[31:0]),
244
         .rIMM_OF                       (rIMM_OF[15:0]),
245
         .rOPC_OF                       (rOPC_OF[5:0]),
246
         .rRA_OF                        (rRA_OF[4:0]),
247
         .rRD_OF                        (rRD_OF[4:0]),
248
         .rRD_EX                        (rRD_EX[4:0]),
249
         .rRD_MA                        (rRD_MA[4:0]),
250
         .rOPD_EX                       (rOPD_EX[2:0]),
251
         .rOPD_MA                       (rOPD_MA[2:0]),
252
         .rALU_OF                       (rALU_OF[2:0]),
253
         // Inputs
254 85 sybreon
         .rRES_EX                       (rRES_EX[31:0]),
255
         .rREGD_OF                      (rREGD_OF[31:0]),
256
         .rREGA_OF                      (rREGA_OF[31:0]),
257
         .rREGB_OF                      (rREGB_OF[31:0]),
258 78 sybreon
         .rBRA                          (rBRA[1:0]),
259
         .rXCE                          (rXCE),
260
         .rINT                          (rINT),
261 85 sybreon
         .rPC_IF                        (rPC_IF[31:2]),
262 78 sybreon
         .rIMM_IF                       (rIMM_IF[15:0]),
263
         .rALT_IF                       (rALT_IF[10:0]),
264
         .rOPC_IF                       (rOPC_IF[5:0]),
265
         .rRA_IF                        (rRA_IF[4:0]),
266
         .rRB_IF                        (rRB_IF[4:0]),
267
         .rRD_IF                        (rRD_IF[4:0]),
268
         .pha_i                         (pha_i),
269
         .clk_i                         (clk_i),
270
         .rst_i                         (rst_i),
271 85 sybreon
         .ena_i                         (ena_i));
272
 
273
 
274 78 sybreon
   /* Arithmetic Shift Logic Unit */
275
 
276
   aeMB2_aslu
277
     #(/*AUTOINSTPARAM*/
278
       // Parameters
279
       .DWB                             (DWB),
280 80 sybreon
       .TXE                             (TXE),
281 78 sybreon
       .MUL                             (MUL),
282
       .BSF                             (BSF),
283 80 sybreon
       .FSL                             (FSL))
284 78 sybreon
   aslu (/*AUTOINST*/
285
         // Outputs
286
         .dwb_adr_o                     (dwb_adr_o[DWB-1:2]),
287
         .dwb_sel_o                     (dwb_sel_o[3:0]),
288
         .rSEL_MA                       (rSEL_MA[3:0]),
289
         .cwb_adr_o                     (cwb_adr_o[6:2]),
290
         .cwb_tga_o                     (cwb_tga_o[1:0]),
291
         .cwb_sel_o                     (cwb_sel_o[3:0]),
292 81 sybreon
         .iwb_tga_o                     (iwb_tga_o),
293
         .dwb_tga_o                     (dwb_tga_o),
294 78 sybreon
         .rMUL_MA                       (rMUL_MA[31:0]),
295
         .rRES_MA                       (rRES_MA[31:0]),
296
         .rRES_EX                       (rRES_EX[31:0]),
297
         .rMSR_IE                       (rMSR_IE),
298
         .rMSR_BE                       (rMSR_BE),
299
         .rMSR_BIP                      (rMSR_BIP),
300
         // Inputs
301
         .rIMM_OF                       (rIMM_OF[15:0]),
302
         .rALU_OF                       (rALU_OF[2:0]),
303
         .rOPC_OF                       (rOPC_OF[5:0]),
304 80 sybreon
         .rOPC_IF                       (rOPC_IF[5:0]),
305 78 sybreon
         .rRA_OF                        (rRA_OF[4:0]),
306
         .rRD_OF                        (rRD_OF[4:0]),
307
         .rOPA_OF                       (rOPA_OF[31:0]),
308
         .rOPB_OF                       (rOPB_OF[31:0]),
309
         .pha_i                         (pha_i),
310
         .clk_i                         (clk_i),
311
         .rst_i                         (rst_i),
312
         .ena_i                         (ena_i));
313 80 sybreon
 
314 78 sybreon
 
315 76 sybreon
endmodule // aeMB2_edk32
316
 
317 78 sybreon
/* $Log: not supported by cvs2svn $
318 92 sybreon
/* Revision 1.7  2007/12/17 12:53:13  sybreon
319
/* Changed simulation kernel.
320
/*
321 89 sybreon
/* Revision 1.6  2007/12/16 03:25:22  sybreon
322
/* Replaced OF/ID blocks with combined block.
323
/*
324 85 sybreon
/* Revision 1.5  2007/12/13 21:25:41  sybreon
325
/* Further optimisations (speed + size).
326
/*
327 82 sybreon
/* Revision 1.4  2007/12/13 20:12:11  sybreon
328
/* Code cleanup + minor speed regression.
329
/*
330 81 sybreon
/* Revision 1.3  2007/12/12 19:16:59  sybreon
331
/* Minor optimisations (~10% faster)
332
/*
333 80 sybreon
/* Revision 1.2  2007/12/11 00:43:17  sybreon
334
/* initial import
335
/*
336 78 sybreon
/* Revision 1.1  2007/12/07 18:58:51  sybreon
337
/* initial
338
/* */

powered by: WebSVN 2.1.0

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