OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [orpsocv2/] [bench/] [verilog/] [vpi/] [c/] [gdb.h] - Blame information for rev 268

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

Line No. Rev Author Line
1 40 julius
/*$$HEADER*/
2
/******************************************************************************/
3
/*                                                                            */
4
/*                    H E A D E R   I N F O R M A T I O N                     */
5
/*                                                                            */
6
/******************************************************************************/
7
 
8
// Project Name                   : ORPSoCv2
9
// File Name                      : gdb.h
10
// Prepared By                    : jb, rmd
11
// Project Start                  : 2008-10-01
12
 
13
/*$$COPYRIGHT NOTICE*/
14
/******************************************************************************/
15
/*                                                                            */
16
/*                      C O P Y R I G H T   N O T I C E                       */
17
/*                                                                            */
18
/******************************************************************************/
19
/*
20
  This library is free software; you can redistribute it and/or
21
  modify it under the terms of the GNU Lesser General Public
22
  License as published by the Free Software Foundation;
23
  version 2.1 of the License, a copy of which is available from
24
  http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt.
25
 
26
  This library is distributed in the hope that it will be useful,
27
  but WITHOUT ANY WARRANTY; without even the implied warranty of
28
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
29
  Lesser General Public License for more details.
30
 
31
  You should have received a copy of the GNU Lesser General Public
32
  License along with this library; if not, write to the Free Software
33
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
34
*/
35
 
36
/*$$CHANGE HISTORY*/
37
/******************************************************************************/
38
/*                                                                            */
39
/*                         C H A N G E  H I S T O R Y                         */
40
/*                                                                            */
41
/******************************************************************************/
42
 
43
// Date         Version Description
44
//------------------------------------------------------------------------
45
// 081101               First revision, adapted from existing "jp" 
46
//                      debug proxy.                               jb, rmd
47
// 090608               A few hacks for VPI compatibilty added          jb
48
 
49
#ifndef GDB_H
50
#define GDB_H
51
 
52
#include <sys/types.h>
53
#include <inttypes.h>
54
 
55
extern void HandleServerSocket(void);
56
extern void handle_rsp (void);
57
int GetServerSocket(const char* name, const char* proto, int port);
58
extern void JTAGRequest(void);
59
void setup_or32(void);
60
void gdb_close();
61
void rsp_set_server_port(int);
62
 
63
//extern int err;
64
 
65
/* All JTAG chains.  */
66
enum jtag_chains
67
  {
68
    SC_GLOBAL,      /* 0 Global BS Chain */
69
    SC_RISC_DEBUG,  /* 1 RISC Debug Interface chain */
70
    SC_RISC_TEST,   /* 2 RISC Test Chain */
71
    SC_TRACE,       /* 3 Trace Chain */
72
    SC_REGISTER,    /* 4 Register Chain */
73
    SC_WISHBONE,    /* 5 Memory chain */
74
    SC_BLOCK,       /* 6 Block Chains */
75
  };
76
 
77
/* See JTAG documentation about these.  */
78
#define JI_SIZE (4)
79
enum jtag_instr
80
  {
81
    JI_EXTEST,
82
    JI_SAMPLE_PRELOAD,
83
    JI_IDCODE,
84
    JI_CHAIN_SELECT,
85
    JI_INTEST,
86
    JI_CLAMP,
87
    JI_CLAMPZ,
88
    JI_HIGHZ,
89
    JI_DEBUG,
90
    JI_BYPASS = 0xF
91
  };
92
 
93
/* JTAG registers.  */
94
#define JTAG_MODER  (0x0)
95
#define JTAG_TSEL   (0x1)
96
#define JTAG_QSEL   (0x2)
97
#define JTAG_SSEL   (0x3)
98
#define JTAG_RISCOP (0x4)
99
#define JTAG_RECWP0 (0x10)
100
#define JTAG_RECBP0 (0x1b)
101
 
102
/* This is repeated from gdb tm-or1k.h There needs to be
103
   a better mechanism for tracking this, but I don't see
104
   an easy way to share files between modules. */
105
 
106
typedef enum {
107
  JTAG_COMMAND_READ = 1,
108
  JTAG_COMMAND_WRITE = 2,
109
  JTAG_COMMAND_BLOCK_READ = 3,
110
  JTAG_COMMAND_BLOCK_WRITE = 4,
111
  JTAG_COMMAND_CHAIN = 5,
112
} JTAG_proxy_protocol_commands;
113
 
114
/* Each transmit structure must begin with an integer
115
   which specifies the type of command. Information
116
   after this is variable. Make sure to have all information
117
   aligned properly. If we stick with 32 bit integers, it
118
   should be portable onto every platform. These structures
119
   will be transmitted across the network in network byte
120
   order.
121
*/
122
 
123 49 julius
/* Special purpose groups */
124
 
125
#define OR1K_SPG_SIZE_BITS  11
126
#define OR1K_SPG_SIZE       (1 << OR1K_SPG_SIZE_BITS)
127
 
128
#define OR1K_SPG_SYS      0
129
#define OR1K_SPG_DMMU     1
130
#define OR1K_SPG_IMMU     2
131
#define OR1K_SPG_DC       3
132
#define OR1K_SPG_IC       4
133
#define OR1K_SPG_MAC      5
134
#define OR1K_SPG_DEBUG    6
135
#define OR1K_SPG_PC       7
136
#define OR1K_SPG_PM       8
137
#define OR1K_SPG_PIC      9
138
#define OR1K_SPG_TT      10
139
#define OR1K_SPG_FPU     11
140
 
141
 
142 40 julius
typedef struct {
143
  uint32_t command;
144
  uint32_t length;
145
  uint32_t address;
146
  uint32_t data_H;
147
  uint32_t data_L;
148
} JTAGProxyWriteMessage;
149
 
150
typedef struct {
151
  uint32_t command;
152
  uint32_t length;
153
  uint32_t address;
154
} JTAGProxyReadMessage;
155
 
156
typedef struct {
157
  uint32_t command;
158
  uint32_t length;
159
  uint32_t address;
160
  int32_t  nRegisters;
161
  uint32_t data[1];
162
} JTAGProxyBlockWriteMessage;
163
 
164
typedef struct {
165
  uint32_t command;
166
  uint32_t length;
167
  uint32_t address;
168
  int32_t  nRegisters;
169
} JTAGProxyBlockReadMessage;
170
 
171
typedef struct {
172
  uint32_t command;
173
  uint32_t length;
174
  uint32_t chain;
175
} JTAGProxyChainMessage;
176
 
177
/* The responses are messages specific, however convention
178
   states the first word should be an error code. Again,
179
   sticking with 32 bit integers should provide maximum
180
   portability. */
181
 
182
typedef struct {
183
  int32_t status;
184
} JTAGProxyWriteResponse;
185
 
186
typedef struct {
187
  int32_t status;
188
  uint32_t data_H;
189
  uint32_t data_L;
190
} JTAGProxyReadResponse;
191
 
192
typedef struct {
193
  int32_t status;
194
} JTAGProxyBlockWriteResponse;
195
 
196
typedef struct {
197
  int32_t status;
198
  int32_t nRegisters;
199
  uint32_t data[1];
200
  /* uint32_t data[nRegisters-1] still unread */
201
} JTAGProxyBlockReadResponse;
202
 
203
typedef struct {
204
  int32_t status;
205
} JTAGProxyChainResponse;
206
 
207
 
208
#endif /* GDB_H */

powered by: WebSVN 2.1.0

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