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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [rtl/] [verilog/] [openMSP430.v] - Blame information for rev 106

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

Line No. Rev Author Line
1 2 olivier.gi
//----------------------------------------------------------------------------
2
// Copyright (C) 2001 Authors
3
//
4
// This source file may be used and distributed without restriction provided
5
// that this copyright statement is not removed from the file and that any
6
// derivative work contains the original copyright notice and the associated
7
// disclaimer.
8
//
9
// This source file is free software; you can redistribute it and/or modify
10
// it under the terms of the GNU Lesser General Public License as published
11
// by the Free Software Foundation; either version 2.1 of the License, or
12
// (at your option) any later version.
13
//
14
// This source is distributed in the hope that it will be useful, but WITHOUT
15
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17
// License for more details.
18
//
19
// You should have received a copy of the GNU Lesser General Public License
20
// along with this source; if not, write to the Free Software Foundation,
21
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22
//
23
//----------------------------------------------------------------------------
24
//
25
// *File Name: openMSP430.v
26
// 
27
// *Module Description:
28
//                       openMSP430 Top level file
29
//
30
// *Author(s):
31
//              - Olivier Girard,    olgirard@gmail.com
32
//
33
//----------------------------------------------------------------------------
34 17 olivier.gi
// $Rev: 106 $
35
// $LastChangedBy: olivier.girard $
36
// $LastChangedDate: 2011-03-25 23:01:03 +0100 (Fri, 25 Mar 2011) $
37
//----------------------------------------------------------------------------
38 103 olivier.gi
`ifdef OMSP_NO_INCLUDE
39
`else
40 23 olivier.gi
`include "openMSP430_defines.v"
41 103 olivier.gi
`endif
42 2 olivier.gi
 
43
module  openMSP430 (
44
 
45
// OUTPUTs
46 33 olivier.gi
    aclk_en,                       // ACLK enable
47
    dbg_freeze,                    // Freeze peripherals
48
    dbg_uart_txd,                  // Debug interface: UART TXD
49
    dmem_addr,                     // Data Memory address
50
    dmem_cen,                      // Data Memory chip enable (low active)
51
    dmem_din,                      // Data Memory data input
52
    dmem_wen,                      // Data Memory write enable (low active)
53
    irq_acc,                       // Interrupt request accepted (one-hot signal)
54
    mclk,                          // Main system clock
55
    per_addr,                      // Peripheral address
56
    per_din,                       // Peripheral data input
57 106 olivier.gi
    per_we,                        // Peripheral write enable (high active)
58 33 olivier.gi
    per_en,                        // Peripheral enable (high active)
59
    pmem_addr,                     // Program Memory address
60
    pmem_cen,                      // Program Memory chip enable (low active)
61
    pmem_din,                      // Program Memory data input (optional)
62
    pmem_wen,                      // Program Memory write enable (low active) (optional)
63
    puc,                           // Main system reset
64
    smclk_en,                      // SMCLK enable
65 2 olivier.gi
 
66
// INPUTs
67 106 olivier.gi
    cpu_en,                        // Enable CPU code execution (asynchronous)
68
    dbg_en,                        // Debug interface enable (asynchronous)
69
    dbg_uart_rxd,                  // Debug interface: UART RXD (asynchronous)
70 33 olivier.gi
    dco_clk,                       // Fast oscillator (fast clock)
71
    dmem_dout,                     // Data Memory data output
72
    irq,                           // Maskable interrupts
73
    lfxt_clk,                      // Low frequency oscillator (typ 32kHz)
74
    nmi,                           // Non-maskable interrupt (asynchronous)
75
    per_dout,                      // Peripheral data output
76
    pmem_dout,                     // Program Memory data output
77 106 olivier.gi
    reset_n                        // Reset Pin (low active, asynchronous)
78 2 olivier.gi
);
79
 
