How to add a reset after 4 clock cycles in LTSpice
I would think that for a D flip flop, you'd have to bring the CLR line high for all flops to reset them. You could do this with logic from the last flop, or a PWL source.