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

Subversion Repositories m32632

[/] [m32632/] [trunk/] [rtl/] [DATENPFAD.v] - Blame information for rev 49

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

Line No. Rev Author Line
1 29 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 9 ns32kum
//
3
// This file is part of the M32632 project
4
// http://opencores.org/project,m32632
5
//
6 23 ns32kum
//      Filename:       DATENPFAD.v
7 48 ns32kum
//      Project:        M32632
8
//  Version:    3.1 bug fix of 25 February 2019 
9
//      History:        3.0 Cache Interface reworked
10
//                              2.1 bug fix of 26 November 2016
11 29 ns32kum
//                              1.1 bug fix of 7 October 2015
12 23 ns32kum
//                              1.0 first release of 30 Mai 2015
13 48 ns32kum
//      Author:         Udo Moeller
14
//      Date:           8 July 2017
15 9 ns32kum
//
16 48 ns32kum
// Copyright (C) 2019 Udo Moeller
17 9 ns32kum
// 
18
// This source file may be used and distributed without 
19
// restriction provided that this copyright statement is not 
20
// removed from the file and that any derivative work contains 
21
// the original copyright notice and the associated disclaimer.
22
// 
23
// This source file is free software; you can redistribute it 
24
// and/or modify it under the terms of the GNU Lesser General 
25
// Public License as published by the Free Software Foundation;
26
// either version 2.1 of the License, or (at your option) any 
27
// later version. 
28
// 
29
// This source is distributed in the hope that it will be 
30
// useful, but WITHOUT ANY WARRANTY; without even the implied 
31
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
32
// PURPOSE. See the GNU Lesser General Public License for more 
33
// details. 
34
// 
35
// You should have received a copy of the GNU Lesser General 
36
// Public License along with this source; if not, download it 
37
// from http://www.opencores.org/lgpl.shtml 
38
// 
39 29 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
40 9 ns32kum
//
41
//      Modules contained in this file:
42
//      DATENPFAD       the data path of M32632
43
//
44 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
45 9 ns32kum
 
46 11 ns32kum
module DATENPFAD( BCLK, BRESET, WREN, IO_READY, LD_DIN, LD_IMME, WR_REG, IC_USER, ACC_FELD, ACC_STAT, DIN, DISP, IC_TEX,
47
                                  IMME_Q, INFO_AU, LD_OUT, DETOIP, MMU_UPDATE, OPER, PC_ARCHI, PC_ICACHE, RDAA, RDAB, START, WMASKE,
48 29 ns32kum
                                  WRADR, DONE, Y_INIT, WRITE_OUT, READ_OUT, ZTEST, RMW, QWATWO, ACC_DONE, CTRL_QW, PTB_SEL, PTB_WR, ACB_ZERO,
49 48 ns32kum
                                  ABORT, SAVE_PC, CFG, CINV, DP_Q, IVAR, IVAR_MUX, MCR, PACKET, PC_NEW, PSR, SIZE, STRING, TRAPS, VADR, RWVFLAG,
50 9 ns32kum
                                  DBG_HIT, DBG_IN, COP_GO, COP_OP, COP_IN, COP_DONE, COP_OUT);
51
 
52
input                   BCLK;
53
input                   BRESET;
54
input                   WREN;           // write enable of the register file
55
input                   IO_READY;
56
input                   LD_DIN;
57
input                   LD_IMME;
58
input                   WR_REG;         // write signal for the DP_FPU
59
input                   IC_USER;
60
input                   RWVFLAG;
61
input   [14:0]   ACC_FELD;
62
input    [5:0]   ACC_STAT;
63
input   [31:0]   DIN;
64
input   [31:0]   DISP;
65
input    [2:0]   IC_TEX;
66
input   [31:0]   IMME_Q;
67
input    [6:0]   INFO_AU;
68
input    [1:0]   LD_OUT;
69
input   [12:0]   DETOIP;
70
input    [1:0]   MMU_UPDATE;
71
input   [10:0]   OPER;
72
input   [31:0]   PC_ARCHI;
73
input   [31:0]   PC_ICACHE;
74
input    [7:0]   RDAA;
75
input    [7:0]   RDAB;
76
input    [1:0]   START;
77
input    [1:0]   WMASKE;
78
input    [5:0]   WRADR;
79
input                   DBG_HIT;
80
input                   COP_DONE;
81
input   [23:0]   COP_OP;
82
input   [63:0]   COP_IN;
83
 
