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

Subversion Repositories m32632

[/] [m32632/] [trunk/] [rtl/] [M32632.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:       M32632.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
//                              2.0 50 MHz release of 14 August 2016
12
//                              1.1 bug fix of 7 October 2015
13 23 ns32kum
//                              1.0 first release of 30 Mai 2015
14 48 ns32kum
//      Author:         Udo Moeller
15
//      Date:           8 July 2017
16 9 ns32kum
//
17 48 ns32kum
// Copyright (C) 2019 Udo Moeller
18 9 ns32kum
// 
19
// This source file may be used and distributed without 
20
// restriction provided that this copyright statement is not 
21
// removed from the file and that any derivative work contains 
22
// the original copyright notice and the associated disclaimer.
23
// 
24
// This source file is free software; you can redistribute it 
25
// and/or modify it under the terms of the GNU Lesser General 
26
// Public License as published by the Free Software Foundation;
27
// either version 2.1 of the License, or (at your option) any 
28
// later version. 
29
// 
30
// This source is distributed in the hope that it will be 
31
// useful, but WITHOUT ANY WARRANTY; without even the implied 
32
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
33
// PURPOSE. See the GNU Lesser General Public License for more 
34
// details. 
35
// 
36
// You should have received a copy of the GNU Lesser General 
37
// Public License along with this source; if not, download it 
38
// from http://www.opencores.org/lgpl.shtml 
39
// 
40 29 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41 9 ns32kum
//
42
//      Modules contained in this file:
43
//      M32632          The top level of M32632
44
//
45 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
46 9 ns32kum
 
47 29 ns32kum
module M32632( BCLK, DRAMSZ, BRESET, NMI_N, INT_N, STATUS, ILO, STATSIGS,
48 9 ns32kum
                           IO_WR, IO_RD, IO_A, IO_BE, IO_DI, IO_Q, IO_READY,
49 29 ns32kum
                           ENDRAM, IC_MDONE, DC_MDONE, ENWR, DRAM_Q, DC_INHIBIT, IC_INHIBIT,
50 9 ns32kum
                           IC_ACC, IDRAM_ADR, DC_ACC, DC_WR, DRAM_ADR, DRAM_DI,
51 23 ns32kum
                           HOLD, HLDA, DMA_CHK, DMA_AA,
52 9 ns32kum
                           COP_GO, COP_OP, COP_OUT, COP_DONE, COP_IN );
53
 
54
// ++++++++++ Basic Signals
55
input                   BCLK;   // Basic Clock for everything
56 23 ns32kum
input    [2:0]   DRAMSZ;
57 9 ns32kum
input                   BRESET;
58
input                   NMI_N;
59
input                   INT_N;
60
output   [3:0]   STATUS;
61
output                  ILO;
62
output   [7:0]   STATSIGS;
63
// +++++++++ General Purpose Interface
64
output                  IO_WR;
65
output                  IO_RD;
66
output  [31:0]   IO_A;
67
output   [3:0]   IO_BE;
68
output  [31:0]   IO_DI;
69
input   [31:0]   IO_Q;
70
input                   IO_READY;
71
// +++++++++ DRAM Interface In
72
input                   ENDRAM;
73
input                   IC_MDONE;
74
input                   DC_MDONE;
75
input                   ENWR;
76 29 ns32kum
input  [127:0]   DRAM_Q;
77
input                   DC_INHIBIT;
78
input                   IC_INHIBIT;
79 9 ns32kum
// +++++++++ DRAM Interface Out
80
output                  IC_ACC;
81 29 ns32kum
output  [28:0]   IDRAM_ADR;
82 9 ns32kum
output                  DC_ACC;
83
output                  DC_WR;
84 29 ns32kum
output  [28:0]   DRAM_ADR;
85 9 ns32kum
output  [35:0]   DRAM_DI;
86
// ++++++++++ DMA Interface
87
input                   HOLD;
88
output                  HLDA;
89 23 ns32kum
input                   DMA_CHK;
90 29 ns32kum
input   [28:4]  DMA_AA;
91 9 ns32kum
// ++++++++++ Coprocessor Interface
92
output                  COP_GO;
93
output  [23:0]   COP_OP;
94
output [127:0]   COP_OUT;
95
input                   COP_DONE;
96
input   [63:0]   COP_IN;
97
 
98
wire                    ACC_DONE;
99
wire     [5:0]   ACC_STAT;
100
wire    [12:0]   CFG;
101
wire     [3:0]   CINV;
102
wire                    DATA_HOLD;
103
wire                    DC_INIT;
104
wire                    Y_INIT;
105
wire                    DONE;
106
wire    [63:0]   DP_Q;
107
wire     [3:0]   IACC_STAT;
108
wire                    PROT_ERROR;
109
wire     [2:0]   GENSTAT;
110
wire                    IC_INIT;
111
wire                    IC_PREQ;
112
wire                    IC_READ;
113
wire     [1:0]   IC_SIGS;
114
wire                    IC_USER;
115
wire   [31:12]  IC_VA;
116
wire     [3:0]   ICTODC;
117
wire     [6:0]   INFO_AU;
118
wire     [1:0]   IVAR;
119 48 ns32kum
wire                    IVAR_MUX;
120 9 ns32kum
wire                    KDET;
121 29 ns32kum
wire    [28:4]  KOLLI_A;
122 9 ns32kum
wire     [3:0]   MCR;
123
wire    [23:0]   MMU_DIN;
124
wire    [11:0]   PSR;
125
wire                    PTB_SEL;
126
wire                    PTB_WR;
127
wire                    READ;
128
wire                    WRITE;
129
wire                    ZTEST;
130
wire                    RMW;
131 12 ns32kum
wire                    QWATWO;
132 9 ns32kum
wire     [2:0]   RWVAL;
133
wire                    RWVFLAG;
134
wire     [3:0]   D_IOBE;
135
wire                    D_IORDY;
136 29 ns32kum
wire     [1:0]   CTRL_QW;
137 9 ns32kum
wire     [3:0]   PACKET;
138
wire     [1:0]   SIZE;
139
wire    [31:0]   VADR;
140
wire                    WREN_REG;
141
wire                    LD_DIN;
142
wire                    LD_IMME;
143
wire                    WR_REG;
144
wire    [14:0]   ACC_FELD;
145
wire    [31:0]   DIN;
146
wire    [31:0]   DISP;
147
wire     [2:0]   IC_TEX;
148
wire    [31:0]   IMME_Q;
149
wire     [1:0]   LD_OUT;
150
wire    [12:0]   DETOIP;
151
wire     [1:0]   MMU_UPDATE;
152
wire    [10:0]   OPER;
153
wire    [31:0]   PC_ARCHI;
154
wire    [31:0]   PC_ICACHE;
155
wire     [7:0]   RDAA;
156
wire     [7:0]   RDAB;
157
wire     [1:0]   START;
158
wire     [1:0]   WMASKE;
159
wire     [5:0]   WRADR;
160
wire                    I_IORDY;
161
wire                    ACB_ZERO;
162
wire                    DC_ABORT;
163
wire                    SAVE_PC;
164
wire    [31:0]   IC_DIN;
165
wire    [31:0]   PC_NEW;
166
wire     [4:0]   STRING;
167
wire     [5:0]   TRAPS;
168
wire                    I_IORD;
169
wire                    D_IOWR;
170
wire                    D_IORD;
171
wire    [31:0]   D_IOA;
172
wire    [31:0]   I_IOA;
173
wire                    ENA_HK;
174
wire                    STOP_CINV;
175
wire                    KOLLISION;
176
wire                    ILO_SIG;
177
wire     [1:0]   PTE_STAT;
178
wire                    DBG_HIT;
179
wire    [40:2]  DBG_IN;
180
 
181 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
182 9 ns32kum
//            The Data Cache
183 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
184 9 ns32kum
DCACHE  ARMS(
185
        .BCLK(BCLK),
186 23 ns32kum
        .DRAMSZ(DRAMSZ),
187 9 ns32kum
        .BRESET(BRESET),
188
        .PTB_WR(PTB_WR),
189
        .PTB_SEL(PTB_SEL),
190
        .MDONE(DC_MDONE),
191
        .IO_READY(D_IORDY),
192 29 ns32kum
        .CTRL_QW(CTRL_QW),
193 9 ns32kum
        .PSR_USER(INFO_AU[1]),
194
        .WRITE(WRITE),
195
        .READ(READ),
196
        .ZTEST(ZTEST),
197
        .RMW(RMW),
198 12 ns32kum
        .QWATWO(QWATWO),
199 9 ns32kum
        .ENWR(ENWR),
200
        .IC_PREQ(IC_PREQ),
201 23 ns32kum
        .DMA_CHK(DMA_CHK),
202 9 ns32kum
        .CFG(CFG[10:9]),
203
        .ENDRAM(ENDRAM),
204
        .CINVAL(CINV[1:0]),
205
        .DMA_AA(DMA_AA),
206
        .DP_Q(DP_Q),
207
        .DRAM_Q(DRAM_Q),
208
        .IC_VA(IC_VA),
209
        .ICTODC(ICTODC),
210
        .IO_Q(IO_Q),
211
        .IVAR(IVAR),
212
        .MCR_FLAGS(MCR),
213
        .PACKET(PACKET),
214
        .SIZE(SIZE),
215
        .VADR(VADR),
216 29 ns32kum
        .INHIBIT(DC_INHIBIT),
217 9 ns32kum
        .DRAM_ACC(DC_ACC),
218
        .DRAM_WR(DC_WR),
219
        .IO_RD(D_IORD),
220
        .IO_WR(D_IOWR),
221
        .INIT_RUN(DC_INIT),
222
        .KDET(KDET),
223
        .HLDA(HLDA),
224
        .ACC_STAT(ACC_STAT),
225
        .DP_DI(DIN),
226
        .DRAM_A(DRAM_ADR),
227
        .DRAM_DI(DRAM_DI),
228
        .IACC_STAT(IACC_STAT[3:1]),
229
        .IC_SIGS(IC_SIGS),
230
        .IO_A(D_IOA),
231
        .IO_BE(D_IOBE),
232
        .IO_DI(IO_DI),
233
        .PTE_STAT(PTE_STAT),
234
        .DBG_HIT(DBG_HIT),
235
        .DBG_IN(DBG_IN),
236
        .KOLLI_A(KOLLI_A),
237
        .MMU_DIN(MMU_DIN),
238
        .RWVAL(RWVAL),
239
        .RWVFLAG(RWVFLAG));
240
 
241 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
242 9 ns32kum
//            The Datapath
243 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
244 9 ns32kum
DATENPFAD       STOMACH(
245
        .WREN(WREN_REG),
246
        .BRESET(BRESET),
247
        .BCLK(BCLK),
248
        .IO_READY(D_IORDY),
249
        .LD_DIN(LD_DIN),
250
        .LD_IMME(LD_IMME),
251
        .WR_REG(WR_REG),
252
        .IC_USER(IC_USER),
253
        .ACC_FELD(ACC_FELD),
254
        .ACC_STAT(ACC_STAT),
255
        .DIN(DIN),
256
        .DISP(DISP),
257
        .IC_TEX(IC_TEX),
258
        .IMME_Q(IMME_Q),
259
        .INFO_AU(INFO_AU),
260
        .LD_OUT(LD_OUT),
261
        .DETOIP(DETOIP),
262
        .MMU_UPDATE(MMU_UPDATE),
263
        .OPER(OPER),
264
        .PC_ARCHI(PC_ARCHI),
265
        .PC_ICACHE(PC_ICACHE),
266
        .RDAA(RDAA),
267
        .RDAB(RDAB),
268
        .START(START),
269
        .WMASKE(WMASKE),
270
        .WRADR(WRADR),
271
        .READ_OUT(READ),
272
        .WRITE_OUT(WRITE),
273
        .ZTEST(ZTEST),
274
        .RMW(RMW),
275 12 ns32kum
        .QWATWO(QWATWO),
276 9 ns32kum
        .ACC_DONE(ACC_DONE),
277 29 ns32kum
        .CTRL_QW(CTRL_QW),
278 9 ns32kum
        .Y_INIT(Y_INIT),
279
        .DONE(DONE),
280
        .PTB_WR(PTB_WR),
281
        .PTB_SEL(PTB_SEL),
282
        .ACB_ZERO(ACB_ZERO),
283
        .ABORT(DC_ABORT),
284
        .SAVE_PC(SAVE_PC),
285
        .CFG(CFG),
286
        .CINV(CINV),
287
        .DP_Q(DP_Q),
288
        .IVAR(IVAR),
289 48 ns32kum
        .IVAR_MUX(IVAR_MUX),
290 9 ns32kum
        .MCR(MCR),
291
        .PACKET(PACKET),
292
        .PC_NEW(PC_NEW),
293
        .PSR(PSR),
294
        .SIZE(SIZE),
295
        .STRING(STRING),
296
        .TRAPS(TRAPS),
297
        .VADR(VADR),
298
        .RWVFLAG(RWVFLAG),
299
        .DBG_HIT(DBG_HIT),
300
        .DBG_IN(DBG_IN),
301
        .COP_DONE(COP_DONE),
302
        .COP_OP(COP_OP),
303
        .COP_IN(COP_IN),
304
        .COP_GO(COP_GO),
305
        .COP_OUT(COP_OUT));
306
 
307 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
308 9 ns32kum
//            The Instruction Cache
309 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
310 9 ns32kum
ICACHE  LEGS(
311
        .BCLK(BCLK),
312 23 ns32kum
        .DRAMSZ(DRAMSZ),
313 9 ns32kum
        .BRESET(BRESET),
314
        .PTB_WR(PTB_WR),
315
        .PTB_SEL(PTB_SEL),
316
        .MDONE(IC_MDONE),
317
        .IO_READY(I_IORDY),
318
        .READ_I(IC_READ),
319
        .PSR_USER(IC_USER),
320
        .DATA_HOLD(DATA_HOLD),
321
        .DRAM_WR(DC_WR),
322
        .KDET(KDET),
323
        .HOLD(HOLD),
324
        .CFG(CFG[12:11]),
325
        .ENDRAM(ENDRAM),
326
        .DRAM_Q(DRAM_Q),
327
        .CINVAL(CINV[3:2]),
328
        .IC_SIGS(IC_SIGS),
329
        .IO_Q(IO_Q),
330
        .IVAR(IVAR),
331 48 ns32kum
        .IVAR_MUX(IVAR_MUX),
332
        .VADR_D(VADR[31:12]),
333 9 ns32kum
        .KOLLI_A(KOLLI_A),
334
        .MCR_FLAGS(MCR),
335
        .MMU_DIN(MMU_DIN),
336 48 ns32kum
        .VADR_I(PC_ICACHE),
337 29 ns32kum
        .INHIBIT(IC_INHIBIT),
338 9 ns32kum
        .DRAM_ACC(IC_ACC),
339
        .IO_RD(I_IORD),
340
        .INIT_RUN(IC_INIT),
341
        .PROT_ERROR(PROT_ERROR),
342
        .ACC_OK(IACC_STAT[0]),
343
        .IC_PREQ(IC_PREQ),
344
        .KOLLISION(KOLLISION),
345
        .DRAM_A(IDRAM_ADR),
346
        .IC_DQ(IC_DIN),
347
        .IC_VA(IC_VA),
348
        .ICTODC(ICTODC),
349
        .ENA_HK(ENA_HK),
350
        .STOP_CINV(STOP_CINV),
351
        .IO_A(I_IOA));
352
 
353 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
354 9 ns32kum
//            The Control Unit
355 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
356 9 ns32kum
STEUERUNG       BRAIN(
357
        .BCLK(BCLK),
358
        .BRESET(BRESET),
359
        .DC_ACC_DONE(ACC_DONE),
360
        .ACB_ZERO(ACB_ZERO),
361
        .DONE(DONE),
362
        .NMI_N(NMI_N),
363
        .INT_N(INT_N),
364
        .DC_ABORT(DC_ABORT),
365
        .IC_INIT(IC_INIT),
366
        .DC_INIT(DC_INIT),
367
        .Y_INIT(Y_INIT),
368
        .SAVE_PC(SAVE_PC),
369
        .CFG(CFG[8:0]),
370
        .IACC_STAT(IACC_STAT),
371
        .PROT_ERROR(PROT_ERROR),
372
        .IC_DIN(IC_DIN),
373
        .PC_NEW(PC_NEW),
374
        .PSR(PSR),
375
        .STRING(STRING),
376
        .TRAPS(TRAPS),
377
        .IC_READ(IC_READ),
378
        .DATA_HOLD(DATA_HOLD),
379
        .LD_DIN(LD_DIN),
380
        .LD_IMME(LD_IMME),
381
        .WREN(WREN_REG),
382
        .WR_REG(WR_REG),
383
        .GENSTAT(GENSTAT),
384
        .IC_USER(IC_USER),
385
        .ACC_FELD(ACC_FELD),
386
        .DISP(DISP),
387
        .IC_TEX(IC_TEX),
388
        .IMME_Q(IMME_Q),
389
        .INFO_AU(INFO_AU),
390
        .LD_OUT(LD_OUT),
391
        .DETOIP(DETOIP),
392
        .MMU_UPDATE(MMU_UPDATE),
393
        .OPER(OPER),
394
        .PC_ARCHI(PC_ARCHI),
395
        .PC_ICACHE(PC_ICACHE),
396
        .RDAA(RDAA),
397
        .RDAB(RDAB),
398
        .START(START),
399
        .WMASKE(WMASKE),
400
        .WRADR(WRADR),
401
        .ENA_HK(ENA_HK),
402
        .STOP_CINV(STOP_CINV),
403
        .COP_OP(COP_OP),
404
        .ILO(ILO_SIG),
405
        .RWVAL(RWVAL));
406
 
407 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
408 9 ns32kum
//            The Input/Output Interface
409 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
410 9 ns32kum
IO_SWITCH       ISWITCH(
411
        .I_IORD(I_IORD),
412
        .D_IOWR(D_IOWR),
413
        .IO_READY(IO_READY),
414
        .D_IORD(D_IORD),
415
        .D_IOBE(D_IOBE),
416
        .BRESET(BRESET),
417
        .BCLK(BCLK),
418
        .GENSTAT(GENSTAT),
419
        .D_IOA(D_IOA),
420
        .I_IOA(I_IOA),
421
        .D_IORDY(D_IORDY),
422
        .I_IORDY(I_IORDY),
423
        .IO_RD(IO_RD),
424
        .IO_WR(IO_WR),
425
        .IO_BE(IO_BE),
426
        .ILO_SIG(ILO_SIG),
427
        .ILO(ILO),
428
        .IO_A(IO_A),
429
        .DCWACC({DC_WR,DC_ACC}),
430
        .STATUS(STATUS));
431
 
432 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
433 9 ns32kum
//            The Statistic Signal Generator
434 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
435 9 ns32kum
MAKE_STAT       MKSTAT(
436
        .BCLK(BCLK),
437
        .READ(READ),
438
        .DACC_OK(ACC_STAT[0]),
439
        .KOLLISION(KOLLISION),
440
        .DC_ACC(DC_ACC),
441
        .DPTE_ACC(PTE_STAT[0]),
442
        .DC_MDONE(DC_MDONE),
443
        .DRAM_WR(DC_WR),
444
        .IC_READ(IC_READ),
445
        .IACC_OK(IACC_STAT[0]),
446
        .IC_ACC(IC_ACC),
447
        .IPTE_ACC(PTE_STAT[1]),
448
        .IC_MDONE(IC_MDONE),
449
        .DATA_HOLD(DATA_HOLD),
450
        .STATSIGS(STATSIGS));
451
 
452
endmodule

powered by: WebSVN 2.1.0

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