OpenCores
URL https://opencores.org/ocsvn/wf3d/wf3d/trunk

Subversion Repositories wf3d

[/] [wf3d/] [trunk/] [rtl/] [core/] [fm_ras.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 specular
//=======================================================================
2
// Project Monophony
3
//   Wire-Frame 3D Graphics Accelerator IP Core
4
//
5
// File:
6
//   fm_ras.v
7
//
8
// Abstract:
9
//   Rasterizer top module.
10
//
11
// Author:
12 9 specular
//   Kenji Ishimaru (info.info.wf3d@gmail.com)
13 2 specular
//
14
//======================================================================
15
//
16
// Copyright (c) 2015, Kenji Ishimaru
17
// All rights reserved.
18
//
19
// Redistribution and use in source and binary forms, with or without
20
// modification, are permitted provided that the following conditions are met:
21
//
22
//  -Redistributions of source code must retain the above copyright notice,
23
//   this list of conditions and the following disclaimer.
24
//  -Redistributions in binary form must reproduce the above copyright notice,
25
//   this list of conditions and the following disclaimer in the documentation
26
//   and/or other materials provided with the distribution.
27
//
28
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39
//
40
// Revision History
41
 
42
`include "fm_3d_define.v"
43
module fm_ras (
44
  // system
45
  input         clk_core,
46
  input         rst_x,
47
  // Register Configuration
48
  input [15:0]  i_scr_w_m1,
49
  input [15:0]  i_scr_h_m1,
50
  input [15:0]  i_scr_w,
51
  input [29:0]  i_pixel_top_address,
52
  input [7:0]   i_pixel_color,
53
  input         i_y_flip,
54
  // Geometry Engine I/F
55 4 specular
(* mark_debug = "true" *) input         i_en,
56
(* mark_debug = "true" *) output        o_ack,
57
(* mark_debug = "true" *) input  [`D3D_FTOI_WIDTH-1:0] i_v0_x,
58
(* mark_debug = "true" *) input  [`D3D_FTOI_WIDTH-1:0] i_v0_y,
59
(* mark_debug = "true" *) input  [`D3D_FTOI_WIDTH-1:0] i_v1_x,
60
(* mark_debug = "true" *) input  [`D3D_FTOI_WIDTH-1:0] i_v1_y,
61
(* mark_debug = "true" *) input  [`D3D_FTOI_WIDTH-1:0] i_v2_x,
62
(* mark_debug = "true" *) input  [`D3D_FTOI_WIDTH-1:0] i_v2_y,
63
(* mark_debug = "true" *) output        o_ras_state,
64 2 specular
  // Pixel Write Memory I/F (Write Only)
65
  output        o_req_m,
66
  output [31:0] o_adrs_m,
67
  input         i_ack_m,
68
  output [3:0]  o_be_m,
69
  output [31:0] o_dbw_m
70
);
71
 
72
//////////////////////////////////
73
// wire
74
//////////////////////////////////
75
wire        w_en;
76
wire        w_ack;
77
wire [`D3D_FTOI_WIDTH-1:0] w_v0_x;
78
wire [`D3D_FTOI_WIDTH-1:0] w_v0_y;
79
wire [`D3D_FTOI_WIDTH-1:0] w_v1_x;
80
wire [`D3D_FTOI_WIDTH-1:0] w_v1_y;
81
 
82
wire        w_en_pix;
83
wire        w_ack_pix;
84
wire [`D3D_FTOI_WIDTH-1:0] w_x;
85
wire [`D3D_FTOI_WIDTH-1:0] w_y;
86
wire       w_state_line;
87
//////////////////////////////////
88
// module instance
89
//////////////////////////////////
90
fm_ras_state u_ras_state (
91
  // system
92
  .clk_core(clk_core),
93
  .rst_x(rst_x),
94
  // Register Configuration
95
  .i_scr_w_m1(i_scr_w_m1),
96
  .i_scr_h_m1(i_scr_h_m1),
97
  // Vertex input
98
  .i_en(i_en),
99
  .o_ack(o_ack),
100
  .i_v0_x(i_v0_x),
101
  .i_v0_y(i_v0_y),
102
  .i_v1_x(i_v1_x),
103
  .i_v1_y(i_v1_y),
104
  .i_v2_x(i_v2_x),
105
  .i_v2_y(i_v2_y),
106
  .o_ras_state(o_ras_state),
107
  // Current Line
108
  .o_en(w_en),
109
  .i_ack(w_ack),
110
  .o_v0_x(w_v0_x),
111
  .o_v0_y(w_v0_y),
112
  .o_v1_x(w_v1_x),
113
  .o_v1_y(w_v1_y),
114
  .i_state(w_state_line)
115
);
116
 
117
fm_ras_line u_ras_line (
118
  // system
119
  .clk_core(clk_core),
120
  .rst_x(rst_x),
121
  .o_state(w_state_line),
122
  // Register Configuration
123
  .i_scr_w_m1(i_scr_w_m1),
124
  .i_scr_h_m1(i_scr_h_m1),
125
  // Vertex input
126
  .i_en(w_en),
127
  .o_ack(w_ack),
128
  .i_v0_x(w_v0_x),
129
  .i_v0_y(w_v0_y),
130
  .i_v1_x(w_v1_x),
131
  .i_v1_y(w_v1_y),
132
  // Pixel out
133
  .o_en(w_en_pix),
134
  .i_ack(w_ack_pix),
135
  .o_x(w_x),
136
  .o_y(w_y)
137
);
138
 
139
fm_ras_mem u_ras_mem (
140
  // system
141
  .clk_core(clk_core),
142
  .rst_x(rst_x),
143
  .i_y_flip(i_y_flip),
144
  // Register Configuration
145
  .i_scr_w(i_scr_w),
146
  .i_scr_h_m1(i_scr_h_m1),
147
  .i_pixel_top_address(i_pixel_top_address),
148
  .i_pixel_color(i_pixel_color),
149
  // Pixel In
150
  .i_en(w_en_pix),
151
  .o_ack(w_ack_pix),
152
  .i_x(w_x),
153
  .i_y(w_y),
154
  // Pixel Write Memory I/F (Write Only)
155
  .o_req_m(o_req_m),
156
  .o_adrs_m(o_adrs_m),
157
  .i_ack_m(i_ack_m),
158
  .o_be_m(o_be_m),
159
  .o_dbw_m(o_dbw_m)
160
);
161
 
162
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.