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 2

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
//   Kenji Ishimaru (kenji.ishimaru@prtissimo.com)
13
//
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
module fm_hvc (
43
    clk_core,
44
    clk_vi,
45
    rst_x,
46
    // configuration registers
47
    i_video_start,
48
    i_fb0_offset,
49
    i_fb0_ms_offset,
50
    i_fb1_offset,
51
    i_fb1_ms_offset,
52
    i_color_mode,
53
    i_front_buffer,
54
    i_aa_en,
55
    i_fb_blend_en,
56
    // status out
57
    o_vint_x,
58
    o_vint_edge,
59
    // dram if
60
    o_req,
61
    o_adrs,
62
    o_len,
63
    i_ack,
64
    i_rstr,
65
    i_rd,
66
    // video out
67
    clk_vo,
68
    o_r,
69
    o_g,
70
    o_b,
71
    o_vsync_x,
72
    o_hsync_x,
73
    o_blank_x,
74
    o_de
75
);
76
 
77
//////////////////////////////////
78
// I/O port definition
79
//////////////////////////////////
80
    input          clk_core;
81
    input          clk_vi;     // 25MHz
82
    input          rst_x;
83
    // configuration registers
84
    input          i_video_start;
85
    input  [6:0]   i_fb0_offset;
86
    input  [3:0]   i_fb0_ms_offset;
87
    input  [6:0]   i_fb1_offset;
88
    input  [3:0]   i_fb1_ms_offset;
89
    input  [1:0]   i_color_mode;
90
    input          i_front_buffer;
91
    input  [2:0]   i_aa_en;
92
    input          i_fb_blend_en;
93
    // status out
94
    output         o_vint_x;
95
    output         o_vint_edge;
96
    // dram if
97
    output        o_req;
98
    output [23:0] o_adrs;
99
    output [5:0]  o_len;
100
    input         i_ack;
101
    input         i_rstr;
102
    input  [31:0] i_rd;
103
 
104
    output         clk_vo;
105
    output [7:0]   o_r;
106
    output [7:0]   o_g;
107
    output [7:0]   o_b;
108
    output         o_vsync_x;
109
    output         o_hsync_x;
110
    output         o_blank_x;
111
    output         o_de;
112
 
113
//////////////////////////////////
114
// wire
115
//////////////////////////////////
116
    wire   [7:0]   w_test_r;
117
    wire   [7:0]   w_test_g;
118
    wire   [7:0]   w_test_b;
119
 
120
    wire           w_vsync_i;
121
    wire           w_hsync_i;
122
    wire           w_active;
123
    wire           w_first_line;
124
    wire           w_fifo_available;
125
    wire           w_fifo_available_ack;
126
//////////////////////////////////
127
// assign
128
//////////////////////////////////
129
    assign clk_vo = clk_vi;
130
///////////////////////////
131
//  module instance
132
//////////////////////////
133
 
134
fm_hvc_core fm_hvc_core (
135
    .clk_vi(clk_vi),
136
    .rst_x(rst_x),
137
    // configuration registers
138
    .i_video_start(i_video_start),
139
    // control out (only for internal use)
140
    .o_vsync_i(w_vsync_i),
141
    .o_hsync_i(w_hsync_i),
142
    // video out timing
143
    .o_active(w_active),
144
    .o_first_line(w_first_line),
145
    .o_r(w_test_r),
146
    .o_g(w_test_g),
147
    .o_b(w_test_b),
148
    .o_vsync_x(o_vsync_x),
149
    .o_hsync_x(o_hsync_x),
150
    .o_blank_x(o_blank_x),
151
    .o_de(o_de)
152
);
153
 
154
fm_hvc_dma fm_hvc_dma (
155
    .clk_core(clk_core),
156
    .rst_x(rst_x),
157
    .i_color_mode(i_color_mode),
158
    .i_video_start(i_video_start),
159
    .i_vsync(w_vsync_i),
160
    .i_hsync(w_hsync_i),
161
    .i_fb0_offset(i_fb0_offset),
162
    .i_fb0_ms_offset(i_fb0_ms_offset),
163
    .i_fb1_offset(i_fb1_offset),
164
    .i_fb1_ms_offset(i_fb1_ms_offset),
165
    .i_front_buffer(i_front_buffer),
166
    .i_aa_en(i_aa_en[0]),
167
    .i_fifo_available(w_fifo_available),
168
    .o_fifo_available_ack(w_fifo_available_ack),
169
    .o_vsync(o_vint_x),
170
    .o_vsync_edge(o_vint_edge),
171
    // dram if
172
    .o_req(o_req),
173
    .o_adrs(o_adrs),
174
    .o_len(o_len),
175
    .i_ack(i_ack)
176
);
177
 
178
fm_hvc_data fm_hvc_data (
179
    .clk_core(clk_core),
180
    .clk_vi(clk_vi),
181
    .rst_x(rst_x),
182
    // sdram interface
183
    .i_rstr(i_rstr),
184
    .i_rd(i_rd),
185
    // timing control
186
    .i_h_active(w_active),
187
    .i_first_line(w_first_line),
188
    .i_hsync(w_hsync_i),
189
    .i_vsync(w_vsync_i),
190
    .o_fifo_available(w_fifo_available),
191
    .i_fifo_available_ack(w_fifo_available_ack),
192
    // configuration
193
    .i_video_start(i_video_start),
194
    .i_color_mode(i_color_mode),
195
    // test color input
196
    .i_test_r(w_test_r),
197
    .i_test_g(w_test_g),
198
    .i_test_b(w_test_b),
199
    // color out
200
    .o_r(o_r),
201
    .o_g(o_g),
202
    .o_b(o_b),
203
    .o_a()
204
);
205
 
206
 
207
endmodule

powered by: WebSVN 2.1.0

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