OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_processor/] [aeMB/] [verilog/] [src/] [aeMB2_edk62.v] - Blame information for rev 16

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 16 alirezamon
/* $Id: aeMB2_edk62.v,v 1.8 2008-05-01 08:32:58 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
 * 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
`timescale  1ns/1ps
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_tag_o, iwb_stb_o, iwb_sel_o, iwb_cyc_o,
34
   iwb_adr_o, dwb_wre_o, dwb_tag_o, dwb_stb_o, dwb_sel_o, dwb_dat_o,
35
   dwb_cyc_o, dwb_adr_o,
36
   // Inputs
37
   xwb_dat_i, xwb_ack_i, sys_rst_i, sys_int_i, sys_ena_i, sys_clk_i,
38
   iwb_dat_i, iwb_ack_i, dwb_dat_i, dwb_ack_i
39
   );
40
   // BUS WIDTHS
41
   parameter AEMB_IWB = 32; ///< INST bus width
42
   parameter AEMB_DWB = 32; ///< DATA bus width
43
   parameter AEMB_XWB = 7; ///< XCEL bus width
44
 
45
   // CACHE PARAMETERS
46
   parameter AEMB_ICH = 11; ///< instruction cache size
47
   parameter AEMB_IDX = 6; ///< cache index size
48
 
49
   // OPTIONAL HARDWARE
50
   parameter AEMB_BSF = 1; ///< optional barrel shift
51
   parameter AEMB_MUL = 1; ///< optional multiplier
52
   parameter AEMB_DIV = 0; ///< optional divider (future)
53
   parameter AEMB_FPU = 0; ///< optional floating point unit (future)
54
 
55
   // DEPRECATED PARAMETERS
56
   localparam AEMB_XSL = 1; ///< implement XSL bus
57
   localparam AEMB_HTX = 1; ///< hardware thread extension
58
 
59
   /*AUTOOUTPUT*/
60
   // Beginning of automatic outputs (from unused autoinst outputs)
61
   output [AEMB_DWB-1:2] dwb_adr_o;             // From memif0 of aeMB2_memif.v
62
   output               dwb_cyc_o;              // From memif0 of aeMB2_memif.v
63
   output [31:0] dwb_dat_o;              // From memif0 of aeMB2_memif.v
64
   output [3:0]          dwb_sel_o;              // From memif0 of aeMB2_memif.v
65
   output               dwb_stb_o;              // From memif0 of aeMB2_memif.v
66
   output               dwb_tag_o;              // From memif0 of aeMB2_memif.v
67
   output               dwb_wre_o;              // From memif0 of aeMB2_memif.v
68
   output [AEMB_IWB-1:2] iwb_adr_o;             // From iwbif0 of aeMB2_iwbif.v
69
   output               iwb_cyc_o;              // From iwbif0 of aeMB2_iwbif.v
70
   output [3:0]          iwb_sel_o;              // From iwbif0 of aeMB2_iwbif.v
71
   output               iwb_stb_o;              // From iwbif0 of aeMB2_iwbif.v
72
   output               iwb_tag_o;              // From iwbif0 of aeMB2_iwbif.v
73
   output               iwb_wre_o;              // From iwbif0 of aeMB2_iwbif.v
74
   output [AEMB_XWB-1:2] xwb_adr_o;             // From memif0 of aeMB2_memif.v
75
   output               xwb_cyc_o;              // From memif0 of aeMB2_memif.v
76
   output [31:0] xwb_dat_o;              // From memif0 of aeMB2_memif.v
77
   output [3:0]          xwb_sel_o;              // From memif0 of aeMB2_memif.v
78
   output               xwb_stb_o;              // From memif0 of aeMB2_memif.v
79
   output               xwb_tag_o;              // From memif0 of aeMB2_memif.v
80
   output               xwb_wre_o;              // From memif0 of aeMB2_memif.v
81
   // End of automatics
82
   /*AUTOINPUT*/
83
   // Beginning of automatic inputs (from unused autoinst inputs)
84
   input                dwb_ack_i;              // To memif0 of aeMB2_memif.v
85
   input [31:0]          dwb_dat_i;              // To memif0 of aeMB2_memif.v
86
   input                iwb_ack_i;              // To iche0 of aeMB2_iche.v, ...
87
   input [31:0]          iwb_dat_i;              // To iche0 of aeMB2_iche.v, ...
