Attention
This documentation is a work in progress. Expect to see errors and unfinished things.
freq_count Source File
1// Synthesizes to 86 slices at 312 MHz in XC3Sxxx-4 using XST-8.2i
2// (well, that's just the unknown frequency input; max sysclk is 132 MHz)
3
4`timescale 1ns / 1ns
5
6module freq_count #(
7 // Default configuration useful for input frequencies < 96 MHz
8 parameter glitch_thresh=2,
9 parameter refcnt_width=24,
10 parameter freq_width=28,
11 parameter initv=0
12) (
13 // input clocks
14 input sysclk, // timespec 8.0 ns
15 input f_in, // unknown input
16
17 // outputs in sysclk domain
18 output [freq_width-1:0] frequency,
19 output freq_strobe,
20 output [15:0] diff_stream,
21 output diff_stream_strobe,
22 // glitch_catcher can be routed to a physical pin to trigger
23 // a 'scope; see glitch_thresh parameter above
24 output glitch_catcher
25);
26
27freq_gcount #(
28 .glitch_thresh(glitch_thresh),
29 .refcnt_width(refcnt_width),
30 .freq_width(freq_width),
31 .initv(initv)
32) work (
33 .sysclk(sysclk), .f_in(f_in),
34 .g_in(1'b1), // this is the whole point!
35 .frequency(frequency), .freq_strobe(freq_strobe),
36 .diff_stream(diff_stream), .diff_stream_strobe(diff_stream_strobe),
37 .glitch_catcher(glitch_catcher)
38);
39
40endmodule