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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB2_edk63.v] - Blame information for rev 209

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 205 sybreon
/*
2
** AEMB2 EDK 6.3 COMPATIBLE CORE
3
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
4
**
5
** This file is part of AEMB.
6
**
7
** AEMB is free software: you can redistribute it and/or modify it
8
** under the terms of the GNU Lesser General Public License as
9
** published by the Free Software Foundation, either version 3 of the
10
** License, or (at your option) any later version.
11
**
12
** AEMB is distributed in the hope that it will be useful, but WITHOUT
13
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
15
** Public License for more details.
16
**
17
** You should have received a copy of the GNU Lesser General Public
18
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
19
*/
20
/**
21
 * Top Level Core
22
 * @file aeMB2_edk63.v
23
 
24
 * This implements an EDK 6.3 opcode compatible core. It implements
25
   all the software instructions except for division and cache writes.
26
 
27
 */
28
 
29
module aeMB2_edk63 (/*AUTOARG*/
30
   // Outputs
31
   xwb_wre_o, xwb_tag_o, xwb_stb_o, xwb_sel_o, xwb_dat_o, xwb_cyc_o,
32
   xwb_adr_o, iwb_wre_o, iwb_tag_o, iwb_stb_o, iwb_sel_o, iwb_cyc_o,
33
   iwb_adr_o, dwb_wre_o, dwb_tag_o, dwb_stb_o, dwb_sel_o, dwb_dat_o,
34
   dwb_cyc_o, dwb_adr_o,
35
   // Inputs
36
   xwb_dat_i, xwb_ack_i, sys_rst_i, sys_int_i, sys_ena_i, sys_clk_i,
37 206 sybreon
   iwb_dat_i, iwb_ack_i, dwb_dat_i, dwb_ack_i
38 205 sybreon
   );
39
   // BUS WIDTHS
40
   parameter AEMB_IWB = 32; ///< INST bus width
41
   parameter AEMB_DWB = 32; ///< DATA bus width
42
   parameter AEMB_XWB = 7; ///< XCEL bus width
43
 
44
   // CACHE PARAMETERS
45
   parameter AEMB_ICH = 11; ///< instruction cache size
46
   parameter AEMB_IDX = 6; ///< cache index size
47
 
48
   // OPTIONAL HARDWARE
49
   parameter AEMB_BSF = 1; ///< optional barrel shift
50
   parameter AEMB_MUL = 1; ///< optional multiplier
51
   parameter AEMB_DIV = 0; ///< optional divider (future)
52
   parameter AEMB_FPU = 0; ///< optional floating point unit (future)
53
 
54
   // DEPRECATED PARAMETERS
55
   localparam AEMB_XSL = 1; ///< implement XSL bus
56
   localparam AEMB_HTX = 1; ///< hardware thread extension
57
 
58
   /*AUTOOUTPUT*/
59
   // Beginning of automatic outputs (from unused autoinst outputs)
60
   output [AEMB_DWB-1:2] dwb_adr_o;             // From memif0 of aeMB2_memif.v
61
   output               dwb_cyc_o;              // From memif0 of aeMB2_memif.v
62
   output [31:0] dwb_dat_o;              // From memif0 of aeMB2_memif.v
63
   output [3:0]          dwb_sel_o;              // From memif0 of aeMB2_memif.v
64
   output               dwb_stb_o;              // From memif0 of aeMB2_memif.v
65
   output               dwb_tag_o;              // From memif0 of aeMB2_memif.v
66
   output               dwb_wre_o;              // From memif0 of aeMB2_memif.v
67
   output [AEMB_IWB-1:2] iwb_adr_o;             // From iwbif0 of aeMB2_iwbif.v
68
   output               iwb_cyc_o;              // From iwbif0 of aeMB2_iwbif.v
69
   output [3:0]          iwb_sel_o;              // From iwbif0 of aeMB2_iwbif.v
70
   output               iwb_stb_o;              // From iwbif0 of aeMB2_iwbif.v
71
   output               iwb_tag_o;              // From iwbif0 of aeMB2_iwbif.v
72
   output               iwb_wre_o;              // From iwbif0 of aeMB2_iwbif.v
73
   output [AEMB_XWB-1:2] xwb_adr_o;             // From memif0 of aeMB2_memif.v
74
   output               xwb_cyc_o;              // From memif0 of aeMB2_memif.v
75
   output [31:0] xwb_dat_o;              // From memif0 of aeMB2_memif.v
76
   output [3:0]          xwb_sel_o;              // From memif0 of aeMB2_memif.v
