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

Subversion Repositories aemb

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

Go to most recent revision | 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
   wire [31:2]          rpc_if;                 // From iwbif0 of aeMB2_iwbif.v
136
   wire [31:2]          rpc_mx;                 // From iwbif0 of aeMB2_iwbif.v
137
   wire [3:0]            sel_mx;                 // From memif0 of aeMB2_memif.v
138
   wire [31:0]           sfr_mx;                 // From exec0 of aeMB2_exec.v
139
   wire                 xwb_fb;                 // From memif0 of aeMB2_memif.v
140
   wire [31:0]           xwb_mx;                 // From memif0 of aeMB2_memif.v
141
   // End of automatics
142
   /*AUTOREG*/
143
 
144
   aeMB2_pipe
145
     pip0
146
       (/*AUTOINST*/
147
        // Outputs
148
        .brk_if                         (brk_if[1:0]),
149
        .gpha                           (gpha),
150
        .gclk                           (gclk),
151
        .grst                           (grst),
152
        .dena                           (dena),
153
        .iena                           (iena),
154
        // Inputs
155
        .bra_ex                         (bra_ex[1:0]),
156
        .dwb_fb                         (dwb_fb),
157
        .xwb_fb                         (xwb_fb),
158
        .ich_fb                         (ich_fb),
159
        .fet_fb                         (fet_fb),
160
        .msr_ex                         (msr_ex[9:0]),
161
        .exc_dwb                        (exc_dwb[1:0]),
162
        .exc_iwb                        (exc_iwb),
163
        .exc_ill                        (exc_ill),
164
        .sys_clk_i                      (sys_clk_i),
165
        .sys_int_i                      (sys_int_i),
166
        .sys_rst_i                      (sys_rst_i),
167
        .sys_ena_i                      (sys_ena_i));
168
 
169
   aeMB2_iche
170
     #(/*AUTOINSTPARAM*/
171
       // Parameters
172
       .AEMB_IWB                        (AEMB_IWB),
173
       .AEMB_ICH                        (AEMB_ICH),
174
       .AEMB_IDX                        (AEMB_IDX),
175
       .AEMB_HTX                        (AEMB_HTX))
176
   iche0
177
     (/*AUTOINST*/
178
      // Outputs
179
      .ich_dat                          (ich_dat[31:0]),
180
      .ich_hit                          (ich_hit),
181
      .ich_fb                           (ich_fb),
182
      // Inputs
183
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
184
      .iwb_dat_i                        (iwb_dat_i[31:0]),
185
      .iwb_ack_i                        (iwb_ack_i),
186
      .gclk                             (gclk),
187
      .grst                             (grst),
188
      .iena                             (iena),
189
      .gpha                             (gpha));
190
 
191
   aeMB2_iwbif
192
     #(/*AUTOINSTPARAM*/
193
       // Parameters
194
       .AEMB_IWB                        (AEMB_IWB),
195
       .AEMB_HTX                        (AEMB_HTX))
196
   iwbif0
197
     (/*AUTOINST*/
198
      // Outputs
199
      .iwb_adr_o                        (iwb_adr_o[AEMB_IWB-1:2]),
200
      .iwb_stb_o                        (iwb_stb_o),
201
      .iwb_sel_o                        (iwb_sel_o[3:0]),
202
      .iwb_wre_o                        (iwb_wre_o),
203
      .iwb_cyc_o                        (iwb_cyc_o),
204
      .iwb_tag_o                        (iwb_tag_o),
205
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
206
      .fet_fb                           (fet_fb),
207
      .rpc_if                           (rpc_if[31:2]),
208
      .rpc_mx                           (rpc_mx[31:2]),
209
      .exc_iwb                          (exc_iwb),
210
      // Inputs
211
      .iwb_ack_i                        (iwb_ack_i),
212
      .iwb_dat_i                        (iwb_dat_i[31:0]),
213
      .ich_hit                          (ich_hit),
214
      .msr_ex                           (msr_ex[7:5]),
215
      .hzd_bpc                          (hzd_bpc),
216
      .hzd_fwd                          (hzd_fwd),
217
      .bra_ex                           (bra_ex[1:0]),
218
      .bpc_ex                           (bpc_ex[31:2]),
219
      .gclk                             (gclk),
220
      .grst                             (grst),
221
      .dena                             (dena),
222
      .iena                             (iena),
223
      .gpha                             (gpha));
