carpet install

How far up under the dash should the carpet go? Does it need to be trimmed to clear the gas pedal “arm” or does it stop at the base?