bl_cvg2.v
9.28 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
// Module instances modified by /home/rws/workarea/rf/sw/bbplayer/tools/necprimfix
//
// 2 instances of ad01d1 changed to j_ad01.
// 7 instances of ad01d1h changed to j_ad01.
// 1 instance of an02d1 changed to j_an02.
// 11 instances of an02d1h changed to j_an02.
// 1 instance of an05d2 changed to j_an05.
// 19 instances of in01d2 changed to j_in01.
// 24 instances of mx21d1h changed to j_mx21.
// 16 instances of mx81d1h changed to j_mx81.
// 1 instance of or04d1 changed to j_or04.
// 1 instance of xo02d1 changed to j_xo02.
// 1 instance of xo02d1h changed to j_xo02.
//
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: bl_cvg2
// description: Interpenetration and coverage wrap for blend unit.
//
// designer: Phil Gossett
// date: 9/19/94
//
////////////////////////////////////////////////////////////////////////
module bl_cvg2 (pcvg, mcvg, newz, oldz, deltaz, zmode, infront, farther,
pout, wrap, we);
input [3:0] pcvg; // 1.3
input [2:0] mcvg; // 0.3
input [17:0] newz; // 0,15.3
input [17:0] oldz; // 0,15.3
input [3:0] deltaz; // log2
input [1:0] zmode; // 0) opaque, 1) inter, 2) trans, 3) decal.
input infront;
input farther;
output [3:0] pout; // 1.3
output wrap;
output we;
wire [2:0] cw;
wire [17:0] nz_l;
wire [3:0] sxa;
wire [3:0] sxb;
wire [3:0] sx;
wire [3:0] sya;
wire [3:0] syb;
wire [3:0] sy;
wire [2:0] cz;
wire [3:0] mx;
wire [1:0] p0p;
wire [2:0] p1p;
wire [1:0] p2p;
wire [2:0] mys;
wire [2:0] myc;
wire [1:0] mpc;
wire [2:0] pmp;
wire [3:0] mpa;
wire [3:0] mpb;
wire [3:0] mp;
j_an02 adwc0 ( .a1(pcvg[0]), .a2(mcvg[0]), .z(cw[0]));
j_ad01 adwc1 (.ci(cw[0]), .a(pcvg[1]), .b(mcvg[1]), .co(cw[1]));
j_ad01 adwc2 (.ci(cw[1]), .a(pcvg[2]), .b(mcvg[2]), .co(cw[2]));
j_xo02 adwc3 (.a1(cw[2]), .a2(pcvg[3]), .z(wrap));
j_in01 inn00 (.i(newz[ 0]), .zn(nz_l[ 0]));
j_in01 inn01 (.i(newz[ 1]), .zn(nz_l[ 1]));
j_in01 inn02 (.i(newz[ 2]), .zn(nz_l[ 2]));
j_in01 inn03 (.i(newz[ 3]), .zn(nz_l[ 3]));
j_in01 inn04 (.i(newz[ 4]), .zn(nz_l[ 4]));
j_in01 inn05 (.i(newz[ 5]), .zn(nz_l[ 5]));
j_in01 inn06 (.i(newz[ 6]), .zn(nz_l[ 6]));
j_in01 inn07 (.i(newz[ 7]), .zn(nz_l[ 7]));
j_in01 inn08 (.i(newz[ 8]), .zn(nz_l[ 8]));
j_in01 inn09 (.i(newz[ 9]), .zn(nz_l[ 9]));
j_in01 inn10 (.i(newz[10]), .zn(nz_l[10]));
j_in01 inn11 (.i(newz[11]), .zn(nz_l[11]));
j_in01 inn12 (.i(newz[12]), .zn(nz_l[12]));
j_in01 inn13 (.i(newz[13]), .zn(nz_l[13]));
j_in01 inn14 (.i(newz[14]), .zn(nz_l[14]));
j_in01 inn15 (.i(newz[15]), .zn(nz_l[15]));
j_in01 inn16 (.i(newz[16]), .zn(nz_l[16]));
j_in01 inn17 (.i(newz[17]), .zn(nz_l[17]));
j_mx81 sxa0 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[ 0]), .i1(oldz[ 1]), .i2(oldz[ 2]), .i3(oldz[ 3]),
.i4(oldz[ 4]), .i5(oldz[ 5]), .i6(oldz[ 6]), .i7(oldz[ 7]),
.z(sxa[0]));
j_mx81 sxa1 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[ 1]), .i1(oldz[ 2]), .i2(oldz[ 3]), .i3(oldz[ 4]),
.i4(oldz[ 5]), .i5(oldz[ 6]), .i6(oldz[ 7]), .i7(oldz[ 8]),
.z(sxa[1]));
j_mx81 sxa2 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[ 2]), .i1(oldz[ 3]), .i2(oldz[ 4]), .i3(oldz[ 5]),
.i4(oldz[ 6]), .i5(oldz[ 7]), .i6(oldz[ 8]), .i7(oldz[ 9]),
.z(sxa[2]));
j_mx81 sxa3 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[ 3]), .i1(oldz[ 4]), .i2(oldz[ 5]), .i3(oldz[ 6]),
.i4(oldz[ 7]), .i5(oldz[ 8]), .i6(oldz[ 9]), .i7(oldz[10]),
.z(sxa[3]));
j_mx81 sxb0 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[ 8]), .i1(oldz[ 9]), .i2(oldz[10]), .i3(oldz[11]),
.i4(oldz[12]), .i5(oldz[13]), .i6(oldz[14]), .i7(oldz[15]),
.z(sxb[0]));
j_mx81 sxb1 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[ 9]), .i1(oldz[10]), .i2(oldz[11]), .i3(oldz[12]),
.i4(oldz[13]), .i5(oldz[14]), .i6(oldz[15]), .i7(oldz[16]),
.z(sxb[1]));
j_mx81 sxb2 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[10]), .i1(oldz[11]), .i2(oldz[12]), .i3(oldz[13]),
.i4(oldz[14]), .i5(oldz[15]), .i6(oldz[16]), .i7(oldz[17]),
.z(sxb[2]));
j_mx81 sxb3 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(oldz[11]), .i1(oldz[12]), .i2(oldz[13]), .i3(oldz[14]),
.i4(oldz[15]), .i5(oldz[16]), .i6(oldz[17]), .i7( 1'b0),
.z(sxb[3]));
j_mx21 sxc0 (.s(deltaz[3]), .i0(sxa[0]), .i1(sxb[0]), .z(sx[0]));
j_mx21 sxc1 (.s(deltaz[3]), .i0(sxa[1]), .i1(sxb[1]), .z(sx[1]));
j_mx21 sxc2 (.s(deltaz[3]), .i0(sxa[2]), .i1(sxb[2]), .z(sx[2]));
j_mx21 sxc3 (.s(deltaz[3]), .i0(sxa[3]), .i1(sxb[3]), .z(sx[3]));
j_mx81 sya0 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[ 0]), .i1(nz_l[ 1]), .i2(nz_l[ 2]), .i3(nz_l[ 3]),
.i4(nz_l[ 4]), .i5(nz_l[ 5]), .i6(nz_l[ 6]), .i7(nz_l[ 7]),
.z(sya[0]));
j_mx81 sya1 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[ 1]), .i1(nz_l[ 2]), .i2(nz_l[ 3]), .i3(nz_l[ 4]),
.i4(nz_l[ 5]), .i5(nz_l[ 6]), .i6(nz_l[ 7]), .i7(nz_l[ 8]),
.z(sya[1]));
j_mx81 sya2 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[ 2]), .i1(nz_l[ 3]), .i2(nz_l[ 4]), .i3(nz_l[ 5]),
.i4(nz_l[ 6]), .i5(nz_l[ 7]), .i6(nz_l[ 8]), .i7(nz_l[ 9]),
.z(sya[2]));
j_mx81 sya3 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[ 3]), .i1(nz_l[ 4]), .i2(nz_l[ 5]), .i3(nz_l[ 6]),
.i4(nz_l[ 7]), .i5(nz_l[ 8]), .i6(nz_l[ 9]), .i7(nz_l[10]),
.z(sya[3]));
j_mx81 syb0 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[ 8]), .i1(nz_l[ 9]), .i2(nz_l[10]), .i3(nz_l[11]),
.i4(nz_l[12]), .i5(nz_l[13]), .i6(nz_l[14]), .i7(nz_l[15]),
.z(syb[0]));
j_mx81 syb1 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[ 9]), .i1(nz_l[10]), .i2(nz_l[11]), .i3(nz_l[12]),
.i4(nz_l[13]), .i5(nz_l[14]), .i6(nz_l[15]), .i7(nz_l[16]),
.z(syb[1]));
j_mx81 syb2 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[10]), .i1(nz_l[11]), .i2(nz_l[12]), .i3(nz_l[13]),
.i4(nz_l[14]), .i5(nz_l[15]), .i6(nz_l[16]), .i7(nz_l[17]),
.z(syb[2]));
j_mx81 syb3 (.s0(deltaz[0]), .s1(deltaz[1]), .s2(deltaz[2]),
.i0(nz_l[11]), .i1(nz_l[12]), .i2(nz_l[13]), .i3(nz_l[14]),
.i4(nz_l[15]), .i5(nz_l[16]), .i6(nz_l[17]), .i7( 1'b1),
.z(syb[3]));
j_mx21 syc0 (.s(deltaz[3]), .i0(sya[0]), .i1(syb[0]), .z(sy[0]));
j_mx21 syc1 (.s(deltaz[3]), .i0(sya[1]), .i1(syb[1]), .z(sy[1]));
j_mx21 syc2 (.s(deltaz[3]), .i0(sya[2]), .i1(syb[2]), .z(sy[2]));
j_mx21 syc3 (.s(deltaz[3]), .i0(sya[3]), .i1(syb[3]), .z(sy[3]));
j_ad01 adz00 (.ci( 1'b1), .a(sx[0]), .b(sy[0]), .s(mx[0]), .co(cz[0]));
j_ad01 adz01 (.ci(cz[0]), .a(sx[1]), .b(sy[1]), .s(mx[1]), .co(cz[1]));
j_ad01 adz02 (.ci(cz[1]), .a(sx[2]), .b(sy[2]), .s(mx[2]), .co(cz[2]));
j_ad01 adz03 (.ci(cz[2]), .a(sx[3]), .b(sy[3]), .s(mx[3]));
j_an02 man1 (.a1(pcvg[0]), .a2(mx[1]), .z(p0p[0]));
j_an02 man2 (.a1(pcvg[0]), .a2(mx[2]), .z(p0p[1]));
j_an02 man3 (.a1(pcvg[1]), .a2(mx[0]), .z(p1p[0]));
j_an02 man4 (.a1(pcvg[1]), .a2(mx[1]), .z(p1p[1]));
j_an02 man5 (.a1(pcvg[1]), .a2(mx[2]), .z(p1p[2]));
j_an02 man6 (.a1(pcvg[2]), .a2(mx[0]), .z(p2p[0]));
j_an02 man7 (.a1(pcvg[2]), .a2(mx[1]), .z(p2p[1]));
j_an02 man8 (.a1(pcvg[2]), .a2(mx[2]), .z(mys[2]));
j_an02 myc0 (.a1(p0p[0]), .a2(p1p[0]), .z(myc[0]));
j_ad01 mys0 (.ci(p0p[1]), .a(p1p[1]), .b(p2p[0]), .s(mys[0]), .co(myc[1]));
j_xo02 mys1 (.a1(p1p[2]), .a2(p2p[1]), .z(mys[1]));
j_an02 myc2 (.a1(p1p[2]), .a2(p2p[1]), .z(myc[2]));
j_an02 myp0 ( .a1(mys[0]), .a2(myc[0]), .z(mpc[0]));
j_ad01 myp1 (.ci(mpc[0]), .a(mys[1]), .b(myc[1]), .s(pmp[0]), .co(mpc[1]));
j_ad01 myp2 (.ci(mpc[1]), .a(mys[2]), .b(myc[2]), .s(pmp[1]), .co(pmp[2]));
j_mx21 mpa0 (.s( mx[3]), .i0(pmp[0]), .i1(pcvg[0]), .z(mpa[0]));
j_mx21 mpa1 (.s( mx[3]), .i0(pmp[1]), .i1(pcvg[1]), .z(mpa[1]));
j_mx21 mpa2 (.s( mx[3]), .i0(pmp[2]), .i1(pcvg[2]), .z(mpa[2]));
j_mx21 mpa3 (.s( mx[3]), .i0( 1'b0), .i1(pcvg[3]), .z(mpa[3]));
j_mx21 mpb0 (.s( mx[3]), .i0( mx[0]), .i1( 1'b0), .z(mpb[0]));
j_mx21 mpb1 (.s( mx[3]), .i0( mx[1]), .i1( 1'b0), .z(mpb[1]));
j_mx21 mpb2 (.s( mx[3]), .i0( mx[2]), .i1( 1'b0), .z(mpb[2]));
j_mx21 mpb3 (.s( mx[3]), .i0( mx[3]), .i1( 1'b1), .z(mpb[3]));
j_mx21 mpc0 (.s(pcvg[3]), .i0(mpa[0]), .i1(mpb[0]), .z(mp[0]));
j_mx21 mpc1 (.s(pcvg[3]), .i0(mpa[1]), .i1(mpb[1]), .z(mp[1]));
j_mx21 mpc2 (.s(pcvg[3]), .i0(mpa[2]), .i1(mpb[2]), .z(mp[2]));
j_mx21 mpc3 (.s(pcvg[3]), .i0(mpa[3]), .i1(mpb[3]), .z(mp[3]));
j_in01 inz (.i(zmode[1]), .zn(zmode1_l));
j_an05 an5 (.a1(wrap), .a2(zmode[0]), .a3(zmode1_l),
.a4(infront), .a5(farther), .z(selmpy));
j_mx21 mps0 (.s(selmpy), .i0(pcvg[0]), .i1(mp[0]), .z(pout[0]));
j_mx21 mps1 (.s(selmpy), .i0(pcvg[1]), .i1(mp[1]), .z(pout[1]));
j_mx21 mps2 (.s(selmpy), .i0(pcvg[2]), .i1(mp[2]), .z(pout[2]));
j_mx21 mps3 (.s(selmpy), .i0(pcvg[3]), .i1(mp[3]), .z(pout[3]));
j_or04 ocvg (.a1(pout[0]), .a2(pout[1]), .a3(pout[2]), .a4(pout[3]),
.z(we));
endmodule // bl_cvg2