84
output                  DONE;
85
output                  Y_INIT;
86
output                  WRITE_OUT;
87
output                  READ_OUT;
88
output                  ZTEST;
89
output                  RMW;
90 12 ns32kum
output                  QWATWO;
91 9 ns32kum
output                  ACC_DONE;
92 29 ns32kum
output   [1:0]   CTRL_QW;
93 9 ns32kum
output                  PTB_SEL;
94
output                  PTB_WR;
95
output reg              ACB_ZERO;
96
output                  ABORT;
97
output                  SAVE_PC;
98
output  [12:0]   CFG;
99
output   [3:0]   CINV;
100
output  [63:0]   DP_Q;
101
output   [1:0]   IVAR;
102 48 ns32kum
output                  IVAR_MUX;
103 9 ns32kum
output   [3:0]   MCR;
104
output   [3:0]   PACKET;
105
output  [31:0]   PC_NEW;
106
output  [11:0]   PSR;
107
output   [1:0]   SIZE;
108
output   [4:0]   STRING;
109
output   [5:0]   TRAPS;
110
output  [31:0]   VADR;
111
output  [40:2]  DBG_IN;
112
output                  COP_GO;
113
output [127:0]   COP_OUT;
114
 
115
reg     [31:0]   high_dq;
116 23 ns32kum
reg             [31:0]   IMMREG,MEMREG;
117 9 ns32kum
reg             [31:0]   BYDIN;          // the bypass register
118 23 ns32kum
reg                             LDIMR;
119 9 ns32kum
 
120
wire     [2:0]   BITSEL;
121
wire     [1:0]   BWD;
122
wire                    CLR_LSB;
123
wire    [31:0]   ERGEBNIS;       // the result bus
124
wire                    FL;
125
wire    [31:0]   FSR;
126 29 ns32kum
wire    [32:0]   MRESULT;
127 9 ns32kum
wire     [7:0]   OPCODE;
128
wire                    SELI_A;
129
wire                    SELI_B;
130
wire     [2:0]   SP_CMP;
131
wire    [31:0]   SRC1;           // the bus for the Source 1 operand
132
wire    [31:0]   SRC2;           // the bus for the Source 2 operand
133 23 ns32kum
wire    [31:0]   OUT_I;
134 9 ns32kum
wire     [4:0]   TT_DP;
135
wire                    TWREN;          // active if FPU Trap occurs
136
wire                    UP_DP;
137
wire                    WRADR_0;
138
wire                    WREN_L,WREN_LX;
139
wire                    LD_FSR;
140
wire                    UP_SP;
141
wire     [4:0]   TT_SP;
142
wire    [31:0]   addr_i;
143
wire     [2:0]   DP_CMP;
144
wire    [31:0]   DP_OUT;
145
wire    [31:0]   SFP_DAT;
146
wire     [6:0]   BMCODE;
147
wire    [31:0]   OUT_A,OUT_B;
148
wire                    SP_MUX;
149
wire    [31:0]   I_OUT;
150
wire    [31:0]   FP_OUT;
151
wire                    DOWR;
152
wire                    ENWR;
153
wire     [3:0]   OVF_BCD;
154
wire     [3:0]   DSR;
155
wire                    acb_zero_i;
156
wire    [31:0]   BMASKE;
157
 
158
assign  FL         = OPER[10];
159
assign  BWD        = OPER[9:8];
160
assign  OPCODE = OPER[7:0];
161
 
162
assign  ERGEBNIS = SP_MUX ? FP_OUT : I_OUT;
163
 
164 23 ns32kum
assign  WRADR_0 = WRADR[0] ^ CLR_LSB;
165 9 ns32kum
assign  ENWR = WREN_L | WREN;
166
assign  DOWR = ENWR & TWREN;
167
 
168
assign  WREN_L = WREN_LX & ~TRAPS[0];
169
 
170
assign  DP_Q[63:32] = high_dq;
171
 
172
assign  PC_NEW = SRC1;
173
 
174
always @(posedge BCLK) if (LD_OUT[1] || WREN)    ACB_ZERO <= acb_zero_i;
175
 
176 23 ns32kum
always @(posedge BCLK) if (LD_OUT[1]) high_dq <= ERGEBNIS;
177 9 ns32kum
 
178 23 ns32kum
always @(posedge BCLK)
179
        if (LD_DIN)
180
                begin
181
                        IMMREG <= IMME_Q;
182
                        MEMREG <= DIN;
183
                        LDIMR  <= LD_IMME;
184
                end
185
 
186
assign OUT_I = LDIMR ? IMMREG : MEMREG; // old solution had the multiplexor before the register
187 9 ns32kum
 
188
always @(posedge BCLK) if (RDAA[7]) BYDIN <= ERGEBNIS;
189
 
