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

Subversion Repositories aemb

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

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

Line No. Rev Author Line
1 132 sybreon
/* $Id: aeMB2_edk62.v,v 1.5 2008-04-26 01:11:30 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
module aeMB2_edk62 (/*AUTOARG*/
31
   // Outputs
32
   xwb_wre_o, xwb_tag_o, xwb_stb_o, xwb_sel_o, xwb_dat_o, xwb_cyc_o,
33
   xwb_adr_o, iwb_wre_o, iwb_stb_o, iwb_sel_o, iwb_cyc_o, iwb_adr_o,
34 125 sybreon
   dwb_wre_o, dwb_tag_o, dwb_stb_o, dwb_sel_o, dwb_dat_o, dwb_cyc_o,
35
   dwb_adr_o,
36 118 sybreon
   // Inputs
37
   xwb_dat_i, xwb_ack_i, sys_rst_i, sys_ena_i, sys_clk_i, iwb_dat_i,
38 125 sybreon
   iwb_ack_i, dwb_dat_i, dwb_ack_i
39 118 sybreon
   );
40
   parameter AEMB_IWB = 32; ///< INST bus width
41
   parameter AEMB_DWB = 32; ///< DATA bus width
42
   parameter AEMB_XWB = 3; ///< XSEL bus width
43 120 sybreon
 
44 118 sybreon
   parameter AEMB_HTX = 1; ///< hardware thread extension
45
 
46
   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
 
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 131 sybreon
   output [AEMB_XWB-1:2] xwb_adr_o;             // From memif0 of aeMB2_memif.v
68 118 sybreon
   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                dwb_ack_i;              // To memif0 of aeMB2_memif.v
78
   input [31:0]          dwb_dat_i;              // To memif0 of aeMB2_memif.v
79 120 sybreon
   input                iwb_ack_i;              // To pip0 of aeMB2_pipe.v, ...
80 118 sybreon
   input [31:0]          iwb_dat_i;              // To iche0 of aeMB2_iche.v, ...
81
   input                sys_clk_i;              // To pip0 of aeMB2_pipe.v
82
   input                sys_ena_i;              // To pip0 of aeMB2_pipe.v
83
   input                sys_rst_i;              // To pip0 of aeMB2_pipe.v
84
   input                xwb_ack_i;              // To memif0 of aeMB2_memif.v
85
   input [31:0]          xwb_dat_i;              // To memif0 of aeMB2_memif.v
86
   // End of automatics
87
   /*AUTOWIRE*/
88
   // Beginning of automatic wires (for undeclared instantiated-module outputs)
89
   wire [31:0]           alu_ex;                 // From exec0 of aeMB2_exec.v
90
   wire [31:0]           alu_mx;                 // From exec0 of aeMB2_exec.v
91
   wire [31:2]          bpc_ex;                 // From exec0 of aeMB2_exec.v
92
   wire [1:0]            bra_ex;                 // From brcc0 of aeMB2_brcc.v
93
   wire [31:0]           bsf_mx;                 // From exec0 of aeMB2_exec.v
94
   wire                 dena;                   // From pip0 of aeMB2_pipe.v
95
   wire                 dwb_fb;                 // From memif0 of aeMB2_memif.v
96
   wire [31:0]           dwb_mx;                 // From memif0 of aeMB2_memif.v
97
   wire                 fet_fb;                 // From iwbif0 of aeMB2_iwbif.v
98
   wire                 gclk;                   // From pip0 of aeMB2_pipe.v
99
   wire                 gpha;                   // From pip0 of aeMB2_pipe.v
100
   wire                 grst;                   // From pip0 of aeMB2_pipe.v
101
   wire                 hzd_bpc;                // From ctrl0 of aeMB2_ctrl.v
102
   wire                 hzd_fwd;                // From ctrl0 of aeMB2_ctrl.v
103
   wire [AEMB_IWB-1:2]  ich_adr;                // From iwbif0 of aeMB2_iwbif.v
104
   wire [31:0]           ich_dat;                // From iche0 of aeMB2_iche.v
105
   wire                 ich_fb;                 // From iche0 of aeMB2_iche.v
106
   wire                 ich_hit;                // From iche0 of aeMB2_iche.v
107
   wire                 iena;                   // From pip0 of aeMB2_pipe.v
108
   wire [15:0]           imm_of;                 // From ctrl0 of aeMB2_ctrl.v
109
   wire [31:2]          mem_ex;                 // From exec0 of aeMB2_exec.v
110
   wire [7:0]            msr_ex;                 // From exec0 of aeMB2_exec.v
111
   wire [31:0]           mul_mx;                 // From exec0 of aeMB2_exec.v
112
   wire [2:0]            mux_ex;                 // From ctrl0 of aeMB2_ctrl.v
113
   wire [2:0]            mux_of;                 // From ctrl0 of aeMB2_ctrl.v
