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

Subversion Repositories aemb

[/] [aemb/] [branches/] [AEMB2_712/] [rtl/] [verilog/] [aeMB_edk32.v] - Blame information for rev 66

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

Line No. Rev Author Line
1 66 sybreon
// $Id: aeMB_edk32.v,v 1.10 2007-11-16 21:52:03 sybreon Exp $
2 41 sybreon
//
3
// AEMB EDK 3.2 Compatible Core
4
//
5
// Copyright (C) 2004-2007 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
6
//  
7 55 sybreon
// This file is part of AEMB.
8 41 sybreon
//
9 55 sybreon
// AEMB is free software: you can redistribute it and/or modify it
10
// under the terms of the GNU Lesser General Public License as
11
// published by the Free Software Foundation, either version 3 of the
12
// License, or (at your option) any later version.
13
//
14
// AEMB is distributed in the hope that it will be useful, but WITHOUT
15
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
17
// Public License for more details.
18
//
19 41 sybreon
// You should have received a copy of the GNU Lesser General Public
20 55 sybreon
// License along with AEMB. If not, see <http://www.gnu.org/licenses/>.
21 41 sybreon
//
22
// $Log: not supported by cvs2svn $
23 66 sybreon
// Revision 1.9  2007/11/14 23:19:24  sybreon
24
// Fixed minor typo.
25
//
26 62 sybreon
// Revision 1.8  2007/11/14 22:14:34  sybreon
27
// Changed interrupt handling system (reported by M. Ettus).
28
//
29 61 sybreon
// Revision 1.7  2007/11/10 16:39:38  sybreon
30
// Upgraded license to LGPLv3.
31
// Significant performance optimisations.
32
//
33 55 sybreon
// Revision 1.6  2007/11/09 20:51:52  sybreon
34
// Added GET/PUT support through a FSL bus.
35
//
36 53 sybreon
// Revision 1.5  2007/11/08 17:48:14  sybreon
37
// Fixed data WISHBONE arbitration problem (reported by J Lee).
38
//
39 51 sybreon
// Revision 1.4  2007/11/08 14:17:47  sybreon
40
// Parameterised optional components.
41
//
42 50 sybreon
// Revision 1.3  2007/11/03 08:34:55  sybreon
43
// Minor code cleanup.
44
//
45 45 sybreon
// Revision 1.2  2007/11/02 19:20:58  sybreon
46
// Added better (beta) interrupt support.
47
// Changed MSR_IE to disabled at reset as per MB docs.
48
//
49 44 sybreon
// Revision 1.1  2007/11/02 03:25:40  sybreon
50
// New EDK 3.2 compatible design with optional barrel-shifter and multiplier.
51
// Fixed various minor data hazard bugs.
52
// Code compatible with -O0/1/2/3/s generated code.
53
//
54 41 sybreon
 
55
module aeMB_edk32 (/*AUTOARG*/
56
   // Outputs
57 66 sybreon
   iwb_stb_o, iwb_adr_o, fsl_wre_o, fsl_tag_o, fsl_stb_o, fsl_dat_o,
58
   fsl_adr_o, dwb_wre_o, dwb_stb_o, dwb_sel_o, dwb_dat_o, dwb_adr_o,
59 41 sybreon
   // Inputs
60 61 sybreon
   sys_int_i, iwb_dat_i, iwb_ack_i, fsl_dat_i, fsl_ack_i, dwb_dat_i,
61
   dwb_ack_i, sys_clk_i, sys_rst_i
62 41 sybreon
   );
63 50 sybreon
   // Bus widths
64
   parameter IW = 32; /// Instruction bus address width
65
   parameter DW = 32; /// Data bus address width
66 41 sybreon
 
67 50 sybreon
   // Optional functions
68
   parameter MUL = 1; // Multiplier
69
   parameter BSF = 1; // Barrel Shifter
70 41 sybreon
 
71
   /*AUTOOUTPUT*/
72
   // Beginning of automatic outputs (from unused autoinst outputs)
73
   output [DW-1:2]      dwb_adr_o;              // From xecu of aeMB_xecu.v
