view fpga/sniffer-pps/clk_check.v @ 56:966a54303d68

simsniff-dec: factor out high-level decoding
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2023 01:18:50 +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