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

Subversion Repositories instruction_list_pipelined_processor_with_peripherals

[/] [instruction_list_pipelined_processor_with_peripherals/] [trunk/] [hdl/] [controlUnit.v] - Blame information for rev 10

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

Line No. Rev Author Line
1 10 maheshpalv
////////////////////////////////////////////////////////////////////////////////////////////////
2
////                                                                                                                    ////
3
////                                                                                                                    ////
4
////    This file is part of the project                                                                                        ////
5
////    "instruction_list_pipelined_processor_with_peripherals"                                                         ////
6
////                                                                                                                    ////
7
////  http://opencores.org/project,instruction_list_pipelined_processor_with_peripherals        ////
8
////                                                                                                                    ////
9
////                                                                                                                    ////
10
////                             Author:                                                                                ////
11
////                            - Mahesh Sukhdeo Palve                                                                                                  ////
12
////                                                                                                                                                                            ////
13
////////////////////////////////////////////////////////////////////////////////////////////////
14
////////////////////////////////////////////////////////////////////////////////////////////////
15
////                                                                                                                                                                            ////
16
////                                                                                                                                                            ////
17
////                                                                                                                    ////
18
////                                    This source file may be used and distributed without                    ////
19
////                                    restriction provided that this copyright statement is not               ////
20
////                                    removed from the file and that any derivative work contains             ////
21
////                                    the original copyright notice and the associated disclaimer.            ////
22
////                                                                                                                    ////
23
////                                    This source file is free software; you can redistribute it              ////
24
////                                    and/or modify it under the terms of the GNU Lesser General              ////
25
////                                    Public License as published by the Free Software Foundation;            ////
26
////                                    either version 2.1 of the License, or (at your option) any              ////
27
////                                    later version.                                                          ////
28
////                                                                                                                    ////
29
////                                    This source is distributed in the hope that it will be                  ////
30
////                                    useful, but WITHOUT ANY WARRANTY; without even the implied              ////
31
////                                    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR                 ////
32
////                                    PURPOSE.  See the GNU Lesser General Public License for more            ////
33
////                                    details.                                                                ////
34
////                                                                                                                    ////
35
////                                    You should have received a copy of the GNU Lesser General               ////
36
////                                    Public License along with this source; if not, download it              ////
37
////                                    from http://www.opencores.org/lgpl.shtml                                ////
38
////                                                                                                                    ////
39
////////////////////////////////////////////////////////////////////////////////////////////////
40 3 maheshpalv
 
41
`include "timescale.v"
42
`include "defines.v"
43
 
44
 
45 5 maheshpalv
module controlUnit (clk, reset, instOpCode, acc0, iomemCode,
46 3 maheshpalv
                                                        branch,
47 6 maheshpalv
                                                        accMuxSel, accEn, op2MuxSel, aluEn, aluOpcode,
48 3 maheshpalv
                                                        bitRamEn, bitRamRw, byteRamEn, byteRamRw,
49
                                                        inputRead, outputRw
50
 
51
                                                        `ifdef timerAndCounter_peripheral
52
                                                                , entypeEn, tcAccRead, tcResetEn, tcPresetEn, tcLoadEn
53
                                                        `endif
54
 
55
                                                        `ifdef UART_peripheral
56
                                                                , uartRead, uartWrite
57
                                                        `endif
58
 
59
                                                        `ifdef SPI_peripheral
60
                                                                , sconEn, spiStatRead, spiBufRead, spiBufWrite, spiBufShift
61
                                                        `endif
62
 
63
                                                        );
64
 
65
 
66
        input clk, reset;
67
        input [`instOpCodeLen-1:0] instOpCode;
68
        input acc0;
69
        input [1:0] iomemCode;
70
 
71
        output branch;
72
        output [`accMuxSelLen-1:0]       accMuxSel;
73
        output accEn;
74
        output [`op2MuxSelLen-1:0]       op2MuxSel;
75 6 maheshpalv
        output aluEn;
76 3 maheshpalv
        output [`aluOpcodeLen-1:0] aluOpcode;
77
        output bitRamEn, bitRamRw, byteRamEn, byteRamRw;