88
   input                sys_clk_i;              // To pip0 of aeMB2_pipe.v
89
   input                sys_ena_i;              // To pip0 of aeMB2_pipe.v
90
   input                sys_int_i;              // To pip0 of aeMB2_pipe.v
91
   input                sys_rst_i;              // To pip0 of aeMB2_pipe.v
92
   input                xwb_ack_i;              // To memif0 of aeMB2_memif.v
93
   input [31:0]          xwb_dat_i;              // To memif0 of aeMB2_memif.v
94
   // End of automatics
95
   /*AUTOWIRE*/
96
   // Beginning of automatic wires (for undeclared instantiated-module outputs)
97
   wire [31:0]           alu_ex;                 // From exec0 of aeMB2_exec.v
98
   wire [31:0]           alu_mx;                 // From exec0 of aeMB2_exec.v
99
   wire [31:2]          bpc_ex;                 // From exec0 of aeMB2_exec.v
100
   wire [1:0]            bra_ex;                 // From brcc0 of aeMB2_brcc.v
101
   wire [1:0]            brk_if;                 // From pip0 of aeMB2_pipe.v
102
   wire [31:0]           bsf_mx;                 // From exec0 of aeMB2_exec.v
103
   wire                 dena;                   // From pip0 of aeMB2_pipe.v
104
   wire                 dwb_fb;                 // From memif0 of aeMB2_memif.v
105
   wire [31:0]           dwb_mx;                 // From memif0 of aeMB2_memif.v
106
   wire                 fet_fb;                 // From iwbif0 of aeMB2_iwbif.v
107
   wire                 gclk;                   // From pip0 of aeMB2_pipe.v
108
   wire                 gpha;                   // From pip0 of aeMB2_pipe.v
109
   wire                 grst;                   // From pip0 of aeMB2_pipe.v
110
   wire                 hzd_bpc;                // From ctrl0 of aeMB2_ctrl.v
111
   wire                 hzd_fwd;                // From ctrl0 of aeMB2_ctrl.v
112
   wire [AEMB_IWB-1:2]  ich_adr;                // From iwbif0 of aeMB2_iwbif.v
113
   wire [31:0]           ich_dat;                // From iche0 of aeMB2_iche.v
114
   wire                 ich_fb;                 // From iche0 of aeMB2_iche.v
115
   wire                 ich_hit;                // From iche0 of aeMB2_iche.v
116
   wire                 iena;                   // From pip0 of aeMB2_pipe.v
117
   wire [15:0]           imm_of;                 // From ctrl0 of aeMB2_ctrl.v
118
   wire [31:2]          mem_ex;                 // From exec0 of aeMB2_exec.v
119
   wire [7:0]            msr_ex;                 // From exec0 of aeMB2_exec.v
120
   wire [31:0]           mul_mx;                 // From exec0 of aeMB2_exec.v
121
   wire [2:0]            mux_ex;                 // From ctrl0 of aeMB2_ctrl.v
122
   wire [2:0]            mux_of;                 // From ctrl0 of aeMB2_ctrl.v
123
   wire [31:0]           opa_if;                 // From regs0 of aeMB2_regs.v
124
   wire [31:0]           opa_of;                 // From ctrl0 of aeMB2_ctrl.v
125
   wire [31:0]           opb_if;                 // From regs0 of aeMB2_regs.v
126
   wire [31:0]           opb_of;                 // From ctrl0 of aeMB2_ctrl.v
127
   wire [5:0]            opc_of;                 // From ctrl0 of aeMB2_ctrl.v
128
   wire [31:0]           opd_if;                 // From regs0 of aeMB2_regs.v
129
   wire [31:0]           opd_of;                 // From ctrl0 of aeMB2_ctrl.v
130
   wire [4:0]            ra_of;                  // From ctrl0 of aeMB2_ctrl.v
131
   wire [4:0]            rd_ex;                  // From ctrl0 of aeMB2_ctrl.v
132
   wire [4:0]            rd_of;                  // From ctrl0 of aeMB2_ctrl.v
133
   wire [31:2]          rpc_if;                 // From iwbif0 of aeMB2_iwbif.v
134
   wire [31:2]          rpc_mx;                 // From iwbif0 of aeMB2_iwbif.v
