dump_tab.vh
4.69 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
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: rcp_tab.vh
// description: dumps out an rcp i/o .tab file
//
// designer: Tony DeLaurier
// date: 11/21/94
//
////////////////////////////////////////////////////////////////////////
integer tab_file_ptr;
integer cycle_0;
// open tab file
initial
begin
tab_file_ptr = $fopen("test.tab");
$fwriteh(tab_file_ptr, "gclk @C 1(8) 0(8) \n");
$fwriteh(tab_file_ptr, "st_span @I @E 2\n");
$fwriteh(tab_file_ptr, "ncyc @I @E 2\n");
$fwriteh(tab_file_ptr, "l[15:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "s[15:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "t[15:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "w[15:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "min_level[4:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "detail_en @I @E 2\n");
$fwriteh(tab_file_ptr, "sharp_en @I @E 2\n");
$fwriteh(tab_file_ptr, "lod_en @I @E 2\n");
$fwriteh(tab_file_ptr, "persp_en @I @E 2\n");
$fwriteh(tab_file_ptr, "copy @I @E 2\n");
$fwriteh(tab_file_ptr, "samp_type @I @E 2\n");
$fwriteh(tab_file_ptr, "tlut_en @I @E 2\n");
$fwriteh(tab_file_ptr, "tlut_type @I @E 2\n");
$fwriteh(tab_file_ptr, "max_level[2:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "prim_tile[2:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "load @I @E 2\n");
$fwriteh(tab_file_ptr, "shift_coord @I @E 2\n");
$fwriteh(tab_file_ptr, "tile_adrs[2:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "tile_data[47:0] @I @E 2\n");
$fwriteh(tab_file_ptr, "we_tile_size @I @E 2\n");
$fwriteh(tab_file_ptr, "we_tile_attr @I @E 2\n");
$fwriteh(tab_file_ptr, "copy_load[63:0] @B copy_load_oe 1 @E 2 @S 15\n");
$fwriteh(tab_file_ptr, "copy_load_oe @O @S 15\n");
$fwriteh(tab_file_ptr, "load_dv @I @E 2\n");
$fwriteh(tab_file_ptr, "l_frac[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "lod_ge_one @O @S 15\n");
$fwriteh(tab_file_ptr, "s_frac_rg[7:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "t_frac_rg[7:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "s_frac_ba[7:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "t_frac_ba[7:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "red_a[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "green_a[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "blue_a[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "alpha_a[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "red_b[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "green_b[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "blue_b[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "alpha_b[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "red_c[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "green_c[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "blue_c[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "alpha_c[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "red_d[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "green_d[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "blue_d[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "alpha_d[8:0] @O @S 15\n");
$fwriteh(tab_file_ptr, "\n");
// set cycle 0 flag
cycle_0 = 1;
end // initial
// dump i/o at pos edge clock
always @(posedge gclk)
begin
if (!cycle_0)
begin
$fwriteh(tab_file_ptr,
st_span,,
ncyc,," ",
"0x",l,,
"0x",s,,
"0x",t,,
"0x",w,," ",
"0x",min_level,,
detail_en,,
sharp_en,,
lod_en,,
persp_en,,
copy,,
samp_type,,
tlut_en,,
tlut_type,,
"0x",max_level,,
"0x",prim_tile,,
load,,
shift_coord,," ",
"0x",tile_adrs,,
"0x",tile_data,,
we_tile_size,,
we_tile_attr,," ",
"0x",copy_load,,
tex.tm.copy_load_oe,,
load_dv,," ",
"0x",l_frac,,
lod_ge_one,," ",
"0x",s_frac_rg,,
"0x",t_frac_rg,,
"0x",s_frac_ba,,
"0x",t_frac_ba,," ",
"0x",red_a,,
"0x",green_a,,
"0x",blue_a,,
"0x",alpha_a,," ",
"0x",red_b,,
"0x",green_b,,
"0x",blue_b,,
"0x",alpha_b,," ",
"0x",red_c,,
"0x",green_c,,
"0x",blue_c,,
"0x",alpha_c,," ",
"0x",red_d,,
"0x",green_d,,
"0x",blue_d,,
"0x",alpha_d,
"\n");
end // if
else
cycle_0 = 0;
end // always