80
// OUTPUTs
81
//=========
82 33 olivier.gi
output               aclk_en;      // ACLK enable
83
output               dbg_freeze;   // Freeze peripherals
84
output               dbg_uart_txd; // Debug interface: UART TXD
85
output [`DMEM_MSB:0] dmem_addr;    // Data Memory address
86
output               dmem_cen;     // Data Memory chip enable (low active)
87
output        [15:0] dmem_din;     // Data Memory data input
88
output         [1:0] dmem_wen;     // Data Memory write enable (low active)
89
output        [13:0] irq_acc;      // Interrupt request accepted (one-hot signal)
90
output               mclk;         // Main system clock
91
output         [7:0] per_addr;     // Peripheral address
92
output        [15:0] per_din;      // Peripheral data input
93 106 olivier.gi
output         [1:0] per_we;       // Peripheral write enable (high active)
94 33 olivier.gi
output               per_en;       // Peripheral enable (high active)
95
output [`PMEM_MSB:0] pmem_addr;    // Program Memory address
96
output               pmem_cen;     // Program Memory chip enable (low active)
97
output        [15:0] pmem_din;     // Program Memory data input (optional)
98
output         [1:0] pmem_wen;     // Program Memory write enable (low active) (optional)
99
output               puc;          // Main system reset
100
output               smclk_en;     // SMCLK enable
101 2 olivier.gi
 
102
 
103
// INPUTs
104
//=========
105 106 olivier.gi
input                cpu_en;       // Enable CPU code execution (asynchronous)
106
input                dbg_en;       // Debug interface enable (asynchronous)
107
input                dbg_uart_rxd; // Debug interface: UART RXD (asynchronous)
108 33 olivier.gi
input                dco_clk;      // Fast oscillator (fast clock)
109
input         [15:0] dmem_dout;    // Data Memory data output
110
input         [13:0] irq;          // Maskable interrupts
111
input                lfxt_clk;     // Low frequency oscillator (typ 32kHz)
112
input                nmi;          // Non-maskable interrupt (asynchronous)
113
input         [15:0] per_dout;     // Peripheral data output
114
input         [15:0] pmem_dout;    // Program Memory data output
115 106 olivier.gi
input                reset_n;      // Reset Pin (active low, asynchronous)
116 2 olivier.gi
 
117
 
118
 
119
//=============================================================================
120
// 1)  INTERNAL WIRES/REGISTERS/PARAMETERS DECLARATION
121
//=============================================================================
122
 
123
wire          [7:0] inst_ad;
124
wire          [7:0] inst_as;
125
wire         [11:0] inst_alu;
126
wire                inst_bw;
127
wire         [15:0] inst_dest;
128
wire         [15:0] inst_dext;
129
wire         [15:0] inst_sext;
130
wire          [7:0] inst_so;
131
wire         [15:0] inst_src;
132
wire          [2:0] inst_type;
133
wire          [3:0] e_state;
134
wire                exec_done;
135
 
136
wire         [15:0] eu_mab;
137
wire         [15:0] eu_mdb_in;
138
wire         [15:0] eu_mdb_out;
139
wire          [1:0] eu_mb_wr;
140
wire         [15:0] fe_mab;
141
wire         [15:0] fe_mdb_in;
142
 
143
wire         [15:0] pc_sw;
144
wire          [7:0] inst_jmp;
145
wire         [15:0] pc;
146
wire         [15:0] pc_nxt;
147
 
148 86 olivier.gi
wire                dbg_halt_cmd;
149
wire                dbg_mem_en;
150
wire                dbg_reg_wr;
151 106 olivier.gi
wire                dbg_cpu_reset;
152 2 olivier.gi
wire         [15:0] dbg_mem_addr;
153
wire         [15:0] dbg_mem_dout;
154
wire         [15:0] dbg_mem_din;
155
wire         [15:0] dbg_reg_din;
156
wire          [1:0] dbg_mem_wr;
157
 
158
wire         [15:0] per_dout_or;
159
wire         [15:0] per_dout_sfr;
160
wire         [15:0] per_dout_wdog;
161 67 olivier.gi
wire         [15:0] per_dout_mpy;
162 2 olivier.gi
wire         [15:0] per_dout_clk;
163
 
