cvpipe.v
2.88 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
/**************************************************************************
* *
* 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. *
* *
*************************************************************************/
// $Id: cvpipe.v,v 1.1 2002/03/28 00:26:13 berndt Exp $
/////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: cvpipe
// description: pipeline between ew and cv
//
//
// designer: Mike M. Cai 8/24/94
//
/////////////////////////////////////////////////////////////////////////
module cvpipe( // outputs
xval,
xmax0_, xmax1_, xmax2_, xmax3_,
xmin0_, xmin1_, xmin2_, xmin3_,
// inputs
x_sc, left, new_span,
gclk);
output [3:0] xval;
output [12:0] xmax0_, xmax1_, xmax2_, xmax3_,
xmin0_, xmin1_, xmin2_, xmin3_;
input [12:0] x_sc;
input left, new_span, gclk;
reg [12:0] xval_m,
xm3_m, xh3_m, xm2_m,xh2_m,
xm1_m, xh1_m, xm0_m, xh0_m;
reg [12:0] xmin3_m, xmax3_m, xmin2_m, xmax2_m,
xmin1_m, xmax1_m, xmin0_m, xmax0_m;
reg [12:0] xmin3_, xmax3_, xmin2_, xmax2_,
xmin1_, xmax1_, xmin0_, xmax0_;
reg [3:0] xval;
always @(posedge gclk)
begin
// xval_m = x_sc;
// xm3_m <= xval_m;
xm3_m <= x_sc;
xh3_m <= xm3_m;
xm2_m <= xh3_m;
xh2_m <= xm2_m;
xm1_m <= xh2_m;
xh1_m <= xm1_m;
xm0_m <= xh1_m;
xh0_m <= xm0_m;
xmin3_m = left ? xh3_m : xm3_m;
xmax3_m = left ? xm3_m : xh3_m;
xmin2_m = left ? xh2_m : xm2_m;
xmax2_m = left ? xm2_m : xh2_m;
xmin1_m = left ? xh1_m : xm1_m;
xmax1_m = left ? xm1_m : xh1_m;
xmin0_m = left ? xh0_m : xm0_m;
xmax0_m = left ? xm0_m : xh0_m;
xval <= new_span ? x_sc[3:0] : xval;
xmin3_ <= new_span ? xmin3_m : xmin3_;
xmax3_ <= new_span ? xmax3_m : xmax3_;
xmin2_ <= new_span ? xmin2_m : xmin2_;
xmax2_ <= new_span ? xmax2_m : xmax2_;
xmin1_ <= new_span ? xmin1_m : xmin1_;
xmax1_ <= new_span ? xmax1_m : xmax1_;
xmin0_ <= new_span ? xmin0_m : xmin0_;
xmax0_ <= new_span ? xmax0_m : xmax0_;
end
endmodule // cvpipe