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

Subversion Repositories m32632

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

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
// Version:  1.0
8
// Date:     30 May 2015
9
//
10
// Copyright (C) 2015 Udo Moeller
11
// 
12
// This source file may be used and distributed without 
13
// restriction provided that this copyright statement is not 
14
// removed from the file and that any derivative work contains 
15
// the original copyright notice and the associated disclaimer.
16
// 
17
// This source file is free software; you can redistribute it 
18
// and/or modify it under the terms of the GNU Lesser General 
19
// Public License as published by the Free Software Foundation;
20
// either version 2.1 of the License, or (at your option) any 
21
// later version. 
22
// 
23
// This source is distributed in the hope that it will be 
24
// useful, but WITHOUT ANY WARRANTY; without even the implied 
25
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
26
// PURPOSE. See the GNU Lesser General Public License for more 
27
// details. 
28
// 
29
// You should have received a copy of the GNU Lesser General 
30
// Public License along with this source; if not, download it 
31
// from http://www.opencores.org/lgpl.shtml 
32
// 
33
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34
//
35
//      Modules contained in this file:
36
//      M32632          The top level of M32632
37
//
38 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39 9 ns32kum
 
40
module M32632( BCLK, MCLK, WRCFG, BRESET, NMI_N, INT_N, STATUS, ILO, STATSIGS,
41
                           IO_WR, IO_RD, IO_A, IO_BE, IO_DI, IO_Q, IO_READY,
42
                           ENDRAM, IC_MDONE, DC_MDONE, ENWR, WAMUX, WADDR, DRAM_Q, DWCTRL, IWCTRL,
43
                           IC_ACC, IDRAM_ADR, DC_ACC, DC_WR, DRAM_ADR, DRAM_DI,
44
                           HOLD, HLDA, FILLRAM, DMA_AA,
45
                           COP_GO, COP_OP, COP_OUT, COP_DONE, COP_IN );
46
 
47
// ++++++++++ Basic Signals
48
input                   BCLK;   // Basic Clock for everything
49
input                   MCLK;   // Memory Clock, used in Caches
50
input                   WRCFG;
51
input                   BRESET;
52
input                   NMI_N;
53
input                   INT_N;
54
output   [3:0]   STATUS;
55
output                  ILO;
56
output   [7:0]   STATSIGS;
57
// +++++++++ General Purpose Interface
58
output                  IO_WR;
59
output                  IO_RD;
60
output  [31:0]   IO_A;
61
output   [3:0]   IO_BE;
62
output  [31:0]   IO_DI;
63
input   [31:0]   IO_Q;
64
input                   IO_READY;
65
// +++++++++ DRAM Interface In
66
input                   ENDRAM;
67
input                   IC_MDONE;
68
input                   DC_MDONE;
69
input                   ENWR;
70
input                   WAMUX;
71
input   [11:2]  WADDR;
72
input   [31:0]   DRAM_Q;
73
input    [2:0]   DWCTRL;
74
input    [2:0]   IWCTRL;
75
// +++++++++ DRAM Interface Out
76
output                  IC_ACC;
77
output  [27:0]   IDRAM_ADR;
78
output                  DC_ACC;
79
output                  DC_WR;
80
output  [27:0]   DRAM_ADR;
81
output  [35:0]   DRAM_DI;
82
// ++++++++++ DMA Interface
83
input                   HOLD;
84
output                  HLDA;
85
input                   FILLRAM;
86
input   [27:4]  DMA_AA;
87
// ++++++++++ Coprocessor Interface
88
output                  COP_GO;
89
output  [23:0]   COP_OP;
90
output [127:0]   COP_OUT;
91
input                   COP_DONE;
92
input   [63:0]   COP_IN;
93
 
94
wire                    ACC_DONE;
95
wire     [5:0]   ACC_STAT;
96
wire    [12:0]   CFG;
97
wire     [3:0]   CINV;
98
wire                    DATA_HOLD;
99
wire                    DC_INIT;
100
wire                    Y_INIT;
101
wire                    DONE;
102
wire    [63:0]   DP_Q;
103
wire     [3:0]   IACC_STAT;
104
wire                    PROT_ERROR;
105
wire     [2:0]   GENSTAT;
106
wire                    IC_INIT;
107
wire                    IC_PREQ;
108
wire                    IC_READ;
109
wire     [1:0]   IC_SIGS;
110
wire                    IC_USER;
111
wire   [31:12]  IC_VA;
112
wire     [3:0]   ICTODC;
113
wire     [6:0]   INFO_AU;
114
wire     [1:0]   IVAR;
115
wire                    KDET;
116
wire    [27:4]  KOLLI_A;
117
wire     [3:0]   MCR;
118
wire    [23:0]   MMU_DIN;
119
wire    [11:0]   PSR;
120
wire                    PTB_SEL;
121
wire                    PTB_WR;
122
wire                    READ;
123
wire                    WRITE;
124
wire                    ZTEST;
125
wire                    RMW;
126
wire     [2:0]   RWVAL;
127
wire                    RWVFLAG;
128
wire     [3:0]   D_IOBE;
129
wire                    D_IORDY;
130
wire                    REG_OUT;
131
wire     [3:0]   PACKET;
132
wire     [1:0]   SIZE;
133
wire    [31:0]   VADR;
134
wire                    WREN_REG;
135
wire                    LD_DIN;
136
wire                    LD_IMME;
137
wire                    WR_REG;
138
wire    [14:0]   ACC_FELD;
139
wire    [31:0]   DIN;
140
wire    [31:0]   DISP;
141
wire     [2:0]   IC_TEX;
142
wire    [31:0]   IMME_Q;
143
wire     [1:0]   LD_OUT;
144
wire    [12:0]   DETOIP;
145
wire     [1:0]   MMU_UPDATE;
146
wire    [10:0]   OPER;
147
wire    [31:0]   PC_ARCHI;
148
wire    [31:0]   PC_ICACHE;
149
wire     [7:0]   RDAA;
150
wire     [7:0]   RDAB;
151
wire     [1:0]   START;
152
wire     [1:0]   WMASKE;
153
wire     [5:0]   WRADR;
154
wire                    I_IORDY;
155
wire                    ACB_ZERO;
156
wire                    DC_ABORT;
157
wire                    SAVE_PC;
158
wire    [31:0]   IC_DIN;
159
wire    [31:0]   PC_NEW;
160
wire     [4:0]   STRING;
161
wire     [5:0]   TRAPS;
162
wire                    I_IORD;
163
wire                    D_IOWR;
164
wire                    D_IORD;
165
wire    [31:0]   D_IOA;
166
wire    [31:0]   I_IOA;
167
wire                    ENA_HK;
168
wire                    STOP_CINV;
169
wire                    KOLLISION;
170
wire                    ILO_SIG;
171
wire     [1:0]   PTE_STAT;
172
wire                    DBG_HIT;
173
wire    [40:2]  DBG_IN;
174
 