78
        output inputRead, outputRw;
79
 
80
        `ifdef timerAndCounter_peripheral
81
        output entypeEn, tcAccRead, tcResetEn, tcPresetEn, tcLoadEn;
82 5 maheshpalv
        `endif
83 3 maheshpalv
 
84
        `ifdef UART_peripheral
85
        output uartRead, uartWrite;
86
        `endif
87
 
88
        `ifdef SPI_peripheral
89
        output sconEn, spiStatRead, spiBufRead, spiBufWrite, spiBufShift;
90
        `endif
91 5 maheshpalv
 
92
        reg branch;
93
        reg [`accMuxSelLen-1:0]  accMuxSel;
94
        reg accEn;
95
        reg [`op2MuxSelLen-1:0]  op2MuxSel;
96 6 maheshpalv
        reg aluEn;
97 5 maheshpalv
        reg [`aluOpcodeLen-1:0] aluOpcode;
98
        reg bitRamEn, bitRamRw, byteRamEn, byteRamRw;
99
        reg inputRead, outputRw;
100
 
101
        `ifdef timerAndCounter_peripheral
102
        reg entypeEn, tcAccRead, tcResetEn, tcPresetEn, tcLoadEn;
103
        `endif
104
 
105
        `ifdef UART_peripheral
106
        reg uartRead, uartWrite;
107
        `endif
108 3 maheshpalv
 
109 5 maheshpalv
        `ifdef SPI_peripheral
110
        reg sconEn, spiStatRead, spiBufRead, spiBufWrite, spiBufShift;
111
        `endif
112
 
113
        reg [`cuStateLen-1:0] state;
114
 
115
        // control unit FSM states:
116
 
117
        parameter       s               = `cuStateLen'b0;
118
        parameter       sTc     = `cuStateLen'b1;
119
        parameter       sBr     = `cuStateLen'b10;
120
        parameter       sLd     = `cuStateLen'b11;
121
        parameter       sSt     = `cuStateLen'b100;
122
        parameter       sUart   = `cuStateLen'b101;
123
        parameter       sSpi    = `cuStateLen'b110;
124
        parameter       sAlu    = `cuStateLen'b111;
125
 
126
 
127
 
128
 
129
        always @ (negedge clk)
130
        begin
131
 
132
 
133
                if (reset)
134
                begin
135
                        state = s;
136
 
137 6 maheshpalv
                        branch = 0;      accMuxSel = 0;   accEn = 0;       op2MuxSel = 0;   aluEn = 0; aluOpcode = 0; bitRamEn = 0;
138 5 maheshpalv
                        bitRamRw = 1;   byteRamEn = 0;   byteRamRw = 1;  inputRead = 0;   outputRw = 1;
139
 
140
                        `ifdef timeAndCounter_peripheral
141
                                entypeEn = 0;    tcAccRead = 0;   tcResetEn = 0;           tcPresetEn = 0;  tcLoadEn = 0;
142
                        `endif
143
 
144
                        `ifdef UART_peripheral
145
                                uartRead = 0;    uartWrite = 0;
146
                        `endif
147
 
148
                        `ifdef SPI_peripheral
149
                                sconEn = 0;              spiStatRead = 0; spiBufRead = 0;  spiBufWrite = 0; spiBufShift = 0;
150
                        `endif
151
                end
152
 
153
                else
154
                begin
155
 
156
                        // execution unit control signals
157
 
158
                        case (state)
159
 
160
                        s               :               begin
161
 
162 3 maheshpalv
 
163 5 maheshpalv
                                case (instOpCode)
164
 
165
                                `END                    :       begin
166
 
167
                                                state = sBr;
168
 
169
                                                branch = 1;                     // branch to some address . . .
170
                                                accMuxSel = 0;
171
                                                accEn = 0;
172
                                                op2MuxSel = 0;
173 6 maheshpalv
                                                aluEn = 0;
174 5 maheshpalv
                                                aluOpcode = 0;
175
                                                bitRamEn = 0;
176
                                                bitRamRw = 1;
177
                                                byteRamEn = 0;
178
                                                byteRamRw = 1;
179
                                                inputRead = 0;
180
                                                outputRw = 1;
181
 
182
                                                `ifdef timeAndCounter_peripheral