135
   wire [3:0]            sel_mx;                 // From memif0 of aeMB2_memif.v
136
   wire [31:0]           sfr_mx;                 // From exec0 of aeMB2_exec.v
137
   wire                 xwb_fb;                 // From memif0 of aeMB2_memif.v
138
   wire [31:0]           xwb_mx;                 // From memif0 of aeMB2_memif.v
139
   // End of automatics
140
   /*AUTOREG*/
141
 
142
   aeMB2_pipe
143
     pip0
144
       (/*AUTOINST*/
145
        // Outputs
146
        .brk_if                         (brk_if[1:0]),
147
        .gpha                           (gpha),
148
        .gclk                           (gclk),
149
        .grst                           (grst),
150
        .dena                           (dena),
151
        .iena                           (iena),
152
        // Inputs
153
        .bra_ex                         (bra_ex[1:0]),
154
        .dwb_fb                         (dwb_fb),
155
        .xwb_fb                         (xwb_fb),
156
        .ich_fb                         (ich_fb),
157
        .fet_fb                         (fet_fb),
158
        .msr_ex                         (msr_ex[3:0]),
159
        .sys_clk_i                      (sys_clk_i),
160
        .sys_int_i                      (sys_int_i),
161
        .sys_rst_i                      (sys_rst_i),
162
        .sys_ena_i                      (sys_ena_i));
163
 
164
   aeMB2_iche
165
     #(/*AUTOINSTPARAM*/
166
       // Parameters
167
       .AEMB_IWB                        (AEMB_IWB),
168
       .AEMB_ICH                        (AEMB_ICH),
169
       .AEMB_IDX                        (AEMB_IDX),
170
       .AEMB_HTX                        (AEMB_HTX))
171
   iche0
172
     (/*AUTOINST*/
173
      // Outputs
174
      .ich_dat                          (ich_dat[31:0]),
175
      .ich_hit                          (ich_hit),
176
      .ich_fb                           (ich_fb),
177
      // Inputs
178
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
179
      .iwb_dat_i                        (iwb_dat_i[31:0]),
180
      .iwb_ack_i                        (iwb_ack_i),
181
      .gclk                             (gclk),
182
      .grst                             (grst),
183
      .iena                             (iena),
184
      .gpha                             (gpha));
185
 
186
   aeMB2_iwbif
187
     #(/*AUTOINSTPARAM*/
188
       // Parameters
189
       .AEMB_IWB                        (AEMB_IWB),
190
       .AEMB_HTX                        (AEMB_HTX))
191
   iwbif0
192
     (/*AUTOINST*/
193
      // Outputs
194
      .iwb_adr_o                        (iwb_adr_o[AEMB_IWB-1:2]),
195
      .iwb_stb_o                        (iwb_stb_o),
196
      .iwb_sel_o                        (iwb_sel_o[3:0]),
197
      .iwb_wre_o                        (iwb_wre_o),
198
      .iwb_cyc_o                        (iwb_cyc_o),
199
      .iwb_tag_o                        (iwb_tag_o),
200
      .ich_adr                          (ich_adr[AEMB_IWB-1:2]),
201
      .fet_fb                           (fet_fb),
202
      .rpc_if                           (rpc_if[31:2]),
203
      .rpc_mx                           (rpc_mx[31:2]),
204
      // Inputs
205
      .iwb_ack_i                        (iwb_ack_i),
206
      .iwb_dat_i                        (iwb_dat_i[31:0]),
207
      .ich_hit                          (ich_hit),
208
      .msr_ex                           (msr_ex[7:5]),
209
      .hzd_bpc                          (hzd_bpc),
210
      .hzd_fwd                          (hzd_fwd),
211
      .bra_ex                           (bra_ex[1:0]),
212
      .bpc_ex                           (bpc_ex[31:2]),
213
      .gclk                             (gclk),
214
      .grst                             (grst),
215
      .dena                             (dena),
216
      .iena                             (iena),
217
      .gpha                             (gpha));
218
 
219
   aeMB2_ctrl
220
     #(/*AUTOINSTPARAM*/
221
       // Parameters
222
       .AEMB_HTX                        (AEMB_HTX))
223
   ctrl0
