tc_max_abs_dif.v
5.62 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
// Module instances modified by /home/rws/workarea/rf/sw/bbplayer/tools/necprimfix
//
// 6 instances of ad01d1h changed to j_ad01.
// 1 instance of an02d1h changed to j_an02.
// 2 instances of an04d2 changed to j_an04.
// 34 instances of in01d4 changed to j_in01.
// 2 instances of nr02d2 changed to j_nr02.
// 2 instances of nr04d2 changed to j_nr04.
// 1 instance of or03d2 changed to j_or03.
//
/*
*************************************************************************
* *
* Copyright (C) 1994, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************
*/
/*
*************************************************************************
* *
* Project Reality *
* *
* module: tc_max_abs_dif.v *
* description: Max of absolute value of difference. For LOD. *
* *
* designer: Phil Gossett *
* date: 6/11/95 *
* *
*************************************************************************
*/
// $Id: tc_max_abs_dif.v,v 1.2 2002/11/13 02:11:41 rws Exp $
module tc_max_abs_dif (s_curr, s_next, t_curr, t_next, last_max, max);
input [16:0] s_curr;
input [16:0] s_next;
input [16:0] t_curr;
input [16:0] t_next;
input [14:0] last_max;
output [14:0] max;
wire [16:0] s_curr_n;
wire [16:0] t_curr_n;
wire [17:0] ds;
wire [2:0] dsc;
wire [17:0] dt;
wire [2:0] dtc;
wire [13:0] a;
wire [13:0] a_n;
wire [13:0] b;
wire [13:0] b_n;
wire agtb;
wire cgta;
wire cgtb;
wire cmax;
wire [13:0] abmax;
wire anso;
wire ansz;
wire anto;
wire antz;
wire nrs;
wire nrt;
j_in01 insc16 (.i(s_curr[16]), .zn(s_curr_n[16]));
j_in01 insc15 (.i(s_curr[15]), .zn(s_curr_n[15]));
j_in01 insc14 (.i(s_curr[14]), .zn(s_curr_n[14]));
j_in01 insc13 (.i(s_curr[13]), .zn(s_curr_n[13]));
j_in01 insc12 (.i(s_curr[12]), .zn(s_curr_n[12]));
j_in01 insc11 (.i(s_curr[11]), .zn(s_curr_n[11]));
j_in01 insc10 (.i(s_curr[10]), .zn(s_curr_n[10]));
j_in01 insc9 (.i(s_curr[9]), .zn(s_curr_n[9]));
j_in01 insc8 (.i(s_curr[8]), .zn(s_curr_n[8]));
j_in01 insc7 (.i(s_curr[7]), .zn(s_curr_n[7]));
j_in01 insc6 (.i(s_curr[6]), .zn(s_curr_n[6]));
j_in01 insc5 (.i(s_curr[5]), .zn(s_curr_n[5]));
j_in01 insc4 (.i(s_curr[4]), .zn(s_curr_n[4]));
j_in01 insc3 (.i(s_curr[3]), .zn(s_curr_n[3]));
j_in01 insc2 (.i(s_curr[2]), .zn(s_curr_n[2]));
j_in01 insc1 (.i(s_curr[1]), .zn(s_curr_n[1]));
j_in01 insc0 (.i(s_curr[0]), .zn(s_curr_n[0]));
j_in01 intc16 (.i(t_curr[16]), .zn(t_curr_n[16]));
j_in01 intc15 (.i(t_curr[15]), .zn(t_curr_n[15]));
j_in01 intc14 (.i(t_curr[14]), .zn(t_curr_n[14]));
j_in01 intc13 (.i(t_curr[13]), .zn(t_curr_n[13]));
j_in01 intc12 (.i(t_curr[12]), .zn(t_curr_n[12]));
j_in01 intc11 (.i(t_curr[11]), .zn(t_curr_n[11]));
j_in01 intc10 (.i(t_curr[10]), .zn(t_curr_n[10]));
j_in01 intc9 (.i(t_curr[9]), .zn(t_curr_n[9]));
j_in01 intc8 (.i(t_curr[8]), .zn(t_curr_n[8]));
j_in01 intc7 (.i(t_curr[7]), .zn(t_curr_n[7]));
j_in01 intc6 (.i(t_curr[6]), .zn(t_curr_n[6]));
j_in01 intc5 (.i(t_curr[5]), .zn(t_curr_n[5]));
j_in01 intc4 (.i(t_curr[4]), .zn(t_curr_n[4]));
j_in01 intc3 (.i(t_curr[3]), .zn(t_curr_n[3]));
j_in01 intc2 (.i(t_curr[2]), .zn(t_curr_n[2]));
j_in01 intc1 (.i(t_curr[1]), .zn(t_curr_n[1]));
j_in01 intc0 (.i(t_curr[0]), .zn(t_curr_n[0]));
tc_max_abs_dif_add15 tcas (.a(s_next[14:0]),
.b(s_curr_n[14:0]), .n(s_curr[14:0]), .s(ds[14:0]),
.co(dsc[0]));
tc_max_abs_dif_add15 tcat (.a(t_next[14:0]),
.b(t_curr_n[14:0]), .n(t_curr[14:0]), .s(dt[14:0]),
.co(dtc[0]));
j_ad01 tca1s (.a(s_next[15]), .b(s_curr_n[15]), .ci(dsc[0]), .s(ds[15]),
.co(dsc[1]));
j_ad01 tca2s (.a(s_next[16]), .b(s_curr_n[16]), .ci(dsc[1]), .s(ds[16]),
.co(dsc[2]));
j_ad01 tca3s (.a(s_next[16]), .b(s_curr_n[16]), .ci(dsc[2]), .s(ds[17]));
j_ad01 tca1t (.a(t_next[15]), .b(t_curr_n[15]), .ci(dtc[0]), .s(dt[15]),
.co(dtc[1]));
j_ad01 tca2t (.a(t_next[16]), .b(t_curr_n[16]), .ci(dtc[1]), .s(dt[16]),
.co(dtc[2]));
j_ad01 tca3t (.a(t_next[16]), .b(t_curr_n[16]), .ci(dtc[2]), .s(dt[17]));
tc_max_abs_dif_xor tcxoa (.i(ds[13:0]), .c(ds[14]), .z(a));
tc_max_abs_dif_xnor tcxna (.i(ds[13:0]), .c(ds[14]), .z(a_n));
tc_max_abs_dif_xor tcxob (.i(dt[13:0]), .c(dt[14]), .z(b));
tc_max_abs_dif_xnor tcxnb (.i(dt[13:0]), .c(dt[14]), .z(b_n));
tc_max_abs_dif_cry15 tcagtb (.a({1'b0,a}),
.b({1'b1,b_n}), .co(agtb));
tc_max_abs_dif_cry15 tccgta (.a(last_max[14:0]),
.b({1'b1,a_n}), .co(cgta));
tc_max_abs_dif_cry15 tccgtb (.a(last_max[14:0]),
.b({1'b1,b_n}), .co(cgtb));
j_an02 tcan (.a1(cgta), .a2(cgtb), .z(cmax));
tc_max_abs_dif_mx21 tcmxab (.s(agtb), .i0(b), .i1(a),
.z(abmax));
tc_max_abs_dif_mx21 tcmxc (.s(cmax), .i0(abmax), .i1(last_max[13:0]),
.z(max[13:0]));
j_an04 tcaso (.a1(ds[14]), .a2(ds[15]), .a3(ds[16]), .a4(ds[17]), .z( anso));
j_nr04 tcasz (.a1(ds[14]), .a2(ds[15]), .a3(ds[16]), .a4(ds[17]), .zn(ansz));
j_an04 tcato (.a1(dt[14]), .a2(dt[15]), .a3(dt[16]), .a4(dt[17]), .z( anto));
j_nr04 tcatz (.a1(dt[14]), .a2(dt[15]), .a3(dt[16]), .a4(dt[17]), .zn(antz));
j_nr02 tcnrs (.a1(anso), .a2(ansz), .zn(nrs));
j_nr02 tcnrt (.a1(anto), .a2(antz), .zn(nrt));
j_or03 tcor (.a1(nrs), .a2(nrt), .a3(last_max[14]), .z(max[14]));
endmodule // tc_max_abs_dif