183
                                                        entypeEn = 0;            tcAccRead = 0;   tcResetEn = 0;           tcPresetEn = 0;  tcLoadEn = 0;
184
                                                `endif
185
 
186
                                                `ifdef UART_peripheral
187
                                                        uartRead = 0;            uartWrite = 0;
188
                                                `endif
189
 
190
                                                `ifdef SPI_peripheral
191
                                                        sconEn = 0;              spiStatRead = 0; spiBufRead = 0;  spiBufWrite = 0;
192
                                                        spiBufShift = 0;
193
                                                `endif
194
 
195
                                end     // end case END
196 3 maheshpalv
 
197
 
198 5 maheshpalv
 
199
                                `JMP                    :       begin
200
 
201
                                                state = sBr;
202
 
203 6 maheshpalv
                                                if (acc0)
204
                                                        branch = 1;                     // branch to some address . . .
205
                                                else
206
                                                        branch = 0;
207 5 maheshpalv
                                                accMuxSel = 0;
208
                                                accEn = 0;
209
                                                op2MuxSel = 0;
210 6 maheshpalv
                                                aluEn = 0;
211 5 maheshpalv
                                                aluOpcode = 0;
212
                                                bitRamEn = 0;
213
                                                bitRamRw = 1;
214
                                                byteRamEn = 0;
215
                                                byteRamRw = 1;
216
                                                inputRead = 0;
217
                                                outputRw = 1;
218
 
219
                                                `ifdef timeAndCounter_peripheral
220
                                                        entypeEn = 0;            tcAccRead = 0;   tcResetEn = 0;           tcPresetEn = 0;  tcLoadEn = 0;
221
                                                `endif
222
 
223
                                                `ifdef UART_peripheral
224
                                                        uartRead = 0;            uartWrite = 0;
225
                                                `endif
226
 
227
                                                `ifdef SPI_peripheral
228
                                                        sconEn = 0;              spiStatRead = 0; spiBufRead = 0;  spiBufWrite = 0; spiBufShift = 0;
229
                                                `endif
230
 
231
                                end     // end case JMP
232
 
233
 
234
 
235
                                `Ld                     :       begin
236
                                // load thr. op2 MUX and alu.... enable acc in next cycle
237 9 maheshpalv
                                                state = sAlu;
238 5 maheshpalv
 
239
                                                branch = 0;
240 9 maheshpalv
//                                              accMuxSel = `accMuxSelAluOut;
241 5 maheshpalv
                                                accMuxSel = 0;
242
                                                accEn = 0;
243
 
244
                                                        case (iomemCode)
245
                                                        2'b00   :       op2MuxSel = `op2MuxSelInput;
246
                                                        2'b01   :       op2MuxSel = `op2MuxSelOutput;
247
                                                        2'b10   :       op2MuxSel = `op2MuxSelBitRam;
248
                                                        2'b11   :       op2MuxSel = `op2MuxSelByteRam;
249
                                                        default:        op2MuxSel = `op2MuxSelInput;
250
                                                        endcase
251 7 maheshpalv
                                                        aluEn = 1'b1;
252 5 maheshpalv
                                                        aluOpcode = `LD_data;
253
 
254 7 maheshpalv
                                                bitRamEn = 1'b1;
255
                                                bitRamRw = 1'b1;
256
                                                byteRamEn = 1'b1;
257
                                                byteRamRw = 1'b1;
258
                                                inputRead = 1'b1;
259
                                                outputRw = 1'b1;
260 5 maheshpalv
 
261
                                                `ifdef timeAndCounter_peripheral
262 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
263 5 maheshpalv
                                                `endif
264
 
265
                                                `ifdef UART_peripheral
266 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
267 5 maheshpalv
                                                `endif
268
 
269
                                                `ifdef SPI_peripheral
270 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
271 5 maheshpalv
                                                `endif
272
 
273
                                end     // end case Ld
274
 
275
 
276
 
277
 
