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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB2_edk62.v] - Blame information for rev 148

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

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

powered by: WebSVN 2.1.0

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