inp.h
2.91 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
typedef unsigned long int u32;
typedef unsigned long long u64;
typedef struct {
union {
u32 u_data[2];
u64 u_data64;
Gsetimg u_gimg;
Gsetcombine u_gcomb;
Gsetcolor u_gscol;
Gfillrect u_gfillr;
Gsettile u_gstile;
Gloadtile u_gltile;
Gtexrect u_gtexr;
Gloadtlut u_gltlut;
} xbus_cs_data;
int xbus_cs_valid;
int ew_cs_busy;
int ms_busy;
int rel_sync_tile;
int rel_sync_pipe;
int rel_sync_full;
int rel_sync_load;
int texel_size;
int copy_fill;
int reset_l;
} vector_t;
#define data xbus_cs_data.u_data
#define data64 xbus_cs_data.u_data64
#define gimg xbus_cs_data.u_gimg
#define gcomb xbus_cs_data.u_gcomb
#define gscol xbus_cs_data.u_gscol
#define gfillr xbus_cs_data.u_gfillr
#define gstile xbus_cs_data.u_gstile
#define gltile xbus_cs_data.u_gltile
#define gtexr xbus_cs_data.u_gtexr
#define gltlut xbus_cs_data.u_gltlut
static void
printHeader(void)
{
printf("#\n");
printf("# command shuffle verification\n");
printf("#\n");
printf("gclk @C 0(8) 1(8)\n");
printf("xbus_cs_data[63:0] @I @E 0\n");
printf("xbus_cs_valid @I @E 0\n");
printf("ew_cs_busy @I @E 0\n");
printf("ms_busy @I @E 0\n");
printf("rel_sync_tile @I @E 0\n");
printf("rel_sync_pipe @I @E 0\n");
printf("rel_sync_full @I @E 0\n");
printf("rel_sync_load @I @E 0\n");
printf("texel_size[1:0] @I @E 0\n");
printf("copy_fill @I @E 0\n");
printf("reset_l @I @E 0\n");
printf("dv_0 @I\n");
printf("\n");
}
static void
printVector(vector_t *vp, int valid)
{
printf("0x%08x 0x%08x %d %d %d %d %d %d %d %x %d %d %d\n",
vp->data[0], vp->data[1],
vp->xbus_cs_valid,
vp->ew_cs_busy,
vp->ms_busy,
vp->rel_sync_tile,
vp->rel_sync_pipe,
vp->rel_sync_full,
vp->rel_sync_load,
vp->texel_size,
vp->copy_fill,
vp->reset_l,
valid);
}
static void
resetFifo(void)
{
int i;
vector_t v;
vector_t *vp = &v;
bzero(vp, sizeof(*vp));
printf("# Reset FIFO\n");
vp->reset_l = 1;
printVector(vp, 0);
vp->reset_l = 0;
printVector(vp, 0);
vp->reset_l = 1;
printVector(vp, 0);
}
static void
initFifo(void)
{
int i;
vector_t v;
vector_t *vp = &v;
bzero(vp, sizeof(*vp));
printf("# Initialize FIFO\n");
vp->reset_l = 1;
vp->xbus_cs_valid = 1;
vp->data[0] = (G_NOOP << 24);
vp->data[1] = 0x0;
for (i = 0; i < 10; i++) {
printVector(vp, 0);
}
vp->xbus_cs_valid = 0;
vp->data64 = 0;
for (i = 0; i < 3; i++)
printVector(vp, 0);
vp->xbus_cs_valid = 1;
vp->data[0] = (G_NOOP << 24);
vp->data[1] = 0x0;
for (i = 0; i < 10; i++)
printVector(vp, 0);
vp->xbus_cs_valid = 0;
vp->data64 = 0;
for (i = 0; i < 3; i++)
printVector(vp, 0);
vp->xbus_cs_valid = 1;
vp->data[0] = (G_NOOP << 24);
vp->data[1] = 0x0;
for (i = 0; i < 10; i++)
printVector(vp, 0);
vp->xbus_cs_valid = 0;
vp->data64 = 0;
for (i = 0; i < 3; i++)
printVector(vp, 0);
vp->xbus_cs_valid = 1;
vp->data[0] = (G_NOOP << 24);
vp->data[1] = 0x0;
for (i = 0; i < 2; i++)
printVector(vp, 0);
}