inp000.c
4.66 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
/*
* inp000.c: quick check of texture filter
*/
#include <stdio.h>
/*
* Signals
*/
int st_span; /* start of span */
int ncyc; /* number of cycles per pixel */
int bilerp0m; /* cycle 0 mode bit */
int bilerp1m; /* cycle 1 mode bit */
int convert_one; /* loopback mode */
int mid_texel; /* mid mode (for 4 texel avg) */
int k0_coeff; /* [8:0], color convert coeffs */
int k1_coeff; /* [8:0], color convert coeffs */
int k2_coeff; /* [8:0], color convert coeffs */
int k3_coeff; /* [8:0], color convert coeffs */
int lod_frac; /* [8:0], s,8.0, pipe through to CCU */
int lge1; /* lod >= 1.0 */
int sfrac_rg; /* [7:0], 0.8, bilerp alphas */
int tfrac_rg; /* [7:0], 0.8, bilerp alphas */
int sfrac_ba; /* [7:0], 0.8, bilerp alphas */
int tfrac_ba; /* [7:0], 0.8, bilerp alphas */
int tm_ra; /* [8:0], s,8.0, texel A */
int tm_ga;
int tm_ba;
int tm_aa;
int tm_rb; /* [8:0], s,8.0, texel B */
int tm_gb;
int tm_bb;
int tm_ab;
int tm_rc; /* [8:0], s,8.0, texel C */
int tm_gc;
int tm_bc;
int tm_ac;
int tm_rd; /* [8:0], s,8.0, texel D */
int tm_gd;
int tm_bd;
int tm_ad;
int dv;
/*
* Prints header info for input signals, same for all dumps
*/
static void
print_input_header( void )
{
printf("gclk @C 1(8) 0(8)\n");
printf("st_span @I @E 0\n");
printf("ncyc @I @E 0\n");
printf("bilerp0m @I @E 0\n");
printf("bilerp1m @I @E 0\n");
printf("convert_one @I @E 0\n");
printf("mid_texel @I @E 0\n");
printf("k0_coeff[8:0] @I @E 0\n");
printf("k1_coeff[8:0] @I @E 0\n");
printf("k2_coeff[8:0] @I @E 0\n");
printf("k3_coeff[8:0] @I @E 0\n");
printf("lod_frac[8:0] @I @E 0\n");
printf("lge1 @I @E 0\n");
printf("sfrac_rg[7:0] @I @E 0\n");
printf("tfrac_rg[7:0] @I @E 0\n");
printf("sfrac_ba[7:0] @I @E 0\n");
printf("tfrac_ba[7:0] @I @E 0\n");
printf("tm_ra[8:0] @I @E 0\n");
printf("tm_ga[8:0] @I @E 0\n");
printf("tm_ba[8:0] @I @E 0\n");
printf("tm_aa[8:0] @I @E 0\n");
printf("tm_rb[8:0] @I @E 0\n");
printf("tm_gb[8:0] @I @E 0\n");
printf("tm_bb[8:0] @I @E 0\n");
printf("tm_ab[8:0] @I @E 0\n");
printf("tm_rc[8:0] @I @E 0\n");
printf("tm_gc[8:0] @I @E 0\n");
printf("tm_bc[8:0] @I @E 0\n");
printf("tm_ac[8:0] @I @E 0\n");
printf("tm_rd[8:0] @I @E 0\n");
printf("tm_gd[8:0] @I @E 0\n");
printf("tm_bd[8:0] @I @E 0\n");
printf("tm_ad[8:0] @I @E 0\n");
printf("dv @I @E 0\n");
printf("\n"); /* required newline */
}
/*
* Prints signal values info for input signals, same for all dumps
*/
static void
print_input_sigs( void )
{
printf("%d %d %d %d %d %d ",
st_span,
ncyc,
bilerp0m,
bilerp1m,
convert_one,
mid_texel);
printf("0x%.3x 0x%.3x 0x%.3x 0x%.3x ",
k0_coeff,
k1_coeff,
k2_coeff,
k3_coeff);
printf("0x%.3x %d 0x%.2x 0x%.2x 0x%.2x 0x%.2x ",
lod_frac,
lge1,
sfrac_rg,
tfrac_rg,
sfrac_ba,
tfrac_ba);
printf("0x%0.3x 0x%0.3x 0x%0.3x 0x%0.3x ",
tm_ra,
tm_ga,
tm_ba,
tm_aa);
printf("0x%0.3x 0x%0.3x 0x%0.3x 0x%0.3x ",
tm_rb,
tm_gb,
tm_bb,
tm_ab);
printf("0x%0.3x 0x%0.3x 0x%0.3x 0x%0.3x ",
tm_rc,
tm_gc,
tm_bc,
tm_ac);
printf("0x%0.3x 0x%0.3x 0x%0.3x 0x%0.3x ",
tm_rd,
tm_gd,
tm_bd,
tm_ad);
printf("%d\n", dv);
}
/*
* Generate test vcectors
*/
main(int argc, char **argv)
{
print_input_header();
print_input_sigs();
print_input_sigs();
printf("# select A texel\n");
bilerp0m = 1;
bilerp1m = 1;
lod_frac = 0x1aa; /* see if it gets through */
lge1 = 1; /* see if it gets through */
tm_ra = 0xff;
tm_ga = 0xee;
tm_ba = 0xdd;
tm_aa = 0xcc;
tm_rb = 0xbb;
tm_gb = 0xaa;
tm_bb = 0x99;
tm_ab = 0x88;
tm_rc = 0x77;
tm_gc = 0x66;
tm_bc = 0x55;
tm_ac = 0x44;
tm_rc = 0x33;
tm_gc = 0x22;
tm_bc = 0x11;
tm_ac = 0x00;
print_input_sigs();
dv = 1;
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
printf("# select B texel\n");
sfrac_rg = 0xff;
sfrac_ba = 0xff;
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
printf("# select C texel\n");
sfrac_rg = 0x00;
sfrac_ba = 0x00;
tfrac_rg = 0xff;
tfrac_ba = 0xff;
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
printf("# select D texel\n");
sfrac_rg = 0xff;
sfrac_ba = 0xff;
tfrac_rg = 0xff;
tfrac_ba = 0xff;
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
print_input_sigs();
}