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

Subversion Repositories aemb

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

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

Line No. Rev Author Line
1 125 sybreon
/* $Id: aeMB2_edk62.v,v 1.3 2008-04-21 12:11:38 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
/**
23
 * Top Level Core
24
 * @file aeMB2_edk62.v
25
 
26
 * This implements an EDK 6.2 software compatible core. It implements
27
   all the software instructions except for division and cache writes.
28
 
29
 */
30
 
31
module aeMB2_edk62 (/*AUTOARG*/
32
   // Outputs
33
   xwb_wre_o, xwb_tag_o, xwb_stb_o, xwb_sel_o, xwb_dat_o, xwb_cyc_o,
34
   xwb_adr_o, iwb_wre_o, iwb_stb_o, iwb_sel_o, iwb_cyc_o, iwb_adr_o,
35 125 sybreon
   dwb_wre_o, dwb_tag_o, dwb_stb_o, dwb_sel_o, dwb_dat_o, dwb_cyc_o,
36
   dwb_adr_o,
37 118 sybreon
   // Inputs
38
   xwb_dat_i, xwb_ack_i, sys_rst_i, sys_ena_i, sys_clk_i, iwb_dat_i,
39 125 sybreon
   iwb_ack_i, dwb_dat_i, dwb_ack_i
40 118 sybreon
   );
41
   parameter AEMB_IWB = 32; ///< INST bus width
42
   parameter AEMB_DWB = 32; ///< DATA bus width
43
   parameter AEMB_XWB = 3; ///< XSEL bus width
44 120 sybreon
 
45 118 sybreon
   parameter AEMB_HTX = 1; ///< hardware thread extension
46
 
47
   parameter AEMB_ICH = 11; ///< instruction cache size
48 120 sybreon
   parameter AEMB_IDX = 6; ///< cache index size
49
 
50 118 sybreon
   parameter AEMB_BSF = 1; ///< implement barrel shift
51
   parameter AEMB_MUL = 1; ///< implement multiplier
52
   parameter AEMB_XSL = 1; ///< implement XSL bus
53
 
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
   output               iwb_wre_o;              // From iwbif0 of aeMB2_iwbif.v
68
   output [AEMB_XWB+1:2] xwb_adr_o;             // From memif0 of aeMB2_memif.v
69
   output               xwb_cyc_o;              // From memif0 of aeMB2_memif.v
70
   output [31:0] xwb_dat_o;              // From memif0 of aeMB2_memif.v
71
   output [3:0]          xwb_sel_o;              // From memif0 of aeMB2_memif.v
72
   output               xwb_stb_o;              // From memif0 of aeMB2_memif.v
73
   output               xwb_tag_o;              // From memif0 of aeMB2_memif.v
74
   output               xwb_wre_o;              // From memif0 of aeMB2_memif.v
75
   // End of automatics
76
   /*AUTOINPUT*/
77
   // Beginning of automatic inputs (from unused autoinst inputs)
78
   input                dwb_ack_i;              // To memif0 of aeMB2_memif.v
79
   input [31:0]          dwb_dat_i;              // To memif0 of aeMB2_memif.v
80 120 sybreon
   input                iwb_ack_i;              // To pip0 of aeMB2_pipe.v, ...
81 118 sybreon
   input [31:0]          iwb_dat_i;              // To iche0 of aeMB2_iche.v, ...
82
   input                sys_clk_i;              // To pip0 of aeMB2_pipe.v
83
   input                sys_ena_i;              // To pip0 of aeMB2_pipe.v
84
   input                sys_rst_i;              // To pip0 of aeMB2_pipe.v
85
   input                xwb_ack_i;              // To memif0 of aeMB2_memif.v
86
   input [31:0]          xwb_dat_i;              // To memif0 of aeMB2_memif.v
87
   // End of automatics
88
   /*AUTOWIRE*/