77
   output               xwb_stb_o;              // From memif0 of aeMB2_memif.v
78
   output               xwb_tag_o;              // From memif0 of aeMB2_memif.v
79
   output               xwb_wre_o;              // From memif0 of aeMB2_memif.v
80
   // End of automatics
81
   /*AUTOINPUT*/
82
   // Beginning of automatic inputs (from unused autoinst inputs)
83
   input                dwb_ack_i;              // To memif0 of aeMB2_memif.v
84
   input [31:0]          dwb_dat_i;              // To memif0 of aeMB2_memif.v
85
   input                iwb_ack_i;              // To iche0 of aeMB2_iche.v, ...
86
   input [31:0]          iwb_dat_i;              // To iche0 of aeMB2_iche.v, ...
87
   input                sys_clk_i;              // To pip0 of aeMB2_pipe.v
88
   input                sys_ena_i;              // To pip0 of aeMB2_pipe.v
89
   input                sys_int_i;              // To pip0 of aeMB2_pipe.v
90
   input                sys_rst_i;              // To pip0 of aeMB2_pipe.v
91
   input                xwb_ack_i;              // To memif0 of aeMB2_memif.v
92
   input [31:0]          xwb_dat_i;              // To memif0 of aeMB2_memif.v
93
   // End of automatics
94
   /*AUTOWIRE*/
95
   // Beginning of automatic wires (for undeclared instantiated-module outputs)
96
   wire [31:0]           alu_ex;                 // From exec0 of aeMB2_exec.v
97
   wire [31:0]           alu_mx;                 // From exec0 of aeMB2_exec.v
98
   wire [31:2]          bpc_ex;                 // From exec0 of aeMB2_exec.v
99
   wire [1:0]            bra_ex;                 // From brcc0 of aeMB2_brcc.v
100
   wire [1:0]            brk_if;                 // From pip0 of aeMB2_pipe.v
101
   wire [31:0]           bsf_mx;                 // From exec0 of aeMB2_exec.v
102
   wire                 dena;                   // From pip0 of aeMB2_pipe.v
103
   wire                 dwb_fb;                 // From memif0 of aeMB2_memif.v
104
   wire [31:0]           dwb_mx;                 // From memif0 of aeMB2_memif.v
105 206 sybreon
   wire [1:0]            exc_dwb;                // From memif0 of aeMB2_memif.v
106 205 sybreon
   wire                 exc_ill;                // From exec0 of aeMB2_exec.v
107
   wire                 exc_iwb;                // From iwbif0 of aeMB2_iwbif.v
108
   wire                 fet_fb;                 // From iwbif0 of aeMB2_iwbif.v
109
   wire                 gclk;                   // From pip0 of aeMB2_pipe.v
110
   wire                 gpha;                   // From pip0 of aeMB2_pipe.v
111
   wire                 grst;                   // From pip0 of aeMB2_pipe.v
112
   wire                 hzd_bpc;                // From ctrl0 of aeMB2_ctrl.v
113
   wire                 hzd_fwd;                // From ctrl0 of aeMB2_ctrl.v
114
   wire [AEMB_IWB-1:2]  ich_adr;                // From iwbif0 of aeMB2_iwbif.v
115
   wire [31:0]           ich_dat;                // From iche0 of aeMB2_iche.v
116
   wire                 ich_fb;                 // From iche0 of aeMB2_iche.v
117
   wire                 ich_hit;                // From iche0 of aeMB2_iche.v
118
   wire                 iena;                   // From pip0 of aeMB2_pipe.v
119
   wire [15:0]           imm_of;                 // From ctrl0 of aeMB2_ctrl.v
120
   wire [31:2]          mem_ex;                 // From exec0 of aeMB2_exec.v
121
   wire [9:0]            msr_ex;                 // From exec0 of aeMB2_exec.v
122
   wire [31:0]           mul_mx;                 // From exec0 of aeMB2_exec.v
123
   wire [2:0]            mux_ex;                 // From ctrl0 of aeMB2_ctrl.v
124
   wire [2:0]            mux_of;                 // From ctrl0 of aeMB2_ctrl.v
125
   wire [31:0]           opa_if;                 // From regs0 of aeMB2_regs.v
126
   wire [31:0]           opa_of;                 // From ctrl0 of aeMB2_ctrl.v
127
   wire [31:0]           opb_if;                 // From regs0 of aeMB2_regs.v
128
   wire [31:0]           opb_of;                 // From ctrl0 of aeMB2_ctrl.v
129
   wire [5:0]            opc_of;                 // From ctrl0 of aeMB2_ctrl.v
