Viagra, generically referred to as sildenafil, is a drug primarily used to treat erectile dysfunction , a condition where men have difficulty achieving or sustaining an erection . Beyond the primary purpose, it has also found off-label in the treatment of pulmonary high blood pressure in the lung