278
                                `Ldi                    :       begin
279 9 maheshpalv
                                                state = sLd;
280 5 maheshpalv
 
281 7 maheshpalv
                                                branch = 1'b0;
282 5 maheshpalv
                                                        accMuxSel = `accMuxSelImmData;  // select imm data thr mux
283 7 maheshpalv
                                                        accEn = 1'b1;           // acc enabled
284
                                                op2MuxSel = 1'b0;
285
                                                aluOpcode = 1'b0;
286
                                                aluEn = 1'b0;
287
                                                bitRamEn = 1'b0;
288
                                                bitRamRw = 1'b1;
289
                                                byteRamEn = 1'b0;
290
                                                byteRamRw = 1'b1;
291
                                                inputRead = 1'b0;
292
                                                outputRw = 1'b1;
293 5 maheshpalv
 
294
                                                `ifdef timeAndCounter_peripheral
295 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
296 5 maheshpalv
                                                `endif
297
 
298
                                                `ifdef UART_peripheral
299 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
300 5 maheshpalv
                                                `endif
301
 
302
                                                `ifdef SPI_peripheral
303 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
304 5 maheshpalv
                                                `endif
305
 
306
                                end             // end case Ldi
307
 
308
 
309
 
310
                                `ST                     :       begin
311
                                                state = sSt;
312
 
313 7 maheshpalv
                                                branch = 1'b0;
314
                                                accMuxSel = 1'b0;
315
                                                accEn = 1'b0;
316
                                                op2MuxSel = 1'b0;
317
                                                aluEn = 1'b0;
318
                                                aluOpcode = 1'b0;
319
                                                inputRead = 1'b0;
320 5 maheshpalv
 
321
                                                        case (iomemCode)
322 9 maheshpalv
                                                        2'b10   :       begin   bitRamRw = 1'b0;        byteRamRw = 1'b1;       outputRw = 1'b1; bitRamEn = 1'b1;       byteRamEn = 1'b1;       end
323
                                                        2'b11   :       begin   bitRamRw = 1'b1;        byteRamRw = 1'b0;       outputRw = 1'b1; bitRamEn = 1'b1;       byteRamEn = 1'b1;       end
324
                                                        2'b01   :       begin   bitRamRw = 1'b1;        byteRamRw = 1'b1;       outputRw = 1'b0; end
325 7 maheshpalv
                                                        default:        begin   bitRamRw = 1'b1;        byteRamRw = 1'b1;       outputRw = 1'b1;        end
326 5 maheshpalv
                                                        endcase
327
 
328
                                                `ifdef timeAndCounter_peripheral
329 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
330 5 maheshpalv
                                                `endif
331
 
332
                                                `ifdef UART_peripheral
333 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
334 5 maheshpalv
                                                `endif
335
 
336
                                                `ifdef SPI_peripheral
337 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
338 5 maheshpalv
                                                `endif
339
 
340
                                end
341
 
342
 
343
 
344
                                `ADD                    :       begin
345
                                                state = sAlu;
346
                                                aluOpcode = `ADD_alu;
347 7 maheshpalv
                                                aluEn = 1'b1;
348
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
349
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
350 5 maheshpalv
 
351
                                                `ifdef timeAndCounter_peripheral
352 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
353 5 maheshpalv
                                                `endif
354
 
355
                                                `ifdef UART_peripheral
356 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
357 5 maheshpalv
                                                `endif
358
 
359
                                                `ifdef SPI_peripheral
360 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
361 5 maheshpalv
                                                `endif
362
 
363
                                end
364
 
365
 
366
                                `SUB                    :       begin
367
                                                state = sAlu;
368
                                                aluOpcode = `SUB_alu;
369 7 maheshpalv
                                                aluEn = 1'b1;
370
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
371
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
372 5 maheshpalv
 
373
                                                `ifdef timeAndCounter_peripheral
374 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
375 5 maheshpalv
                                                `endif
376
 
377
                                                `ifdef UART_peripheral
378 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
379 5 maheshpalv
                                                `endif
380
 
381
                                                `ifdef SPI_peripheral
382 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
383 5 maheshpalv
                                                `endif
384
 
385
                                end
386
 
387
                                // MUL & DIV are not implemented
388
 
389
 
390
 
391
                                `AND                    :       begin
