Viharas were for the purpose of living, Chaityas were assemblies for the purpose of discussions. Further, Chaityas were with Stupas, Viharas did not have stupas.
The Divyavadana is a Sanskrit anthology of Buddhist avadana tales. They have originated in Mulasarvastivadin vinaya texts. It is dated to 2nd century CE.