How to an input signal to an FPGA be determined as the clock signal

clockfpga

How can I determine a seemingly arbitrary signal applied to an FPGA to be the clock signal? Conditions:
1. There is no other clock signal available (as an input to the FPGA) for sampling this input.
2. Assume, this should be the highest speed clock.
3. The source of this signal can be anything, can be generated elsewhere in the circuit and then applied to the FPGA or can be generated only for this block. (In my opinion, the source does not matter.)

Best Answer

This is rather like asking "how do identify which electrical potential is the ground". Both "ground" and "clock" are designations rather than physical properties. You choose a signal and use it as the clock.

Now, there are various properties of signals usually used as clocks which a human using a scope would use to identify a clock. High frequency square wave with 50% duty cycle and no modulation or variation? Looks like a clock. You could automate that check if you had another reference clock to sample the signal with.

But there's no strict requirement for those, provided the edges are clean and minimum pulse widths are met. You could have strange duty cycles or very slow clocks; clocking microcontrollers off 32kHz signals in semi-sleep mode is sometimes done. Not all systems have a minimum clock frequency. Some very old systems had handcranks which could be used to generate clock pulses, allowing the operator to single-step a program for debugging.