89
   // Beginning of automatic wires (for undeclared instantiated-module outputs)
90
   wire [31:0]           alu_ex;                 // From exec0 of aeMB2_exec.v
91
   wire [31:0]           alu_mx;                 // From exec0 of aeMB2_exec.v
92
   wire [31:2]          bpc_ex;                 // From exec0 of aeMB2_exec.v
93
   wire [1:0]            bra_ex;                 // From brcc0 of aeMB2_brcc.v
94
   wire [31:0]           bsf_mx;                 // From exec0 of aeMB2_exec.v
95
   wire                 dena;                   // From pip0 of aeMB2_pipe.v
96
   wire                 dwb_fb;                 // From memif0 of aeMB2_memif.v
97
   wire [31:0]           dwb_mx;                 // From memif0 of aeMB2_memif.v
98
   wire                 fet_fb;                 // From iwbif0 of aeMB2_iwbif.v
99
   wire                 gclk;                   // From pip0 of aeMB2_pipe.v
100
   wire                 gpha;                   // From pip0 of aeMB2_pipe.v
101
   wire                 grst;                   // From pip0 of aeMB2_pipe.v
102
   wire                 hzd_bpc;                // From ctrl0 of aeMB2_ctrl.v
103
   wire                 hzd_fwd;                // From ctrl0 of aeMB2_ctrl.v
104
   wire [AEMB_IWB-1:2]  ich_adr;                // From iwbif0 of aeMB2_iwbif.v
105
   wire [31:0]           ich_dat;                // From iche0 of aeMB2_iche.v
106
   wire                 ich_fb;                 // From iche0 of aeMB2_iche.v
107
   wire                 ich_hit;                // From iche0 of aeMB2_iche.v
108
   wire                 iena;                   // From pip0 of aeMB2_pipe.v
109
   wire [15:0]           imm_of;                 // From ctrl0 of aeMB2_ctrl.v
110
   wire [31:2]          mem_ex;                 // From exec0 of aeMB2_exec.v
111
   wire [7:0]            msr_ex;                 // From exec0 of aeMB2_exec.v
112
   wire [31:0]           mul_mx;                 // From exec0 of aeMB2_exec.v
113
   wire [2:0]            mux_ex;                 // From ctrl0 of aeMB2_ctrl.v
114
   wire [2:0]            mux_of;                 // From ctrl0 of aeMB2_ctrl.v
115
   wire [31:0]           opa_if;                 // From regs0 of aeMB2_regs.v
116
   wire [31:0]           opa_of;                 // From ctrl0 of aeMB2_ctrl.v
117
   wire [31:0]           opb_if;                 // From regs0 of aeMB2_regs.v
118
   wire [31:0]           opb_of;                 // From ctrl0 of aeMB2_ctrl.v
119
   wire [5:0]            opc_of;                 // From ctrl0 of aeMB2_ctrl.v
120
   wire [31:0]           opd_if;                 // From regs0 of aeMB2_regs.v
121
   wire [31:0]           opd_of;                 // From ctrl0 of aeMB2_ctrl.v
122
   wire [4:0]            ra_of;                  // From ctrl0 of aeMB2_ctrl.v
123
   wire [4:0]            rd_ex;                  // From ctrl0 of aeMB2_ctrl.v
124
   wire [4:0]            rd_of;                  // From ctrl0 of aeMB2_ctrl.v
125
   wire [31:2]          rpc_if;                 // From iwbif0 of aeMB2_iwbif.v
126
   wire [31:2]          rpc_mx;                 // From iwbif0 of aeMB2_iwbif.v
127
   wire [3:0]            sel_mx;                 // From memif0 of aeMB2_memif.v
128
   wire [31:0]           sfr_mx;                 // From exec0 of aeMB2_exec.v
129
   wire                 xwb_fb;                 // From memif0 of aeMB2_memif.v
130
   wire [31:0]           xwb_mx;                 // From memif0 of aeMB2_memif.v
