Phalanx wasn't used by Romans once they switched to the Legionary style army. Whilst still fighting with the inner tribes of Italy they adopted the phalanx but they eventually dropped it for the Legionaries. And on the note of anti-cav, it was basically cav vs cav, inf vs inf, to my knowledge they really didn't use anti-cav other than allied rock slingers etc.