Mourners gathered in Tehran for the funeral of top Iranian commanders and scientists killed in a 12-day war with Israel.