Stuttgart will play European football next season after they reached the German Cup final by beating 2-1 Freiburg at home in the semi-finals.