164
 
165
//=============================================================================
166
// 2)  GLOBAL CLOCK & RESET MANAGEMENT
167
//=============================================================================
168
 
169 34 olivier.gi
omsp_clock_module clock_module_0 (
170 2 olivier.gi
 
171
// OUTPUTs
172
    .aclk_en      (aclk_en),       // ACLK enablex
173 106 olivier.gi
    .cpu_en_s     (cpu_en_s),      // Enable CPU code execution (synchronous)
174
    .dbg_clk      (dbg_clk),       // Debug unit clock
175
    .dbg_en_s     (dbg_en_s),      // Debug interface enable (synchronous)
176
    .dbg_rst      (dbg_rst),       // Debug unit reset
177 2 olivier.gi
    .mclk         (mclk),          // Main system clock
178
    .per_dout     (per_dout_clk),  // Peripheral data output
179
    .por          (por),           // Power-on reset
180
    .puc          (puc),           // Main system reset
181
    .smclk_en     (smclk_en),      // SMCLK enable
182
 
183
// INPUTs
184 106 olivier.gi
    .cpu_en       (cpu_en),        // Enable CPU code execution (asynchronous)
185
    .dbg_cpu_reset(dbg_cpu_reset), // Reset CPU from debug interface
186
    .dbg_en       (dbg_en),        // Debug interface enable (asynchronous)
187 2 olivier.gi
    .dco_clk      (dco_clk),       // Fast oscillator (fast clock)
188
    .lfxt_clk     (lfxt_clk),      // Low frequency oscillator (typ 32kHz)
189
    .oscoff       (oscoff),        // Turns off LFXT1 clock input
190
    .per_addr     (per_addr),      // Peripheral address
191
    .per_din      (per_din),       // Peripheral data input
192
    .per_en       (per_en),        // Peripheral enable (high active)
193 106 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
194
    .reset_n      (reset_n),       // Reset Pin (low active, asynchronous)
195 2 olivier.gi
    .scg1         (scg1),          // System clock generator 1. Turns off the SMCLK
196
    .wdt_reset    (wdt_reset)      // Watchdog-timer reset
197
);
198
 
199
 
200
//=============================================================================
201
// 3)  FRONTEND (<=> FETCH & DECODE)
202
//=============================================================================
203
 
