|
6 | 6 | <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /> |
7 | 7 |
|
8 | 8 | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
9 | | - <title>Frequency counter — NDK-FPGA documentation</title> |
| 9 | + <title>Frequency meter — NDK-FPGA documentation</title> |
10 | 10 | <link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=80d5e7a1" /> |
11 | 11 | <link rel="stylesheet" type="text/css" href="../../../../_static/css/theme_overrides.css?v=b530091d" /> |
12 | 12 |
|
|
18 | 18 | <script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script> |
19 | 19 | <script src="../../../../_static/js/theme.js"></script> |
20 | 20 | <link rel="index" title="Index" href="../../../../genindex.html" /> |
21 | | - <link rel="search" title="Search" href="../../../../search.html" /> |
| 21 | + <link rel="search" title="Search" href="../../../../search.html" /> |
| 22 | + <link rel="next" title="Controllers & TSU" href="../../../../ctrls.html" /> |
| 23 | + <link rel="prev" title="Pulse short" href="../pulse_short/readme.html" /> |
22 | 24 | </head> |
23 | 25 |
|
24 | 26 | <body class="wy-body-for-nav"> |
|
57 | 59 | <li class="toctree-l1"><a class="reference internal" href="../../../../app-minimal.html">Minimal NDK application</a></li> |
58 | 60 | </ul> |
59 | 61 | <p class="caption" role="heading"><span class="caption-text">Reusable Modules Library</span></p> |
60 | | -<ul> |
61 | | -<li class="toctree-l1"><a class="reference internal" href="../../../../base.html">Basic Tools</a></li> |
| 62 | +<ul class="current"> |
| 63 | +<li class="toctree-l1 current"><a class="reference internal" href="../../../../base.html">Basic Tools</a><ul class="current"> |
| 64 | +<li class="toctree-l2"><a class="reference internal" href="../../../../async.html">Asynchronous modules</a></li> |
| 65 | +<li class="toctree-l2"><a class="reference internal" href="../../../../memory.html">Memory modules</a></li> |
| 66 | +<li class="toctree-l2"><a class="reference internal" href="../../../../fifo.html">FIFO components</a></li> |
| 67 | +<li class="toctree-l2"><a class="reference internal" href="../../../../dsp.html">DSP components</a></li> |
| 68 | +<li class="toctree-l2"><a class="reference internal" href="../../../../logic.html">Basic logic elements</a></li> |
| 69 | +<li class="toctree-l2 current"><a class="reference internal" href="../../../../misc.html">Miscellaneous</a><ul class="current"> |
| 70 | +<li class="toctree-l3"><a class="reference internal" href="../crossbarx/readme.html">CrossbarX</a></li> |
| 71 | +<li class="toctree-l3"><a class="reference internal" href="../trans_sorter/readme.html">Transaction Sorter</a></li> |
| 72 | +<li class="toctree-l3"><a class="reference internal" href="../packet_planner/readme.html">Packet Planner</a></li> |
| 73 | +<li class="toctree-l3"><a class="reference internal" href="../event_counter/readme.html">Event Counter</a></li> |
| 74 | +<li class="toctree-l3"><a class="reference internal" href="../pulse_short/readme.html">Pulse short</a></li> |
| 75 | +<li class="toctree-l3 current"><a class="current reference internal" href="#">Frequency meter</a></li> |
| 76 | +</ul> |
| 77 | +</li> |
| 78 | +</ul> |
| 79 | +</li> |
62 | 80 | <li class="toctree-l1"><a class="reference internal" href="../../../../ctrls.html">Controllers & TSU</a></li> |
63 | 81 | <li class="toctree-l1"><a class="reference internal" href="../../../../mi.html">MI Tools</a></li> |
64 | 82 | <li class="toctree-l1"><a class="reference internal" href="../../../../mfb.html">MFB Tools</a></li> |
|
105 | 123 | <div role="navigation" aria-label="Page navigation"> |
106 | 124 | <ul class="wy-breadcrumbs"> |
107 | 125 | <li><a href="../../../../index.html" class="icon icon-home" aria-label="Home"></a></li> |
108 | | - <li class="breadcrumb-item active">Frequency counter</li> |
| 126 | + <li class="breadcrumb-item"><a href="../../../../base.html">Basic Tools</a></li> |
| 127 | + <li class="breadcrumb-item"><a href="../../../../misc.html">Miscellaneous</a></li> |
| 128 | + <li class="breadcrumb-item active">Frequency meter</li> |
109 | 129 | <li class="wy-breadcrumbs-aside"> |
110 | 130 | <a href="../../../../_sources/comp/base/misc/frequency_meter/readme.rst.txt" rel="nofollow"> View page source</a> |
111 | 131 | </li> |
|
115 | 135 | <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
116 | 136 | <div itemprop="articleBody"> |
117 | 137 |
|
118 | | - <section id="frequency-counter"> |
119 | | -<span id="id1"></span><h1>Frequency counter<a class="headerlink" href="#frequency-counter" title="Link to this heading"></a></h1> |
| 138 | + <section id="frequency-meter"> |
| 139 | +<span id="id1"></span><h1>Frequency meter<a class="headerlink" href="#frequency-meter" title="Link to this heading"></a></h1> |
120 | 140 | <dl class="vhdl autoentity"> |
121 | | -<dt class="sig sig-object vhdl" id="vhdl-entity-frequency_counter"> |
122 | | -<span class="k"><span class="pre">ENTITY</span> </span><span class="sig-name descname"><span class="pre">FREQUENCY_COUNTER</span></span><span class="k"> <span class="pre">IS</span></span><a class="headerlink" href="#vhdl-entity-frequency_counter" title="Link to this definition"></a></dt> |
123 | | -<dd><p>SPHINX-VHDL: Entity was not found in parsed VHDL files!</p> |
| 141 | +<dt class="sig sig-object vhdl" id="vhdl-entity-frequency_meter"> |
| 142 | +<span class="k"><span class="pre">ENTITY</span> </span><span class="sig-name descname"><span class="pre">FREQUENCY_METER</span></span><span class="k"> <span class="pre">IS</span></span><a class="headerlink" href="#vhdl-entity-frequency_meter" title="Link to this definition"></a></dt> |
| 143 | +<dd><p>The component FREQUENCY_METER measures frequency of a (Clock) signal using the Equal Precision algorithm. |
| 144 | +For this, it needs a reference (Clock) signal of known frequency.</p> |
| 145 | +<p>The “Measured frequency” is measured within an Interval, which is configurable via the MI bus (see the |
| 146 | +MI Address Space below). Start the measurement by a Write to the Command register. |
| 147 | +During this Interval, two counters are enabled, one running on the Reference Clock, |
| 148 | +the other on the Measured Clock. After it has passed, the counters’ data will be ready to be fetched (=> loaded to MI registers). |
| 149 | +Check the Status register for information about whether the measurement is running or has completed, if the data are ready, |
| 150 | +or if any errors occurred (and which one(s)).</p> |
| 151 | +<div class="admonition note"> |
| 152 | +<p class="admonition-title">Note</p> |
| 153 | +<p>In the case of an overflow error (status(6-7)), either make a new design with wider counter(s) or |
| 154 | +just lower the duration of the measurement by writing a new value to the Interval length register. |
| 155 | +Be aware that lower lengths of the Interval (slightly) decrease the accuracy of the measurement.</p> |
| 156 | +</div> |
| 157 | +<div class="admonition note"> |
| 158 | +<p class="admonition-title">Note</p> |
| 159 | +<p>Issuing a MI reset command (cmd(1)) during an in-progress measurement without stopping it (re)starts the |
| 160 | +measurement anew, so there is no need to start it again by writing to the command register (cmd(0)).</p> |
| 161 | +</div> |
| 162 | +<p>The component cannot calculate the final frequency (is not yet implemented). |
| 163 | +At this time, it can simply be done in software using formula: Fmeas = Fref * Nmeas/Nref, where |
| 164 | +F<meas/ref> is the Measured or Reference frequency and N<meas/ref> are the data from the counters. |
| 165 | +It is recommended to use the provided python tool to calculate the final value of the measured frequency(ies).</p> |
| 166 | +<p>Other yet-to-be-implemented features include storing the counters’ values from multiple measurements and |
| 167 | +a histogram of these values.</p> |
| 168 | +<p><strong>MI Address Space</strong></p> |
| 169 | +<span class="sig-name descname">Generics</span><table class="docutils align-default"> |
| 170 | +<thead> |
| 171 | +<tr class="row-odd"><th class="head"><p>Generic</p></th> |
| 172 | +<th class="head"><p>Type</p></th> |
| 173 | +<th class="head"><p>Default</p></th> |
| 174 | +<th class="head"><p>Description</p></th> |
| 175 | +</tr> |
| 176 | +</thead> |
| 177 | +<tbody> |
| 178 | +<tr class="row-even" id="vhdl-gengeneric-frequency_meter-mi_data_width"><td><p>MI_DATA_WIDTH</p></td> |
| 179 | +<td><p>natural</p></td> |
| 180 | +<td><p>32</p></td> |
| 181 | +<td></td> |
| 182 | +</tr> |
| 183 | +<tr class="row-odd" id="vhdl-gengeneric-frequency_meter-mi_addr_width"><td><p>MI_ADDR_WIDTH</p></td> |
| 184 | +<td><p>natural</p></td> |
| 185 | +<td><p>32</p></td> |
| 186 | +<td></td> |
| 187 | +</tr> |
| 188 | +<tr class="row-even" id="vhdl-gengeneric-frequency_meter-interval_len_width"><td><p>INTERVAL_LEN_WIDTH</p></td> |
| 189 | +<td><p>natural</p></td> |
| 190 | +<td><p>32</p></td> |
| 191 | +<td><p>Maximum width of the Interval length signal => the highest possible value is 2**INTERVAL_LEN_WIDTH-1. |
| 192 | +This value of the Interval length signal can be set over the MI. |
| 193 | +Defines the length of the Interval during which the frequency measurement takes place. |
| 194 | +Counts by 1 to its maximum which is when the “frequency counters” are sampled. |
| 195 | +Values over 32 (=MI_DATA_WIDTH) are currently not supported!</p></td> |
| 196 | +</tr> |
| 197 | +<tr class="row-odd" id="vhdl-gengeneric-frequency_meter-reference_cntr_width"><td><p>REFERENCE_CNTR_WIDTH</p></td> |
| 198 | +<td><p>natural</p></td> |
| 199 | +<td><p>31</p></td> |
| 200 | +<td><p>Width of the “Reference Frequency Counter”. |
| 201 | +Watch out for overflow (indicated by a bit in the Status register). |
| 202 | +Must not be over 32!</p></td> |
| 203 | +</tr> |
| 204 | +<tr class="row-even" id="vhdl-gengeneric-frequency_meter-measured_cntr_width"><td><p>MEASURED_CNTR_WIDTH</p></td> |
| 205 | +<td><p>natural</p></td> |
| 206 | +<td><p>31</p></td> |
| 207 | +<td><p>Width of the “Measured Frequency Counter” (all of them if there is more than one). |
| 208 | +Watch out for overflow (indicated by a bit in the Status register). |
| 209 | +Must not be over 32!</p></td> |
| 210 | +</tr> |
| 211 | +<tr class="row-odd" id="vhdl-gengeneric-frequency_meter-measured_frequencies"><td><p>MEASURED_FREQUENCIES</p></td> |
| 212 | +<td><p>natural</p></td> |
| 213 | +<td><p>10</p></td> |
| 214 | +<td><p>Maximum number of measured frequencies.</p></td> |
| 215 | +</tr> |
| 216 | +<tr class="row-even" id="vhdl-gengeneric-frequency_meter-reference_clk_freq"><td><p>REFERENCE_CLK_FREQ</p></td> |
| 217 | +<td><p>natural</p></td> |
| 218 | +<td><p>200_000_000</p></td> |
| 219 | +<td><p>Frequency of the reference clock signal in Hz. |
| 220 | +Used in the final calculation when the CALCULATE_FREQ generic is True. |
| 221 | +Recommended to read before the SW calculation (when the CALCULATE_FREQ generic is False).</p></td> |
| 222 | +</tr> |
| 223 | +<tr class="row-odd" id="vhdl-gengeneric-frequency_meter-dsp_cntr_en"><td><p>DSP_CNTR_EN</p></td> |
| 224 | +<td><p>boolean</p></td> |
| 225 | +<td><p>False</p></td> |
| 226 | +<td><p>Utilize DSPs for both “frequency counters”.</p></td> |
| 227 | +</tr> |
| 228 | +<tr class="row-even" id="vhdl-gengeneric-frequency_meter-calculate_freq"><td><p>CALCULATE_FREQ</p></td> |
| 229 | +<td><p>boolean</p></td> |
| 230 | +<td><p>False</p></td> |
| 231 | +<td><p>Calculate the unknown frequency in the FPGA. |
| 232 | +Uses extra resources. |
| 233 | +Not supported yet!</p></td> |
| 234 | +</tr> |
| 235 | +<tr class="row-odd" id="vhdl-gengeneric-frequency_meter-store_data_en"><td><p>STORE_DATA_EN</p></td> |
| 236 | +<td><p>boolean</p></td> |
| 237 | +<td><p>False</p></td> |
| 238 | +<td><p>Store measured data and/or calculated frequencies in a FIFO to read out later. |
| 239 | +Could be useful for further analysis. |
| 240 | +Not supported yet! (Also leads to a generic for FIFO_SIZE)</p></td> |
| 241 | +</tr> |
| 242 | +<tr class="row-even" id="vhdl-gengeneric-frequency_meter-histogram_en"><td><p>HISTOGRAM_EN</p></td> |
| 243 | +<td><p>boolean</p></td> |
| 244 | +<td><p>False</p></td> |
| 245 | +<td><p>Store measured data and/or calculated frequencies in a histogram. |
| 246 | +Could be useful for further analysis. |
| 247 | +Not supported yet!</p></td> |
| 248 | +</tr> |
| 249 | +<tr class="row-odd" id="vhdl-gengeneric-frequency_meter-device"><td><p>DEVICE</p></td> |
| 250 | +<td><p>string</p></td> |
| 251 | +<td><p>“AGILEX”</p></td> |
| 252 | +<td><p>Target device.</p></td> |
| 253 | +</tr> |
| 254 | +</tbody> |
| 255 | +</table> |
| 256 | +<span class="sig-name descname">Ports</span><table class="docutils align-default"> |
| 257 | +<thead> |
| 258 | +<tr class="row-odd"><th class="head"><p>Port</p></th> |
| 259 | +<th class="head"><p>Type</p></th> |
| 260 | +<th class="head"><p>Mode</p></th> |
| 261 | +<th class="head"><p>Description</p></th> |
| 262 | +</tr> |
| 263 | +</thead> |
| 264 | +<tbody> |
| 265 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-reference_clk"><td><p>REFERENCE_CLK</p></td> |
| 266 | +<td><p>std_logic</p></td> |
| 267 | +<td><p>in</p></td> |
| 268 | +<td></td> |
| 269 | +</tr> |
| 270 | +<tr class="row-odd" id="vhdl-portsignal-frequency_meter-reference_reset"><td><p>REFERENCE_RESET</p></td> |
| 271 | +<td><p>std_logic</p></td> |
| 272 | +<td><p>in</p></td> |
| 273 | +<td></td> |
| 274 | +</tr> |
| 275 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-measured_clk"><td><p>MEASURED_CLK</p></td> |
| 276 | +<td><p>std_logic_vector(MEASURED_FREQUENCIES-1 downto 0)</p></td> |
| 277 | +<td><p>in</p></td> |
| 278 | +<td></td> |
| 279 | +</tr> |
| 280 | +<tr class="row-odd" id="vhdl-portsignal-frequency_meter-measured_reset"><td><p>MEASURED_RESET</p></td> |
| 281 | +<td><p>std_logic_vector(MEASURED_FREQUENCIES-1 downto 0)</p></td> |
| 282 | +<td><p>in</p></td> |
| 283 | +<td></td> |
| 284 | +</tr> |
| 285 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-mi_clk"><td><p>MI_CLK</p></td> |
| 286 | +<td><p>std_logic</p></td> |
| 287 | +<td><p>in</p></td> |
| 288 | +<td><p>MI interface</p></td> |
| 289 | +</tr> |
| 290 | +<tr class="row-odd" id="vhdl-portsignal-frequency_meter-mi_reset"><td><p>MI_RESET</p></td> |
| 291 | +<td><p>std_logic</p></td> |
| 292 | +<td><p>in</p></td> |
| 293 | +<td></td> |
| 294 | +</tr> |
| 295 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-mi_dwr"><td><p>MI_DWR</p></td> |
| 296 | +<td><p>std_logic_vector(MI_DATA_WIDTH-1 downto 0)</p></td> |
| 297 | +<td><p>in</p></td> |
| 298 | +<td></td> |
| 299 | +</tr> |
| 300 | +<tr class="row-odd" id="vhdl-portsignal-frequency_meter-mi_addr"><td><p>MI_ADDR</p></td> |
| 301 | +<td><p>std_logic_vector(MI_ADDR_WIDTH-1 downto 0)</p></td> |
| 302 | +<td><p>in</p></td> |
| 303 | +<td></td> |
| 304 | +</tr> |
| 305 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-mi_rd"><td><p>MI_RD</p></td> |
| 306 | +<td><p>std_logic</p></td> |
| 307 | +<td><p>in</p></td> |
| 308 | +<td></td> |
| 309 | +</tr> |
| 310 | +<tr class="row-odd" id="vhdl-portsignal-frequency_meter-mi_wr"><td><p>MI_WR</p></td> |
| 311 | +<td><p>std_logic</p></td> |
| 312 | +<td><p>in</p></td> |
| 313 | +<td></td> |
| 314 | +</tr> |
| 315 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-mi_ardy"><td><p>MI_ARDY</p></td> |
| 316 | +<td><p>std_logic</p></td> |
| 317 | +<td><p>out</p></td> |
| 318 | +<td></td> |
| 319 | +</tr> |
| 320 | +<tr class="row-odd" id="vhdl-portsignal-frequency_meter-mi_drd"><td><p>MI_DRD</p></td> |
| 321 | +<td><p>std_logic_vector(MI_DATA_WIDTH-1 downto 0)</p></td> |
| 322 | +<td><p>out</p></td> |
| 323 | +<td></td> |
| 324 | +</tr> |
| 325 | +<tr class="row-even" id="vhdl-portsignal-frequency_meter-mi_drdy"><td><p>MI_DRDY</p></td> |
| 326 | +<td><p>std_logic</p></td> |
| 327 | +<td><p>out</p></td> |
| 328 | +<td></td> |
| 329 | +</tr> |
| 330 | +</tbody> |
| 331 | +</table> |
124 | 332 | </dd></dl> |
125 | 333 |
|
126 | 334 | </section> |
127 | 335 |
|
128 | 336 |
|
129 | 337 | </div> |
130 | 338 | </div> |
131 | | - <footer> |
| 339 | + <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> |
| 340 | + <a href="../pulse_short/readme.html" class="btn btn-neutral float-left" title="Pulse short" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> |
| 341 | + <a href="../../../../ctrls.html" class="btn btn-neutral float-right" title="Controllers & TSU" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> |
| 342 | + </div> |
132 | 343 |
|
133 | 344 | <hr/> |
134 | 345 |
|
|
0 commit comments