224
 
225
   aeMB2_ctrl
226
     #(/*AUTOINSTPARAM*/
227
       // Parameters
228
       .AEMB_HTX                        (AEMB_HTX))
229
   ctrl0
230
     (/*AUTOINST*/
231
      // Outputs
232
      .opa_of                           (opa_of[31:0]),
233
      .opb_of                           (opb_of[31:0]),
234
      .opd_of                           (opd_of[31:0]),
235
      .opc_of                           (opc_of[5:0]),
236
      .ra_of                            (ra_of[4:0]),
237
      .rd_of                            (rd_of[4:0]),
238
      .imm_of                           (imm_of[15:0]),
239
      .rd_ex                            (rd_ex[4:0]),
240
      .mux_of                           (mux_of[2:0]),
241
      .mux_ex                           (mux_ex[2:0]),
242
      .hzd_bpc                          (hzd_bpc),
243
      .hzd_fwd                          (hzd_fwd),
244
      // Inputs
245
      .opa_if                           (opa_if[31:0]),
246
      .opb_if                           (opb_if[31:0]),
247
      .opd_if                           (opd_if[31:0]),
248
      .brk_if                           (brk_if[1:0]),
249
      .bra_ex                           (bra_ex[1:0]),
250
      .rpc_if                           (rpc_if[31:2]),
251
      .alu_ex                           (alu_ex[31:0]),
252
      .ich_dat                          (ich_dat[31:0]),
253
      .gclk                             (gclk),
254
      .grst                             (grst),
255
      .dena                             (dena),
256
      .iena                             (iena),
257
      .gpha                             (gpha));
258
 
259
   aeMB2_brcc
260
     #(/*AUTOINSTPARAM*/
261
       // Parameters
262
       .AEMB_HTX                        (AEMB_HTX))
263
   brcc0
264
     (/*AUTOINST*/
265
      // Outputs
266
      .bra_ex                           (bra_ex[1:0]),
267
      // Inputs
268
      .opd_of                           (opd_of[31:0]),
269
      .ra_of                            (ra_of[4:0]),
270
      .rd_of                            (rd_of[4:0]),
271
      .opc_of                           (opc_of[5:0]),
272
      .gclk                             (gclk),
273
      .grst                             (grst),
274
      .dena                             (dena),
275
      .iena                             (iena),
276
      .gpha                             (gpha));
277
 
278
   aeMB2_exec
279
     #(/*AUTOINSTPARAM*/
280
       // Parameters
281
       .AEMB_IWB                        (AEMB_IWB),
282
       .AEMB_DWB                        (AEMB_DWB),
283
       .AEMB_MUL                        (AEMB_MUL),
284
       .AEMB_BSF                        (AEMB_BSF),
285
       .AEMB_HTX                        (AEMB_HTX))
286
   exec0
287
     (/*AUTOINST*/
288
      // Outputs
289
      .alu_ex                           (alu_ex[31:0]),
290
      .alu_mx                           (alu_mx[31:0]),
291
      .bpc_ex                           (bpc_ex[31:2]),
292
      .bsf_mx                           (bsf_mx[31:0]),
293
      .mem_ex                           (mem_ex[31:2]),
294
      .msr_ex                           (msr_ex[9:0]),
295
      .mul_mx                           (mul_mx[31:0]),
296
      .sfr_mx                           (sfr_mx[31:0]),
297
      .exc_ill                          (exc_ill),
298
      // Inputs
299
      .dena                             (dena),
300
      .gclk                             (gclk),
301
      .gpha                             (gpha),
302
      .grst                             (grst),
303
      .imm_of                           (imm_of[15:0]),
304
      .opa_of                           (opa_of[31:0]),
305
      .opb_of                           (opb_of[31:0]),
306
      .opc_of                           (opc_of[5:0]),
307
      .opd_of                           (opd_of[31:0]),
308
      .ra_of                            (ra_of[4:0]),
309
      .rd_of                            (rd_of[4:0]));
310
 
311
   aeMB2_memif
312
     #(/*AUTOINSTPARAM*/