114
   wire [31:0]           opa_if;                 // From regs0 of aeMB2_regs.v
115
   wire [31:0]           opa_of;                 // From ctrl0 of aeMB2_ctrl.v
116
   wire [31:0]           opb_if;                 // From regs0 of aeMB2_regs.v
117
   wire [31:0]           opb_of;                 // From ctrl0 of aeMB2_ctrl.v
118
   wire [5:0]            opc_of;                 // From ctrl0 of aeMB2_ctrl.v
119
   wire [31:0]           opd_if;                 // From regs0 of aeMB2_regs.v
120
   wire [31:0]           opd_of;                 // From ctrl0 of aeMB2_ctrl.v
121
   wire [4:0]            ra_of;                  // From ctrl0 of aeMB2_ctrl.v
122
   wire [4:0]            rd_ex;                  // From ctrl0 of aeMB2_ctrl.v
123
   wire [4:0]            rd_of;                  // From ctrl0 of aeMB2_ctrl.v
124
   wire [31:2]          rpc_if;                 // From iwbif0 of aeMB2_iwbif.v
125
   wire [31:2]          rpc_mx;                 // From iwbif0 of aeMB2_iwbif.v
126
   wire [3:0]            sel_mx;                 // From memif0 of aeMB2_memif.v
127
   wire [31:0]           sfr_mx;                 // From exec0 of aeMB2_exec.v
128
   wire                 xwb_fb;                 // From memif0 of aeMB2_memif.v
129
   wire [31:0]           xwb_mx;                 // From memif0 of aeMB2_memif.v
130
   // End of automatics
131
   /*AUTOREG*/
132
 
133
   aeMB2_pipe
134
     pip0
135
       (/*AUTOINST*/
136
        // Outputs
137
        .gpha                           (gpha),
138
        .gclk                           (gclk),
139
        .grst                           (grst),
140
        .dena                           (dena),
141
        .iena                           (iena),
142
        // Inputs
143
        .bra_ex                         (bra_ex[1:0]),
144
        .dwb_fb                         (dwb_fb),
145
        .xwb_fb                         (xwb_fb),
146
        .ich_fb                         (ich_fb),
147
        .fet_fb                         (fet_fb),
148 120 sybreon
        .iwb_ack_i                      (iwb_ack_i),
149 118 sybreon
        .sys_clk_i                      (sys_clk_i),
150
        .sys_rst_i                      (sys_rst_i),
151
        .sys_ena_i                      (sys_ena_i));
152
 
153
   aeMB2_iche
154
     #(/*AUTOINSTPARAM*/
155
       // Parameters
156
       .AEMB_IWB                        (AEMB_IWB),
157
       .AEMB_ICH                        (AEMB_ICH),
158 120 sybreon
       .AEMB_IDX                        (AEMB_IDX),
159 118 sybreon
       .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
      .iwb_dat_i                        (iwb_dat_i[31:0]),
169
      .iwb_ack_i                        (iwb_ack_i),
170
      .gclk                             (gclk),
171
      .grst                             (grst),
172
      .iena                             (iena),
173
      .gpha                             (gpha));
174
 
175
   aeMB2_iwbif
176
     #(/*AUTOINSTPARAM*/
177
       // Parameters
178
       .AEMB_IWB                        (AEMB_IWB),
179
       .AEMB_HTX                        (AEMB_HTX))
180
   iwbif0
181
     (/*AUTOINST*/
182
      // Outputs
183
      .iwb_adr_o                        (iwb_adr_o[AEMB_IWB-1:2]),
184
      .iwb_stb_o                        (iwb_stb_o),
185
      .iwb_sel_o                        (iwb_sel_o[3:0]),
186
      .iwb_wre_o                        (iwb_wre_o),
187
      .iwb_cyc_o                        (iwb_cyc_o),
188
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
189
      .fet_fb                           (fet_fb),
190
      .rpc_if                           (rpc_if[31:2]),
191
      .rpc_mx                           (rpc_mx[31:2]),
192
      // Inputs
193
      .iwb_ack_i                        (iwb_ack_i),
194
      .iwb_dat_i                        (iwb_dat_i[31:0]),
195
      .ich_hit                          (ich_hit),
196
      .hzd_bpc                          (hzd_bpc),
197
      .hzd_fwd                          (hzd_fwd),
198
      .bra_ex                           (bra_ex[1:0]),
199
      .bpc_ex                           (bpc_ex[31:2]),
200
      .gclk                             (gclk),
201
      .grst                             (grst),
202
      .dena                             (dena),
203
      .iena                             (iena),
204
      .gpha                             (gpha));
205
 
206
   aeMB2_ctrl
207
     #(/*AUTOINSTPARAM*/
208
       // Parameters
209
       .AEMB_HTX                        (AEMB_HTX))