204 34 olivier.gi
omsp_frontend frontend_0 (
205 2 olivier.gi
 
206
// OUTPUTs
207
    .dbg_halt_st  (dbg_halt_st),   // Halt/Run status from CPU
208 53 olivier.gi
    .decode_noirq (decode_noirq),  // Frontend decode instruction
209 2 olivier.gi
    .e_state      (e_state),       // Execution state
210
    .exec_done    (exec_done),     // Execution completed
211
    .inst_ad      (inst_ad),       // Decoded Inst: destination addressing mode
212
    .inst_as      (inst_as),       // Decoded Inst: source addressing mode
213
    .inst_alu     (inst_alu),      // ALU control signals
214
    .inst_bw      (inst_bw),       // Decoded Inst: byte width
215
    .inst_dest    (inst_dest),     // Decoded Inst: destination (one hot)
216
    .inst_dext    (inst_dext),     // Decoded Inst: destination extended instruction word
217
    .inst_irq_rst (inst_irq_rst),  // Decoded Inst: Reset interrupt
218
    .inst_jmp     (inst_jmp),      // Decoded Inst: Conditional jump
219 105 olivier.gi
    .inst_mov     (inst_mov),      // Decoded Inst: mov instruction
220 2 olivier.gi
    .inst_sext    (inst_sext),     // Decoded Inst: source extended instruction word
221
    .inst_so      (inst_so),       // Decoded Inst: Single-operand arithmetic
222
    .inst_src     (inst_src),      // Decoded Inst: source (one hot)
223
    .inst_type    (inst_type),     // Decoded Instruction type
224
    .irq_acc      (irq_acc),       // Interrupt request accepted
225
    .mab          (fe_mab),        // Frontend Memory address bus
226
    .mb_en        (fe_mb_en),      // Frontend Memory bus enable
227
    .nmi_acc      (nmi_acc),       // Non-Maskable interrupt request accepted
228
    .pc           (pc),            // Program counter
229
    .pc_nxt       (pc_nxt),        // Next PC value (for CALL & IRQ)
230
 
231
// INPUTs
232 106 olivier.gi
    .cpu_en_s     (cpu_en_s),      // Enable CPU code execution (synchronous)
233 2 olivier.gi
    .cpuoff       (cpuoff),        // Turns off the CPU
234
    .dbg_halt_cmd (dbg_halt_cmd),  // Halt CPU command
235
    .dbg_reg_sel  (dbg_mem_addr[3:0]), // Debug selected register for rd/wr access
236 33 olivier.gi
    .fe_pmem_wait (fe_pmem_wait),  // Frontend wait for Instruction fetch
237 2 olivier.gi
    .gie          (gie),           // General interrupt enable
238
    .irq          (irq),           // Maskable interrupts
239
    .mclk         (mclk),          // Main system clock
240
    .mdb_in       (fe_mdb_in),     // Frontend Memory data bus input
241
    .nmi_evt      (nmi_evt),       // Non-maskable interrupt event
242
    .pc_sw        (pc_sw),         // Program counter software value
243
    .pc_sw_wr     (pc_sw_wr),      // Program counter software write
244
    .puc          (puc),           // Main system reset
245
    .wdt_irq      (wdt_irq)        // Watchdog-timer interrupt
246
);
247
 
248
 
249
//=============================================================================
250
// 4)  EXECUTION UNIT
251
//=============================================================================
252
 
253 34 olivier.gi
omsp_execution_unit execution_unit_0 (
254 2 olivier.gi
 
255
// OUTPUTs
256
    .cpuoff       (cpuoff),        // Turns off the CPU
257
    .dbg_reg_din  (dbg_reg_din),   // Debug unit CPU register data input
258
    .mab          (eu_mab),        // Memory address bus
259
    .mb_en        (eu_mb_en),      // Memory bus enable
260
    .mb_wr        (eu_mb_wr),      // Memory bus write transfer
261
    .mdb_out      (eu_mdb_out),    // Memory data bus output
262
    .oscoff       (oscoff),        // Turns off LFXT1 clock input
263
    .pc_sw        (pc_sw),         // Program counter software value
264
    .pc_sw_wr     (pc_sw_wr),      // Program counter software write
265
    .scg1         (scg1),          // System clock generator 1. Turns off the SMCLK
266
 
267
// INPUTs
268
    .dbg_halt_st  (dbg_halt_st),   // Halt/Run status from CPU
269
    .dbg_mem_dout (dbg_mem_dout),  // Debug unit data output
270
    .dbg_reg_wr   (dbg_reg_wr),    // Debug unit CPU register write
271
    .e_state      (e_state),       // Execution state
272
    .exec_done    (exec_done),     // Execution completed
273
    .gie          (gie),           // General interrupt enable
274
    .inst_ad      (inst_ad),       // Decoded Inst: destination addressing mode
275
    .inst_as      (inst_as),       // Decoded Inst: source addressing mode
276
    .inst_alu     (inst_alu),      // ALU control signals
277
    .inst_bw      (inst_bw),       // Decoded Inst: byte width
278
    .inst_dest    (inst_dest),     // Decoded Inst: destination (one hot)
279
    .inst_dext    (inst_dext),     // Decoded Inst: destination extended instruction word
280
    .inst_irq_rst (inst_irq_rst),  // Decoded Inst: reset interrupt
281
    .inst_jmp     (inst_jmp),      // Decoded Inst: Conditional jump
282 105 olivier.gi
    .inst_mov     (inst_mov),      // Decoded Inst: mov instruction
283 2 olivier.gi
    .inst_sext    (inst_sext),     // Decoded Inst: source extended instruction word
284
    .inst_so      (inst_so),       // Decoded Inst: Single-operand arithmetic
285
    .inst_src     (inst_src),      // Decoded Inst: source (one hot)
286
    .inst_type    (inst_type),     // Decoded Instruction type
287
    .mclk         (mclk),          // Main system clock
288
    .mdb_in       (eu_mdb_in),     // Memory data bus input
289
    .pc           (pc),            // Program counter
290
    .pc_nxt       (pc_nxt),        // Next PC value (for CALL & IRQ)
291
    .puc          (puc)            // Main system reset
292
);
293
 