392
                                                state = sAlu;
393
                                                aluOpcode = `AND_alu;
394 7 maheshpalv
                                                aluEn = 1'b1;
395
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
396
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
397 5 maheshpalv
 
398
                                                `ifdef timeAndCounter_peripheral
399 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
400 5 maheshpalv
                                                `endif
401
 
402
                                                `ifdef UART_peripheral
403 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
404 5 maheshpalv
                                                `endif
405
 
406
                                                `ifdef SPI_peripheral
407 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
408 5 maheshpalv
                                                `endif
409
 
410
                                end
411
 
412
 
413
 
414
                                `OR                     :       begin
415
                                                state = sAlu;
416
                                                aluOpcode = `OR_alu;
417 7 maheshpalv
                                                aluEn = 1'b1;
418
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
419
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
420 5 maheshpalv
 
421
                                                `ifdef timeAndCounter_peripheral
422 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
423 5 maheshpalv
                                                `endif
424
 
425
                                                `ifdef UART_peripheral
426 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
427 5 maheshpalv
                                                `endif
428
 
429
                                                `ifdef SPI_peripheral
430 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
431 5 maheshpalv
                                                `endif
432
 
433
                                end
434
 
435
 
436
 
437
                                `XOR                    :       begin
438
                                                state = sAlu;
439
                                                aluOpcode = `XOR_alu;
440 7 maheshpalv
                                                aluEn = 1'b1;
441
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
442
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
443 5 maheshpalv
 
444
                                                `ifdef timeAndCounter_peripheral
445 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
446 5 maheshpalv
                                                `endif
447
 
448
                                                `ifdef UART_peripheral
449 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
450 5 maheshpalv
                                                `endif
451
 
452
                                                `ifdef SPI_peripheral
453 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
454 5 maheshpalv
                                                `endif
455
 
456
                                end
457
 
458
 
459
 
460
                                `GrT                    :       begin
461
                                                state = sAlu;
462
                                                aluOpcode = `GT_alu;
463 7 maheshpalv
                                                aluEn = 1'b1;
464
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
465
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
466 5 maheshpalv
 
467
                                                `ifdef timeAndCounter_peripheral
468 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
469 5 maheshpalv
                                                `endif
470
 
471
                                                `ifdef UART_peripheral
472 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
473 5 maheshpalv
                                                `endif
474
 
475
                                                `ifdef SPI_peripheral
476 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
477 5 maheshpalv
                                                `endif
478
 
479
                                end
480
 
481
 
482
 
483
 
484
 
485
                                `GE                     :       begin
486
                                                state = sAlu;
487
                                                aluOpcode = `GE_alu;
488 7 maheshpalv
                                                aluEn = 1'b1;
489
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
490
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
491 5 maheshpalv
 
492
                                                `ifdef timeAndCounter_peripheral
493 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
494 5 maheshpalv
                                                `endif
495
 
496
                                                `ifdef UART_peripheral
497 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
498 5 maheshpalv
                                                `endif
499
 
500
                                                `ifdef SPI_peripheral
501 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
502 5 maheshpalv
                                                `endif
503
 
504
                                end
505
 
506
 
507
 
508
 
509
 
510
                                `EQ                     :       begin
511
                                                state = sAlu;
512
                                                aluOpcode = `EQ_alu;
513 7 maheshpalv
                                                aluEn = 1'b1;
514
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
515
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
516 5 maheshpalv
 
517
                                                `ifdef timeAndCounter_peripheral
518 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
519 5 maheshpalv
                                                `endif
520
 
521
                                                `ifdef UART_peripheral
522 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
523 5 maheshpalv
                                                `endif
524
 
525
                                                `ifdef SPI_peripheral
526 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
527 5 maheshpalv
                                                `endif
528
 
529
                                end
530
 
531
 
532
 
533
 
534
 
535
                                `LE                     :       begin
536
                                                state = sAlu;
537
                                                aluOpcode = `LE_alu;
538 7 maheshpalv
                                                aluEn = 1'b1;
539
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
540
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
541 5 maheshpalv
 
542
                                                `ifdef timeAndCounter_peripheral
