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

Subversion Repositories wf3d

[/] [wf3d/] [trunk/] [implement/] [rtl/] [fm_hvc/] [fm_hvc.v] - Blame information for rev 8

Go to most recent revision | 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_hvc.v
7
//
8
// Abstract:
9
//   VGA LCD Controller
10
//
11
// Author:
12 4 specular
//   Kenji Ishimaru (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 4 specular
// 2016/08/14 64-bit bus support
42 2 specular
 
43
module fm_hvc (
44
    clk_core,
45
    clk_vi,
46
    rst_x,
47
    // configuration registers
48
    i_video_start,
49
    i_fb0_offset,
50
    i_fb1_offset,
51
    i_color_mode,
52
    i_front_buffer,
53
    // status out
54
    o_vint_x,
55
    o_vint_edge,
56
    // dram if
57
    o_req,
58
    o_adrs,
59
    o_len,
60
    i_ack,
61
    i_rstr,
62
    i_rd,
63
    // video out
64
    clk_vo,
65
    o_r,
66
    o_g,
67
    o_b,
68
    o_vsync_x,
69
    o_hsync_x,
70
    o_blank_x,
71
    o_de
72
);
73 4 specular
localparam P_IB_LEN_WIDTH  = 'd6;
74
`ifdef PP_BUSWIDTH_64
75
localparam P_IB_BASE_WIDTH = 'd12;
76
localparam P_IB_ADDR_WIDTH = 'd29;
77
localparam P_IB_DATA_WIDTH = 'd64;
78
`else
79
localparam P_IB_BASE_WIDTH = 'd7;
80
localparam P_IB_ADDR_WIDTH = 'd24;
81
localparam P_IB_DATA_WIDTH = 'd32;
82
`endif
83 2 specular
//////////////////////////////////
84
// I/O port definition
85
//////////////////////////////////
86
    input          clk_core;
87
    input          clk_vi;     // 25MHz
88
    input          rst_x;
89
    // configuration registers
90
    input          i_video_start;
91 4 specular
    input  [P_IB_BASE_WIDTH-1:0]   i_fb0_offset;
92
    input  [P_IB_BASE_WIDTH-1:0]   i_fb1_offset;
93 2 specular
    input  [1:0]   i_color_mode;
94
    input          i_front_buffer;
95
    // status out
96
    output         o_vint_x;
97
    output         o_vint_edge;
98
    // dram if
99
    output        o_req;
100 4 specular
    output [P_IB_ADDR_WIDTH-1:0]
101
                  o_adrs;
102
    output [P_IB_LEN_WIDTH-1:0]
103
                  o_len;
104 2 specular
    input         i_ack;
105
    input         i_rstr;
106 4 specular
    input  [P_IB_DATA_WIDTH-1:0]
107
                  i_rd;
108 2 specular
 
109
    output         clk_vo;
110
    output [7:0]   o_r;
111
    output [7:0]   o_g;
112
    output [7:0]   o_b;
113
    output         o_vsync_x;
114
    output         o_hsync_x;
115
    output         o_blank_x;
116
    output         o_de;
117
 
118
//////////////////////////////////
119
// wire
120
//////////////////////////////////
121
    wire   [7:0]   w_test_r;
122
    wire   [7:0]   w_test_g;
123
    wire   [7:0]   w_test_b;
124
 
125
    wire           w_vsync_i;
126
    wire           w_hsync_i;
127
    wire           w_active;
128
    wire           w_first_line;
129
    wire           w_fifo_available;
130
    wire           w_fifo_available_ack;
131
//////////////////////////////////
132
// assign
133
//////////////////////////////////
134
    assign clk_vo = clk_vi;
135
///////////////////////////
136
//  module instance
137
//////////////////////////
138
 
139
fm_hvc_core fm_hvc_core (
140
    .clk_vi(clk_vi),
141
    .rst_x(rst_x),
142
    // configuration registers
143
    .i_video_start(i_video_start),
144
    // control out (only for internal use)
145
    .o_vsync_i(w_vsync_i),
146
    .o_hsync_i(w_hsync_i),
147
    // video out timing
148
    .o_active(w_active),
149
    .o_first_line(w_first_line),
150
    .o_r(w_test_r),
151
    .o_g(w_test_g),
152
    .o_b(w_test_b),
153
    .o_vsync_x(o_vsync_x),
154
    .o_hsync_x(o_hsync_x),
155
    .o_blank_x(o_blank_x),
156
    .o_de(o_de)
157
);
158
 
159 4 specular
`ifdef PP_USE_AXI
160
`ifdef PP_BUSWIDTH_64
161
`else
162
   wire w_req;