190 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
191 9 ns32kum
// Register Set 1 => SRC1
192 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
193 9 ns32kum
REGISTER        REG_SET_A(
194
        .BCLK(BCLK),
195
        .ENWR(ENWR),
196
        .DOWR(DOWR),
197
        .DIN(ERGEBNIS),
198
        .BYDIN(BYDIN),
199
        .RADR(RDAA),
200
        .WADR({WRADR[5:1],WRADR_0}),
201
        .WMASKE(WMASKE),
202
        .SELI(SELI_A),
203
        .DOUT(OUT_A));
204
 
205
assign SRC1 = SELI_A ? OUT_I : OUT_A;
206
 
207 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
208 9 ns32kum
// Register Set 2 => SRC2
209 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
210 9 ns32kum
REGISTER        REG_SET_B(
211
        .BCLK(BCLK),
212
        .ENWR(ENWR),
213
        .DOWR(DOWR),
214
        .DIN(ERGEBNIS),
215
        .BYDIN(BYDIN),
216
        .RADR(RDAB),
217
        .WADR({WRADR[5:1],WRADR_0}),
218
        .WMASKE(WMASKE),
219
        .SELI(SELI_B),
220
        .DOUT(OUT_B));
221
 
222
assign SRC2 = SELI_B ? OUT_I : OUT_B;
223
 
224 29 ns32kum
MULFILTER       M_FILTER(               // signed multiplier 32 * 32 bits = 64 bits
225 9 ns32kum
        .BWD(BWD),
226
        .SRC1(SRC1),
227
        .SRC2(SRC2),
228 29 ns32kum
        .MRESULT(MRESULT));
229 9 ns32kum
 
230
BITMASK  BITM_U(
231
        .AA(BMCODE),
232
        .DOUT(BMASKE));
233
 
234 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
235 9 ns32kum
// The integer data path
236 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
237 9 ns32kum
I_PFAD  GANZ_U(
238
        .FL(FL),
239
        .BRESET(BRESET),
240
        .BCLK(BCLK),
241
        .WREN(WREN),
242
        .LD_OUT(LD_OUT[1]),
243
        .ADDR(addr_i),
244
        .BITSEL(BITSEL),
245
        .BMASKE(BMASKE),
246
        .BWD(BWD),
247
        .DP_CMP(DP_CMP),
248
        .DP_OUT(DP_OUT),
249
        .FSR(FSR),
250
        .DETOIP(DETOIP[11:0]),
251
        .MRESULT(MRESULT),
252
        .OPCODE(OPCODE),
253
        .RDAA(RDAA),
254
        .SFP_DAT(SFP_DAT),
255
        .SP_CMP(SP_CMP),
256
        .SRC1(SRC1),
257
        .SRC2(SRC2),
258
        .WRADR(WRADR),
259
        .DSR(DSR),
260
        .OV_FLAG(TRAPS[2]),
261
        .ACB_ZERO(acb_zero_i),
262
        .BMCODE(BMCODE),
263
        .I_OUT(I_OUT),
264
        .PSR(PSR),
265
        .STRING(STRING),
266
        .OVF_BCD(OVF_BCD),
267
        .DISP(DISP[4:0]),
268
        .RWVFLAG(RWVFLAG));
269
 
270 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
271 9 ns32kum
// The address unit
272 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
273 9 ns32kum
ADDR_UNIT       ADDR_U(
274
        .BCLK(BCLK),
275
        .BRESET(BRESET),
276
        .IO_READY(IO_READY),
277
        .READ(ACC_FELD[11]),
278
        .WRITE(ACC_FELD[10]),
279
        .CLRMSW(ACC_FELD[2]),
280
        .FULLACC(ACC_FELD[8]),
281
        .POST(ACC_FELD[3]),
282
        .DISP_OK(INFO_AU[0]),
283
        .LDEA(ACC_FELD[9]),
284
        .NEWACC(ACC_FELD[14]),
285
        .FPU_TRAP(TRAPS[0]),
286
        .ADIVAR(INFO_AU[2]),
287
        .RWVAL_1(INFO_AU[3]),
288
        .ABO_STAT({INFO_AU[1],IC_USER}),
289
        .ACC_STAT(ACC_STAT),
290
        .ASIZE(ACC_FELD[13:12]),
291
        .BWD(BWD),
292
        .DISP(DISP),
293
        .IC_TEX(IC_TEX),
294
        .INDEX(ACC_FELD[7:4]),
295
        .MMU_UPDATE(MMU_UPDATE),
296
        .PC_ARCHI(PC_ARCHI),
297
        .PC_ICACHE(PC_ICACHE),
298
        .SRC1(SRC1),
299
        .SRC2(SRC2),
300
        .SRC2SEL(ACC_FELD[1:0]),
301 29 ns32kum
        .CTRL_QW(CTRL_QW),
302 9 ns32kum
        .ACC_DONE(ACC_DONE),
303
        .READ_OUT(READ_OUT),
304
        .WRITE_OUT(WRITE_OUT),
305
        .ABORT(ABORT),
306
        .ADDR(addr_i),
307
        .BITSEL(BITSEL),
308
        .PACKET(PACKET),
309
        .SIZE(SIZE),
310
        .VADR(VADR),
311
        .ZTEST(ZTEST),
312
        .RMW(RMW),
313 12 ns32kum
        .QWATWO(QWATWO),
314 9 ns32kum
        .OP_RMW(INFO_AU[4]),
315
        .PHASE_17(INFO_AU[5]),
316
        .NO_TRAP(INFO_AU[6]) );
