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

Subversion Repositories aemb

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

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

Line No. Rev Author Line
1 118 sybreon
/* $Id: aeMB2_edk62.v,v 1.1 2008-04-18 00:21:52 sybreon Exp $
2
**
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
   dwb_wre_o, dwb_tag_o, dwb_stb_o, dwb_sel_o, dwb_dat_o, dwb_cyc_o,
36
   dwb_adr_o,
37
   // Inputs
38
   xwb_dat_i, xwb_ack_i, sys_rst_i, sys_ena_i, sys_clk_i, iwb_dat_i,
39
   iwb_ack_i, dwb_dat_i, dwb_ack_i, alu_c
40
   );
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
 
45
   parameter AEMB_HTX = 1; ///< hardware thread extension
46
 
47
   parameter AEMB_ICH = 11; ///< instruction cache size
48
 
49
   parameter AEMB_BSF = 1; ///< implement barrel shift
50
   parameter AEMB_MUL = 1; ///< implement multiplier
51
   parameter AEMB_XSL = 1; ///< implement XSL bus
52
 
53
   /*AUTOOUTPUT*/
54
   // Beginning of automatic outputs (from unused autoinst outputs)
55
   output [AEMB_DWB-1:2] dwb_adr_o;             // From memif0 of aeMB2_memif.v
56
   output               dwb_cyc_o;              // From memif0 of aeMB2_memif.v
57
   output [31:0] dwb_dat_o;              // From memif0 of aeMB2_memif.v
58
   output [3:0]          dwb_sel_o;              // From memif0 of aeMB2_memif.v
59
   output               dwb_stb_o;              // From memif0 of aeMB2_memif.v
60
   output               dwb_tag_o;              // From memif0 of aeMB2_memif.v
61
   output               dwb_wre_o;              // From memif0 of aeMB2_memif.v
62
   output [AEMB_IWB-1:2] iwb_adr_o;             // From iwbif0 of aeMB2_iwbif.v
63
   output               iwb_cyc_o;              // From iwbif0 of aeMB2_iwbif.v
64
   output [3:0]          iwb_sel_o;              // From iwbif0 of aeMB2_iwbif.v
65
   output               iwb_stb_o;              // From iwbif0 of aeMB2_iwbif.v
66
   output               iwb_wre_o;              // From iwbif0 of aeMB2_iwbif.v
67
   output [AEMB_XWB+1:2] xwb_adr_o;             // From memif0 of aeMB2_memif.v
68
   output               xwb_cyc_o;              // From memif0 of aeMB2_memif.v
69
   output [31:0] xwb_dat_o;              // From memif0 of aeMB2_memif.v
70
   output [3:0]          xwb_sel_o;              // From memif0 of aeMB2_memif.v
71
   output               xwb_stb_o;              // From memif0 of aeMB2_memif.v
72
   output               xwb_tag_o;              // From memif0 of aeMB2_memif.v
73
   output               xwb_wre_o;              // From memif0 of aeMB2_memif.v
74
   // End of automatics
75
   /*AUTOINPUT*/
76
   // Beginning of automatic inputs (from unused autoinst inputs)
77
   input                alu_c;                  // To regs0 of aeMB2_regs.v
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
   input                iwb_ack_i;              // To iche0 of aeMB2_iche.v, ...
81
   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_fil;                // From iwbif0 of aeMB2_iwbif.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
        .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
       .AEMB_HTX                        (AEMB_HTX))
160
   iche0
161
     (/*AUTOINST*/
162
      // Outputs
163
      .ich_dat                          (ich_dat[31:0]),
164
      .ich_hit                          (ich_hit),
165
      .ich_fb                           (ich_fb),
166
      // Inputs
167
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
168
      .ich_fil                          (ich_fil),
169
      .iwb_dat_i                        (iwb_dat_i[31:0]),
170
      .iwb_ack_i                        (iwb_ack_i),
171
      .rpc_if                           (rpc_if[31:2]),
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
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
191
      .ich_fil                          (ich_fil),
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
      .hzd_bpc                          (hzd_bpc),
200
      .hzd_fwd                          (hzd_fwd),
201
      .bra_ex                           (bra_ex[1:0]),
202
      .bpc_ex                           (bpc_ex[31:2]),
203
      .gclk                             (gclk),
204
      .grst                             (grst),
205
      .dena                             (dena),
206
      .iena                             (iena),
207
      .gpha                             (gpha));
208
 
209
   aeMB2_ctrl
210
     #(/*AUTOINSTPARAM*/
211
       // Parameters
212
       .AEMB_HTX                        (AEMB_HTX))
213
   ctrl0
214
     (/*AUTOINST*/
215
      // Outputs
216
      .opa_of                           (opa_of[31:0]),
217
      .opb_of                           (opb_of[31:0]),
218
      .opd_of                           (opd_of[31:0]),
219
      .opc_of                           (opc_of[5:0]),
220
      .ra_of                            (ra_of[4:0]),
221
      .rd_of                            (rd_of[4:0]),
222
      .imm_of                           (imm_of[15:0]),
223
      .rd_ex                            (rd_ex[4:0]),
224
      .mux_of                           (mux_of[2:0]),
225
      .mux_ex                           (mux_ex[2:0]),
226
      .hzd_bpc                          (hzd_bpc),
227
      .hzd_fwd                          (hzd_fwd),
228
      // Inputs
229
      .opa_if                           (opa_if[31:0]),
230
      .opb_if                           (opb_if[31:0]),
231
      .opd_if                           (opd_if[31:0]),
232
      .bra_ex                           (bra_ex[1:0]),
233
      .rpc_if                           (rpc_if[31:2]),
234
      .alu_ex                           (alu_ex[31:0]),
235
      .ich_dat                          (ich_dat[31:0]),
236
      .gclk                             (gclk),
237
      .grst                             (grst),
238
      .dena                             (dena),
239
      .iena                             (iena),
240
      .gpha                             (gpha));