224
     (/*AUTOINST*/
225
      // Outputs
226
      .opa_of                           (opa_of[31:0]),
227
      .opb_of                           (opb_of[31:0]),
228
      .opd_of                           (opd_of[31:0]),
229
      .opc_of                           (opc_of[5:0]),
230
      .ra_of                            (ra_of[4:0]),
231
      .rd_of                            (rd_of[4:0]),
232
      .imm_of                           (imm_of[15:0]),
233
      .rd_ex                            (rd_ex[4:0]),
234
      .mux_of                           (mux_of[2:0]),
235
      .mux_ex                           (mux_ex[2:0]),
236
      .hzd_bpc                          (hzd_bpc),
237
      .hzd_fwd                          (hzd_fwd),
238
      // Inputs
239
      .opa_if                           (opa_if[31:0]),
240
      .opb_if                           (opb_if[31:0]),
241
      .opd_if                           (opd_if[31:0]),
242
      .brk_if                           (brk_if[1:0]),
243
      .bra_ex                           (bra_ex[1:0]),
244
      .rpc_if                           (rpc_if[31:2]),
245
      .alu_ex                           (alu_ex[31:0]),
246
      .ich_dat                          (ich_dat[31:0]),
247
      .gclk                             (gclk),
248
      .grst                             (grst),
249
      .dena                             (dena),
250
      .iena                             (iena),
251
      .gpha                             (gpha));
252
 
253
   aeMB2_brcc
254
     #(/*AUTOINSTPARAM*/
255
       // Parameters
256
       .AEMB_HTX                        (AEMB_HTX))
257
   brcc0
258
     (/*AUTOINST*/
259
      // Outputs
260
      .bra_ex                           (bra_ex[1:0]),
261
      // Inputs
262
      .opd_of                           (opd_of[31:0]),
263
      .ra_of                            (ra_of[4:0]),
264
      .rd_of                            (rd_of[4:0]),
265
      .opc_of                           (opc_of[5:0]),
266
      .gclk                             (gclk),
267
      .grst                             (grst),
268
      .dena                             (dena),
269
      .iena                             (iena),
270
      .gpha                             (gpha));
271
 
272
   aeMB2_exec
273
     #(/*AUTOINSTPARAM*/
274
       // Parameters
275
       .AEMB_IWB                        (AEMB_IWB),
276
       .AEMB_DWB                        (AEMB_DWB),
277
       .AEMB_MUL                        (AEMB_MUL),
278
       .AEMB_BSF                        (AEMB_BSF),
279
       .AEMB_HTX                        (AEMB_HTX))
280
   exec0
281
     (/*AUTOINST*/
282
      // Outputs
283
      .alu_ex                           (alu_ex[31:0]),
284
      .alu_mx                           (alu_mx[31:0]),
285
      .bpc_ex                           (bpc_ex[31:2]),
286
      .bsf_mx                           (bsf_mx[31:0]),
287
      .mem_ex                           (mem_ex[31:2]),
288
      .msr_ex                           (msr_ex[7:0]),
289
      .mul_mx                           (mul_mx[31:0]),
290
      .sfr_mx                           (sfr_mx[31:0]),
291
      // Inputs
292
      .dena                             (dena),
293
      .gclk                             (gclk),
294
      .gpha                             (gpha),
295
      .grst                             (grst),
296
      .imm_of                           (imm_of[15:0]),
297
      .opa_of                           (opa_of[31:0]),
298
      .opb_of                           (opb_of[31:0]),
299
      .opc_of                           (opc_of[5:0]),
300
      .opd_of                           (opd_of[31:0]),
301
      .ra_of                            (ra_of[4:0]),
302
      .rd_of                            (rd_of[4:0]));
303
 
304
   aeMB2_memif
305
     #(/*AUTOINSTPARAM*/
306
       // Parameters
307
       .AEMB_DWB                        (AEMB_DWB),
308
       .AEMB_XWB                        (AEMB_XWB),
309
       .AEMB_XSL                        (AEMB_XSL))
310
   memif0
