FRANKFURT (Reuters) – Siemens agreed to buy U.S.-based Mentor Graphics in a $4.5 billion all-cash deal that will further build the German engineering group’s software capabilities.