The primary nerve fibers to the penis are from the dorsal nerve of the penis, a branch of the pudendal nerve. The cavernosal nerves are a part of the autonomic nervous system and incorporate both sympathetic and parasympathetic fibers. They travel posterolaterally along the prostate and enter the corpora cavernosa and corpus spongiosum to regulate blood flow during erection and detumescence. The dorsal somatic nerves are also branches of the pudendal nerves. They are primarily responsible for penile sensation. 
There have been rare reports of priapism (prolonged and painful erections lasting six or more hours) with the use of PDE5 inhibitors. Patients with blood cell diseases such as sickle cell anemia, leukemia, and multiple myeloma have higher than normal risks of developing priapism. Untreated priapism can cause injury to the penis and lead to permanent impotence. Therefore, if your erection lasts four hours, you should seek emergency care.
For best results, men with ED take these pills about an hour or two before having sex. The drugs require normal nerve function to the penis. PDE5 inhibitors improve on normal erectile responses helping blood flow into the penis. Use these drugs as directed. About 7 out of 10 men do well and have better erections. Response rates are lower for Diabetics and cancer patients.