163
   wire [P_IB_ADDR_WIDTH-1:0]
164
       w_adrs;
165
   wire [P_IB_LEN_WIDTH-1:0]
166
       w_len;
167
   wire w_ack;
168
fm_rd_split fm_rd_split (
169 2 specular
    .clk_core(clk_core),
170
    .rst_x(rst_x),
171 4 specular
    .i_req(w_req),
172
    .i_adrs(w_adrs),
173
    .i_len(w_len),
174
    .o_ack(w_ack),
175
    // dram if
176
    .o_req(o_req),
177
    .o_adrs(o_adrs),
178
    .o_len(o_len),
179
    .i_ack(i_ack)
180
);
181
`endif
182
`endif
183
 
184
fm_hvc_dma #(.P_IB_ADDR_WIDTH(P_IB_ADDR_WIDTH),
185
             .P_IB_LEN_WIDTH(P_IB_LEN_WIDTH))
186
  fm_hvc_dma (
187
    .clk_core(clk_core),
188
    .rst_x(rst_x),
189 2 specular
    .i_color_mode(i_color_mode),
190
    .i_video_start(i_video_start),
191
    .i_vsync(w_vsync_i),
192
    .i_hsync(w_hsync_i),
193
    .i_fb0_offset(i_fb0_offset),
194
    .i_fb1_offset(i_fb1_offset),
195
    .i_front_buffer(i_front_buffer),
196
    .i_fifo_available(w_fifo_available),
197
    .o_fifo_available_ack(w_fifo_available_ack),
198
    .o_vsync(o_vint_x),
199
    .o_vsync_edge(o_vint_edge),
200
    // dram if
201 4 specular
`ifdef PP_USE_AXI
202
`ifdef PP_BUSWIDTH_64
203 2 specular
    .o_req(o_req),
204
    .o_adrs(o_adrs),
205
    .o_len(o_len),
206
    .i_ack(i_ack)
207 4 specular
`else
208
    .o_req(w_req),
209
    .o_adrs(w_adrs),
210
    .o_len(w_len),
211
    .i_ack(w_ack)
212
`endif
213
`else
214
    .o_req(o_req),
215
    .o_adrs(o_adrs),
216
    .o_len(o_len),
217
    .i_ack(i_ack)
218
`endif
219 2 specular
);
220
 
221
fm_hvc_data fm_hvc_data (
222
    .clk_core(clk_core),
223
    .clk_vi(clk_vi),
224
    .rst_x(rst_x),
225
    // sdram interface
226
    .i_rstr(i_rstr),
227
    .i_rd(i_rd),
228
    // timing control
229
    .i_h_active(w_active),
230
    .i_first_line(w_first_line),
231
    .i_hsync(w_hsync_i),
232
    .i_vsync(w_vsync_i),
233
    .o_fifo_available(w_fifo_available),
234
    .i_fifo_available_ack(w_fifo_available_ack),
235
    // configuration
236
    .i_video_start(i_video_start),
237
    .i_color_mode(i_color_mode),
238
    // test color input
239
    .i_test_r(w_test_r),
240
    .i_test_g(w_test_g),
241
    .i_test_b(w_test_b),
242
    // color out
243
    .o_r(o_r),
244
    .o_g(o_g),
245
    .o_b(o_b),
246
    .o_a()
247
);
248
 
249
 
250
endmodule

powered by: WebSVN 2.1.0

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