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

Subversion Repositories m32632

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

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

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

powered by: WebSVN 2.1.0

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