74
   output [31:0] dwb_dat_o;              // From regf of aeMB_regf.v
75
   output [3:0]          dwb_sel_o;              // From xecu of aeMB_xecu.v
76
   output               dwb_stb_o;              // From ctrl of aeMB_ctrl.v
77
   output               dwb_wre_o;              // From ctrl of aeMB_ctrl.v
78 66 sybreon
   output [6:2]         fsl_adr_o;              // From xecu of aeMB_xecu.v
79 53 sybreon
   output [31:0] fsl_dat_o;              // From regf of aeMB_regf.v
80
   output               fsl_stb_o;              // From ctrl of aeMB_ctrl.v
81 66 sybreon
   output [1:0]          fsl_tag_o;              // From xecu of aeMB_xecu.v
82 53 sybreon
   output               fsl_wre_o;              // From ctrl of aeMB_ctrl.v
83 41 sybreon
   output [IW-1:2]      iwb_adr_o;              // From bpcu of aeMB_bpcu.v
84
   output               iwb_stb_o;              // From ibuf of aeMB_ibuf.v
85
   // End of automatics
86
   /*AUTOINPUT*/
87
   // Beginning of automatic inputs (from unused autoinst inputs)
88 61 sybreon
   input                dwb_ack_i;              // To ctrl of aeMB_ctrl.v
89 41 sybreon
   input [31:0]          dwb_dat_i;              // To regf of aeMB_regf.v
90 61 sybreon
   input                fsl_ack_i;              // To ctrl of aeMB_ctrl.v
91 53 sybreon
   input [31:0]          fsl_dat_i;              // To regf of aeMB_regf.v
92 61 sybreon
   input                iwb_ack_i;              // To ibuf of aeMB_ibuf.v, ...
93
   input [31:0]          iwb_dat_i;              // To ibuf of aeMB_ibuf.v
94
   input                sys_int_i;              // To ibuf of aeMB_ibuf.v
95 41 sybreon
   // End of automatics
96
   /*AUTOWIRE*/
97
   // Beginning of automatic wires (for undeclared instantiated-module outputs)
98
   wire [10:0]           rALT;                   // From ibuf of aeMB_ibuf.v
99
   wire                 rBRA;                   // From bpcu of aeMB_bpcu.v
100
   wire                 rDLY;                   // From bpcu of aeMB_bpcu.v
101
   wire [31:0]           rDWBDI;                 // From regf of aeMB_regf.v
102
   wire [3:0]            rDWBSEL;                // From xecu of aeMB_xecu.v
103
   wire [15:0]           rIMM;                   // From ibuf of aeMB_ibuf.v
104 44 sybreon
   wire                 rMSR_BIP;               // From xecu of aeMB_xecu.v
105 41 sybreon
   wire                 rMSR_IE;                // From xecu of aeMB_xecu.v
106
   wire [1:0]            rMXALT;                 // From ctrl of aeMB_ctrl.v
107
   wire [2:0]            rMXALU;                 // From ctrl of aeMB_ctrl.v
108
   wire [1:0]            rMXDST;                 // From ctrl of aeMB_ctrl.v
109
   wire [1:0]            rMXSRC;                 // From ctrl of aeMB_ctrl.v
110
   wire [1:0]            rMXTGT;                 // From ctrl of aeMB_ctrl.v
111
   wire [5:0]            rOPC;                   // From ibuf of aeMB_ibuf.v
112
   wire [31:2]          rPC;                    // From bpcu of aeMB_bpcu.v
113
   wire [31:2]          rPCLNK;                 // From bpcu of aeMB_bpcu.v
114
   wire [4:0]            rRA;                    // From ibuf of aeMB_ibuf.v
115
   wire [4:0]            rRB;                    // From ibuf of aeMB_ibuf.v
116
   wire [4:0]            rRD;                    // From ibuf of aeMB_ibuf.v
117
   wire [31:0]           rREGA;                  // From regf of aeMB_regf.v
118
   wire [31:0]           rREGB;                  // From regf of aeMB_regf.v
