top_level.v
4.35 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
////////////////////////////////////////////////////////////////////////
//
// Project Reality
//
// module: top_level
// description: Top Level Driver
//
// designer: Rob Moore
// date: 8/23/94
//
////////////////////////////////////////////////////////////////////////
`timescale 10ps / 10ps //1unit = 0.01ns
module top_level();
wire gclk; // RDP gated clock
wire st_span; // start span
wire ncyc; // 0: 1-cycle mode, 1: 2-cycle mode
wire [7:0] blend_mask;
wire z_source_select;
wire antialias_enable;
wire z_compare_enable;
wire z_update_enable;
wire [1:0] z_mode;
wire [1:0] cvg_dest;
wire color_on_cvg;
wire force_blend;
wire mask15b;
wire [1:0] bl_p_sel_0_r;
wire [1:0] bl_m_sel_0_r;
wire [1:0] bl_a_sel_0_r;
wire [1:0] bl_b_sel_0_r;
wire [1:0] bl_p_sel_1_r;
wire [1:0] bl_m_sel_1_r;
wire [1:0] bl_a_sel_1_r;
wire [1:0] bl_b_sel_1_r;
wire [7:0] blend_r;
wire [7:0] blend_g;
wire [7:0] blend_b;
wire [7:0] fog_r;
wire [7:0] fog_g;
wire [7:0] fog_b;
wire [7:0] fog_a;
wire [7:0] pixel_r;
wire [7:0] pixel_g;
wire [7:0] pixel_b;
wire [8:0] pixel_a; // 1.8
wire [3:0] pixel_cvg; // 1.3
wire [7:0] shade_a; // piped thru CC
wire [17:0] st_z; // stepped integer z (18 ms bits)
wire [15:0] dzdx; // S.15 attributes
wire [15:0] dzdy;
wire [15:0] prim_z;
wire [15:0] prim_delta_z;
wire [7:0] mem_r; // from mem_span unit
wire [7:0] mem_g;
wire [7:0] mem_b;
wire [2:0] mem_a;
wire [17:0] mem_z; // z and delta from memory (fp format)
wire [7:0] span_r; // to mem_span unit
wire [7:0] span_g;
wire [7:0] span_b;
wire [2:0] span_a;
wire [17:0] span_z; // z and delta to memory (fp format)
wire span_color_we;
wire span_depth_we;
// instance driver
driver driver (.gclk(gclk), .st_span(st_span), .ncyc(ncyc),
.blend_mask(blend_mask), .z_source_select(z_source_select), .antialias_enable(antialias_enable),
.z_compare_enable(z_compare_enable), .z_update_enable(z_update_enable), .z_mode(z_mode),
.cvg_dest(cvg_dest), .color_on_cvg(color_on_cvg), .force_blend(force_blend), .mask15b(mask15b),
.bl_p_sel_0_r(bl_p_sel_0_r), .bl_m_sel_0_r(bl_m_sel_0_r), .bl_a_sel_0_r(bl_a_sel_0_r), .bl_b_sel_0_r(bl_b_sel_0_r),
.bl_p_sel_1_r(bl_p_sel_1_r), .bl_m_sel_1_r(bl_m_sel_1_r), .bl_a_sel_1_r(bl_a_sel_1_r), .bl_b_sel_1_r(bl_b_sel_1_r),
.blend_r(blend_r), .blend_g(blend_g), .blend_b(blend_b), .fog_r(fog_r), .fog_g(fog_g), .fog_b(fog_b), .fog_a(fog_a),
.pixel_r(pixel_r), .pixel_g(pixel_g), .pixel_b(pixel_b), .pixel_a(pixel_a), .pixel_cvg(pixel_cvg),
.shade_a(shade_a), .st_z(st_z), .dzdx(dzdx), .dzdy(dzdy), .prim_z(prim_z), .prim_delta_z(prim_delta_z),
.mem_r(mem_r), .mem_g(mem_g), .mem_b(mem_b), .mem_a(mem_a), .mem_z(mem_z),
.span_r(span_r), .span_g(span_g), .span_b(span_b), .span_a(span_a), .span_z(span_z),
.span_color_we(span_color_we), .span_depth_we(span_depth_we));
// instance blender
bl blend (.gclk(gclk), .st_span(st_span), .ncyc(ncyc),
.blend_mask(blend_mask), .z_source_select(z_source_select), .antialias_enable(antialias_enable),
.z_compare_enable(z_compare_enable), .z_update_enable(z_update_enable), .z_mode(z_mode),
.cvg_dest(cvg_dest), .color_on_cvg(color_on_cvg), .force_blend(force_blend), .mask15b(mask15b),
.bl_p_sel_0_r(bl_p_sel_0_r), .bl_m_sel_0_r(bl_m_sel_0_r), .bl_a_sel_0_r(bl_a_sel_0_r), .bl_b_sel_0_r(bl_b_sel_0_r),
.bl_p_sel_1_r(bl_p_sel_1_r), .bl_m_sel_1_r(bl_m_sel_1_r), .bl_a_sel_1_r(bl_a_sel_1_r), .bl_b_sel_1_r(bl_b_sel_1_r),
.blend_r(blend_r), .blend_g(blend_g), .blend_b(blend_b), .fog_r(fog_r), .fog_g(fog_g), .fog_b(fog_b), .fog_a(fog_a),
.pixel_r(pixel_r), .pixel_g(pixel_g), .pixel_b(pixel_b), .pixel_a(pixel_a), .pixel_cvg(pixel_cvg),
.shade_a(shade_a), .st_z(st_z), .dzdx(dzdx), .dzdy(dzdy), .prim_z(prim_z), .prim_delta_z(prim_delta_z),
.mem_r(mem_r), .mem_g(mem_g), .mem_b(mem_b), .mem_a(mem_a), .mem_z(mem_z),
.span_r(span_r), .span_g(span_g), .span_b(span_b), .span_a(span_a), .span_z(span_z),
.span_color_we(span_color_we), .span_depth_we(span_depth_we));
// kill simulation when tabular file read
always @(driver.EndVectors)
$finish;
// dump file
initial
begin
$dumpvars;
end
endmodule // top_level