294
 
295
//=============================================================================
296
// 5)  MEMORY BACKBONE
297
//=============================================================================
298
 
299 34 olivier.gi
omsp_mem_backbone mem_backbone_0 (
300 2 olivier.gi
 
301
// OUTPUTs
302
    .dbg_mem_din  (dbg_mem_din),   // Debug unit Memory data input
303 33 olivier.gi
    .dmem_addr    (dmem_addr),     // Data Memory address
304
    .dmem_cen     (dmem_cen),      // Data Memory chip enable (low active)
305
    .dmem_din     (dmem_din),      // Data Memory data input
306
    .dmem_wen     (dmem_wen),      // Data Memory write enable (low active)
307 2 olivier.gi
    .eu_mdb_in    (eu_mdb_in),     // Execution Unit Memory data bus input
308
    .fe_mdb_in    (fe_mdb_in),     // Frontend Memory data bus input
309 33 olivier.gi
    .fe_pmem_wait (fe_pmem_wait),  // Frontend wait for Instruction fetch
310 2 olivier.gi
    .per_addr     (per_addr),      // Peripheral address
311
    .per_din      (per_din),       // Peripheral data input
312 106 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
313 2 olivier.gi
    .per_en       (per_en),        // Peripheral enable (high active)
314 33 olivier.gi
    .pmem_addr    (pmem_addr),     // Program Memory address
315
    .pmem_cen     (pmem_cen),      // Program Memory chip enable (low active)
316
    .pmem_din     (pmem_din),      // Program Memory data input (optional)
317
    .pmem_wen     (pmem_wen),      // Program Memory write enable (low active) (optional)
318 2 olivier.gi
 
319
// INPUTs
320
    .dbg_halt_st  (dbg_halt_st),   // Halt/Run status from CPU
321
    .dbg_mem_addr (dbg_mem_addr),  // Debug address for rd/wr access
322
    .dbg_mem_dout (dbg_mem_dout),  // Debug unit data output
323
    .dbg_mem_en   (dbg_mem_en),    // Debug unit memory enable
324
    .dbg_mem_wr   (dbg_mem_wr),    // Debug unit memory write
325 33 olivier.gi
    .dmem_dout    (dmem_dout),     // Data Memory data output
326 2 olivier.gi
    .eu_mab       (eu_mab[15:1]),  // Execution Unit Memory address bus
327
    .eu_mb_en     (eu_mb_en),      // Execution Unit Memory bus enable
328
    .eu_mb_wr     (eu_mb_wr),      // Execution Unit Memory bus write transfer
329
    .eu_mdb_out   (eu_mdb_out),    // Execution Unit Memory data bus output
330
    .fe_mab       (fe_mab[15:1]),  // Frontend Memory address bus
331
    .fe_mb_en     (fe_mb_en),      // Frontend Memory bus enable
332
    .mclk         (mclk),          // Main system clock
333
    .per_dout     (per_dout_or),   // Peripheral data output
334 33 olivier.gi
    .pmem_dout    (pmem_dout),     // Program Memory data output
335
    .puc          (puc)            // Main system reset
336 2 olivier.gi
);
337
 
338
 
339
//=============================================================================
340
// 6)  SPECIAL FUNCTION REGISTERS
341
//=============================================================================
342
 