210
   ctrl0
211
     (/*AUTOINST*/
212
      // Outputs
213
      .opa_of                           (opa_of[31:0]),
214
      .opb_of                           (opb_of[31:0]),
215
      .opd_of                           (opd_of[31:0]),
216
      .opc_of                           (opc_of[5:0]),
217
      .ra_of                            (ra_of[4:0]),
218
      .rd_of                            (rd_of[4:0]),
219
      .imm_of                           (imm_of[15:0]),
220
      .rd_ex                            (rd_ex[4:0]),
221
      .mux_of                           (mux_of[2:0]),
222
      .mux_ex                           (mux_ex[2:0]),
223
      .hzd_bpc                          (hzd_bpc),
224
      .hzd_fwd                          (hzd_fwd),
225
      // Inputs
226
      .opa_if                           (opa_if[31:0]),
227
      .opb_if                           (opb_if[31:0]),
228
      .opd_if                           (opd_if[31:0]),
229
      .bra_ex                           (bra_ex[1:0]),
230
      .rpc_if                           (rpc_if[31:2]),
231
      .alu_ex                           (alu_ex[31:0]),
232
      .ich_dat                          (ich_dat[31:0]),
233
      .gclk                             (gclk),
234
      .grst                             (grst),
235
      .dena                             (dena),
236
      .iena                             (iena),
237
      .gpha                             (gpha));
238
 
239
   aeMB2_brcc
240 120 sybreon
     #(/*AUTOINSTPARAM*/
241
       // Parameters
242
       .AEMB_HTX                        (AEMB_HTX))
243 118 sybreon
   brcc0
244
     (/*AUTOINST*/
245
      // Outputs
246
      .bra_ex                           (bra_ex[1:0]),
247
      // Inputs
248
      .opd_of                           (opd_of[31:0]),
249
      .ra_of                            (ra_of[4:0]),
250
      .rd_of                            (rd_of[4:0]),
251
      .opc_of                           (opc_of[5:0]),
252
      .gclk                             (gclk),
253
      .grst                             (grst),
254
      .dena                             (dena),
255 120 sybreon
      .iena                             (iena),
256 118 sybreon
      .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 132 sybreon
       .AEMB_BSF                        (AEMB_BSF),
265
       .AEMB_HTX                        (AEMB_HTX))
266 118 sybreon
   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 131 sybreon
      .xwb_adr_o                        (xwb_adr_o[AEMB_XWB-1:2]),
310 118 sybreon
      .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 131 sybreon
      .sfr_mx                           (sfr_mx[7:5]),
333 118 sybreon
      .xwb_ack_i                        (xwb_ack_i),
334
      .xwb_dat_i                        (xwb_dat_i[31:0]));
335
 
336
   aeMB2_regs
337
     #(/*AUTOINSTPARAM*/
338
       // Parameters
339
       .AEMB_HTX                        (AEMB_HTX))
340
   regs0
341
     (/*AUTOINST*/
342
      // Outputs
343
      .opa_if                           (opa_if[31:0]),
344
      .opb_if                           (opb_if[31:0]),
345
      .opd_if                           (opd_if[31:0]),
346
      // Inputs
347
      .alu_mx                           (alu_mx[31:0]),
348
      .bsf_mx                           (bsf_mx[31:0]),
349
      .dena                             (dena),
350
      .dwb_mx                           (dwb_mx[31:0]),
351
      .gclk                             (gclk),
352
      .gpha                             (gpha),
353
      .grst                             (grst),
354
      .ich_dat                          (ich_dat[31:0]),
355
      .mul_mx                           (mul_mx[31:0]),
356
      .mux_ex                           (mux_ex[2:0]),
357
      .mux_of                           (mux_of[2:0]),
358
      .rd_ex                            (rd_ex[4:0]),
359
      .rd_of                            (rd_of[4:0]),
360
      .rpc_mx                           (rpc_mx[31:2]),
361
      .sel_mx                           (sel_mx[3:0]),
362
      .sfr_mx                           (sfr_mx[31:0]),
363
      .xwb_mx                           (xwb_mx[31:0]));
364
 
365
endmodule // aeMB2_edk62
366
 
367 131 sybreon
/*
368
 $Log: not supported by cvs2svn $
369 132 sybreon
 Revision 1.4  2008/04/26 01:09:05  sybreon
370
 Passes basic tests. Minor documentation changes to make it compatible with iverilog pre-processor.
371
 
372 131 sybreon
 Revision 1.3  2008/04/21 12:11:38  sybreon
373
 Passes arithmetic tests with single thread.
374
 
375
 Revision 1.2  2008/04/20 16:34:32  sybreon
376
 Basic version with some features left out.
377
 
378
 Revision 1.1  2008/04/18 00:21:52  sybreon
379
 Initial import.
380
*/

powered by: WebSVN 2.1.0

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