175 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
176 9 ns32kum
//            The Data Cache
177 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
178 9 ns32kum
DCACHE  ARMS(
179
        .MCLK(MCLK),
180
        .BCLK(BCLK),
181
        .WRCFG(WRCFG),
182
        .BRESET(BRESET),
183
        .PTB_WR(PTB_WR),
184
        .PTB_SEL(PTB_SEL),
185
        .MDONE(DC_MDONE),
186
        .IO_READY(D_IORDY),
187
        .REG_OUT(REG_OUT),
188
        .PSR_USER(INFO_AU[1]),
189
        .WRITE(WRITE),
190
        .READ(READ),
191
        .ZTEST(ZTEST),
192
        .RMW(RMW),
193
        .WAMUX(WAMUX),
194
        .ENWR(ENWR),
195
        .IC_PREQ(IC_PREQ),
196
        .FILLRAM(FILLRAM),
197
        .CFG(CFG[10:9]),
198
        .ENDRAM(ENDRAM),
199
        .CINVAL(CINV[1:0]),
200
        .DMA_AA(DMA_AA),
201
        .DP_Q(DP_Q),
202
        .DRAM_Q(DRAM_Q),
203
        .IC_VA(IC_VA),
204
        .ICTODC(ICTODC),
205
        .IO_Q(IO_Q),
206
        .IVAR(IVAR),
207
        .MCR_FLAGS(MCR),
208
        .PACKET(PACKET),
209
        .SIZE(SIZE),
210
        .VADR(VADR),
211
        .WADDR(WADDR),
212
        .WCTRL(DWCTRL),
213
        .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
        .ACC_DONE(ACC_DONE),
272
        .REG_OUT(REG_OUT),
273
        .Y_INIT(Y_INIT),
274
        .DONE(DONE),
275
        .PTB_WR(PTB_WR),
276
        .PTB_SEL(PTB_SEL),
277
        .ACB_ZERO(ACB_ZERO),
278
        .ABORT(DC_ABORT),
279
        .SAVE_PC(SAVE_PC),
280
        .CFG(CFG),
281
        .CINV(CINV),
282
        .DP_Q(DP_Q),
283
        .IVAR(IVAR),
284
        .MCR(MCR),
285
        .PACKET(PACKET),
286
        .PC_NEW(PC_NEW),
287
        .PSR(PSR),
288
        .SIZE(SIZE),
289
        .STRING(STRING),
290
        .TRAPS(TRAPS),
291
        .VADR(VADR),
292
        .RWVFLAG(RWVFLAG),
293
        .DBG_HIT(DBG_HIT),
294
        .DBG_IN(DBG_IN),
295
        .COP_DONE(COP_DONE),
296
        .COP_OP(COP_OP),
297
        .COP_IN(COP_IN),
298
        .COP_GO(COP_GO),
299
        .COP_OUT(COP_OUT));
300
 
301 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
302 9 ns32kum
//            The Instruction Cache
303 11 ns32kum
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
304 9 ns32kum
ICACHE  LEGS(
305
        .MCLK(MCLK),
306
        .BCLK(BCLK),
307
        .BRESET(BRESET),
308
        .PTB_WR(PTB_WR),
309
        .PTB_SEL(PTB_SEL),
310
        .MDONE(IC_MDONE),
311
        .IO_READY(I_IORDY),
312
        .READ_I(IC_READ),
313
        .PSR_USER(IC_USER),
314
        .DATA_HOLD(DATA_HOLD),
315
        .DRAM_WR(DC_WR),
316
        .KDET(KDET),
317
        .HOLD(HOLD),
318
        .CFG(CFG[12:11]),
319
        .ENDRAM(ENDRAM),
320
        .DRAM_Q(DRAM_Q),
321
        .CINVAL(CINV[3:2]),
322
        .IC_SIGS(IC_SIGS),
323
        .IO_Q(IO_Q),
324
        .IVAR(IVAR),
325
        .KOLLI_A(KOLLI_A),
326
        .MCR_FLAGS(MCR),
327
        .MMU_DIN(MMU_DIN),
328
        .VADR(PC_ICACHE),
329
        .WADDR(WADDR),
330
        .WCTRL(IWCTRL),
331
        .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.