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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [actel_m1a3pl_dev_kit/] [rtl/] [verilog/] [openMSP430_fpga.v] - Blame information for rev 200

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

Line No. Rev Author Line
1 80 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_fpga.v
26
// 
27
// *Module Description:
28
//                      openMSP430 FPGA Top-level
29
//                      (targeting an Actel ProASIC3L).
30
//
31
// *Author(s):
32
//              - Olivier Girard,    olgirard@gmail.com
33
//
34
//----------------------------------------------------------------------------
35
// $Rev: 37 $
36
// $LastChangedBy: olivier.girard $
37
// $LastChangedDate: 2009-12-29 21:58:14 +0100 (Tue, 29 Dec 2009) $
38
//----------------------------------------------------------------------------
39
`include "openMSP430_defines.v"
40
 
41
module openMSP430_fpga (
42
 
43
// OUTPUTs
44
    din_x,                        // SPI Serial Data
45
    din_y,                        // SPI Serial Data
46
    led,                          // Board LEDs
47
    sclk_x,                       // SPI Serial Clock
48
    sclk_y,                       // SPI Serial Clock
49
    sync_n_x,                     // SPI Frame synchronization signal (low active)
50
    sync_n_y,                     // SPI Frame synchronization signal (low active)
51
    uart_tx,                      // Board UART TX pin
52
 
53
// INPUTs
54
    oscclk,                       // Board Oscillator (?? MHz)
55
    porst_n,                      // Board Power-On reset (active low)
56
    pbrst_n,                      // Board Push-Button reset (active low)
57
    uart_rx,                      // Board UART RX pin
58
    switch                        // Board Switches
59
);
60
 
61
// OUTPUTs
62
//=========
63
output              din_x;        // SPI Serial Data
64
output              din_y;        // SPI Serial Data
65
output        [9:0] led;          // Board LEDs
66
output              sclk_x;       // SPI Serial Clock
67
output              sclk_y;       // SPI Serial Clock
68
output              sync_n_x;     // SPI Frame synchronization signal (low active)
69
output              sync_n_y;     // SPI Frame synchronization signal (low active)
70
output              uart_tx;      // Board UART TX pin
71
 
72
// INPUTs
73
//=========
74
input               oscclk;       // Board Oscillator (?? MHz)
75
input               porst_n;      // Board Power-On reset (active low)
76
input               pbrst_n;      // Board Push-Button reset (active low)
77
input               uart_rx;      // Board UART RX pin
78
input         [9:0] switch;       // Board Switches
79
 
80
 
81
//=============================================================================
82
// 1)  INTERNAL WIRES/REGISTERS/PARAMETERS DECLARATION
83
//=============================================================================
84
 
85
wire  [`DMEM_MSB:0] dmem_addr;
86
wire                dmem_cen;
87
wire         [15:0] dmem_din;
88
wire          [1:0] dmem_wen;
89
wire         [15:0] dmem_dout;
90
 