313
       // Parameters
314
       .AEMB_DWB                        (AEMB_DWB),
315
       .AEMB_XWB                        (AEMB_XWB),
316
       .AEMB_XSL                        (AEMB_XSL))
317
   memif0
318
     (/*AUTOINST*/
319
      // Outputs
320
      .dwb_adr_o                        (dwb_adr_o[AEMB_DWB-1:2]),
321
      .dwb_cyc_o                        (dwb_cyc_o),
322
      .dwb_dat_o                        (dwb_dat_o[31:0]),
323
      .dwb_fb                           (dwb_fb),
324
      .dwb_mx                           (dwb_mx[31:0]),
325
      .dwb_sel_o                        (dwb_sel_o[3:0]),
326
      .dwb_stb_o                        (dwb_stb_o),
327
      .dwb_tag_o                        (dwb_tag_o),
328
      .dwb_wre_o                        (dwb_wre_o),
329 206 sybreon
      .exc_dwb                          (exc_dwb[1:0]),
330 205 sybreon
      .sel_mx                           (sel_mx[3:0]),
331
      .xwb_adr_o                        (xwb_adr_o[AEMB_XWB-1:2]),
332
      .xwb_cyc_o                        (xwb_cyc_o),
333
      .xwb_dat_o                        (xwb_dat_o[31:0]),
334
      .xwb_fb                           (xwb_fb),
335
      .xwb_mx                           (xwb_mx[31:0]),
336
      .xwb_sel_o                        (xwb_sel_o[3:0]),
337
      .xwb_stb_o                        (xwb_stb_o),
338
      .xwb_tag_o                        (xwb_tag_o),
339
      .xwb_wre_o                        (xwb_wre_o),
340
      // Inputs
341
      .dena                             (dena),
342
      .dwb_ack_i                        (dwb_ack_i),
343
      .dwb_dat_i                        (dwb_dat_i[31:0]),
344
      .gclk                             (gclk),
345
      .gpha                             (gpha),
346
      .grst                             (grst),
347
      .imm_of                           (imm_of[15:0]),
348
      .mem_ex                           (mem_ex[AEMB_DWB-1:2]),
349
      .msr_ex                           (msr_ex[7:0]),
350
      .opa_of                           (opa_of[31:0]),
351
      .opb_of                           (opb_of[1:0]),
352
      .opc_of                           (opc_of[5:0]),
353
      .opd_of                           (opd_of[31:0]),
354
      .sfr_mx                           (sfr_mx[7:5]),
355
      .xwb_ack_i                        (xwb_ack_i),
356
      .xwb_dat_i                        (xwb_dat_i[31:0]));
357
 
358
   aeMB2_regs
359
     #(/*AUTOINSTPARAM*/
360
       // Parameters
361
       .AEMB_HTX                        (AEMB_HTX))
362
   regs0
363
     (/*AUTOINST*/
364
      // Outputs
365
      .opa_if                           (opa_if[31:0]),
366
      .opb_if                           (opb_if[31:0]),
367
      .opd_if                           (opd_if[31:0]),
368
      // Inputs
369
      .alu_mx                           (alu_mx[31:0]),
370
      .bsf_mx                           (bsf_mx[31:0]),
371
      .dena                             (dena),
372
      .dwb_mx                           (dwb_mx[31:0]),
373
      .gclk                             (gclk),
374
      .gpha                             (gpha),
375
      .grst                             (grst),
376
      .ich_dat                          (ich_dat[31:0]),
377
      .mul_mx                           (mul_mx[31:0]),
378
      .mux_ex                           (mux_ex[2:0]),
379
      .mux_of                           (mux_of[2:0]),
380
      .rd_ex                            (rd_ex[4:0]),
381
      .rd_of                            (rd_of[4:0]),
382
      .rpc_mx                           (rpc_mx[31:2]),
383
      .sel_mx                           (sel_mx[3:0]),
384
      .sfr_mx                           (sfr_mx[31:0]),
385
      .xwb_mx                           (xwb_mx[31:0]));
386
 
387
endmodule // aeMB2_edk63
388
/*
389
Local Variables:
390
verilog-library-directories:(".")
391
End:
392
*/

powered by: WebSVN 2.1.0

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