131
   // End of automatics
132
   /*AUTOREG*/
133
 
134
   aeMB2_pipe
135
     pip0
136
       (/*AUTOINST*/
137
        // Outputs
138
        .gpha                           (gpha),
139
        .gclk                           (gclk),
140
        .grst                           (grst),
141
        .dena                           (dena),
142
        .iena                           (iena),
143
        // Inputs
144
        .bra_ex                         (bra_ex[1:0]),
145
        .dwb_fb                         (dwb_fb),
146
        .xwb_fb                         (xwb_fb),
147
        .ich_fb                         (ich_fb),
148
        .fet_fb                         (fet_fb),
149 120 sybreon
        .iwb_ack_i                      (iwb_ack_i),
150 118 sybreon
        .sys_clk_i                      (sys_clk_i),
151
        .sys_rst_i                      (sys_rst_i),
152
        .sys_ena_i                      (sys_ena_i));
153
 
154
   aeMB2_iche
155
     #(/*AUTOINSTPARAM*/
156
       // Parameters
157
       .AEMB_IWB                        (AEMB_IWB),
158
       .AEMB_ICH                        (AEMB_ICH),
159 120 sybreon
       .AEMB_IDX                        (AEMB_IDX),
160 118 sybreon
       .AEMB_HTX                        (AEMB_HTX))
161
   iche0
162
     (/*AUTOINST*/
163
      // Outputs
164
      .ich_dat                          (ich_dat[31:0]),
165
      .ich_hit                          (ich_hit),
166
      .ich_fb                           (ich_fb),
167
      // Inputs
168
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
169
      .iwb_dat_i                        (iwb_dat_i[31:0]),
170
      .iwb_ack_i                        (iwb_ack_i),
171
      .gclk                             (gclk),
172
      .grst                             (grst),
173
      .iena                             (iena),
174
      .gpha                             (gpha));
175
 
176
   aeMB2_iwbif
177
     #(/*AUTOINSTPARAM*/
178
       // Parameters
179
       .AEMB_IWB                        (AEMB_IWB),
180
       .AEMB_HTX                        (AEMB_HTX))
181
   iwbif0
182
     (/*AUTOINST*/
183
      // Outputs
184
      .iwb_adr_o                        (iwb_adr_o[AEMB_IWB-1:2]),
185
      .iwb_stb_o                        (iwb_stb_o),
186
      .iwb_sel_o                        (iwb_sel_o[3:0]),
187
      .iwb_wre_o                        (iwb_wre_o),
188
      .iwb_cyc_o                        (iwb_cyc_o),
189
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
190
      .fet_fb                           (fet_fb),
191
      .rpc_if                           (rpc_if[31:2]),
192
      .rpc_mx                           (rpc_mx[31:2]),
193
      // Inputs
194
      .iwb_ack_i                        (iwb_ack_i),
195
      .iwb_dat_i                        (iwb_dat_i[31:0]),
196
      .ich_hit                          (ich_hit),
197
      .hzd_bpc                          (hzd_bpc),
198
      .hzd_fwd                          (hzd_fwd),
199
      .bra_ex                           (bra_ex[1:0]),
200
      .bpc_ex                           (bpc_ex[31:2]),
201
      .gclk                             (gclk),
202
      .grst                             (grst),
203
      .dena                             (dena),
204
      .iena                             (iena),
205
      .gpha                             (gpha));
206
 
207
   aeMB2_ctrl
208
     #(/*AUTOINSTPARAM*/
209
       // Parameters
210
       .AEMB_HTX                        (AEMB_HTX))
211
   ctrl0
