iotest.h
5.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*************************************************************************
*
* File: iotest.h
*
* Header file for the I/O test driver.
*
* $Header: /root/leakn64/depot/rf/sw/bbplayer/iosim/src/iotest.h,v 1.4 2002/11/01 19:40:23 whs Exp $
*
*/
#ifndef _IO_TEST_H_
#define _IO_TEST_H_
#include <stdio.h>
/**********************************************************************
* General typedefs and definitions
*/
typedef volatile unsigned char vu_char;
typedef volatile unsigned short vu_short;
typedef volatile unsigned int vu_int;
typedef volatile unsigned long long vu_longlong;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/**********************************************************************
* Typedefs
*/
/*
* Test Command Structure
*/
typedef struct _tstCmdStruct {
int id;
char *desc;
int (*handler)(int, int, int, int );
char *name;
} TstCmd;
/**********************************************************************
* Common definitions
*/
#define PASSED 1
#define FAILED 0
#define PASS_STR "Passed"
#define FAIL_STR "Failed"
#define STR_IN_DIR "In/"
#define STR_OUT_DIR "Out/"
#define BUF_SIZE 128
#define MSG_DATAOUT \
"%08x %08x %08x %08x %08x %08x %08x %08x %08x\n"
#define MSG_WR_ERR "ERROR: WR a=0x%x s=%d d:0x%x 0x%x 0x%x 0x%x\n"
#define MSG_RD_ERR "ERROR: RD a=0x%x s=%d\n"
/* test id, description, expected val, actual val, passed/failed */
#define TST_MSG_RES_STR "Test %3d (%15s: %08x %08x %08x %08x)\t"
#define TST_MSG_RES_STR2 "\n\t****ERROR: expected=%08x, actual=%08x\t\t"
/* IO operation types for reading/writing from/to RDRAM */
#define OP_READ 0
#define OP_WRITE 1
/**********************************************************************
* Macro definitions
*/
#define FP_SET(fp) ((fp) ? (fp) : stderr)
#define LOG_ERROR(exp,act) \
fprintf(LogFp, TST_MSG_RES_STR2, \
exp, act)
#define TST_PATTERN1 0x12000000
#define TST_PATTERN2 0x12340000
#define TST_PATTERN3 0x12345678
#define TST_WORD 0x12345678
#define RDRAM_PAGE_SIZE 2048
#define RDRAM_BANK_SIZE 1048576
#define RDRAM_MAX_COUNT 2
#define PAGES_PER_RDRAM 512
#define BANKS_PER_RDRAM 2
#define MAX_RDRAM_PAGES (RDRAM_MAX_COUNT*PAGES_PER_RDRAM)
/***********************************************************************
* External definitions
*/
extern int IpcFd;
extern FILE *LogFp;
extern FILE *dumpFp;
extern char *CmdFile;
extern int errorTotal;
extern int errorCount;
extern TstCmd TstCmdTbl[];
extern int NumberStallCycles;
/***********************************************************************
* External declartions
*/
/*
* Declaration of test routines
*/
extern int LoadFile(char *, unsigned int, int);
extern int UnloadFile(char *, unsigned int, int);
extern int IoWrite(unsigned int, int, unsigned int *);
extern int IoRead(unsigned int, int, unsigned int *);
extern void RdramInit(int);
extern void PiConfigDomain(unsigned int, int, int, int, int);
extern int CpuWait(int, int, int, int);
extern int rdramConfig(int, int, int, int);
extern int piConfigDom1(int, int, int, int);
extern int piConfigDom2(int, int, int, int);
extern int MemRead(int, int, int, int);
extern int MemReadCompare(int, int, int, int);
extern int MemWrite(int, int, int, int);
extern int MemWriteRead(int, int, int, int);
extern int MemReadWrite(int, int, int, int);
extern int MemReadWriteMask(int, int, int, int);
extern int MemPollStatus(int, int, int, int);
extern int MemCompare(int, int, int, int);
extern int MemDump(int, int, int, int);
extern int MemReadUntil(int, int, int, int);
extern int MemReadCompMask(int, int, int, int);
extern int MemReadCompMaskNoError(int, int, int, int);
extern int rdramInit(int, int, int, int);
extern int rdramTestSglRw(int, int, int, int);
extern int rdramTestBlkRw(int, int, int, int);
extern int rdramTestPgRw(int, int, int, int);
extern int IoSpWrite(unsigned int, unsigned int);
extern int IoSpRead(unsigned int);
extern int IoSpDmaCopy(int, unsigned int, unsigned int, int);
extern int SpTestStatus(int, int, int, int);
extern int SpTestReg(int, int, int, int);
extern int SpTestIoRead(int, int, int, int);
extern int SpTestIoWrite(int, int, int, int);
extern int SpTestDma(int, int, int, int);
extern int SpTestDmaPg(int, int, int, int);
extern int IoPiWrite(unsigned int, unsigned int);
extern int IoPiRead(unsigned int);
extern int IoPiDmaCopy(int, unsigned int, unsigned int, int);
extern int PiTestStatus(int, int, int, int);
extern int PiTestReg(int, int, int, int);
extern int PiTestIoRead(int, int, int, int);
extern int PiTestIoWrite(int, int, int, int);
extern int PiTestDma(int, int, int, int);
extern int PiTestDmaPg(int, int, int, int);
extern int IoSiRead(unsigned int);
extern int IoSiDmaCopy(int, unsigned int, unsigned int);
extern int SiTestStatus(int, int, int, int);
extern int SiTestReg(int, int, int, int);
extern int SiTestIoRead(int, int, int, int);
extern int SiTestIoWrite(int, int, int, int);
extern int SiTestDma(int, int, int, int);
extern int SiTestDmaPg(int, int, int, int);
extern void AiInit(unsigned int, unsigned int);
extern int AiTestInit(int, int, int, int);
extern int AiTestStatus(int, int, int, int);
extern int AiTestReg(int, int, int, int);
extern int AiTestDma(int, int, int, int);
extern int AiTestDmaPg(int, int, int, int);
extern int AiCompareData(int, int, int, int);
extern int AiStartDma(int, int, int, int);
extern int AiCompareLength(int, int, int, int);
extern int RDPList(int, int, int, int);
extern int RDPListLoop(int, int, int, int);
extern int RDPListCounter(int, int, int, int);
extern int EbusTestPgRw(int, int, int, int);
#endif /* _IO_TEST_H_ */