The legislation that Congress passed last winter to stimulate the economy ratcheted up federal spending on research and development in the 2009 fiscal year, the National Science Foundation said in a report Wednesday. The NSF said that total federal R&D spending rose by 12.2 percent in 2009, to $157 billion from $140 billion in 2008. Virtually all of the increase came in non-defense spending, with most of the gain coming in health-related research and in general science research.