212
     (/*AUTOINST*/
213
      // Outputs
214
      .opa_of                           (opa_of[31:0]),
215
      .opb_of                           (opb_of[31:0]),
216
      .opd_of                           (opd_of[31:0]),
217
      .opc_of                           (opc_of[5:0]),
218
      .ra_of                            (ra_of[4:0]),
219
      .rd_of                            (rd_of[4:0]),
220
      .imm_of                           (imm_of[15:0]),
221
      .rd_ex                            (rd_ex[4:0]),
222
      .mux_of                           (mux_of[2:0]),
223
      .mux_ex                           (mux_ex[2:0]),
224
      .hzd_bpc                          (hzd_bpc),
225
      .hzd_fwd                          (hzd_fwd),
226
      // Inputs
227
      .opa_if                           (opa_if[31:0]),
228
      .opb_if                           (opb_if[31:0]),
229
      .opd_if                           (opd_if[31:0]),
230
      .bra_ex                           (bra_ex[1:0]),
231
      .rpc_if                           (rpc_if[31:2]),
232
      .alu_ex                           (alu_ex[31:0]),
233
      .ich_dat                          (ich_dat[31:0]),
234
      .gclk                             (gclk),
235
      .grst                             (grst),
236
      .dena                             (dena),
237
      .iena                             (iena),
238
      .gpha                             (gpha));
239
 
240
   aeMB2_brcc
241 120 sybreon
     #(/*AUTOINSTPARAM*/
242
       // Parameters
243
       .AEMB_HTX                        (AEMB_HTX))
244 118 sybreon
   brcc0
245
     (/*AUTOINST*/
246
      // Outputs
247
      .bra_ex                           (bra_ex[1:0]),
248
      // Inputs
249
      .opd_of                           (opd_of[31:0]),
250
      .ra_of                            (ra_of[4:0]),
251
      .rd_of                            (rd_of[4:0]),
252
      .opc_of                           (opc_of[5:0]),
253
      .gclk                             (gclk),
254
      .grst                             (grst),
255
      .dena                             (dena),
256 120 sybreon
      .iena                             (iena),
257 118 sybreon
      .gpha                             (gpha));
258
 
259
   aeMB2_exec
260
     #(/*AUTOINSTPARAM*/
261
       // Parameters
262
       .AEMB_IWB                        (AEMB_IWB),
263
       .AEMB_DWB                        (AEMB_DWB),
264
       .AEMB_MUL                        (AEMB_MUL),
265
       .AEMB_BSF                        (AEMB_BSF))
266
   exec0
267
     (/*AUTOINST*/
268
      // Outputs
269
      .alu_ex                           (alu_ex[31:0]),
270
      .alu_mx                           (alu_mx[31:0]),
271
      .bpc_ex                           (bpc_ex[31:2]),
272
      .bsf_mx                           (bsf_mx[31:0]),
273
      .mem_ex                           (mem_ex[31:2]),
274
      .msr_ex                           (msr_ex[7:0]),
275
      .mul_mx                           (mul_mx[31:0]),
276
      .sfr_mx                           (sfr_mx[31:0]),
277
      // Inputs
278
      .dena                             (dena),
279
      .gclk                             (gclk),
280
      .gpha                             (gpha),
281
      .grst                             (grst),
282
      .imm_of                           (imm_of[15:0]),
283
      .opa_of                           (opa_of[31:0]),
284
      .opb_of                           (opb_of[31:0]),
285
      .opc_of                           (opc_of[5:0]),
286
      .opd_of                           (opd_of[31:0]),
287
      .ra_of                            (ra_of[4:0]),
288
      .rd_of                            (rd_of[4:0]));
289
 
290
   aeMB2_memif
291
     #(/*AUTOINSTPARAM*/
292
       // Parameters
293
       .AEMB_DWB                        (AEMB_DWB),
294
       .AEMB_XWB                        (AEMB_XWB),
295
       .AEMB_XSL                        (AEMB_XSL))
296
   memif0
