In reply to ysaini:
I see this question is related to another question you recently asked. So far, the code you show makes no sense in relation to what you seem to want to check.
It might help to create a small testbench that generates stimulus for the signals you want to check, showing test cases for passing and failing checks. Then we can show you how to fix your code to do what you want it to do. (Oh, and I find it hard to believe you can’t get access to a reference clock)