543 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
544 5 maheshpalv
                                                `endif
545
 
546
                                                `ifdef UART_peripheral
547 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
548 5 maheshpalv
                                                `endif
549
 
550
                                                `ifdef SPI_peripheral
551 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
552 5 maheshpalv
                                                `endif
553
 
554
                                end
555
 
556
 
557
 
558
 
559
 
560
                                `LT                     :       begin
561
                                                state = sAlu;
562
                                                aluOpcode = `LT_alu;
563 7 maheshpalv
                                                aluEn = 1'b1;
564
                                                branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
565
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
566 5 maheshpalv
 
567
                                                `ifdef timeAndCounter_peripheral
568 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
569 5 maheshpalv
                                                `endif
570
 
571
                                                `ifdef UART_peripheral
572 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
573 5 maheshpalv
                                                `endif
574
 
575
                                                `ifdef SPI_peripheral
576 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
577 5 maheshpalv
                                                `endif
578
 
579
                                end
580
 
581
 
582
                                `ifdef timeAndCounter_peripheral
583
                                `PRE                    :       begin
584
                                                state = sTc;
585
 
586 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b1;      tcLoadEn = 1'b0;
587 5 maheshpalv
 
588
 
589 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
590
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
591 5 maheshpalv
 
592
 
593
                                                `ifdef UART_peripheral
594 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
595 5 maheshpalv
                                                `endif
596
 
597
                                                `ifdef SPI_peripheral
598 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
599 5 maheshpalv
                                                `endif
600
                                end
601
                                `endif
602
 
603
 
604
                                `ifdef timeAndCounter_peripheral
605
                                `ETY                    :       begin
606
                                                state = sTc;
607
 
608 7 maheshpalv
                                                entypeEn = 1'b1;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
609 5 maheshpalv
 
610
 
611 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
612
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
613 5 maheshpalv
 
614
 
615
                                                `ifdef UART_peripheral
616 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
617 5 maheshpalv
                                                `endif
618
 
619
                                                `ifdef SPI_peripheral
620 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
621 5 maheshpalv
                                                `endif
622
                                end
623
                                `endif
624
 
625
 
626
 
627
                                `ifdef timeAndCounter_peripheral
628
                                `RST                    :       begin
629
                                                state = sTc;
630
 
631 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b1;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
632 5 maheshpalv
 
633
 
634 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
635
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
636 5 maheshpalv
 
637
 
638
                                                `ifdef UART_peripheral
639 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
640 5 maheshpalv
                                                `endif
641
 
642
                                                `ifdef SPI_peripheral
643 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
644 5 maheshpalv
                                                `endif
645
                                end
646
                                `endif
647
 
648
 
649
 
650
                                `ifdef timeAndCounter_peripheral
651
                                `LdTC                   :       begin
652
                                                state = sTc;
653
 
654 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b1;
655 5 maheshpalv
 
656 7 maheshpalv
                                                accMuxSel = `accMuxSelTcLoad;           accEn = 1'b1;   // loading TC status data
657 5 maheshpalv
 
658 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;                  op2MuxSel = 1'b0;
659
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
660 5 maheshpalv
 
661
 
662
                                                `ifdef UART_peripheral
663 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
664 5 maheshpalv
                                                `endif
665
 
666
                                                `ifdef SPI_peripheral
667 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
668 5 maheshpalv
                                                `endif
669
                                end
670
                                `endif
671
 
672
 
673
 
674
                                `ifdef timeAndCounter_peripheral
675
                                `LdACC                  :       begin
676
                                                state = sTc;
677
 
678 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b1;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
679 5 maheshpalv
 
680 7 maheshpalv
                                                accMuxSel = `accMuxSelTcAcc;            accEn = 1'b1;   // loading TC ACC data
681 5 maheshpalv
 
682 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          op2MuxSel = 1'b0;
683
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
684 5 maheshpalv
 
685
 
686
                                                `ifdef UART_peripheral
687 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
688 5 maheshpalv
                                                `endif
689
 
690
                                                `ifdef SPI_peripheral
691 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
692 5 maheshpalv
                                                `endif
693
                                end
694
                                `endif