297
     (/*AUTOINST*/
298
      // Outputs
299
      .dwb_adr_o                        (dwb_adr_o[AEMB_DWB-1:2]),
300
      .dwb_cyc_o                        (dwb_cyc_o),
301
      .dwb_dat_o                        (dwb_dat_o[31:0]),
302
      .dwb_fb                           (dwb_fb),
303
      .dwb_mx                           (dwb_mx[31:0]),
304
      .dwb_sel_o                        (dwb_sel_o[3:0]),
305
      .dwb_stb_o                        (dwb_stb_o),
306
      .dwb_tag_o                        (dwb_tag_o),
307
      .dwb_wre_o                        (dwb_wre_o),
308
      .sel_mx                           (sel_mx[3:0]),
309
      .xwb_adr_o                        (xwb_adr_o[AEMB_XWB+1:2]),
310
      .xwb_cyc_o                        (xwb_cyc_o),
311
      .xwb_dat_o                        (xwb_dat_o[31:0]),
312
      .xwb_fb                           (xwb_fb),
313
      .xwb_mx                           (xwb_mx[31:0]),
314
      .xwb_sel_o                        (xwb_sel_o[3:0]),
315
      .xwb_stb_o                        (xwb_stb_o),
316
      .xwb_tag_o                        (xwb_tag_o),
317
      .xwb_wre_o                        (xwb_wre_o),
318
      // Inputs
319
      .dena                             (dena),
320
      .dwb_ack_i                        (dwb_ack_i),
321
      .dwb_dat_i                        (dwb_dat_i[31:0]),
322
      .gclk                             (gclk),
323
      .gpha                             (gpha),
324
      .grst                             (grst),
325
      .imm_of                           (imm_of[15:0]),
326
      .mem_ex                           (mem_ex[AEMB_DWB-1:2]),
327
      .msr_ex                           (msr_ex[7:0]),
328
      .opa_of                           (opa_of[31:0]),
329
      .opb_of                           (opb_of[1:0]),
330
      .opc_of                           (opc_of[5:0]),
331
      .opd_of                           (opd_of[31:0]),
332
      .xwb_ack_i                        (xwb_ack_i),
333
      .xwb_dat_i                        (xwb_dat_i[31:0]));
334
 
335
   aeMB2_regs
336
     #(/*AUTOINSTPARAM*/
337
       // Parameters
338
       .AEMB_HTX                        (AEMB_HTX))
339
   regs0
340
     (/*AUTOINST*/
341
      // Outputs
342
      .opa_if                           (opa_if[31:0]),
343
      .opb_if                           (opb_if[31:0]),
344
      .opd_if                           (opd_if[31:0]),
345
      // Inputs
346
      .alu_mx                           (alu_mx[31:0]),
347
      .bsf_mx                           (bsf_mx[31:0]),
348
      .dena                             (dena),
349
      .dwb_mx                           (dwb_mx[31:0]),
350
      .gclk                             (gclk),
351
      .gpha                             (gpha),
352
      .grst                             (grst),
353
      .ich_dat                          (ich_dat[31:0]),
354
      .mul_mx                           (mul_mx[31:0]),
355
      .mux_ex                           (mux_ex[2:0]),
356
      .mux_of                           (mux_of[2:0]),
357
      .rd_ex                            (rd_ex[4:0]),
358
      .rd_of                            (rd_of[4:0]),
359
      .rpc_mx                           (rpc_mx[31:2]),
360
      .sel_mx                           (sel_mx[3:0]),
361
      .sfr_mx                           (sfr_mx[31:0]),
362
      .xwb_mx                           (xwb_mx[31:0]));
363
 
364
endmodule // aeMB2_edk62
365
 
366 120 sybreon
// $Log: not supported by cvs2svn $
367 125 sybreon
// Revision 1.2  2008/04/20 16:34:32  sybreon
368
// Basic version with some features left out.
369
//
370 120 sybreon
// Revision 1.1  2008/04/18 00:21:52  sybreon
371
// Initial import.
372
//

powered by: WebSVN 2.1.0

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