The budgets of the six main agencies that fund R&D in the United States have declined or stagnated since 2012.