317
 
318
CONFIG_REGS     CFG_DBG(
319
        .BCLK(BCLK),
320
        .BRESET(BRESET),
321
        .WREN(WREN),
322
        .LD_OUT(LD_OUT[1]),
323
        .OPCODE(OPCODE),
324
        .SRC1(SRC1),
325
        .WRADR(WRADR),
326
        .PTB_WR(PTB_WR),
327
        .PTB_SEL(PTB_SEL),
328
        .CFG(CFG),
329
        .CINV(CINV),
330
        .IVAR(IVAR),
331 48 ns32kum
        .IVAR_MUX(IVAR_MUX),
332 9 ns32kum
        .Y_INIT(Y_INIT),
333
        .MCR(MCR),
334
        .DBG_TRAPS(TRAPS[5:3]),
335
        .PC_ARCHI(PC_ARCHI),
336
        .DSR(DSR),
337
        .USER(PSR[8]),
338
        .PCMATCH(DETOIP[12]),
339
        .DBG_IN(DBG_IN),
340
        .DBG_HIT(DBG_HIT),
341
        .READ(READ_OUT) );
342
 
343 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
344 9 ns32kum
// The long operation unit
345 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
346 9 ns32kum
DP_FPU  DOUBLE_U(
347
        .BCLK(BCLK),
348
        .FL(FL),
349
        .BRESET(BRESET),
350 23 ns32kum
        .LD_OUT(LD_OUT),
351 9 ns32kum
        .WR_REG(WR_REG),
352
        .BWD(BWD),
353
        .FSR(FSR[8:3]),
354
        .OPCODE(OPCODE),
355
        .SRC1(SRC1),
356
        .SRC2(SRC2),
357
        .START(START),
358
        .DONE(DONE),
359
        .UP_DP(UP_DP),
360
        .WREN_L(WREN_LX),
361
        .CLR_LSB(CLR_LSB),
362
        .DVZ_TRAP(TRAPS[1]),
363
        .DP_CMP(DP_CMP),
364
        .DP_OUT(DP_OUT),
365
        .DP_Q(DP_Q[31:0]),
366
        .TT_DP(TT_DP),
367
        .CY_IN(PSR[0]),
368
        .OVF_BCD(OVF_BCD),
369
        .COP_DONE(COP_DONE),
370
        .COP_OP(COP_OP),
371
        .COP_IN(COP_IN),
372
        .COP_GO(COP_GO),
373
        .COP_OUT(COP_OUT));
374
 
375 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
376 9 ns32kum
// The single precision floating point unit
377 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
378 9 ns32kum
SP_FPU  SINGLE_U(
379
        .FL(FL),
380
        .BCLK(BCLK),
381
        .BWD(BWD),
382
        .FSR(FSR[8:3]),
383
        .OPCODE(OPCODE),
384
        .SRC1(SRC1),
385
        .SRC2(SRC2),
386
        .LD_FSR(LD_FSR),
387
        .SP_MUX(SP_MUX),
388
        .UP_SP(UP_SP),
389
        .FP_OUT(FP_OUT),
390
        .I_OUT(SFP_DAT),
391
        .SP_CMP(SP_CMP),
392 23 ns32kum
        .TT_SP(TT_SP),
393 29 ns32kum
        .START(START[1]) );             // Aenderung
394 9 ns32kum
 
395
FP_STAT_REG     FPS_REG(
396
        .BCLK(BCLK),
397
        .BRESET(BRESET),
398
        .LFSR(LD_FSR),
399
        .WREN(ENWR),
400
        .WRADR(WRADR[5:4]),
401
        .UP_DP(UP_DP),
402 29 ns32kum
        .UP_SP(UP_SP),          // & LD_OUT[1]), Aenderung
403 9 ns32kum
        .DIN(SRC1[16:0]),
404
        .TT_DP(TT_DP),
405
        .TT_SP(TT_SP),
406
        .FPU_TRAP(TRAPS[0]),
407
        .TWREN(TWREN),
408
        .SAVE_PC(SAVE_PC),
409
        .FSR(FSR));
410
 
411
endmodule

powered by: WebSVN 2.1.0

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