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

Subversion Repositories m32632

[/] [m32632/] [trunk/] [rtl/] [M32632.v] - Blame information for rev 29

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

powered by: WebSVN 2.1.0

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