130
   wire [31:0]           opd_if;                 // From regs0 of aeMB2_regs.v
131
   wire [31:0]           opd_of;                 // From ctrl0 of aeMB2_ctrl.v
132
   wire [4:0]            ra_of;                  // From ctrl0 of aeMB2_ctrl.v
133
   wire [4:0]            rd_ex;                  // From ctrl0 of aeMB2_ctrl.v
134
   wire [4:0]            rd_of;                  // From ctrl0 of aeMB2_ctrl.v
135 209 sybreon
   wire [31:2]          rpc_ex;                 // From iwbif0 of aeMB2_iwbif.v
136 205 sybreon
   wire [31:2]          rpc_if;                 // From iwbif0 of aeMB2_iwbif.v
137
   wire [31:2]          rpc_mx;                 // From iwbif0 of aeMB2_iwbif.v
138
   wire [3:0]            sel_mx;                 // From memif0 of aeMB2_memif.v
139
   wire [31:0]           sfr_mx;                 // From exec0 of aeMB2_exec.v
140
   wire                 xwb_fb;                 // From memif0 of aeMB2_memif.v
141
   wire [31:0]           xwb_mx;                 // From memif0 of aeMB2_memif.v
142
   // End of automatics
143
   /*AUTOREG*/
144
 
145
   aeMB2_pipe
146
     pip0
147
       (/*AUTOINST*/
148
        // Outputs
149
        .brk_if                         (brk_if[1:0]),
150
        .gpha                           (gpha),
151
        .gclk                           (gclk),
152
        .grst                           (grst),
153
        .dena                           (dena),
154
        .iena                           (iena),
155
        // Inputs
156
        .bra_ex                         (bra_ex[1:0]),
157
        .dwb_fb                         (dwb_fb),
158
        .xwb_fb                         (xwb_fb),
159
        .ich_fb                         (ich_fb),
160
        .fet_fb                         (fet_fb),
161
        .msr_ex                         (msr_ex[9:0]),
162
        .exc_dwb                        (exc_dwb[1:0]),
163
        .exc_iwb                        (exc_iwb),
164
        .exc_ill                        (exc_ill),
165
        .sys_clk_i                      (sys_clk_i),
166
        .sys_int_i                      (sys_int_i),
167
        .sys_rst_i                      (sys_rst_i),
168
        .sys_ena_i                      (sys_ena_i));
169
 
170
   aeMB2_iche
171
     #(/*AUTOINSTPARAM*/
172
       // Parameters
173
       .AEMB_IWB                        (AEMB_IWB),
174
       .AEMB_ICH                        (AEMB_ICH),
175
       .AEMB_IDX                        (AEMB_IDX),
176
       .AEMB_HTX                        (AEMB_HTX))
177
   iche0
178
     (/*AUTOINST*/
179
      // Outputs
180
      .ich_dat                          (ich_dat[31:0]),
181
      .ich_hit                          (ich_hit),
182
      .ich_fb                           (ich_fb),
183
      // Inputs
184
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
185
      .iwb_dat_i                        (iwb_dat_i[31:0]),
186
      .iwb_ack_i                        (iwb_ack_i),
187
      .gclk                             (gclk),
188
      .grst                             (grst),
189
      .iena                             (iena),
190
      .gpha                             (gpha));
191
 
192
   aeMB2_iwbif
193
     #(/*AUTOINSTPARAM*/
194
       // Parameters
195
       .AEMB_IWB                        (AEMB_IWB),
196
       .AEMB_HTX                        (AEMB_HTX))
197
   iwbif0
198
     (/*AUTOINST*/
199
      // Outputs
200
      .iwb_adr_o                        (iwb_adr_o[AEMB_IWB-1:2]),
201
      .iwb_stb_o                        (iwb_stb_o),
202
      .iwb_sel_o                        (iwb_sel_o[3:0]),
203
      .iwb_wre_o                        (iwb_wre_o),
204
      .iwb_cyc_o                        (iwb_cyc_o),
205
      .iwb_tag_o                        (iwb_tag_o),
206
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
207
      .fet_fb                           (fet_fb),
208
      .rpc_if                           (rpc_if[31:2]),
209 209 sybreon
      .rpc_ex                           (rpc_ex[31:2]),
210 205 sybreon
      .rpc_mx                           (rpc_mx[31:2]),
211
      .exc_iwb                          (exc_iwb),
212
      // Inputs
213
      .iwb_ack_i                        (iwb_ack_i),
214
      .iwb_dat_i                        (iwb_dat_i[31:0]),
215
      .ich_hit                          (ich_hit),
216
      .msr_ex                           (msr_ex[7:5]),
217
      .hzd_bpc                          (hzd_bpc),
218
      .hzd_fwd                          (hzd_fwd),
219
      .bra_ex                           (bra_ex[1:0]),
220
      .bpc_ex                           (bpc_ex[31:2]),
221
      .gclk                             (gclk),
222
      .grst                             (grst),
223
      .dena                             (dena),
224
      .iena                             (iena),
225
      .gpha                             (gpha));