119
   wire [31:0]           rRESULT;                // From xecu of aeMB_xecu.v
120
   wire [4:0]            rRW;                    // From ctrl of aeMB_ctrl.v
121
   wire [31:0]           rSIMM;                  // From ibuf of aeMB_ibuf.v
122 61 sybreon
   wire [31:0]           xIREG;                  // From ibuf of aeMB_ibuf.v
123 41 sybreon
   // End of automatics
124 61 sybreon
 
125
   input                sys_clk_i;
126
   input                sys_rst_i;
127
 
128
   wire                 grst = sys_rst_i;
129
   wire                 gclk = sys_clk_i;
130
   wire                 gena = !((dwb_stb_o ^ dwb_ack_i) | (fsl_stb_o ^ fsl_ack_i) | !iwb_ack_i);
131 50 sybreon
 
132 41 sybreon
   aeMB_ibuf
133
     ibuf (/*AUTOINST*/
134
           // Outputs
135
           .rIMM                        (rIMM[15:0]),
136
           .rRA                         (rRA[4:0]),
137
           .rRD                         (rRD[4:0]),
138
           .rRB                         (rRB[4:0]),
139
           .rALT                        (rALT[10:0]),
140
           .rOPC                        (rOPC[5:0]),
141
           .rSIMM                       (rSIMM[31:0]),
142 61 sybreon
           .xIREG                       (xIREG[31:0]),
143 41 sybreon
           .iwb_stb_o                   (iwb_stb_o),
144
           // Inputs
145
           .rBRA                        (rBRA),
146 61 sybreon
           .rMSR_IE                     (rMSR_IE),
147
           .rMSR_BIP                    (rMSR_BIP),
148 41 sybreon
           .iwb_dat_i                   (iwb_dat_i[31:0]),
149
           .iwb_ack_i                   (iwb_ack_i),
150 61 sybreon
           .sys_int_i                   (sys_int_i),
151 41 sybreon
           .gclk                        (gclk),
152
           .grst                        (grst),
153
           .gena                        (gena));
154
 
155
   aeMB_ctrl
156
     ctrl (/*AUTOINST*/
157
           // Outputs
158
           .rMXDST                      (rMXDST[1:0]),
159
           .rMXSRC                      (rMXSRC[1:0]),
160
           .rMXTGT                      (rMXTGT[1:0]),
161
           .rMXALT                      (rMXALT[1:0]),
162
           .rMXALU                      (rMXALU[2:0]),
163
           .rRW                         (rRW[4:0]),
164
           .dwb_stb_o                   (dwb_stb_o),
165
           .dwb_wre_o                   (dwb_wre_o),
166 53 sybreon
           .fsl_stb_o                   (fsl_stb_o),
167
           .fsl_wre_o                   (fsl_wre_o),
168 41 sybreon
           // Inputs
169
           .rDLY                        (rDLY),
170
           .rIMM                        (rIMM[15:0]),
171
           .rALT                        (rALT[10:0]),
172
           .rOPC                        (rOPC[5:0]),
173
           .rRD                         (rRD[4:0]),
174
           .rRA                         (rRA[4:0]),
175
           .rRB                         (rRB[4:0]),
176
           .rPC                         (rPC[31:2]),
177
           .rBRA                        (rBRA),
178
           .rMSR_IE                     (rMSR_IE),
179 61 sybreon
           .xIREG                       (xIREG[31:0]),
180 50 sybreon
           .dwb_ack_i                   (dwb_ack_i),
181 51 sybreon
           .iwb_ack_i                   (iwb_ack_i),
182 53 sybreon
           .fsl_ack_i                   (fsl_ack_i),
183 41 sybreon
           .gclk                        (gclk),
184
           .grst                        (grst),
185 44 sybreon
           .gena                        (gena));
186 41 sybreon
 
187
   aeMB_bpcu #(IW)
