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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [rtl/] [verilog/] [openMSP430_defines.v] - Blame information for rev 23

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

Line No. Rev Author Line
1 23 olivier.gi
`ifdef OPENMSP430_DEFINES
2
`else
3
`define OPENMSP430_DEFINES
4 2 olivier.gi
//----------------------------------------------------------------------------
5
// Copyright (C) 2001 Authors
6
//
7
// This source file may be used and distributed without restriction provided
8
// that this copyright statement is not removed from the file and that any
9
// derivative work contains the original copyright notice and the associated
10
// disclaimer.
11
//
12
// This source file is free software; you can redistribute it and/or modify
13
// it under the terms of the GNU Lesser General Public License as published
14
// by the Free Software Foundation; either version 2.1 of the License, or
15
// (at your option) any later version.
16
//
17
// This source is distributed in the hope that it will be useful, but WITHOUT
18
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20
// License for more details.
21
//
22
// You should have received a copy of the GNU Lesser General Public License
23
// along with this source; if not, write to the Free Software Foundation,
24
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
25
//
26
//----------------------------------------------------------------------------
27
// 
28 23 olivier.gi
// *File Name: openMSP430_defines.v
29 2 olivier.gi
// 
30
// *Module Description:
31
//                      openMSP430 Configuration file
32
//
33
// *Author(s):
34
//              - Olivier Girard,    olgirard@gmail.com
35
//
36
//----------------------------------------------------------------------------
37 17 olivier.gi
// $Rev: 23 $
38
// $LastChangedBy: olivier.girard $
39
// $LastChangedDate: 2009-08-30 18:39:26 +0200 (Sun, 30 Aug 2009) $
40
//----------------------------------------------------------------------------
41 2 olivier.gi
 
42
//----------------------------------------------------------------------------
43
// SYSTEM CONFIGURATION
44
//----------------------------------------------------------------------------
45
 
46
// ROM Size:
47
//                    9 ->  1kB
48
//                   10 ->  2kB
49
//                   11 ->  4kB
50
//                   12 ->  8kB
51
//                   13 -> 16kB
52
`define ROM_AWIDTH   10
53
 
54
// RAM Size:
55
//                    6 ->  128 B
56
//                    7 ->  256 B
57
//                    8 ->  512 B
58
//                    9 ->    1 kB
59
//                   10 ->    2 kB
60
`define RAM_AWIDTH    6
61
 
62
//----------------------------------------------------------------------------
63
// REMOTE DEBUGGING INTERFACE CONFIGURATION
64
//----------------------------------------------------------------------------
65
 
66
// Include Debug interface
67
`define DBG_EN
68
 
69
// Debug interface selection
70
//             `define DBG_UART -> Enable UART (8N1) debug interface
71
//             `define DBG_JTAG -> DON'T UNCOMMENT, NOT SUPPORTED YET
72
//
73
`define DBG_UART
74
//`define DBG_JTAG
75
 
76
// Number of hardware breakpoints (each unit contains 2 hw address breakpoints)
77
//             `define DBG_HWBRK_0 -> Include hardware breakpoints unit 0
78
//             `define DBG_HWBRK_1 -> Include hardware breakpoints unit 1
79
//             `define DBG_HWBRK_2 -> Include hardware breakpoints unit 2
80
//             `define DBG_HWBRK_3 -> Include hardware breakpoints unit 3
81
//
82
`define  DBG_HWBRK_0
83
`define  DBG_HWBRK_1
84
`define  DBG_HWBRK_2
85
`define  DBG_HWBRK_3
86
 
87
 
88
//==========================================================================//
89
//==========================================================================//
90
//==========================================================================//
91
//==========================================================================//
92
//=====        SYSTEM CONSTANTS --- !!!!!!!! DO NOT EDIT !!!!!!!!      =====//
93
//==========================================================================//
94
//==========================================================================//
95
//==========================================================================//
96
//==========================================================================//
97
 
98
// ROM and RAM sizes
99
`define ROM_SIZE  (2 << `ROM_AWIDTH)
100
`define RAM_SIZE  (2 << `RAM_AWIDTH)
101
 
102
// RAM Base Adresses
103
`define RAM_BASE      16'h0200  // RAM base address
104
 
105
// ROM & RAM most significant address bit (for 16 bit words)
106
`define ROM_MSB   `ROM_AWIDTH-1
107
`define RAM_MSB   `RAM_AWIDTH-1
108
 
109
 
110
// Instructions type
111
`define INST_SO  0
112
`define INST_JMP 1
113
`define INST_TO  2
114
 
115
// Single-operand arithmetic
116
`define RRC    0
117
`define SWPB   1
118
`define RRA    2
119
`define SXT    3
120
`define PUSH   4
121
`define CALL   5
122
`define RETI   6
123
`define IRQ    7
124
 
125
// Conditional jump
126
`define JNE    0
127
`define JEQ    1
128
`define JNC    2
129
`define JC     3
130
`define JN     4
131
`define JGE    5
132
`define JL     6
133
`define JMP    7
134
 
135
// Two-operand arithmetic
136
`define MOV    0
137
`define ADD    1
138
`define ADDC   2
139
`define SUBC   3
140
`define SUB    4
141
`define CMP    5
142
`define DADD   6
143
`define BIT    7
144
`define BIC    8
145
`define BIS    9
146
`define XOR   10
147
`define AND   11
148
 