226
 
227
   aeMB2_ctrl
228
     #(/*AUTOINSTPARAM*/
229
       // Parameters
230
       .AEMB_HTX                        (AEMB_HTX))
231
   ctrl0
232
     (/*AUTOINST*/
233
      // Outputs
234
      .opa_of                           (opa_of[31:0]),
235
      .opb_of                           (opb_of[31:0]),
236
      .opd_of                           (opd_of[31:0]),
237
      .opc_of                           (opc_of[5:0]),
238
      .ra_of                            (ra_of[4:0]),
239
      .rd_of                            (rd_of[4:0]),
240
      .imm_of                           (imm_of[15:0]),
241
      .rd_ex                            (rd_ex[4:0]),
242
      .mux_of                           (mux_of[2:0]),
243
      .mux_ex                           (mux_ex[2:0]),
244
      .hzd_bpc                          (hzd_bpc),
245
      .hzd_fwd                          (hzd_fwd),
246
      // Inputs
247
      .opa_if                           (opa_if[31:0]),
248
      .opb_if                           (opb_if[31:0]),
249
      .opd_if                           (opd_if[31:0]),
250
      .brk_if                           (brk_if[1:0]),
251
      .bra_ex                           (bra_ex[1:0]),
252
      .rpc_if                           (rpc_if[31:2]),
253
      .alu_ex                           (alu_ex[31:0]),
254
      .ich_dat                          (ich_dat[31:0]),
255 207 sybreon
      .exc_dwb                          (exc_dwb[1:0]),
256
      .exc_ill                          (exc_ill),
257
      .exc_iwb                          (exc_iwb),
258 205 sybreon
      .gclk                             (gclk),
259
      .grst                             (grst),
260
      .dena                             (dena),
261
      .iena                             (iena),
262
      .gpha                             (gpha));
263
 
264
   aeMB2_brcc
265
     #(/*AUTOINSTPARAM*/
266
       // Parameters
267
       .AEMB_HTX                        (AEMB_HTX))
268
   brcc0
269
     (/*AUTOINST*/
270
      // Outputs
271
      .bra_ex                           (bra_ex[1:0]),
272
      // Inputs
273
      .opd_of                           (opd_of[31:0]),
274
      .ra_of                            (ra_of[4:0]),
275
      .rd_of                            (rd_of[4:0]),
276
      .opc_of                           (opc_of[5:0]),
277
      .gclk                             (gclk),
278
      .grst                             (grst),
279
      .dena                             (dena),
280
      .iena                             (iena),
281
      .gpha                             (gpha));
282
 
283
   aeMB2_exec
284
     #(/*AUTOINSTPARAM*/
285
       // Parameters
286
       .AEMB_IWB                        (AEMB_IWB),
287
       .AEMB_DWB                        (AEMB_DWB),
288
       .AEMB_MUL                        (AEMB_MUL),
289
       .AEMB_BSF                        (AEMB_BSF),
290
       .AEMB_HTX                        (AEMB_HTX))
291
   exec0
292
     (/*AUTOINST*/
293
      // Outputs
294
      .alu_ex                           (alu_ex[31:0]),
295
      .alu_mx                           (alu_mx[31:0]),
296
      .bpc_ex                           (bpc_ex[31:2]),
297
      .bsf_mx                           (bsf_mx[31:0]),
298
      .mem_ex                           (mem_ex[31:2]),
299
      .msr_ex                           (msr_ex[9:0]),
300
      .mul_mx                           (mul_mx[31:0]),
301
      .sfr_mx                           (sfr_mx[31:0]),
302
      .exc_ill                          (exc_ill),
303
      // Inputs
304
      .dena                             (dena),
305 209 sybreon
      .exc_dwb                          (exc_dwb[1:0]),
306 205 sybreon
      .gclk                             (gclk),
307
      .gpha                             (gpha),
308
      .grst                             (grst),
309
      .imm_of                           (imm_of[15:0]),
310
      .opa_of                           (opa_of[31:0]),
311
      .opb_of                           (opb_of[31:0]),
312
      .opc_of                           (opc_of[5:0]),
313
      .opd_of                           (opd_of[31:0]),
314
      .ra_of                            (ra_of[4:0]),
315 209 sybreon
      .rd_of                            (rd_of[4:0]),
316
      .rpc_ex                           (rpc_ex[31:2]));