91
wire  [`PMEM_MSB:0] pmem_addr;
92
wire                pmem_cen;
93
wire         [15:0] pmem_din;
94
wire          [1:0] pmem_wen;
95
wire         [15:0] pmem_dout;
96
 
97 111 olivier.gi
wire         [13:0] per_addr;
98 80 olivier.gi
wire         [15:0] per_din;
99
wire                per_en;
100 107 olivier.gi
wire          [1:0] per_we;
101 80 olivier.gi
wire         [15:0] per_dout;
102
 
103
wire         [13:0] irq_acc;
104
wire         [13:0] irq_bus;
105
wire                lfxt_clk;
106
wire                nmi;
107
wire                reset_n;
108
 
109
wire                dco_clk;
110
wire                mclk;
111 111 olivier.gi
wire                puc_rst;
112 80 olivier.gi
 
113
wire          [7:0] p1_din;
114
wire          [7:0] p1_dout;
115
wire          [7:0] p1_dout_en;
116
wire          [7:0] p1_sel;
117
wire         [15:0] per_dout_dio;
118
 
119
wire         [15:0] per_dout_tA;
120
 
121
wire          [3:0] cntrl1;
122
wire          [3:0] cntrl2;
123
wire         [15:0] per_dout_dac_x;
124
wire         [15:0] per_dout_dac_y;
125
 
126
 
127
//=============================================================================
128
// 2)  PLL & CLOCK GENERATION
129
//=============================================================================
130
 
131
// Input clock buffer
132
PLLINT clk_in0 (.A(oscclk), .Y(oscclk_buf));
133
 
134
 
135
parameter  FCLKA  = 48.0;
136 81 olivier.gi
parameter  M      = 7'd6;
137
parameter  N      = 7'd9;
138
parameter  U      = 5'd2;
139 80 olivier.gi
parameter  V      = 5'd1;
140
parameter  W      = 5'd1;
141
 
142 81 olivier.gi
parameter  FVCO   = FCLKA*M/N;  //  32 MHz
143 80 olivier.gi
parameter  FGLA   = FVCO/U;     //  16 MHz
144 81 olivier.gi
parameter  FGLB   = FVCO/V;     //  32 MHz
145
parameter  FGLC   = FVCO/W;     //  32 MHz
146 80 olivier.gi
 
147
wire [4:0] oadiv  = U-5'h01;
148
wire [4:0] obdiv  = V-5'h01;
149
wire [4:0] ocdiv  = W-5'h01;
150
wire [6:0] findiv = N-7'h01;
151
wire [6:0] fbdiv  = M-7'h01;
152
 
153
PLL #(.VCOFREQUENCY(FVCO))  pll_0 (
154
 
155
// PLL Inputs
156
    .CLKA         (oscclk_buf),   // Reference Clock Input
157
    .EXTFB        (1'b0),         // External Feedback
158
    .POWERDOWN    (1'b1),         // Power-Down (active low)
159
 
160
// PLL Outputs
161
    .GLA          (dco_clk),      // Primary output
162
    .LOCK         (lock),         // PLL Lock Indicator
163
    .GLB          (glb),          // Secondary 1 output
164
    .YB           (yb),           // Core 1 output
165
    .GLC          (glc),          // Secondary 2 output
166
    .YC           (yc),           // Core 2 output
167
 
168
// GLA Configuration
169
    .OADIV0       (oadiv[0]),     // Primary output divider (divider is oadiv+1)
170
    .OADIV1       (oadiv[1]),
171
    .OADIV2       (oadiv[2]),
172
    .OADIV3       (oadiv[3]),
173
    .OADIV4       (oadiv[4]),
174
 
175
    .OAMUX0       (1'b0),         // Primary output select (selects from the VCO's four phases)
176
    .OAMUX1       (1'b0),
177
    .OAMUX2       (1'b1),
178
 
179
    .DLYGLA0      (1'b0),         // Primary output delay
180
    .DLYGLA1      (1'b0),
181
    .DLYGLA2      (1'b0),
182
    .DLYGLA3      (1'b0),
183
    .DLYGLA4      (1'b0),
184
 
185
// GLB/YB configuration
186
    .OBDIV0       (obdiv[0]),     // Secondary 1 output divider (divider is obdiv+1)
187
    .OBDIV1       (obdiv[1]),
188
    .OBDIV2       (obdiv[2]),
189
    .OBDIV3       (obdiv[3]),
190
    .OBDIV4       (obdiv[4]),
191
 
192
    .OBMUX0       (1'b1),         // Secondary 1 output select (selects from the VCO's four phases)
193
    .OBMUX1       (1'b0),
194
    .OBMUX2       (1'b1),
195
 
196
    .DLYYB0       (1'b0),         // Secondary 1 YB output delay
197
    .DLYYB1       (1'b0),
198
    .DLYYB2       (1'b0),
199
    .DLYYB3       (1'b0),
200
    .DLYYB4       (1'b0),
201
 
202
    .DLYGLB0      (1'b0),         // Secondary 1 GLB output delay
203
    .DLYGLB1      (1'b0),
204
    .DLYGLB2      (1'b0),
205
    .DLYGLB3      (1'b0),
206
    .DLYGLB4      (1'b0),
207
 
208
// GLC/YC configuration
209
    .OCDIV0       (ocdiv[0]),     // Secondary 2 output divider (divider is ocdiv+1)
210
    .OCDIV1       (ocdiv[1]),
211
    .OCDIV2       (ocdiv[2]),
212
    .OCDIV3       (ocdiv[3]),
213
    .OCDIV4       (ocdiv[4]),
214
 
215
    .OCMUX0       (1'b0),         // Secondary 2 output select (selects from the VCO's four phases)
216
    .OCMUX1       (1'b0),
217
    .OCMUX2       (1'b1),
218
 
219
    .DLYYC0       (1'b0),         // Secondary 2 YC output delay
220
    .DLYYC1       (1'b0),
221
    .DLYYC2       (1'b0),
222
    .DLYYC3       (1'b0),
223
    .DLYYC4       (1'b0),
224
 
225
    .DLYGLC0      (1'b0),         // Secondary 2 GLC output delay
226
    .DLYGLC1      (1'b0),
227
    .DLYGLC2      (1'b0),
228
    .DLYGLC3      (1'b0),
229
    .DLYGLC4      (1'b0),
230
 
231
// PLL Core configuration
232
    .FINDIV0      (findiv[0]),    // Input clock divider (divider is findiv+1)
233
    .FINDIV1      (findiv[1]),
234
    .FINDIV2      (findiv[2]),
235
    .FINDIV3      (findiv[3]),
236
    .FINDIV4      (findiv[4]),
237
    .FINDIV5      (findiv[5]),
238
    .FINDIV6      (findiv[6]),
239
 
240
    .FBDIV0       (fbdiv[0]),     // Feedback clock divider (divider is fbdiv+1)
241
    .FBDIV1       (fbdiv[1]),
242
    .FBDIV2       (fbdiv[2]),
243
    .FBDIV3       (fbdiv[3]),
244
    .FBDIV4       (fbdiv[4]),
245
    .FBDIV5       (fbdiv[5]),
246
    .FBDIV6       (fbdiv[6]),
247
 
248
    .FBDLY0       (1'b0),         // Feedback Delay
249
    .FBDLY1       (1'b0),
250
    .FBDLY2       (1'b0),
251
    .FBDLY3       (1'b0),
252
    .FBDLY4       (1'b0),
253
 
254
    .FBSEL0       (1'b1),         // Primary feedback delay select (0:no dly; 1:prog dly element; 2:external feedback)
255
    .FBSEL1       (1'b0),
256
 
257
    .XDLYSEL      (1'b0),         // System Delay Select (0: no dly; 1:inserts system dly)
258
 
259 81 olivier.gi
    .VCOSEL0      (1'b1),         // PLL lock acquisition time (0: Fast with high tracking jitter; 1: Slow with low tracking jitter)
260
 
261
    .VCOSEL1      (1'b1),         // VCO gear control (see table below)
262
    .VCOSEL2      (1'b0)
263 80 olivier.gi
);
264
 
265 81 olivier.gi
//-------------+--------------------------------------------------------------+
266
//             |                           VCOSEL[2:1]                        |
267
//             |---------------+---------------+--------------+---------------|
268
//             |       00      |       01      |       10     |       11      |
269
//  VOLTAGE    |---------------+---------------+--------------+---------------|
270
//             |   Min.  Max.  |   Min.  Max.  |   Min.  Max. |   Min.  Max.  |
271
//             |  (MHz) (MHz)  |  (MHz) (MHz)  |  (MHz) (MHz) |  (MHz) (MHz)  |
272
//-------------+---------------+---------------+--------------+---------------|
273
// IGLOO and IGLOO PLUS                                                       |
274
//-------------+---------------+---------------+--------------+---------------|
275 82 olivier.gi
// 1.2 V +- 5% |   24    35    |   30     70   |   60    140  |   135   160   |
276
// 1.5 V +- 5% |   24    43.75 |   30     87.5 |   60    175  |   135   250   |
277 81 olivier.gi
//-------------+---------------+---------------+--------------+---------------|
278
// ProASIC3L, RT ProASIC3, and Military ProASIC3/L                            |
279
//-------------+---------------+---------------+--------------+---------------|
280 82 olivier.gi
// 1.2 V +- 5% |   24    35    |    30    70   |   60    140  |   135   250   |
281
// 1.5 V +- 5% |   24    43.75 |    30    70   |   60    175  |   135   350   |
282 81 olivier.gi
//-------------+---------------+---------------+--------------+---------------|
283
// ProASIC3 and Fusion                                                        |
284
//-------------+---------------+---------------+--------------+---------------|
285 82 olivier.gi
// 1.5 V +- 5% |   24    43.75 |    33.75 87.5 |  67.5   175  |   135   350   |
286 81 olivier.gi
//-------------+---------------+---------------+--------------+---------------+
287
 
288 80 olivier.gi
 
289
//=============================================================================
290
// 3)  PROGRAM AND DATA MEMORIES
291
//=============================================================================
292
 
293 111 olivier.gi
dmem_128B dmem_hi (.WD(dmem_din[15:8]), .RD(dmem_dout[15:8]), .WEN(dmem_wen[1] | dmem_cen), .REN(~dmem_wen[1] | dmem_cen), .WADDR(dmem_addr) , .RADDR(dmem_addr), .RWCLK(mclk), .RESET(~puc_rst));
294
dmem_128B dmem_lo (.WD(dmem_din[7:0]),  .RD(dmem_dout[7:0]),  .WEN(dmem_wen[0] | dmem_cen), .REN(~dmem_wen[0] | dmem_cen), .WADDR(dmem_addr) , .RADDR(dmem_addr), .RWCLK(mclk), .RESET(~puc_rst));
295 80 olivier.gi
 
296 111 olivier.gi
pmem_2kB  pmem_hi (.WD(pmem_din[15:8]), .RD(pmem_dout[15:8]), .WEN(pmem_wen[1] | pmem_cen), .REN(~pmem_wen[1] | pmem_cen), .WADDR(pmem_addr) , .RADDR(pmem_addr), .RWCLK(mclk), .RESET(~puc_rst));
297
pmem_2kB  pmem_lo (.WD(pmem_din[7:0]),  .RD(pmem_dout[7:0]),  .WEN(pmem_wen[0] | pmem_cen), .REN(~pmem_wen[0] | pmem_cen), .WADDR(pmem_addr) , .RADDR(pmem_addr), .RWCLK(mclk), .RESET(~puc_rst));
298 80 olivier.gi
 
299
 
300
//=============================================================================
301
// 4)  OPENMSP430
302
//=============================================================================
303
 
304
openMSP430 openMSP430_0 (
305
 
306
// OUTPUTs
307 155 olivier.gi
    .aclk              (),             // ASIC ONLY: ACLK
308
    .aclk_en           (aclk_en),      // FPGA ONLY: ACLK enable
309
    .dbg_freeze        (dbg_freeze),   // Freeze peripherals
310
    .dbg_i2c_sda_out   (),             // Debug interface: I2C SDA OUT
311
    .dbg_uart_txd      (uart_tx),      // Debug interface: UART TXD
312
    .dco_enable        (),             // ASIC ONLY: Fast oscillator enable
313
    .dco_wkup          (),             // ASIC ONLY: Fast oscillator wake-up (asynchronous)
314
    .dmem_addr         (dmem_addr),    // Data Memory address
315
    .dmem_cen          (dmem_cen),     // Data Memory chip enable (low active)
316
    .dmem_din          (dmem_din),     // Data Memory data input
317
    .dmem_wen          (dmem_wen),     // Data Memory write enable (low active)
318
    .irq_acc           (irq_acc),      // Interrupt request accepted (one-hot signal)
319
    .lfxt_enable       (),             // ASIC ONLY: Low frequency oscillator enable
320
    .lfxt_wkup         (),             // ASIC ONLY: Low frequency oscillator wake-up (asynchronous)
321
    .mclk              (mclk),         // Main system clock
322
    .per_addr          (per_addr),     // Peripheral address
323
    .per_din           (per_din),      // Peripheral data input
324
    .per_we            (per_we),       // Peripheral write enable (high active)
325
    .per_en            (per_en),       // Peripheral enable (high active)
326
    .pmem_addr         (pmem_addr),    // Program Memory address
327
    .pmem_cen          (pmem_cen),     // Program Memory chip enable (low active)
328
    .pmem_din          (pmem_din),     // Program Memory data input (optional)
329
    .pmem_wen          (pmem_wen),     // Program Memory write enable (low active) (optional)
330
    .puc_rst           (puc_rst),      // Main system reset
331
    .smclk             (),             // ASIC ONLY: SMCLK
332
    .smclk_en          (smclk_en),     // FPGA ONLY: SMCLK enable
333 80 olivier.gi
 
334
// INPUTs
335 155 olivier.gi
    .cpu_en            (1'b1),         // Enable CPU code execution (asynchronous and non-glitchy)
336
    .dbg_en            (1'b1),         // Debug interface enable (asynchronous and non-glitchy)
337
    .dbg_i2c_addr      (7'h00),        // Debug interface: I2C Address
338
    .dbg_i2c_broadcast (7'h00),        // Debug interface: I2C Broadcast Address (for multicore systems)
339
    .dbg_i2c_scl       (1'b1),         // Debug interface: I2C SCL
340
    .dbg_i2c_sda_in    (1'b1),         // Debug interface: I2C SDA IN
341
    .dbg_uart_rxd      (uart_rx),      // Debug interface: UART RXD (asynchronous)
342
    .dco_clk           (dco_clk),      // Fast oscillator (fast clock)
343
    .dmem_dout         (dmem_dout),    // Data Memory data output
344
    .irq               (irq_bus),      // Maskable interrupts
345
    .lfxt_clk          (1'b0),         // Low frequency oscillator (typ 32kHz)
346
    .nmi               (nmi),          // Non-maskable interrupt (asynchronous)
347
    .per_dout          (per_dout),     // Peripheral data output
348
    .pmem_dout         (pmem_dout),    // Program Memory data output
349
    .reset_n           (reset_n),      // Reset Pin (low active, asynchronous and non-glitchy)
350
    .scan_enable       (1'b0),         // ASIC ONLY: Scan enable (active during scan shifting)
351
    .scan_mode         (1'b0),         // ASIC ONLY: Scan mode
352
    .wkup              (1'b0)          // ASIC ONLY: System Wake-up (asynchronous and non-glitchy)
353 80 olivier.gi
);
354
 
355
 
356
//=============================================================================
357
// 5)  OPENMSP430 PERIPHERALS
358
//=============================================================================
359
 
360
//
361
// SPI Interface for the 12 bit DACs
362
//-----------------------------------
363
 
364
dac_spi_if #(1, 9'h190) dac_spi_if_x (
365
 
366
// OUTPUTs
367
    .cntrl1       (cntrl1),         // Control value 1
368
    .cntrl2       (cntrl2),         // Control value 2
369
    .din          (din_x),          // SPI Serial Data
370
    .per_dout     (per_dout_dac_x), // Peripheral data output
371
    .sclk         (sclk_x),         // SPI Serial Clock
372
    .sync_n       (sync_n_x),       // SPI Frame synchronization signal (low active)
373
 
374
// INPUTs
375
    .mclk         (mclk),           // Main system clock
376
    .per_addr     (per_addr),       // Peripheral address
377
    .per_din      (per_din),        // Peripheral data input
378
    .per_en       (per_en),         // Peripheral enable (high active)
379 107 olivier.gi
    .per_we       (per_we),         // Peripheral write enable (high active)
380 111 olivier.gi
    .puc_rst      (puc_rst)         // Main system reset
381 80 olivier.gi
);
382
 
383
dac_spi_if #(1, 9'h1A0) dac_spi_if_y (
384
 
385
// OUTPUTs
386
    .cntrl1       (),               // Control value 1
387
    .cntrl2       (),               // Control value 2
388
    .din          (din_y),          // SPI Serial Data
389
    .per_dout     (per_dout_dac_y), // Peripheral data output
390
    .sclk         (sclk_y),         // SPI Serial Clock
391
    .sync_n       (sync_n_y),       // SPI Frame synchronization signal (low active)
392
 
393
// INPUTs
394
    .mclk         (mclk),           // Main system clock
395
    .per_addr     (per_addr),       // Peripheral address
396
    .per_din      (per_din),        // Peripheral data input
397
    .per_en       (per_en),         // Peripheral enable (high active)
398 107 olivier.gi
    .per_we       (per_we),         // Peripheral write enable (high active)
399 111 olivier.gi
    .puc_rst      (puc_rst)         // Main system reset
400 80 olivier.gi
);
401
 
402
//
403
// Digital I/O
404
//-------------------------------
405
 
406
omsp_gpio #(.P1_EN(1),
407
            .P2_EN(0),
408
            .P3_EN(0),
409
            .P4_EN(0),
410
            .P5_EN(0),
411
            .P6_EN(0)) gpio_0 (
412
 
413
// OUTPUTs
414
    .irq_port1    (irq_port1),     // Port 1 interrupt
415
    .irq_port2    (),              // Port 2 interrupt
416
    .p1_dout      (p1_dout),       // Port 1 data output
417
    .p1_dout_en   (p1_dout_en),    // Port 1 data output enable
418
    .p1_sel       (p1_sel),        // Port 1 function select
419
    .p2_dout      (),              // Port 2 data output
420
    .p2_dout_en   (),              // Port 2 data output enable
421
    .p2_sel       (),              // Port 2 function select
422
    .p3_dout      (),              // Port 3 data output
423
    .p3_dout_en   (),              // Port 3 data output enable
424
    .p3_sel       (),              // Port 3 function select
425
    .p4_dout      (),              // Port 4 data output
426
    .p4_dout_en   (),              // Port 4 data output enable
427
    .p4_sel       (),              // Port 4 function select
428
    .p5_dout      (),              // Port 5 data output
429
    .p5_dout_en   (),              // Port 5 data output enable
430
    .p5_sel       (),              // Port 5 function select
431
    .p6_dout      (),              // Port 6 data output
432
    .p6_dout_en   (),              // Port 6 data output enable
433
    .p6_sel       (),              // Port 6 function select
434
    .per_dout     (per_dout_dio),  // Peripheral data output
435
 
436
// INPUTs
437
    .mclk         (mclk),          // Main system clock
438
    .p1_din       (p1_din),        // Port 1 data input
439
    .p2_din       (8'h00),         // Port 2 data input
440
    .p3_din       (8'h00),         // Port 3 data input
441
    .p4_din       (8'h00),         // Port 4 data input
442
    .p5_din       (8'h00),         // Port 5 data input
443
    .p6_din       (8'h00),         // Port 6 data input
444
    .per_addr     (per_addr),      // Peripheral address
445
    .per_din      (per_din),       // Peripheral data input
446
    .per_en       (per_en),        // Peripheral enable (high active)
447 107 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
448 111 olivier.gi
    .puc_rst      (puc_rst)        // Main system reset
449 80 olivier.gi
);
450
 
451
//
452
// Timer A
453
//----------------------------------------------
454
 
455
omsp_timerA timerA_0 (
456
 
457
// OUTPUTs
458
    .irq_ta0      (irq_ta0),       // Timer A interrupt: TACCR0
459
    .irq_ta1      (irq_ta1),       // Timer A interrupt: TAIV, TACCR1, TACCR2
460
    .per_dout     (per_dout_tA),   // Peripheral data output
461
    .ta_out0      (ta_out0),       // Timer A output 0
462
    .ta_out0_en   (ta_out0_en),    // Timer A output 0 enable
463
    .ta_out1      (ta_out1),       // Timer A output 1
464
    .ta_out1_en   (ta_out1_en),    // Timer A output 1 enable
465
    .ta_out2      (ta_out2),       // Timer A output 2
466
    .ta_out2_en   (ta_out2_en),    // Timer A output 2 enable
467
 
468
// INPUTs
469
    .aclk_en      (aclk_en),       // ACLK enable (from CPU)
470
    .dbg_freeze   (dbg_freeze),    // Freeze Timer A counter
471
    .inclk        (1'b0),          // INCLK external timer clock (SLOW)
472
    .irq_ta0_acc  (irq_acc[9]),    // Interrupt request TACCR0 accepted
473
    .mclk         (mclk),          // Main system clock
474
    .per_addr     (per_addr),      // Peripheral address
475
    .per_din      (per_din),       // Peripheral data input
476
    .per_en       (per_en),        // Peripheral enable (high active)
477 107 olivier.gi
    .per_we       (per_we),        // Peripheral write enable (high active)
478 111 olivier.gi
    .puc_rst      (puc_rst),       // Main system reset
479 80 olivier.gi
    .smclk_en     (smclk_en),      // SMCLK enable (from CPU)
480
    .ta_cci0a     (1'b0),          // Timer A capture 0 input A
481
    .ta_cci0b     (1'b0),          // Timer A capture 0 input B
482
    .ta_cci1a     (1'b0),          // Timer A capture 1 input A
483
    .ta_cci1b     (1'b0),          // Timer A capture 1 input B
484
    .ta_cci2a     (1'b0),          // Timer A capture 2 input A
485
    .ta_cci2b     (1'b0),          // Timer A capture 2 input B
486
    .taclk        (1'b0)           // TACLK external timer clock (SLOW)
487
);
488
 
489
//
490
// Combine peripheral data buses
491
//-------------------------------
492
 
493
assign per_dout = per_dout_dio   |
494
                  per_dout_tA    |
495
                  per_dout_dac_x |
496
                  per_dout_dac_y;
497
 
498
//
499
// Assign interrupts
500
//-------------------------------
501
 
502
assign nmi        =  1'b0;
503
assign irq_bus    = {1'b0,         // Vector 13  (0xFFFA)
504
                     1'b0,         // Vector 12  (0xFFF8)
505
                     1'b0,         // Vector 11  (0xFFF6)
506
                     1'b0,         // Vector 10  (0xFFF4) - Watchdog -
507
                     irq_ta0,      // Vector  9  (0xFFF2)
508
                     irq_ta1,      // Vector  8  (0xFFF0)
509
                     1'b0,         // Vector  7  (0xFFEE)
510
                     1'b0,         // Vector  6  (0xFFEC)
511
                     1'b0,         // Vector  5  (0xFFEA)
512
                     1'b0,         // Vector  4  (0xFFE8)
513
                     1'b0,         // Vector  3  (0xFFE6)
514
                     irq_port1,    // Vector  2  (0xFFE4)
515
                     1'b0,         // Vector  1  (0xFFE2)
516
                     1'b0};        // Vector  0  (0xFFE0)
517
 
518
//
519
// Diverse
520
//-------------------------------
521
 
522
assign  reset_n =  (porst_n & pbrst_n);
523
 
524
assign  p1_din  =  8'h00;
525
 
526 82 olivier.gi
assign  led     =  {cntrl1, p1_dout[0], p1_dout[0], cntrl2};
527 80 olivier.gi
 
528
 
529
endmodule // openMSP430_fpga
530
 

powered by: WebSVN 2.1.0

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