149
// Addressing modes
150
`define DIR      0
151
`define IDX      1
152
`define INDIR    2
153
`define INDIR_I  3
154
`define SYMB     4
155
`define IMM      5
156
`define ABS      6
157
`define CONST    7
158
 
159
// Execution state machine
160
`define E_IRQ_0    4'h0
161
`define E_IRQ_1    4'h1
162
`define E_IRQ_2    4'h2
163
`define E_IRQ_3    4'h3
164
`define E_IRQ_4    4'h4
165
`define E_SRC_AD   4'h5
166
`define E_SRC_RD   4'h6
167
`define E_SRC_WR   4'h7
168
`define E_DST_AD   4'h8
169
`define E_DST_RD   4'h9
170
`define E_DST_WR   4'hA
171
`define E_EXEC     4'hB
172
`define E_JUMP     4'hC
173
`define E_IDLE     4'hD
174
 
175
// ALU control signals
176
`define ALU_SRC_INV   0
177
`define ALU_INC       1
178
`define ALU_INC_C     2
179
`define ALU_ADD       3
180
`define ALU_AND       4
181
`define ALU_OR        5
182
`define ALU_XOR       6
183
`define ALU_DADD      7
184
`define ALU_STAT_7    8
185
`define ALU_STAT_F    9
186
`define ALU_SHIFT    10
187
`define EXEC_NO_WR   11
188
 
189
// Debug interface
190
`define DBG_UART_WR   18
191
`define DBG_UART_BW   17
192
`define DBG_UART_ADDR 16:11
193
 
194
// Debug interface CPU_CTL register
195
`define HALT        0
196
`define RUN         1
197
`define ISTEP       2
198
`define SW_BRK_EN   3
199
`define FRZ_BRK_EN  4
200
`define RST_BRK_EN  5
201
`define CPU_RST     6
202
 
203
// Debug interface CPU_STAT register
204
`define HALT_RUN    0
205
`define PUC_PND     1
206
`define SWBRK_PND   3
207
`define HWBRK0_PND  4
208
`define HWBRK1_PND  5
209
 
210
// Debug interface BRKx_CTL register
211
`define BRK_MODE_RD 0
212
`define BRK_MODE_WR 1
213
`define BRK_MODE    1:0
214
`define BRK_EN      2
215
`define BRK_I_EN    3
216
`define BRK_RANGE   4
217
 
218
// Basic clock module: BCSCTL1 Control Register
219
`define DIVAx       5:4
220
 
221
// Basic clock module: BCSCTL2 Control Register
222
`define SELS        3
223
`define DIVSx       2:1
224
 
225
// Timer A: TACTL Control Register
226
`define TASSELx     9:8
227
`define TAIDx       7:6
228
`define TAMCx       5:4
229
`define TACLR       2
230
`define TAIE        1
231
`define TAIFG       0
232
 
233
// Timer A: TACCTLx Capture/Compare Control Register
234
`define TACMx      15:14
235
`define TACCISx    13:12
236
`define TASCS      11
237
`define TASCCI     10
238
`define TACAP       8
239
`define TAOUTMODx   7:5
240
`define TACCIE      4
241
`define TACCI       3
242
`define TAOUT       2
243
`define TACOV       1
244
`define TACCIFG     0
245
 
246
//
247
// DEBUG INTERFACE EXTRA CONFIGURATION
248
//======================================
249
 
250
// Debug interface: Software breakpoint opcode
251
`define DBG_SWBRK_OP 16'h4343
252
 
253
// Debug interface ID
254
`define DBG_ID  24'h4D5350
255
 
256
// Debug UART interface auto data synchronization
257
// If the following define is commented out, then
258
// the DBG_UART_BAUD and DBG_DCO_FREQ need to be properly
259
// defined.
260
`define DBG_UART_AUTO_SYNC
261
 
262
// Debug UART interface data rate
263
//      In order to properly setup the UART debug interface, you
264
//      need to specify the DCO_CLK frequency (DBG_DCO_FREQ) and
265
//      the chosen BAUD rate from the UART interface.
266
//
267
//`define DBG_UART_BAUD    9600
268
//`define DBG_UART_BAUD   19200
269
//`define DBG_UART_BAUD   38400
270
//`define DBG_UART_BAUD   57600
271
//`define DBG_UART_BAUD  115200
272
//`define DBG_UART_BAUD  230400
273
//`define DBG_UART_BAUD  460800
274
//`define DBG_UART_BAUD  576000
275
//`define DBG_UART_BAUD  921600
276
`define DBG_UART_BAUD 2000000
277
`define DBG_DCO_FREQ  20000000
278
`define DBG_UART_CNT ((`DBG_DCO_FREQ/`DBG_UART_BAUD)-1)
279
 
280
// Check configuration
281
`ifdef DBG_EN
282
 `ifdef DBG_UART
283
   `ifdef DBG_JTAG
284
CONFIGURATION ERROR: JTAG AND UART DEBUG INTERFACE ARE BOTH ENABLED
285
   `endif
286
 `else
287
   `ifdef DBG_JTAG
288
CONFIGURATION ERROR: JTAG INTERFACE NOT SUPPORTED YET
289
   `else
290
CONFIGURATION ERROR: JTAG OR UART DEBUG INTERFACE SHOULD BE ENABLED
291
   `endif
292
 `endif
293
`endif
294 23 olivier.gi
 
295
 
296
`endif

powered by: WebSVN 2.1.0

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