Chip giants Nvidia and AMD have agreed to pay the U.S. government 15% of revenue from their sales to China, as part of a deal to secure export licences for semiconductors.