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

Subversion Repositories m32632

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

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

powered by: WebSVN 2.1.0

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