317 205 sybreon
 
318
   aeMB2_memif
319
     #(/*AUTOINSTPARAM*/
320
       // Parameters
321
       .AEMB_DWB                        (AEMB_DWB),
322
       .AEMB_XWB                        (AEMB_XWB),
323
       .AEMB_XSL                        (AEMB_XSL))
324
   memif0
325
     (/*AUTOINST*/
326
      // Outputs
327
      .dwb_adr_o                        (dwb_adr_o[AEMB_DWB-1:2]),
328
      .dwb_cyc_o                        (dwb_cyc_o),
329
      .dwb_dat_o                        (dwb_dat_o[31:0]),
330
      .dwb_fb                           (dwb_fb),
331
      .dwb_mx                           (dwb_mx[31:0]),
332
      .dwb_sel_o                        (dwb_sel_o[3:0]),
333
      .dwb_stb_o                        (dwb_stb_o),
334
      .dwb_tag_o                        (dwb_tag_o),
335
      .dwb_wre_o                        (dwb_wre_o),
336 206 sybreon
      .exc_dwb                          (exc_dwb[1:0]),
337 205 sybreon
      .sel_mx                           (sel_mx[3:0]),
338
      .xwb_adr_o                        (xwb_adr_o[AEMB_XWB-1:2]),
339
      .xwb_cyc_o                        (xwb_cyc_o),
340
      .xwb_dat_o                        (xwb_dat_o[31:0]),
341
      .xwb_fb                           (xwb_fb),
342
      .xwb_mx                           (xwb_mx[31:0]),
343
      .xwb_sel_o                        (xwb_sel_o[3:0]),
344
      .xwb_stb_o                        (xwb_stb_o),
345
      .xwb_tag_o                        (xwb_tag_o),
346
      .xwb_wre_o                        (xwb_wre_o),
347
      // Inputs
348
      .dena                             (dena),
349
      .dwb_ack_i                        (dwb_ack_i),
350
      .dwb_dat_i                        (dwb_dat_i[31:0]),
351
      .gclk                             (gclk),
352
      .gpha                             (gpha),
353
      .grst                             (grst),
354
      .imm_of                           (imm_of[15:0]),
355
      .mem_ex                           (mem_ex[AEMB_DWB-1:2]),
356
      .msr_ex                           (msr_ex[7:0]),
357
      .opa_of                           (opa_of[31:0]),
358
      .opb_of                           (opb_of[1:0]),
359
      .opc_of                           (opc_of[5:0]),
360
      .opd_of                           (opd_of[31:0]),
361
      .sfr_mx                           (sfr_mx[7:5]),
362
      .xwb_ack_i                        (xwb_ack_i),
363
      .xwb_dat_i                        (xwb_dat_i[31:0]));
364
 
365
   aeMB2_regs
366
     #(/*AUTOINSTPARAM*/
367
       // Parameters
368
       .AEMB_HTX                        (AEMB_HTX))
369
   regs0
370
     (/*AUTOINST*/
371
      // Outputs
372
      .opa_if                           (opa_if[31:0]),
373
      .opb_if                           (opb_if[31:0]),
374
      .opd_if                           (opd_if[31:0]),
375
      // Inputs
376
      .alu_mx                           (alu_mx[31:0]),
377
      .bsf_mx                           (bsf_mx[31:0]),
378
      .dena                             (dena),
379
      .dwb_mx                           (dwb_mx[31:0]),
380
      .gclk                             (gclk),
381
      .gpha                             (gpha),
382
      .grst                             (grst),
383
      .ich_dat                          (ich_dat[31:0]),
384
      .mul_mx                           (mul_mx[31:0]),
385
      .mux_ex                           (mux_ex[2:0]),
386
      .mux_of                           (mux_of[2:0]),
387
      .rd_ex                            (rd_ex[4:0]),
388
      .rd_of                            (rd_of[4:0]),
389
      .rpc_mx                           (rpc_mx[31:2]),
390
      .sel_mx                           (sel_mx[3:0]),
391
      .sfr_mx                           (sfr_mx[31:0]),
392
      .xwb_mx                           (xwb_mx[31:0]));
393
 
394
endmodule // aeMB2_edk63
395
/*
396
Local Variables:
397
verilog-library-directories:(".")
398
End:
399
*/

powered by: WebSVN 2.1.0

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