Please google the LOCK detector of PLL, you can find the analog method and digital method, analog mathod will detect the differenct of PFD out put, and digital method will open a window.
For Lock Detector
just use xor gate with inputs up & down (PFD outputs) if the PLL at lock the up & down will be identical & the Xor will stick to 0 other wise the Xor will toggle
you can use DFF & samples the XOR out with the reference frequency
best regards,
Rania