695
 
696
 
697
 
698
 
699
                                `ifdef UART_peripheral
700
                                `UARTrd                 :       begin
701
                                                state = sUart;
702
 
703 7 maheshpalv
                                                uartRead = 1'b1;                uartWrite = 1'b0;
704 5 maheshpalv
 
705 7 maheshpalv
                                                accMuxSel = `accMuxSelUartData;         accEn = 1'b1;   // loading UART data
706 5 maheshpalv
 
707 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          op2MuxSel = 1'b0;
708
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
709 5 maheshpalv
 
710
                                                `ifdef timerAndCounter_peripheral
711 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
712 5 maheshpalv
                                                `endif
713
 
714
 
715
                                                `ifdef SPI_peripheral
716 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
717 5 maheshpalv
                                                `endif
718
                                end
719
                                `endif
720
 
721
 
722
 
723 7 maheshpalv
                                `ifdef UART_peripheral
724
                                `UARTstat                       :       begin
725
                                                state = sUart;
726
 
727
                                                uartRead = 1'b0;                uartWrite = 1'b0;
728
 
729
                                                accMuxSel = `accMuxSelUartStat;         accEn = 1'b1;   // loading UART status
730
 
731
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          op2MuxSel = 1'b0;
732
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
733
 
734
                                                `ifdef timerAndCounter_peripheral
735
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
736
                                                `endif
737
 
738
 
739
                                                `ifdef SPI_peripheral
740
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
741
                                                `endif
742
                                end
743
                                `endif
744 5 maheshpalv
 
745 7 maheshpalv
 
746
 
747
 
748 5 maheshpalv
                                `ifdef UART_peripheral
749
                                `UARTwr                 :       begin
750
                                                state = sUart;
751
 
752 7 maheshpalv
                                                uartRead = 1'b0;                uartWrite = 1'b1;
753 5 maheshpalv
 
754 7 maheshpalv
                                                aluEn = 1'b0;   aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
755
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
756 5 maheshpalv
 
757
                                                `ifdef timerAndCounter_peripheral
758 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
759 5 maheshpalv
                                                `endif
760
 
761
 
762
                                                `ifdef SPI_peripheral
763 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
764 5 maheshpalv
                                                `endif
765
                                end
766
                                `endif
767
 
768
 
769
 
770
 
771
                                `ifdef SPI_peripheral
772
                                `SPIxFER                        :       begin
773
                                                state = sSpi;
774
 
775 7 maheshpalv
                                                sconEn = 1'b1;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
776 5 maheshpalv
 
777
 
778 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
779
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
780 5 maheshpalv
 
781
                                                `ifdef timerAndCounter_peripheral
782 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
783 5 maheshpalv
                                                `endif
784
 
785
                                                `ifdef UART_peripheral
786 7 maheshpalv
                                                uartRead = 1'b0;                uartWrite = 1'b0;
787 5 maheshpalv
                                                `endif
788
 
789
                                end
790
                                `endif
791
 
792
 
793
 
794
                                `ifdef SPI_peripheral
795
                                `SPIstat                        :       begin
796
                                                state = sSpi;
797
 
798 7 maheshpalv
                                                sconEn = 1'b0;          spiStatRead = 1'b1;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
799 5 maheshpalv
 
800
 
801 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
802
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
803 5 maheshpalv
 
804
                                                `ifdef timerAndCounter_peripheral
805 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
806 5 maheshpalv
                                                `endif
807
 
808
                                                `ifdef UART_peripheral
809 7 maheshpalv
                                                uartRead = 1'b0;                uartWrite = 1'b0;
810 5 maheshpalv
                                                `endif
811
 
812
                                end
813
                                `endif
814
 
815
 
816
 
817
                                `ifdef SPI_peripheral
818
                                `SPIwBUF                        :       begin
819
                                                state = sSpi;
820
 
821 7 maheshpalv
                                                sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b1;     spiBufShift = 1'b0;
822 5 maheshpalv
 
823
 
824 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
825
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
826 5 maheshpalv
 
827
                                                `ifdef timerAndCounter_peripheral