343 34 olivier.gi
omsp_sfr sfr_0 (
344 2 olivier.gi
 
345
// OUTPUTs
346
    .nmie         (nmie),          // Non-maskable interrupt enable
347
    .per_dout     (per_dout_sfr),  // Peripheral data output
348
    .wdt_irq      (wdt_irq),       // Watchdog-timer interrupt
349
    .wdt_reset    (wdt_reset),     // Watchdog-timer reset
350
    .wdtie        (wdtie),         // Watchdog-timer interrupt enable
351
 
352
// INPUTs
353
    .mclk         (mclk),          // Main system clock
354
    .nmi_acc      (nmi_acc),       // Non-Maskable interrupt request accepted
355
    .per_addr     (per_addr),      // Peripheral address
356
    .per_din      (per_din),       // Peripheral data input
357
    .per_en       (per_en),        // Peripheral enable (high active)
358 106 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
359 2 olivier.gi
    .por          (por),           // Power-on reset
360
    .puc          (puc),           // Main system reset
361
    .wdtifg_clr   (irq_acc[10]),   // Clear Watchdog-timer interrupt flag
362
    .wdtifg_set   (wdtifg_set),    // Set Watchdog-timer interrupt flag
363
    .wdtpw_error  (wdtpw_error),   // Watchdog-timer password error
364
    .wdttmsel     (wdttmsel)       // Watchdog-timer mode select
365
);
366
 
367
 
368
//=============================================================================
369
// 7)  WATCHDOG TIMER
370
//=============================================================================
371
 
372 34 olivier.gi
omsp_watchdog watchdog_0 (
373 2 olivier.gi
 
374
// OUTPUTs
375
    .nmi_evt      (nmi_evt),       // NMI Event
376
    .per_dout     (per_dout_wdog), // Peripheral data output
377
    .wdtifg_set   (wdtifg_set),    // Set Watchdog-timer interrupt flag
378
    .wdtpw_error  (wdtpw_error),   // Watchdog-timer password error
379
    .wdttmsel     (wdttmsel),      // Watchdog-timer mode select
380
 
381
// INPUTs
382
    .aclk_en      (aclk_en),       // ACLK enable
383
    .dbg_freeze   (dbg_freeze),    // Freeze Watchdog counter
384
    .mclk         (mclk),          // Main system clock
385
    .nmi          (nmi),           // Non-maskable interrupt (asynchronous)
386
    .nmie         (nmie),          // Non-maskable interrupt enable
387
    .per_addr     (per_addr),      // Peripheral address
388
    .per_din      (per_din),       // Peripheral data input
389
    .per_en       (per_en),        // Peripheral enable (high active)
390 106 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
391 2 olivier.gi
    .puc          (puc),           // Main system reset
392
    .smclk_en     (smclk_en),      // SMCLK enable
393
    .wdtie        (wdtie)          // Watchdog-timer interrupt enable
394
);
395
 
396
 