311
     (/*AUTOINST*/
312
      // Outputs
313
      .dwb_adr_o                        (dwb_adr_o[AEMB_DWB-1:2]),
314
      .dwb_cyc_o                        (dwb_cyc_o),
315
      .dwb_dat_o                        (dwb_dat_o[31:0]),
316
      .dwb_fb                           (dwb_fb),
317
      .dwb_mx                           (dwb_mx[31:0]),
318
      .dwb_sel_o                        (dwb_sel_o[3:0]),
319
      .dwb_stb_o                        (dwb_stb_o),
320
      .dwb_tag_o                        (dwb_tag_o),
321
      .dwb_wre_o                        (dwb_wre_o),
322
      .sel_mx                           (sel_mx[3:0]),
323
      .xwb_adr_o                        (xwb_adr_o[AEMB_XWB-1:2]),
324
      .xwb_cyc_o                        (xwb_cyc_o),
325
      .xwb_dat_o                        (xwb_dat_o[31:0]),
326
      .xwb_fb                           (xwb_fb),
327
      .xwb_mx                           (xwb_mx[31:0]),
328
      .xwb_sel_o                        (xwb_sel_o[3:0]),
329
      .xwb_stb_o                        (xwb_stb_o),
330
      .xwb_tag_o                        (xwb_tag_o),
331
      .xwb_wre_o                        (xwb_wre_o),
332
      // Inputs
333
      .dena                             (dena),
334
      .dwb_ack_i                        (dwb_ack_i),
335
      .dwb_dat_i                        (dwb_dat_i[31:0]),
336
      .gclk                             (gclk),
337
      .gpha                             (gpha),
338
      .grst                             (grst),
339
      .imm_of                           (imm_of[15:0]),
340
      .mem_ex                           (mem_ex[AEMB_DWB-1:2]),
341
      .msr_ex                           (msr_ex[7:0]),
342
      .opa_of                           (opa_of[31:0]),
343
      .opb_of                           (opb_of[1:0]),
344
      .opc_of                           (opc_of[5:0]),
345
      .opd_of                           (opd_of[31:0]),
346
      .sfr_mx                           (sfr_mx[7:5]),
347
      .xwb_ack_i                        (xwb_ack_i),
348
      .xwb_dat_i                        (xwb_dat_i[31:0]));
349
 
350
   aeMB2_regs
351
     #(/*AUTOINSTPARAM*/
352
       // Parameters
353
       .AEMB_HTX                        (AEMB_HTX))
354
   regs0
355
     (/*AUTOINST*/
356
      // Outputs
357
      .opa_if                           (opa_if[31:0]),
358
      .opb_if                           (opb_if[31:0]),
359
      .opd_if                           (opd_if[31:0]),
360
      // Inputs
361
      .alu_mx                           (alu_mx[31:0]),
362
      .bsf_mx                           (bsf_mx[31:0]),
363
      .dena                             (dena),
364
      .dwb_mx                           (dwb_mx[31:0]),
365
      .gclk                             (gclk),
366
      .gpha                             (gpha),
367
      .grst                             (grst),
368
      .ich_dat                          (ich_dat[31:0]),
369
      .mul_mx                           (mul_mx[31:0]),
370
      .mux_ex                           (mux_ex[2:0]),
371
      .mux_of                           (mux_of[2:0]),
372
      .rd_ex                            (rd_ex[4:0]),
373
      .rd_of                            (rd_of[4:0]),
374
      .rpc_mx                           (rpc_mx[31:2]),
375
      .sel_mx                           (sel_mx[3:0]),
376
      .sfr_mx                           (sfr_mx[31:0]),
377
      .xwb_mx                           (xwb_mx[31:0]));
378
 
379
endmodule // aeMB2_edk62
380
 
381
/*
382
 $Log: not supported by cvs2svn $
383
 Revision 1.7  2008/04/27 19:52:46  sybreon
384
 added iwb_tag_o signal tied to MSR_ICE.
385
 
386
 Revision 1.6  2008/04/26 17:57:43  sybreon
387
 Minor performance improvements.
388
 
389
 Revision 1.5  2008/04/26 01:11:30  sybreon
390
 Fixed minor typos.
391
 
392
 Revision 1.4  2008/04/26 01:09:05  sybreon
393
 Passes basic tests. Minor documentation changes to make it compatible with iverilog pre-processor.
394
 
395
 Revision 1.3  2008/04/21 12:11:38  sybreon
396
 Passes arithmetic tests with single thread.
397
 
398
 Revision 1.2  2008/04/20 16:34:32  sybreon
399
 Basic version with some features left out.
400
 
401
 Revision 1.1  2008/04/18 00:21:52  sybreon
402
 Initial import.
403
*/

powered by: WebSVN 2.1.0

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