driver.h
5.32 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
/*
* driver.h, memory structure for BL driver
*
*
*
*/
#ifndef DRIVER_INCLUDE
#define DRIVER_INCLUDE
#define DELAY_ONE 1
#define DELAY_TWO 2
#define DELAY_THREE 3
#define DELAY_FOUR 4
#define DELAY_FIVE 5
/*
* Memory structure for driver
*/
typedef struct {
/* required */
char *label; /* label must be first */
int gclk_old;
int argc;
char **argv;
/* input */
int gclk;
/* output */
int st_span;
int ncyc;
int blend_mask; /* [7:0] */
int z_source_select;
int antialias_enable;
int z_compare_enable;
int z_update_enable;
int z_mode; /* [1:0] */
int cvg_dest; /* [1:0] */
int color_on_cvg;
int force_blend;
int mask15b;
int bl_p_sel_0_r; /* [1:0] */
int bl_m_sel_0_r; /* [1:0] */
int bl_a_sel_0_r; /* [1:0] */
int bl_b_sel_0_r; /* [1:0] */
int bl_p_sel_1_r; /* [1:0] */
int bl_m_sel_1_r; /* [1:0] */
int bl_a_sel_1_r; /* [1:0] */
int bl_b_sel_1_r; /* [1:0] */
int blend_r; /* [7:0] */
int blend_g; /* [7:0] */
int blend_b; /* [7:0] */
int fog_r; /* [7:0] */
int fog_g; /* [7:0] */
int fog_b; /* [7:0] */
int fog_a; /* [7:0] */
int pixel_r; /* [7:0] */
int pixel_g; /* [7:0] */
int pixel_b; /* [7:0] */
int pixel_a; /* [8:0] */
int pixel_cvg; /* [3:0], 1.3 */
int shade_a; /* [7:0] */
int st_z; /* [17:0], 15.3 */
int dzdx; /* [15:0], s0.15 */
int dzdy; /* [15:0], s0.15 */
int prim_z; /* [15:0] */
int prim_delta_z; /* [15:0] */
int mem_r; /* [7:0] */
int mem_g; /* [7:0] */
int mem_b; /* [7:0] */
int mem_a; /* [2:0] */
int mem_z; /* [17:0], float format:
[17:15] exponent, [14:4] mantissa,
[3:0] delta_z
*/
int dv; /* for validating output, not in Verilog */
/* delay registers */
int blend_mask_dly[DELAY_FOUR]; /* [7:0] */
int z_source_select_dly[DELAY_ONE];
int antialias_enable_dly[DELAY_THREE];
int z_compare_enable_dly[DELAY_THREE];
int z_update_enable_dly[DELAY_THREE];
int z_mode_dly[DELAY_THREE]; /* [1:0] */
int cvg_dest_dly[DELAY_FOUR]; /* [1:0] */
int color_on_cvg_dly[DELAY_FOUR];
int force_blend_dly[DELAY_THREE];
int mask15b_dly[DELAY_THREE];
int bl_p_sel_0_r_dly[DELAY_ONE]; /* [1:0] */
int bl_m_sel_0_r_dly[DELAY_ONE]; /* [1:0] */
int bl_a_sel_0_r_dly[DELAY_ONE]; /* [1:0] */
int bl_b_sel_0_r_dly[DELAY_ONE]; /* [1:0] */
int bl_p_sel_1_r_dly[DELAY_ONE]; /* [1:0] */
int bl_m_sel_1_r_dly[DELAY_ONE]; /* [1:0] */
int bl_a_sel_1_r_dly[DELAY_ONE]; /* [1:0] */
int bl_b_sel_1_r_dly[DELAY_ONE]; /* [1:0] */
int blend_r_dly[DELAY_TWO]; /* [7:0] */
int blend_g_dly[DELAY_TWO]; /* [7:0] */
int blend_b_dly[DELAY_TWO]; /* [7:0] */
int fog_r_dly[DELAY_TWO]; /* [7:0] */
int fog_g_dly[DELAY_TWO]; /* [7:0] */
int fog_b_dly[DELAY_TWO]; /* [7:0] */
int fog_a_dly[DELAY_TWO]; /* [7:0] */
int pixel_r_dly[DELAY_TWO]; /* [7:0] */
int pixel_g_dly[DELAY_TWO]; /* [7:0] */
int pixel_b_dly[DELAY_TWO]; /* [7:0] */
int pixel_a_dly[DELAY_TWO]; /* [8:0] */
int pixel_cvg_dly[DELAY_TWO]; /* [3:0], 1.3 */
int shade_a_dly[DELAY_TWO]; /* [7:0] */
int st_z_dly[DELAY_TWO]; /* [17:0], 15.3 */
int dzdx_dly[DELAY_ONE]; /* [15:0], s0.15 */
int dzdy_dly[DELAY_ONE]; /* [15:0], s0.15 */
int prim_z_dly[DELAY_TWO]; /* [15:0] */
int prim_delta_z_dly[DELAY_ONE]; /* [15:0] */
int mem_r_dly[DELAY_TWO]; /* [7:0] */
int mem_g_dly[DELAY_TWO]; /* [7:0] */
int mem_b_dly[DELAY_TWO]; /* [7:0] */
int mem_a_dly[DELAY_TWO]; /* [2:0] */
int mem_z_dly[DELAY_ONE];
int dv_dly[DELAY_FIVE];
} driver_t;
/*
* Prototypes
*/
void driver(driver_t **pp0, driver_t **pp1);
void driver_init(driver_t *p0, driver_t *p1);
#endif /* DRIVER_INCLUDE */