397
//=============================================================================
398 67 olivier.gi
// 8)  HARDWARE MULTIPLIER
399 2 olivier.gi
//=============================================================================
400 67 olivier.gi
`ifdef MULTIPLIER
401
omsp_multiplier multiplier_0 (
402 2 olivier.gi
 
403 67 olivier.gi
// OUTPUTs
404
    .per_dout     (per_dout_mpy),  // Peripheral data output
405
 
406
// INPUTs
407
    .mclk         (mclk),          // Main system clock
408
    .per_addr     (per_addr),      // Peripheral address
409
    .per_din      (per_din),       // Peripheral data input
410
    .per_en       (per_en),        // Peripheral enable (high active)
411 106 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
412 67 olivier.gi
    .puc          (puc)            // Main system reset
413
);
414
`else
415
assign per_dout_mpy = 16'h0000;
416
`endif
417
 
418
//=============================================================================
419
// 9)  PERIPHERALS' OUTPUT BUS
420
//=============================================================================
421
 
422 2 olivier.gi
assign  per_dout_or  =  per_dout      |
423
                        per_dout_clk  |
424
                        per_dout_sfr  |
425 67 olivier.gi
                        per_dout_wdog |
426
                        per_dout_mpy;
427 2 olivier.gi
 
428
 
429
//=============================================================================
430 67 olivier.gi
// 10)  DEBUG INTERFACE
431 2 olivier.gi
//=============================================================================
432
 
433
`ifdef DBG_EN
434 34 olivier.gi
omsp_dbg dbg_0 (
435 2 olivier.gi
 
436
// OUTPUTs
437
    .dbg_freeze   (dbg_freeze),    // Freeze peripherals
438
    .dbg_halt_cmd (dbg_halt_cmd),  // Halt CPU command
439
    .dbg_mem_addr (dbg_mem_addr),  // Debug address for rd/wr access
440
    .dbg_mem_dout (dbg_mem_dout),  // Debug unit data output
441
    .dbg_mem_en   (dbg_mem_en),    // Debug unit memory enable
442
    .dbg_mem_wr   (dbg_mem_wr),    // Debug unit memory write
443
    .dbg_reg_wr   (dbg_reg_wr),    // Debug unit CPU register write
444 106 olivier.gi
    .dbg_cpu_reset(dbg_cpu_reset), // Reset CPU from debug interface
445 2 olivier.gi
    .dbg_uart_txd (dbg_uart_txd),  // Debug interface: UART TXD
446
 
447
// INPUTs
448 106 olivier.gi
    .cpu_en_s     (cpu_en_s),      // Enable CPU code execution (synchronous)
449
    .dbg_clk      (dbg_clk),       // Debug unit clock
450
    .dbg_en_s     (dbg_en_s),      // Debug interface enable (synchronous)
451 2 olivier.gi
    .dbg_halt_st  (dbg_halt_st),   // Halt/Run status from CPU
452
    .dbg_mem_din  (dbg_mem_din),   // Debug unit Memory data input
453
    .dbg_reg_din  (dbg_reg_din),   // Debug unit CPU register data input
454 106 olivier.gi
    .dbg_rst      (dbg_rst),       // Debug unit reset
455
    .dbg_uart_rxd (dbg_uart_rxd),  // Debug interface: UART RXD (asynchronous)
456 53 olivier.gi
    .decode_noirq (decode_noirq),  // Frontend decode instruction
457 2 olivier.gi
    .eu_mab       (eu_mab),        // Execution-Unit Memory address bus
458
    .eu_mb_en     (eu_mb_en),      // Execution-Unit Memory bus enable
459
    .eu_mb_wr     (eu_mb_wr),      // Execution-Unit Memory bus write transfer
460
    .eu_mdb_in    (eu_mdb_in),     // Memory data bus input
461
    .eu_mdb_out   (eu_mdb_out),    // Memory data bus output
462
    .exec_done    (exec_done),     // Execution completed
463
    .fe_mb_en     (fe_mb_en),      // Frontend Memory bus enable
464
    .fe_mdb_in    (fe_mdb_in),     // Frontend Memory data bus input
465
    .pc           (pc),            // Program counter
466
    .puc          (puc)            // Main system reset
467
);
468
 
469
`else
470 106 olivier.gi
assign dbg_freeze    =  ~cpu_en_s;
471
assign dbg_halt_cmd  =  1'b0;
472
assign dbg_mem_addr  = 16'h0000;
473
assign dbg_mem_dout  = 16'h0000;
474
assign dbg_mem_en    =  1'b0;
475
assign dbg_mem_wr    =  2'b00;
476
assign dbg_reg_wr    =  1'b0;
477
assign dbg_cpu_reset =  1'b0;
478
assign dbg_uart_txd  =  1'b0;
479 2 olivier.gi
`endif
480
 
481
 
482
endmodule // openMSP430
483
 
484 103 olivier.gi
`ifdef OMSP_NO_INCLUDE
485
`else
486 33 olivier.gi
`include "openMSP430_undefines.v"
487 103 olivier.gi
`endif

powered by: WebSVN 2.1.0

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