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

Subversion Repositories aoocs

[/] [aoocs/] [trunk/] [doc/] [doxygen/] [html/] [drv__vga_8v_source.html] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5
<title>aoOCS: drv_vga.v Source File</title>
6
<link href="tabs.css" rel="stylesheet" type="text/css"/>
7
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
8
</head>
9
<body>
10
<!-- Generated by Doxygen 1.7.2 -->
11
<div class="navigation" id="top">
12
  <div class="tabs">
13
    <ul class="tablist">
14
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
15
      <li><a href="annotated.html"><span>Design&#160;Unit&#160;List</span></a></li>
16
      <li class="current"><a href="files.html"><span>Files</span></a></li>
17
    </ul>
18
  </div>
19
  <div class="tabs2">
20
    <ul class="tablist">
21
      <li><a href="files.html"><span>File&#160;List</span></a></li>
22
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
23
    </ul>
24
  </div>
25
<div class="header">
26
  <div class="headertitle">
27
<h1>drv_vga.v</h1>  </div>
28
</div>
29
<div class="contents">
30
<a href="drv__vga_8v.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001  <span class="keyword">/*</span>
31
<a name="l00002"></a>00002 <span class="keyword">  Copyright 2010, Aleksander Osman, alfik@poczta.fm. All rights reserved.</span>
32
<a name="l00003"></a>00003 <span class="keyword"> </span>
33
<a name="l00004"></a>00004 <span class="keyword">  Redistribution and use in source and binary forms, with or without modification, are</span>
34
<a name="l00005"></a>00005 <span class="keyword">  permitted provided that the following conditions are met:</span>
35
<a name="l00006"></a>00006 <span class="keyword"> </span>
36
<a name="l00007"></a>00007 <span class="keyword">   1. Redistributions of source code must retain the above copyright notice, this list of</span>
37
<a name="l00008"></a>00008 <span class="keyword">      conditions and the following disclaimer.</span>
38
<a name="l00009"></a>00009 <span class="keyword"> </span>
39
<a name="l00010"></a>00010 <span class="keyword">   2. Redistributions in binary form must reproduce the above copyright notice, this list</span>
40
<a name="l00011"></a>00011 <span class="keyword">      of conditions and the following disclaimer in the documentation and/or other materials</span>
41
<a name="l00012"></a>00012 <span class="keyword">      provided with the distribution.</span>
42
<a name="l00013"></a>00013 <span class="keyword"> </span>
43
<a name="l00014"></a>00014 <span class="keyword">  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS&#39;&#39; AND ANY EXPRESS OR IMPLIED</span>
44
<a name="l00015"></a>00015 <span class="keyword">  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND</span>
45
<a name="l00016"></a>00016 <span class="keyword">  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR</span>
46
<a name="l00017"></a>00017 <span class="keyword">  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span>
47
<a name="l00018"></a>00018 <span class="keyword">  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR</span>
48
<a name="l00019"></a>00019 <span class="keyword">  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON</span>
49
<a name="l00020"></a>00020 <span class="keyword">  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span>
50
<a name="l00021"></a>00021 <span class="keyword">  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF</span>
51
<a name="l00022"></a>00022 <span class="keyword">  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
52
<a name="l00023"></a>00023 <span class="keyword"> */</span>
53
<a name="l00024"></a>00024
54
<a name="l00025"></a>00025 <span class="keyword">/*! \file</span>
55
<a name="l00026"></a>00026 <span class="keyword">  \brief ADV7123 Video DAC driver for VGA output.</span>
56
<a name="l00027"></a>00027 <span class="keyword"> */</span>
57
<a name="l00028"></a>00028
58
<a name="l00029"></a>00029 <span class="keyword">/*! \brief \copybrief drv_vga.v</span>
59
<a name="l00030"></a>00030 <span class="keyword">*/</span>
60
<a name="l00031"></a><a class="code" href="classdrv__vga.html">00031</a> <span class="vhdlkeyword">module</span> <a class="code" href="classdrv__vga.html">drv_vga</a>(
61
<a name="l00032"></a>00032     <span class="keyword">//% \name Clock and reset
62
</span>
63
<a name="l00033"></a>00033     <span class="keyword">//% @{</span>
64
<a name="l00034"></a><a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">00034</a>     <span class="vhdlkeyword">input</span> <a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a>,
65
<a name="l00035"></a><a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">00035</a>     <span class="vhdlkeyword">input</span> <a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a>,
66
<a name="l00036"></a>00036     <span class="keyword">//% @}</span>
67
<a name="l00037"></a>00037
68
<a name="l00038"></a>00038     <span class="keyword">//% \name On-Screen-Display management interface
69
</span>
70
<a name="l00039"></a>00039     <span class="keyword">//% @{</span>
71
<a name="l00040"></a><a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">00040</a>     <span class="vhdlkeyword">input</span>               <a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a>,
72
<a name="l00041"></a><a class="code" href="classdrv__vga.html#ab7f595d93fa3723c61f056ad13e4b95b">00041</a>     <span class="vhdlkeyword">input</span>               <a class="code" href="classdrv__vga.html#ab7f595d93fa3723c61f056ad13e4b95b">on_screen_display</a>,
73
<a name="l00042"></a><a class="code" href="classdrv__vga.html#a10a45704e7923788c0d10c21c623ac4f">00042</a>     <span class="vhdlkeyword">output</span> [<span class="vhdllogic">4</span>:<span class="vhdllogic">0</span>]        <a class="code" href="classdrv__vga.html#a10a45704e7923788c0d10c21c623ac4f">osd_line</a>,
74
<a name="l00043"></a><a class="code" href="classdrv__vga.html#aa1cc640088b50fda8dd9a874d1abd909">00043</a>     <span class="vhdlkeyword">output</span> [<span class="vhdllogic">4</span>:<span class="vhdllogic">0</span>]        <a class="code" href="classdrv__vga.html#aa1cc640088b50fda8dd9a874d1abd909">osd_column</a>,
75
<a name="l00044"></a><a class="code" href="classdrv__vga.html#a38feb3e41812bbabd4d64c418a6fb622">00044</a>     <span class="vhdlkeyword">input</span> [<span class="vhdllogic">7</span>:<span class="vhdllogic">0</span>]         <a class="code" href="classdrv__vga.html#a38feb3e41812bbabd4d64c418a6fb622">character</a>,
76
<a name="l00045"></a>00045     <span class="keyword">//% @}</span>
77
<a name="l00046"></a>00046
78
<a name="l00047"></a>00047     <span class="keyword">//% \name Control signal for VGA capture
79
</span>
80
<a name="l00048"></a>00048     <span class="keyword">//% @{</span>
81
<a name="l00049"></a><a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">00049</a>     <span class="vhdlkeyword">output</span>              <a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">display_valid</a>,
82
<a name="l00050"></a>00050     <span class="keyword">//% @}</span>
83
<a name="l00051"></a>00051
84
<a name="l00052"></a>00052     <span class="keyword">//% \name Direct drv_ssram burst read DMA video interface
85
</span>
86
<a name="l00053"></a>00053     <span class="keyword">//% @{</span>
87
<a name="l00054"></a><a class="code" href="classdrv__vga.html#aba05385922a89053d0ea07a6543978c1">00054</a>     <span class="vhdlkeyword">output</span> <span class="vhdlkeyword">reg</span>          <a class="code" href="classdrv__vga.html#aba05385922a89053d0ea07a6543978c1">burst_read_request</a>,
88
<a name="l00055"></a><a class="code" href="classdrv__vga.html#aa909360705ddfb7c3bddc854ddf5245b">00055</a>     <span class="vhdlkeyword">output</span> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">31</span>:<span class="vhdllogic">2</span>]   <a class="code" href="classdrv__vga.html#aa909360705ddfb7c3bddc854ddf5245b">burst_read_address</a>,
89
<a name="l00056"></a><a class="code" href="classdrv__vga.html#a6885e8a9dddd0d46eb48885c1d14104d">00056</a>     <span class="vhdlkeyword">input</span>               <a class="code" href="classdrv__vga.html#a6885e8a9dddd0d46eb48885c1d14104d">burst_read_ready</a>,
90
<a name="l00057"></a><a class="code" href="classdrv__vga.html#aeccacb0a76a1694e3db88b8757f934d5">00057</a>     <span class="vhdlkeyword">input</span> [<span class="vhdllogic">35</span>:<span class="vhdllogic">0</span>]        <a class="code" href="classdrv__vga.html#aeccacb0a76a1694e3db88b8757f934d5">burst_read_data</a>,
91
<a name="l00058"></a>00058     <span class="keyword">//% @}</span>
92
<a name="l00059"></a>00059
93
<a name="l00060"></a>00060     <span class="keyword">//% \name ADV7123 Video DAC hardware interface
94
</span>
95
<a name="l00061"></a>00061     <span class="keyword">//% @{</span>
96
<a name="l00062"></a><a class="code" href="classdrv__vga.html#ae093cf39ab1b80814194c6eb1ab39c2f">00062</a>     <span class="vhdlkeyword">output</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>]        <a class="code" href="classdrv__vga.html#ae093cf39ab1b80814194c6eb1ab39c2f">vga_r</a>,
97
<a name="l00063"></a><a class="code" href="classdrv__vga.html#af4d7be7b44d78e0185b57899db4649d2">00063</a>     <span class="vhdlkeyword">output</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>]        <a class="code" href="classdrv__vga.html#af4d7be7b44d78e0185b57899db4649d2">vga_g</a>,
98
<a name="l00064"></a><a class="code" href="classdrv__vga.html#acd92e53e6d10225e6d4aa1cc962be209">00064</a>     <span class="vhdlkeyword">output</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>]        <a class="code" href="classdrv__vga.html#acd92e53e6d10225e6d4aa1cc962be209">vga_b</a>,
99
<a name="l00065"></a><a class="code" href="classdrv__vga.html#af868e9c418e06b2ff0357f2e846226b3">00065</a>     <span class="vhdlkeyword">output</span>              <a class="code" href="classdrv__vga.html#af868e9c418e06b2ff0357f2e846226b3">vga_blank_n</a>,
100
<a name="l00066"></a><a class="code" href="classdrv__vga.html#a463ddc5575768d453d2231f3dcf26738">00066</a>     <span class="vhdlkeyword">output</span>              <a class="code" href="classdrv__vga.html#a463ddc5575768d453d2231f3dcf26738">vga_sync_n</a>,
101
<a name="l00067"></a><a class="code" href="classdrv__vga.html#aa7471e76f774550772ce1b69d44638d1">00067</a>     <span class="vhdlkeyword">output</span>              <a class="code" href="classdrv__vga.html#aa7471e76f774550772ce1b69d44638d1">vga_clock</a>,
102
<a name="l00068"></a><a class="code" href="classdrv__vga.html#abb6a6625a5d411c83df0b1d3afa35a7a">00068</a>     <span class="vhdlkeyword">output</span>              <a class="code" href="classdrv__vga.html#abb6a6625a5d411c83df0b1d3afa35a7a">vga_hsync</a>,
103
<a name="l00069"></a><a class="code" href="classdrv__vga.html#a362ab6edf9ff37ff6f51f8c7c42a0ebf">00069</a>     <span class="vhdlkeyword">output</span>              <a class="code" href="classdrv__vga.html#a362ab6edf9ff37ff6f51f8c7c42a0ebf">vga_vsync</a>
104
<a name="l00070"></a>00070     <span class="keyword">//% @}</span>
105
<a name="l00071"></a>00071 );
106
<a name="l00072"></a>00072
107
<a name="l00073"></a><a class="code" href="classdrv__vga.html#ae70561ced7c536531311b8865aa9ca5f">00073</a> <span class="preprocessor">`define</span> <a class="code" href="classdrv__vga.html#ae70561ced7c536531311b8865aa9ca5f">VGA_VIDEO_BUFFER</a>            <span class="vhdllogic">32&#39;h10180000</span>
108
<a name="l00074"></a><a class="code" href="classdrv__vga.html#aba4ec979e464a3b40494f4d6aef18710">00074</a> <span class="preprocessor">`define</span> <a class="code" href="classdrv__vga.html#aba4ec979e464a3b40494f4d6aef18710">VGA_VIDEO_BUFFER_DIV_4</a>      <span class="vhdllogic">30&#39;h04060000</span>
109
<a name="l00075"></a>00075
110
<a name="l00076"></a>00076 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#af868e9c418e06b2ff0357f2e846226b3">vga_blank_n</a> = <span class="vhdllogic">1&#39;b1</span>;
111
<a name="l00077"></a>00077 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a463ddc5575768d453d2231f3dcf26738">vga_sync_n</a> = <span class="vhdllogic">1&#39;b0</span>;
112
<a name="l00078"></a>00078 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#aa7471e76f774550772ce1b69d44638d1">vga_clock</a> = <a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a>;
113
<a name="l00079"></a>00079
114
<a name="l00080"></a><a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">00080</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">7</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a>;
115
<a name="l00081"></a><a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">00081</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">7</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a>;
116
<a name="l00082"></a><a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">00082</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">35</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>;
117
<a name="l00083"></a><a class="code" href="classdrv__vga.html#a34fbd3b7c69bd1aac8f11bfd9871d808">00083</a> <a class="code" href="classdrv__vga.html#a73ed539019cb91cac1dba5720b142a01">altsyncram</a> <span class="vhdlchar">line_ram_inst</span>(
118
<a name="l00084"></a>00084     .<span class="vhdlchar">clock0</span>(<a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a>),
119
<a name="l00085"></a>00085     .<a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a>(<a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a>),
120
<a name="l00086"></a>00086     .<span class="vhdlchar">wren_a</span>(<a class="code" href="classdrv__vga.html#a6885e8a9dddd0d46eb48885c1d14104d">burst_read_ready</a>),
121
<a name="l00087"></a>00087     .<span class="vhdlchar">data_a</span>(<a class="code" href="classdrv__vga.html#aeccacb0a76a1694e3db88b8757f934d5">burst_read_data</a>),
122
<a name="l00088"></a>00088
123
<a name="l00089"></a>00089     .<span class="vhdlchar">clock1</span>(<a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a>),
124
<a name="l00090"></a>00090     .<a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a>(<a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a>),
125
<a name="l00091"></a>00091     .<a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>(<a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>)
126
<a name="l00092"></a>00092 );
127
<a name="l00093"></a>00093 <span class="vhdlkeyword">defparam</span>    <span class="vhdlchar">line_ram_inst</span>.<span class="vhdlchar">operation_mode</span> = <span class="keyword">&quot;DUAL_PORT&quot;</span>,
128
<a name="l00094"></a>00094             <span class="vhdlchar">line_ram_inst</span>.<span class="vhdlchar">width_a</span> = <span class="vhdllogic">36</span>,
129
<a name="l00095"></a>00095             <span class="vhdlchar">line_ram_inst</span>.<span class="vhdlchar">widthad_a</span> = <span class="vhdllogic">8</span>,
130
<a name="l00096"></a>00096             <span class="vhdlchar">line_ram_inst</span>.<span class="vhdlchar">width_b</span> = <span class="vhdllogic">36</span>,
131
<a name="l00097"></a>00097             <span class="vhdlchar">line_ram_inst</span>.<span class="vhdlchar">widthad_b</span> = <span class="vhdllogic">8</span>;
132
<a name="l00098"></a>00098
133
<a name="l00099"></a>00099
134
<a name="l00100"></a><a class="code" href="classdrv__vga.html#a22c0ae2f921e75fcc914231b378a9808">00100</a> <span class="vhdlkeyword">wire</span> <a class="code" href="classdrv__vga.html#a22c0ae2f921e75fcc914231b378a9808">burst_read_prepare</a>;
135
<a name="l00101"></a>00101 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a22c0ae2f921e75fcc914231b378a9808">burst_read_prepare</a> = (
136
<a name="l00102"></a>00102     <span class="keyword">// time to start of next line: 129 + 150 -&gt; enough for ssram write and read</span>
137
<a name="l00103"></a>00103     <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> == (<span class="vhdllogic">10&#39;d799</span>-<span class="vhdllogic">10&#39;d129</span>) &amp;&amp;
138
<a name="l00104"></a>00104     (
139
<a name="l00105"></a>00105         <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> == <span class="vhdllogic">9&#39;d18</span> || <span class="keyword">/* before first line **/</span>
140
<a name="l00106"></a>00106         (<a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> != <span class="vhdllogic">9&#39;d498</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> != <span class="vhdllogic">9&#39;d511</span> &amp;&amp; {<a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> + <span class="vhdllogic">9&#39;d1</span>} == <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a>) <span class="keyword">/* other valid lines, without last line **/</span>
141
<a name="l00107"></a>00107     )
142
<a name="l00108"></a>00108 ) ? <span class="vhdllogic">1&#39;b1</span> : <span class="vhdllogic">1&#39;b0</span>;
143
<a name="l00109"></a>00109
144
<a name="l00110"></a>00110 <span class="keyword">//  0,  2,  4,  6,  8,  10, 12, 14,</span>
145
<a name="l00111"></a>00111 <span class="keyword">//  15, 17, 19, 21, 23, 25, 27, 29,</span>
146
<a name="l00112"></a>00112 <span class="keyword">//  30, 32, 34, 36, 38, 40, 42, 44,</span>
147
<a name="l00113"></a>00113 <span class="keyword">//  45, ...</span>
148
<a name="l00114"></a>00114 <span class="keyword">//  </span>
149
<a name="l00115"></a>00115
150
<a name="l00116"></a><a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">00116</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">8</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a>;
151
<a name="l00117"></a><a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">00117</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">2</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">next_counter</a>;
152
<a name="l00118"></a><a class="code" href="classdrv__vga.html#a6b8dbc4a4fa4c34875a910e793a34e51">00118</a> <span class="vhdlkeyword">always</span> @(<span class="vhdlkeyword">posedge</span> <a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a> <span class="vhdlkeyword">or</span> <span class="vhdlkeyword">negedge</span> <a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a>) <span class="vhdlkeyword">begin</span>
153
<a name="l00119"></a>00119     <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a> == <span class="vhdllogic">1&#39;b0</span>) <span class="vhdlkeyword">begin</span>
154
<a name="l00120"></a>00120         <a class="code" href="classdrv__vga.html#aba05385922a89053d0ea07a6543978c1">burst_read_request</a> &lt;= <span class="vhdllogic">1&#39;b0</span>;
155
<a name="l00121"></a>00121         <a class="code" href="classdrv__vga.html#aa909360705ddfb7c3bddc854ddf5245b">burst_read_address</a> &lt;= <span class="vhdllogic">30&#39;d0</span>;
156
<a name="l00122"></a>00122         <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> &lt;= <span class="vhdllogic">8&#39;d0</span>;
157
<a name="l00123"></a>00123
158
<a name="l00124"></a>00124         <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a> &lt;= <span class="vhdllogic">9&#39;d0</span>;
159
<a name="l00125"></a>00125         <a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">next_counter</a> &lt;= <span class="vhdllogic">3&#39;d0</span>;
160
<a name="l00126"></a>00126     <span class="vhdlkeyword">end</span>
161
<a name="l00127"></a>00127     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> == <span class="vhdllogic">9&#39;d0</span>) <span class="vhdlkeyword">begin</span>
162
<a name="l00128"></a>00128         <a class="code" href="classdrv__vga.html#aa909360705ddfb7c3bddc854ddf5245b">burst_read_address</a> &lt;= <a class="code" href="classdrv__vga.html#aba4ec979e464a3b40494f4d6aef18710">`VGA_VIDEO_BUFFER_DIV_4</a><span class="vhdlchar"></span>; <span class="keyword">// start of video buffer</span>
163
<a name="l00129"></a>00129         <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a> &lt;= <span class="vhdllogic">9&#39;d0</span>;
164
<a name="l00130"></a>00130         <a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">next_counter</a> &lt;= <span class="vhdllogic">3&#39;d0</span>;
165
<a name="l00131"></a>00131     <span class="vhdlkeyword">end</span>
166
<a name="l00132"></a>00132     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a22c0ae2f921e75fcc914231b378a9808">burst_read_prepare</a> == <span class="vhdllogic">1&#39;b1</span>) <span class="vhdlkeyword">begin</span>
167
<a name="l00133"></a>00133         <a class="code" href="classdrv__vga.html#aba05385922a89053d0ea07a6543978c1">burst_read_request</a> &lt;= <span class="vhdllogic">1&#39;b1</span>;
168
<a name="l00134"></a>00134         <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> &lt;= <span class="vhdllogic">8&#39;d0</span>;
169
<a name="l00135"></a>00135     <span class="vhdlkeyword">end</span>
170
<a name="l00136"></a>00136     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6885e8a9dddd0d46eb48885c1d14104d">burst_read_ready</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> &lt;= <span class="vhdllogic">8&#39;d211</span>) <span class="vhdlkeyword">begin</span>
171
<a name="l00137"></a>00137         <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> &lt;= <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> + <span class="vhdllogic">8&#39;d1</span>;
172
<a name="l00138"></a>00138     <span class="vhdlkeyword">end</span>
173
<a name="l00139"></a>00139     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6885e8a9dddd0d46eb48885c1d14104d">burst_read_ready</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> == <span class="vhdllogic">8&#39;d212</span>) <span class="vhdlkeyword">begin</span>
174
<a name="l00140"></a>00140         <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> &lt;= <a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a> + <span class="vhdllogic">8&#39;d1</span>;
175
<a name="l00141"></a>00141         <a class="code" href="classdrv__vga.html#aba05385922a89053d0ea07a6543978c1">burst_read_request</a> &lt;= <span class="vhdllogic">1&#39;b0</span>;
176
<a name="l00142"></a>00142         <a class="code" href="classdrv__vga.html#aa909360705ddfb7c3bddc854ddf5245b">burst_read_address</a> &lt;= <a class="code" href="classdrv__vga.html#aa909360705ddfb7c3bddc854ddf5245b">burst_read_address</a> + <span class="vhdllogic">30&#39;d216</span>; <span class="keyword">// 640/3 = 213.(3) = 214 +2 for %4 = 0</span>
177
<a name="l00143"></a>00143
178
<a name="l00144"></a>00144         <a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">next_counter</a> &lt;= <a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">next_counter</a> + <span class="vhdllogic">3&#39;d1</span>;
179
<a name="l00145"></a>00145
180
<a name="l00146"></a>00146         <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#aa3178dec4eafb3c597849b728bacd928">next_counter</a> == <span class="vhdllogic">3&#39;d7</span>)    <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a> &lt;= <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a> + <span class="vhdllogic">9&#39;d1</span>;
181
<a name="l00147"></a>00147         <span class="vhdlkeyword">else</span>                        <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a> &lt;= <a class="code" href="classdrv__vga.html#ac648eff1ad8ac1f5e3e7694d7c29fdba">next_line</a> + <span class="vhdllogic">9&#39;d2</span>;
182
<a name="l00148"></a>00148     <span class="vhdlkeyword">end</span>
183
<a name="l00149"></a>00149 <span class="vhdlkeyword">end</span>
184
<a name="l00150"></a>00150
185
<a name="l00151"></a><a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">00151</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">1</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a>;
186
<a name="l00152"></a><a class="code" href="classdrv__vga.html#af98d92d9fb604c7a3090d1dfebb4325b">00152</a> <span class="vhdlkeyword">always</span> @(<span class="vhdlkeyword">posedge</span> <a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a> <span class="vhdlkeyword">or</span> <span class="vhdlkeyword">negedge</span> <a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a>) <span class="vhdlkeyword">begin</span>
187
<a name="l00153"></a>00153     <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a> == <span class="vhdllogic">1&#39;b0</span>) <span class="vhdlkeyword">begin</span>
188
<a name="l00154"></a>00154         <a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a> &lt;= <span class="vhdllogic">8&#39;d0</span>;
189
<a name="l00155"></a>00155         <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> &lt;= <span class="vhdllogic">2&#39;d0</span>;
190
<a name="l00156"></a>00156     <span class="vhdlkeyword">end</span>
191
<a name="l00157"></a>00157     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">display_valid</a> == <span class="vhdllogic">1&#39;b0</span>) <span class="vhdlkeyword">begin</span>
192
<a name="l00158"></a>00158         <a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a> &lt;= <span class="vhdllogic">8&#39;d0</span>;
193
<a name="l00159"></a>00159         <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> &lt;= <span class="vhdllogic">2&#39;d1</span>;
194
<a name="l00160"></a>00160     <span class="vhdlkeyword">end</span>
195
<a name="l00161"></a>00161     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>) <span class="vhdlkeyword">begin</span>
196
<a name="l00162"></a>00162         <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> &lt;= <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> + <span class="vhdllogic">2&#39;d1</span>;
197
<a name="l00163"></a>00163     <span class="vhdlkeyword">end</span>
198
<a name="l00164"></a>00164     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d2</span>) <span class="vhdlkeyword">begin</span>
199
<a name="l00165"></a>00165         <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> &lt;= <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> + <span class="vhdllogic">2&#39;d1</span>;
200
<a name="l00166"></a>00166         <a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a> &lt;= <a class="code" href="classdrv__vga.html#abada63beb55063be05d88df41af318fa">address_b</a> + <span class="vhdllogic">8&#39;d1</span>;
201
<a name="l00167"></a>00167     <span class="vhdlkeyword">end</span>
202
<a name="l00168"></a>00168     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d3</span>) <span class="vhdlkeyword">begin</span>
203
<a name="l00169"></a>00169         <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> &lt;= <span class="vhdllogic">2&#39;d1</span>;
204
<a name="l00170"></a>00170     <span class="vhdlkeyword">end</span>
205
<a name="l00171"></a>00171 <span class="vhdlkeyword">end</span>
206
<a name="l00172"></a>00172
207
<a name="l00173"></a><a class="code" href="classdrv__vga.html#a549d46b8e788387828d20c8079bd43b9">00173</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a549d46b8e788387828d20c8079bd43b9">red</a> =
208
<a name="l00174"></a>00174         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">31</span>:<span class="vhdllogic">29</span>], <span class="vhdllogic">7&#39;b0</span> } :
209
<a name="l00175"></a>00175         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">22</span>:<span class="vhdllogic">20</span>], <span class="vhdllogic">7&#39;b0</span> } :
210
<a name="l00176"></a>00176         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">13</span>:<span class="vhdllogic">11</span>], <span class="vhdllogic">7&#39;b0</span> } :
211
<a name="l00177"></a>00177     (<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>) ? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">35</span>:<span class="vhdllogic">32</span>], <span class="vhdllogic">6&#39;b0</span> } :
212
<a name="l00178"></a>00178     (<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d2</span>) ? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">23</span>:<span class="vhdllogic">20</span>], <span class="vhdllogic">6&#39;b0</span> } :
213
<a name="l00179"></a>00179     { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">11</span>:<span class="vhdllogic">8</span>], <span class="vhdllogic">6&#39;b0</span> };
214
<a name="l00180"></a>00180
215
<a name="l00181"></a><a class="code" href="classdrv__vga.html#ad523316de7108ba00362b2a092bd0d10">00181</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#ad523316de7108ba00362b2a092bd0d10">green</a> =
216
<a name="l00182"></a>00182         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">28</span>:<span class="vhdllogic">26</span>], <span class="vhdllogic">7&#39;b0</span> } :
217
<a name="l00183"></a>00183         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">19</span>:<span class="vhdllogic">17</span>], <span class="vhdllogic">7&#39;b0</span> } :
218
<a name="l00184"></a>00184         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">10</span>:<span class="vhdllogic">8</span>], <span class="vhdllogic">7&#39;b0</span> } :
219
<a name="l00185"></a>00185     (<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>) ? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">31</span>:<span class="vhdllogic">28</span>], <span class="vhdllogic">6&#39;b0</span> } :
220
<a name="l00186"></a>00186     (<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d2</span>) ? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">19</span>:<span class="vhdllogic">16</span>], <span class="vhdllogic">6&#39;b0</span> } :
221
<a name="l00187"></a>00187     { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">7</span>:<span class="vhdllogic">4</span>], <span class="vhdllogic">6&#39;b0</span> };
222
<a name="l00188"></a>00188
223
<a name="l00189"></a><a class="code" href="classdrv__vga.html#a6eb02b3146858fd49f014815679eaa8d">00189</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a6eb02b3146858fd49f014815679eaa8d">blue</a> =
224
<a name="l00190"></a>00190         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">25</span>:<span class="vhdllogic">23</span>], <span class="vhdllogic">7&#39;b0</span> } :
225
<a name="l00191"></a>00191         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">16</span>:<span class="vhdllogic">14</span>], <span class="vhdllogic">7&#39;b0</span> } :
226
<a name="l00192"></a>00192         (<a class="code" href="classdrv__vga.html#a7c72d1d36e519c384a173325a101c738">management_mode</a> == <span class="vhdllogic">1&#39;b1</span>)? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">7</span>:<span class="vhdllogic">5</span>], <span class="vhdllogic">7&#39;b0</span> } :
227
<a name="l00193"></a>00193     (<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d1</span>) ? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">27</span>:<span class="vhdllogic">24</span>], <span class="vhdllogic">6&#39;b0</span> } :
228
<a name="l00194"></a>00194     (<a class="code" href="classdrv__vga.html#a6a5fd8de78bc8bb1bd1431cd860abdf1">three_counter</a> == <span class="vhdllogic">2&#39;d2</span>) ? { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">15</span>:<span class="vhdllogic">12</span>], <span class="vhdllogic">6&#39;b0</span> } :
229
<a name="l00195"></a>00195     { <a class="code" href="classdrv__vga.html#a30f9820bf1b8cc08e21fa0d7f3a18c6c">q_b</a>[<span class="vhdllogic">3</span>:<span class="vhdllogic">0</span>], <span class="vhdllogic">6&#39;b0</span> };
230
<a name="l00196"></a>00196
231
<a name="l00197"></a>00197 <span class="keyword">//------------------------------------------------------------------------------ on screen display: 24 columns, 18 lines start</span>
232
<a name="l00198"></a><a class="code" href="classdrv__vga.html#a0bee1fc166ab279e572fe1fe707e3b67">00198</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">8</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a0bee1fc166ab279e572fe1fe707e3b67">line_counter_for_osd</a>;
233
<a name="l00199"></a>00199 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a0bee1fc166ab279e572fe1fe707e3b67">line_counter_for_osd</a>     = <a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> - <span class="vhdllogic">9&#39;d176</span>;
234
<a name="l00200"></a><a class="code" href="classdrv__vga.html#a4290316a2168f5ff072defe602b7287f">00200</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">10</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a4290316a2168f5ff072defe602b7287f">column_counter_for_osd</a>;
235
<a name="l00201"></a>00201 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a4290316a2168f5ff072defe602b7287f">column_counter_for_osd</a>   = <a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">column_counter</a> - <span class="vhdllogic">11&#39;d8</span>;
236
<a name="l00202"></a>00202
237
<a name="l00203"></a>00203 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a10a45704e7923788c0d10c21c623ac4f">osd_line</a>     = (<a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> &gt;= <span class="vhdllogic">9&#39;d176</span> <span class="keyword">/* 480-16-16x18 **/</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> &lt; <span class="vhdllogic">9&#39;d464</span> <span class="keyword">/* 480-16**/</span>)? <a class="code" href="classdrv__vga.html#a0bee1fc166ab279e572fe1fe707e3b67">line_counter_for_osd</a>[<span class="vhdllogic">8</span>:<span class="vhdllogic">4</span>]  : <span class="vhdllogic">5&#39;d31</span>;
238
<a name="l00204"></a>00204 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#aa1cc640088b50fda8dd9a874d1abd909">osd_column</a>   = (<a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">column_counter</a> &gt;= <span class="vhdllogic">11&#39;d8</span> &amp;&amp; <a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">column_counter</a> &lt; <span class="vhdllogic">11&#39;d200</span> <span class="keyword">/* 8+24x8 **/</span>)?               <a class="code" href="classdrv__vga.html#a4290316a2168f5ff072defe602b7287f">column_counter_for_osd</a>[<span class="vhdllogic">7</span>:<span class="vhdllogic">3</span>]: <span class="vhdllogic">5&#39;d31</span>;
239
<a name="l00205"></a>00205
240
<a name="l00206"></a><a class="code" href="classdrv__vga.html#af55ae5aff822796b9173fcaf7c6b19ea">00206</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">7</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#af55ae5aff822796b9173fcaf7c6b19ea">char_saved</a>;
241
<a name="l00207"></a><a class="code" href="classdrv__vga.html#a0cd5229f9236bafdc60cd75f2836d688">00207</a> <span class="vhdlkeyword">always</span> @(<span class="vhdlkeyword">posedge</span> <a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a> <span class="vhdlkeyword">or</span> <span class="vhdlkeyword">negedge</span> <a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a>) <span class="vhdlkeyword">begin</span>
242
<a name="l00208"></a>00208     <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a> == <span class="vhdllogic">1&#39;b0</span>)                             <a class="code" href="classdrv__vga.html#af55ae5aff822796b9173fcaf7c6b19ea">char_saved</a> &lt;= <span class="vhdllogic">8&#39;d0</span>;
243
<a name="l00209"></a>00209     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a4290316a2168f5ff072defe602b7287f">column_counter_for_osd</a>[<span class="vhdllogic">2</span>:<span class="vhdllogic">0</span>] == <span class="vhdllogic">3&#39;d6</span>)    <a class="code" href="classdrv__vga.html#af55ae5aff822796b9173fcaf7c6b19ea">char_saved</a> &lt;= <a class="code" href="classdrv__vga.html#a38feb3e41812bbabd4d64c418a6fb622">character</a>;
244
<a name="l00210"></a>00210 <span class="vhdlkeyword">end</span>
245
<a name="l00211"></a>00211
246
<a name="l00212"></a>00212 <span class="keyword">//****************** Font</span>
247
<a name="l00213"></a><a class="code" href="classdrv__vga.html#a0ec503813e34949f7668a98f504761a0">00213</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">8</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a0ec503813e34949f7668a98f504761a0">font_line</a>;
248
<a name="l00214"></a>00214 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a0ec503813e34949f7668a98f504761a0">font_line</a> = <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> - <span class="vhdllogic">9&#39;d3</span>;
249
<a name="l00215"></a>00215
250
<a name="l00216"></a><a class="code" href="classdrv__vga.html#ae5d246022a400014c7a17bbcd0398db6">00216</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#ae5d246022a400014c7a17bbcd0398db6">font_column</a>;
251
<a name="l00217"></a>00217 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#ae5d246022a400014c7a17bbcd0398db6">font_column</a> = <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> - <span class="vhdllogic">10&#39;d6</span>;
252
<a name="l00218"></a>00218
253
<a name="l00219"></a><a class="code" href="classdrv__vga.html#a8f0863b6b9622cfa812f1d53ea373b2b">00219</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">7</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a8f0863b6b9622cfa812f1d53ea373b2b">font</a>;
254
<a name="l00220"></a><a class="code" href="classdrv__vga.html#a73ed539019cb91cac1dba5720b142a01">00220</a> <a class="code" href="classdrv__vga.html#a73ed539019cb91cac1dba5720b142a01">altsyncram</a> <span class="vhdlchar">font_rom_inst</span>(
255
<a name="l00221"></a>00221     .<span class="vhdlchar">clock0</span>(<a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a>),
256
<a name="l00222"></a>00222     .<a class="code" href="classdrv__vga.html#a5a908124ef208bf84998f7cde2c452d8">address_a</a>({<a class="code" href="classdrv__vga.html#af55ae5aff822796b9173fcaf7c6b19ea">char_saved</a>[<span class="vhdllogic">6</span>:<span class="vhdllogic">0</span>], <a class="code" href="classdrv__vga.html#a0ec503813e34949f7668a98f504761a0">font_line</a>[<span class="vhdllogic">3</span>:<span class="vhdllogic">0</span>]}),
257
<a name="l00223"></a>00223     .<span class="vhdlchar">q_a</span>(<a class="code" href="classdrv__vga.html#a8f0863b6b9622cfa812f1d53ea373b2b">font</a>)
258
<a name="l00224"></a>00224 );
259
<a name="l00225"></a>00225 <span class="vhdlkeyword">defparam</span> <span class="vhdlchar">font_rom_inst</span>.<span class="vhdlchar">operation_mode</span> = <span class="keyword">&quot;ROM&quot;</span>;
260
<a name="l00226"></a>00226 <span class="vhdlkeyword">defparam</span> <span class="vhdlchar">font_rom_inst</span>.<span class="vhdlchar">width_a</span> = <span class="vhdllogic">8</span>;
261
<a name="l00227"></a>00227 <span class="vhdlkeyword">defparam</span> <span class="vhdlchar">font_rom_inst</span>.<span class="vhdlchar">widthad_a</span> = <span class="vhdllogic">11</span>;
262
<a name="l00228"></a>00228 <span class="vhdlkeyword">defparam</span> <span class="vhdlchar">font_rom_inst</span>.<span class="vhdlchar">init_file</span> = <span class="keyword">&quot;drv_vga_font.mif&quot;</span>;
263
<a name="l00229"></a>00229
264
<a name="l00230"></a><a class="code" href="classdrv__vga.html#a6b8ee2d70db3b00e0bd08671cd13b52d">00230</a> <span class="vhdlkeyword">wire</span> <a class="code" href="classdrv__vga.html#a6b8ee2d70db3b00e0bd08671cd13b52d">font_pixel</a>;
265
<a name="l00231"></a>00231 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a6b8ee2d70db3b00e0bd08671cd13b52d">font_pixel</a> = <a class="code" href="classdrv__vga.html#af55ae5aff822796b9173fcaf7c6b19ea">char_saved</a>[<span class="vhdllogic">7</span>] ^ <a class="code" href="classdrv__vga.html#a8f0863b6b9622cfa812f1d53ea373b2b">font</a>[<a class="code" href="classdrv__vga.html#ae5d246022a400014c7a17bbcd0398db6">font_column</a>[<span class="vhdllogic">2</span>:<span class="vhdllogic">0</span>]];
266
<a name="l00232"></a>00232
267
<a name="l00233"></a><a class="code" href="classdrv__vga.html#a1b5b5b35ae3fdd5eb40af9286ad6dc44">00233</a> <span class="vhdlkeyword">wire</span> <a class="code" href="classdrv__vga.html#a1b5b5b35ae3fdd5eb40af9286ad6dc44">osd_active</a>;
268
<a name="l00234"></a>00234 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a1b5b5b35ae3fdd5eb40af9286ad6dc44">osd_active</a> = (<a class="code" href="classdrv__vga.html#ab7f595d93fa3723c61f056ad13e4b95b">on_screen_display</a> == <span class="vhdllogic">1&#39;b1</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a10a45704e7923788c0d10c21c623ac4f">osd_line</a> != <span class="vhdllogic">5&#39;d31</span> &amp;&amp; <a class="code" href="classdrv__vga.html#aa1cc640088b50fda8dd9a874d1abd909">osd_column</a> != <span class="vhdllogic">5&#39;d31</span>);
269
<a name="l00235"></a>00235 <span class="keyword">//------------------------------------------------------------------------------ on screen display end</span>
270
<a name="l00236"></a>00236
271
<a name="l00237"></a>00237 <span class="keyword">// 640x480@75Hz</span>
272
<a name="l00238"></a><a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">00238</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">9</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a>;
273
<a name="l00239"></a><a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">00239</a> <span class="vhdlkeyword">reg</span> [<span class="vhdllogic">8</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a>;
274
<a name="l00240"></a><a class="code" href="classdrv__vga.html#af0c7c40cb7c77b8c759687d6362a7e17">00240</a> <span class="vhdlkeyword">always</span> @(<span class="vhdlkeyword">posedge</span> <a class="code" href="classdrv__vga.html#a6400b0e4b90964b25c3f763e19b138d9">clk_30</a> <span class="vhdlkeyword">or</span> <span class="vhdlkeyword">negedge</span> <a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a>) <span class="vhdlkeyword">begin</span>
275
<a name="l00241"></a>00241     <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a6ceec01e795fdf21d7a2ccc5b78549ab">reset_n</a> == <span class="vhdllogic">1&#39;b0</span>) <span class="vhdlkeyword">begin</span>
276
<a name="l00242"></a>00242         <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &lt;= <span class="vhdllogic">10&#39;d0</span>;
277
<a name="l00243"></a>00243         <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &lt;= <span class="vhdllogic">9&#39;d0</span>;
278
<a name="l00244"></a>00244     <span class="vhdlkeyword">end</span>
279
<a name="l00245"></a>00245     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> == <span class="vhdllogic">10&#39;d799</span>) <span class="vhdlkeyword">begin</span>
280
<a name="l00246"></a>00246         <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &lt;= <span class="vhdllogic">10&#39;d0</span>;
281
<a name="l00247"></a>00247
282
<a name="l00248"></a>00248         <span class="vhdlkeyword">if</span>(<a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> == <span class="vhdllogic">9&#39;d499</span>)     <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &lt;= <span class="vhdllogic">9&#39;d0</span>;
283
<a name="l00249"></a>00249         <span class="vhdlkeyword">else</span>                        <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &lt;= <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> + <span class="vhdllogic">9&#39;d1</span>;
284
<a name="l00250"></a>00250     <span class="vhdlkeyword">end</span>
285
<a name="l00251"></a>00251     <span class="vhdlkeyword">else</span> <span class="vhdlkeyword">begin</span>
286
<a name="l00252"></a>00252         <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &lt;= <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> + <span class="vhdllogic">10&#39;d1</span>;
287
<a name="l00253"></a>00253     <span class="vhdlkeyword">end</span>
288
<a name="l00254"></a>00254 <span class="vhdlkeyword">end</span>
289
<a name="l00255"></a>00255
290
<a name="l00256"></a>00256 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#abb6a6625a5d411c83df0b1d3afa35a7a">vga_hsync</a> = (<a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &gt;= <span class="vhdllogic">10&#39;d0</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &lt;= <span class="vhdllogic">10&#39;d63</span>) ? <span class="vhdllogic">1&#39;b0</span> : <span class="vhdllogic">1&#39;b1</span>;
291
<a name="l00257"></a>00257 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a362ab6edf9ff37ff6f51f8c7c42a0ebf">vga_vsync</a> = (<a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &gt;= <span class="vhdllogic">9&#39;d0</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &lt;= <span class="vhdllogic">9&#39;d2</span>) ? <span class="vhdllogic">1&#39;b0</span> : <span class="vhdllogic">1&#39;b1</span>;
292
<a name="l00258"></a>00258
293
<a name="l00259"></a><a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">00259</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">8</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a>;
294
<a name="l00260"></a>00260 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> = (<a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &gt;= <span class="vhdllogic">9&#39;d19</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> &lt;= <span class="vhdllogic">9&#39;d498</span>)? <a class="code" href="classdrv__vga.html#a41db336402ed59e650d7287f89e93120">v_counter</a> - <span class="vhdllogic">9&#39;d19</span> : <span class="vhdllogic">9&#39;d511</span>;
295
<a name="l00261"></a>00261
296
<a name="l00262"></a><a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">00262</a> <span class="vhdlkeyword">wire</span> [<span class="vhdllogic">10</span>:<span class="vhdllogic">0</span>] <a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">column_counter</a>;
297
<a name="l00263"></a>00263 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">column_counter</a> = (<a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &gt;= <span class="vhdllogic">10&#39;d150</span> &amp;&amp; <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> &lt;= <span class="vhdllogic">10&#39;d789</span>)? <a class="code" href="classdrv__vga.html#a69690878d398577f9f7e595378cda729">h_counter</a> - <span class="vhdllogic">10&#39;d150</span> : <span class="vhdllogic">10&#39;d1023</span>;
298
<a name="l00264"></a>00264
299
<a name="l00265"></a>00265 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">display_valid</a> = (<a class="code" href="classdrv__vga.html#a9f12b95e1eefddec5a5cffcfb74dedc5">line_counter</a> != <span class="vhdllogic">9&#39;d511</span> &amp;&amp; <a class="code" href="classdrv__vga.html#aa7e8f2c6185b5ee9f8a11def2f04e192">column_counter</a> != <span class="vhdllogic">10&#39;d1023</span>);
300
<a name="l00266"></a>00266
301
<a name="l00267"></a>00267 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#ae093cf39ab1b80814194c6eb1ab39c2f">vga_r</a> = <a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">display_valid</a> ? ((<a class="code" href="classdrv__vga.html#a1b5b5b35ae3fdd5eb40af9286ad6dc44">osd_active</a> == <span class="vhdllogic">1&#39;b0</span>) ? <a class="code" href="classdrv__vga.html#a549d46b8e788387828d20c8079bd43b9">red</a>      : {<span class="vhdllogic">10</span>{<a class="code" href="classdrv__vga.html#a6b8ee2d70db3b00e0bd08671cd13b52d">font_pixel</a>}}) : <span class="vhdllogic">10&#39;d0</span>;
302
<a name="l00268"></a>00268 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#af4d7be7b44d78e0185b57899db4649d2">vga_g</a> = <a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">display_valid</a> ? ((<a class="code" href="classdrv__vga.html#a1b5b5b35ae3fdd5eb40af9286ad6dc44">osd_active</a> == <span class="vhdllogic">1&#39;b0</span>) ? <a class="code" href="classdrv__vga.html#ad523316de7108ba00362b2a092bd0d10">green</a>    : {<span class="vhdllogic">10</span>{<a class="code" href="classdrv__vga.html#a6b8ee2d70db3b00e0bd08671cd13b52d">font_pixel</a>}}) : <span class="vhdllogic">10&#39;d0</span>;
303
<a name="l00269"></a>00269 <span class="vhdlkeyword">assign</span> <a class="code" href="classdrv__vga.html#acd92e53e6d10225e6d4aa1cc962be209">vga_b</a> = <a class="code" href="classdrv__vga.html#ad3b09207753c04efb6a28109361c0848">display_valid</a> ? ((<a class="code" href="classdrv__vga.html#a1b5b5b35ae3fdd5eb40af9286ad6dc44">osd_active</a> == <span class="vhdllogic">1&#39;b0</span>) ? <a class="code" href="classdrv__vga.html#a6eb02b3146858fd49f014815679eaa8d">blue</a>     : {<span class="vhdllogic">10</span>{<a class="code" href="classdrv__vga.html#a6b8ee2d70db3b00e0bd08671cd13b52d">font_pixel</a>}}) : <span class="vhdllogic">10&#39;d0</span>;
304
<a name="l00270"></a>00270
305
<a name="l00271"></a>00271 <span class="vhdlkeyword">endmodule</span>
306
<a name="l00272"></a>00272
307
</pre></div></div>
308
</div>
309
<hr class="footer"/><address class="footer"><small>Generated on Mon Dec 20 2010 21:20:18 for aoOCS by&#160;
310
<a href="http://www.doxygen.org/index.html">
311
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
312
</body>
313
</html>

powered by: WebSVN 2.1.0

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