828 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
829 5 maheshpalv
                                                `endif
830
 
831
                                                `ifdef UART_peripheral
832 7 maheshpalv
                                                uartRead = 1'b0;                uartWrite = 1'b0;
833 5 maheshpalv
                                                `endif
834
 
835
                                end
836
                                `endif
837
 
838
 
839
 
840
                                `ifdef SPI_peripheral
841
                                `SPIrBUF                        :       begin
842
                                                state = sSpi;
843
 
844 7 maheshpalv
                                                sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b1;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
845 5 maheshpalv
 
846
 
847 7 maheshpalv
                                                aluEn = 1'b0;   aluOpcode = 1'b0;               branch = 1'b0;          accMuxSel = 1'b0;               accEn = 1'b0;   op2MuxSel = 1'b0;
848
                                                bitRamEn = 1'b0;        bitRamRw = 1'b1;        byteRamEn = 1'b0;               byteRamRw = 1'b1;               inputRead = 1'b0;               outputRw = 1'b1;
849 5 maheshpalv
 
850
                                                `ifdef timerAndCounter_peripheral
851 7 maheshpalv
                                                entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
852 5 maheshpalv
                                                `endif
853
 
854
                                                `ifdef UART_peripheral
855 7 maheshpalv
                                                uartRead = 1'b0;                uartWrite = 1'b0;
856 5 maheshpalv
                                                `endif
857
 
858
                                end
859
                                `endif
860
 
861
                                default         :       begin
862
 
863 9 maheshpalv
                                $write ("\n", $time, "ns unknown/unused instruction op-code encountered by control unit");
864 8 maheshpalv
//                              $stop;
865 5 maheshpalv
                                end
866
                                endcase // end  case (instOpCode)
867
 
868
 
869
 
870
                        end     // end case (s)
871
 
872
 
873
                        sBr             :       begin
874 7 maheshpalv
                                                        branch = 1'b0;
875 5 maheshpalv
                                                        state = s;
876
                                                        end             // end case sBr
877
 
878
 
879
                        sLd             :       begin
880 9 maheshpalv
                                                        accEn = 1'b0;
881 5 maheshpalv
                                                        state = s;
882
                                                        end             // end case sLd
883
 
884
                        sSt             :       begin
885 7 maheshpalv
                                                        bitRamRw = 1'b1;        byteRamRw = 1'b1; outputRw = 1'b1;
886 5 maheshpalv
                                                        state = s;
887
                                                        end
888
 
889
                        sAlu            :       begin
890 7 maheshpalv
                                                        aluEn = 1'b0;
891
                                                        accEn = 1'b1;
892 5 maheshpalv
                                                        accMuxSel = `accMuxSelAluOut;
893
                                                        state = s;
894
                                                        end
895
 
896
                        `ifdef timerAndCounter_peripheral
897
                        sTc             :       begin
898 7 maheshpalv
                                                        entypeEn = 1'b0;                tcAccRead = 1'b0;       tcResetEn = 1'b0;               tcPresetEn = 1'b0;      tcLoadEn = 1'b0;
899 5 maheshpalv
                                                        state = s;
900
                                                        end
901
                        `endif
902
 
903
                        `ifdef UART_peripheral
904
                        sUart           :       begin
905 7 maheshpalv
                                                        uartRead = 1'b0;                uartWrite = 1'b0;
906 5 maheshpalv
                                                        state = s;
907
                                                        end
908
                        `endif
909
 
910
                        `ifdef SPI_peripheral
911
                        sSpi            :       begin
912 7 maheshpalv
                                                        sconEn = 1'b0;          spiStatRead = 1'b0;     spiBufRead = 1'b0;      spiBufWrite = 1'b0;     spiBufShift = 1'b0;
913 5 maheshpalv
                                                        state = s;
914
                                                        end
915
                        `endif
916
 
917
                        default         :       begin
918
                        $write ("       control unit FSM in unknown state.      ");
919
                        end
920
                        endcase // end  case (state)
921
                end     // end else part (outermost)
922
 
923
 
924
 
925
        end     // end always
926
 
927
 
928 3 maheshpalv
endmodule

powered by: WebSVN 2.1.0

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