Nerves originating in the spinal cord and peripheral ganglia innervate the penis. There are autonomic (parasympathetic and sympathetic), and somatic separate and integrated pathways. The autonomic pathways neurons originate in the spinal cord and peripheral ganglia from the sympathetic and parasympathetic systems, respectively. They merge to form the cavernous nerves that travel alongside the prostate, enter the corpora cavernosa and corpus spongiosum to affect the neurovascular events required for tumescence and detumescence. The somatic nerves send sensory information from the penile skin, glans, and urethra via the dorsal penile nerve and pudendal nerve to the spinal cord. The somatic nerves also initiate contraction of the ischio- and bulbocavernosus muscles.
• Blood Vessels: Diabetes damages blood vessels, especially the smallest blood vessels such as those in the penis. Diabetes can also cause heart disease and other circulatory problems. Proper blood flow is absolutely crucial to achieving erection. “Erection is a hydraulic phenomenon that occurs involuntarily,” says Arturo Rolla, MD, of Harvard University School of Medicine. “Nobody can will an erection!” Anything that limits or impairs blood flow can interfere with the ability to achieve an erection, no matter how strong one’s sexual desire.
A common and important cause of ED is vasculogenic. Many men with ED have comorbid conditions such as hyperlipidemia, hypercholesterolemia, tobacco abuse, diabetes mellitus, or coronary artery disease (CAD).  The Princeton III Consensus recommends screening men who present with ED for cardiovascular risk factors; ED may be the earliest presentation of atherosclerosis and vascular disease. 
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.