188
     bpcu (/*AUTOINST*/
189
           // Outputs
190
           .iwb_adr_o                   (iwb_adr_o[IW-1:2]),
191
           .rPC                         (rPC[31:2]),
192
           .rPCLNK                      (rPCLNK[31:2]),
193
           .rBRA                        (rBRA),
194
           .rDLY                        (rDLY),
195
           // Inputs
196
           .rMXALT                      (rMXALT[1:0]),
197
           .rOPC                        (rOPC[5:0]),
198
           .rRD                         (rRD[4:0]),
199
           .rRA                         (rRA[4:0]),
200
           .rRESULT                     (rRESULT[31:0]),
201
           .rDWBDI                      (rDWBDI[31:0]),
202
           .rREGA                       (rREGA[31:0]),
203
           .gclk                        (gclk),
204
           .grst                        (grst),
205
           .gena                        (gena));
206
 
207
   aeMB_regf
208
     regf (/*AUTOINST*/
209
           // Outputs
210
           .rREGA                       (rREGA[31:0]),
211
           .rREGB                       (rREGB[31:0]),
212
           .rDWBDI                      (rDWBDI[31:0]),
213
           .dwb_dat_o                   (dwb_dat_o[31:0]),
214 53 sybreon
           .fsl_dat_o                   (fsl_dat_o[31:0]),
215 41 sybreon
           // Inputs
216
           .rOPC                        (rOPC[5:0]),
217
           .rRA                         (rRA[4:0]),
218
           .rRB                         (rRB[4:0]),
219
           .rRW                         (rRW[4:0]),
220
           .rRD                         (rRD[4:0]),
221
           .rMXDST                      (rMXDST[1:0]),
222
           .rPCLNK                      (rPCLNK[31:2]),
223
           .rRESULT                     (rRESULT[31:0]),
224
           .rDWBSEL                     (rDWBSEL[3:0]),
225
           .rBRA                        (rBRA),
226
           .rDLY                        (rDLY),
227
           .dwb_dat_i                   (dwb_dat_i[31:0]),
228 53 sybreon
           .fsl_dat_i                   (fsl_dat_i[31:0]),
229 41 sybreon
           .gclk                        (gclk),
230
           .grst                        (grst),
231
           .gena                        (gena));
232
 
233 50 sybreon
   aeMB_xecu #(DW, MUL, BSF)
234
     xecu (/*AUTOINST*/
235 41 sybreon
           // Outputs
236
           .dwb_adr_o                   (dwb_adr_o[DW-1:2]),
237
           .dwb_sel_o                   (dwb_sel_o[3:0]),
238 66 sybreon
           .fsl_adr_o                   (fsl_adr_o[6:2]),
239
           .fsl_tag_o                   (fsl_tag_o[1:0]),
240 41 sybreon
           .rRESULT                     (rRESULT[31:0]),
241
           .rDWBSEL                     (rDWBSEL[3:0]),
242
           .rMSR_IE                     (rMSR_IE),
243 44 sybreon
           .rMSR_BIP                    (rMSR_BIP),
244 41 sybreon
           // Inputs
245
           .rREGA                       (rREGA[31:0]),
246
           .rREGB                       (rREGB[31:0]),
247
           .rMXSRC                      (rMXSRC[1:0]),
248
           .rMXTGT                      (rMXTGT[1:0]),
249
           .rRA                         (rRA[4:0]),
250 53 sybreon
           .rRB                         (rRB[4:0]),
251 41 sybreon
           .rMXALU                      (rMXALU[2:0]),
252
           .rBRA                        (rBRA),
253
           .rDLY                        (rDLY),
254 50 sybreon
           .rALT                        (rALT[10:0]),
255 41 sybreon
           .rSIMM                       (rSIMM[31:0]),
256
           .rIMM                        (rIMM[15:0]),
257
           .rOPC                        (rOPC[5:0]),
258
           .rRD                         (rRD[4:0]),
259
           .rDWBDI                      (rDWBDI[31:0]),
260
           .rPC                         (rPC[31:2]),
261
           .gclk                        (gclk),
262
           .grst                        (grst),
263
           .gena                        (gena));
264
 
265
 
266
endmodule // aeMB_edk32

powered by: WebSVN 2.1.0

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