comparison fpga/sniffer-pps/clk_check.v @ 53:737579209153

fpga/sniffer-pps: add LED indication of running SIM CLK
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 03 Oct 2023 19:35:29 +0000
parents
children
comparison
equal deleted inserted replaced
52:cbfcc480d61b 53:737579209153
1 /*
2 * The logic implemented in this module detects if SIM_CLK is running or not,
3 * for the purpose of visual indication on a LED.
4 */
5
6 module clk_check (IntClk, SIM_CLK_sync, SIM_CLK_running);
7
8 input IntClk;
9 input SIM_CLK_sync;
10 output SIM_CLK_running;
11
12 reg [11:0] shift_reg;
13
14 always @(posedge IntClk)
15 shift_reg <= {shift_reg[10:0],SIM_CLK_sync};
16
17 assign SIM_CLK_running = (shift_reg != 12'h000) && (shift_reg != 12'hFFF);
18
19 endmodule