241
 
242
   aeMB2_brcc
243
     #(/*AUTOINSTPARAM*/)
244
   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
      .gpha                             (gpha));
257
 
258
   aeMB2_exec
259
     #(/*AUTOINSTPARAM*/
260
       // Parameters
261
       .AEMB_IWB                        (AEMB_IWB),
262
       .AEMB_DWB                        (AEMB_DWB),
263
       .AEMB_MUL                        (AEMB_MUL),
264
       .AEMB_BSF                        (AEMB_BSF))
265
   exec0
266
     (/*AUTOINST*/
267
      // Outputs
268
      .alu_ex                           (alu_ex[31:0]),
269
      .alu_mx                           (alu_mx[31:0]),
270
      .bpc_ex                           (bpc_ex[31:2]),
271
      .bsf_mx                           (bsf_mx[31:0]),
272
      .mem_ex                           (mem_ex[31:2]),
273
      .msr_ex                           (msr_ex[7:0]),
274
      .mul_mx                           (mul_mx[31:0]),
275
      .sfr_mx                           (sfr_mx[31:0]),
276
      // Inputs
277
      .dena                             (dena),
278
      .gclk                             (gclk),
279
      .gpha                             (gpha),
280
      .grst                             (grst),
281
      .imm_of                           (imm_of[15:0]),
282
      .opa_of                           (opa_of[31:0]),
283
      .opb_of                           (opb_of[31:0]),
284
      .opc_of                           (opc_of[5:0]),
285
      .opd_of                           (opd_of[31:0]),
286
      .ra_of                            (ra_of[4:0]),
287
      .rd_of                            (rd_of[4:0]));
288
 
289
   aeMB2_memif
290
     #(/*AUTOINSTPARAM*/
291
       // Parameters
292
       .AEMB_DWB                        (AEMB_DWB),
293
       .AEMB_XWB                        (AEMB_XWB),
294
       .AEMB_XSL                        (AEMB_XSL))
295
   memif0
296
     (/*AUTOINST*/
297
      // Outputs
298
      .dwb_adr_o                        (dwb_adr_o[AEMB_DWB-1:2]),
299
      .dwb_cyc_o                        (dwb_cyc_o),
300
      .dwb_dat_o                        (dwb_dat_o[31:0]),
301
      .dwb_fb                           (dwb_fb),
302
      .dwb_mx                           (dwb_mx[31:0]),
303
      .dwb_sel_o                        (dwb_sel_o[3:0]),
304
      .dwb_stb_o                        (dwb_stb_o),
305
      .dwb_tag_o                        (dwb_tag_o),
306
      .dwb_wre_o                        (dwb_wre_o),
307
      .sel_mx                           (sel_mx[3:0]),
308
      .xwb_adr_o                        (xwb_adr_o[AEMB_XWB+1:2]),
309
      .xwb_cyc_o                        (xwb_cyc_o),
310
      .xwb_dat_o                        (xwb_dat_o[31:0]),
311
      .xwb_fb                           (xwb_fb),
312
      .xwb_mx                           (xwb_mx[31:0]),
313
      .xwb_sel_o                        (xwb_sel_o[3:0]),
314
      .xwb_stb_o                        (xwb_stb_o),
315
      .xwb_tag_o                        (xwb_tag_o),
316
      .xwb_wre_o                        (xwb_wre_o),
317
      // Inputs
318
      .dena                             (dena),
319
      .dwb_ack_i                        (dwb_ack_i),
320
      .dwb_dat_i                        (dwb_dat_i[31:0]),
321
      .gclk                             (gclk),
322
      .gpha                             (gpha),
323
      .grst                             (grst),
324
      .imm_of                           (imm_of[15:0]),
325
      .mem_ex                           (mem_ex[AEMB_DWB-1:2]),
326
      .msr_ex                           (msr_ex[7:0]),
327
      .opa_of                           (opa_of[31:0]),
328
      .opb_of                           (opb_of[1:0]),
329
      .opc_of                           (opc_of[5:0]),
330
      .opd_of                           (opd_of[31:0]),
331
      .xwb_ack_i                        (xwb_ack_i),
332
      .xwb_dat_i                        (xwb_dat_i[31:0]));
333
 
334
   aeMB2_regs
335
     #(/*AUTOINSTPARAM*/
336
       // Parameters
337
       .AEMB_HTX                        (AEMB_HTX))
338
   regs0
339
     (/*AUTOINST*/
340
      // Outputs
341
      .opa_if                           (opa_if[31:0]),
342
      .opb_if                           (opb_if[31:0]),
343
      .opd_if                           (opd_if[31:0]),
344
      // Inputs
345
      .alu_c                            (alu_c),
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
      .imm_of                           (imm_of[15:0]),
355
      .mul_mx                           (mul_mx[31:0]),
356
      .mux_ex                           (mux_ex[2:0]),
357
      .mux_of                           (mux_of[2:0]),
358
      .opa_of                           (opa_of[31:0]),
359
      .opc_of                           (opc_of[5:0]),
360
      .ra_of                            (ra_of[4:0]),
361
      .rd_ex                            (rd_ex[4:0]),
362
      .rd_of                            (rd_of[4:0]),
363
      .rpc_if                           (rpc_if[31:2]),
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
// $Log: not supported by cvs2svn $

powered by: WebSVN 2.1.0

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