view fpga/sniffer-pps/clk_check.v @ 58:95ed46b5f8f1 default tip

doc/Sniffing-hw-setup: mv-sniffer is here
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2023 05:55:09 +0000
parents 737579209153
children
line wrap: on
line source

/*
 * The logic implemented in this module detects if SIM_CLK is running or not,
 * for the purpose of visual indication on a LED.
 */

module clk_check (IntClk, SIM_CLK_sync, SIM_CLK_running);

input IntClk;
input SIM_CLK_sync;
output SIM_CLK_running;

reg [11:0] shift_reg;

always @(posedge IntClk)
	shift_reg <= {shift_reg[10:0],SIM_CLK_sync};

assign SIM_CLK_running = (shift_reg != 12'h000) && (shift_reg != 12'hFFF);

endmodule