Logic Design - Simple FPGA Design using Xilinx ISE 14.7
hive-196387·@drifter1·
0.000 HBDLogic Design - Simple FPGA Design using Xilinx ISE 14.7
<img src="https://i.ibb.co/5Fr7QjJ/IMG-20201103-120629.jpg"><br> <h2>Introduction</h2>Hello it's a me again <a href="https://peakd.com/@drifter1">drifter1</a>! <p> After covering <a href="https://steemit.com/fpga/@drifter1/logic-design-simple-fpga-design-using-quartus-in-vhdl">FPGA Design using Altera/Intel 's Quartus</a> a few years ago on Steemit, its finally time to get into <strong>Xilinx FPGAs</strong> as well. I currently own a <strong>Spartan-6 Family</strong> FPGA and thus I will cover the older software <strong>ISE</strong> at its latest version 14.7. </p> So, without further ado, let's get straight into it! <hr> <h2>What is Xilinx's ISE Design Suite?</h2> <p> <img src="https://upload.wikimedia.org/wikipedia/en/0/0a/XilinxISE_DS_Logo.jpg"><br><br> The ISE Design Suite is Xilinx's FPGA design environment, that allows you to take a design from design entry to device programming. There are various editions available that are meant for logic, embedded or DSP system designers. In this article, we will be using the <strong>System Edition</strong> that includes all the tools and capabilities that ISE has to offer. </p> <p> More specifically, the <strong>design flow</strong> includes: <ul> <li><strong>Design creation</strong> - create/add HDL source files and other design modules</li> <li><strong>Synthesis</strong> - compile the design from HDL sources into an architecture-specific design netlist</li> <li><strong>Simulation</strong> - verify the functionality of the design using simulation</li> <li><strong>Constraints</strong> - specify design constraints for timing, placement and more</li> <li><strong>Implementation</strong> - convert logic design into a physical format that can be downloaded to the target device</li> <li><strong>Implementation Analysis</strong> - analyze the design for performance, device resource utilization, timing and power (static report files)</li> <li><strong>Device Configuration and Programming</strong> - configure the device and download the files from the host to a Xilinx device/FPGA</li> </ul> </p> <hr> <h2>How and Where to Download</h2> <h3>Account creation</h3> <p> To be able to download Xilinx's software you have to create a <strong>Xilinx account</strong> (which might change into AMD account soon, because AMD acquired Xilinx). Lots of personal information will also be requested, like the home address, when you request to download ISE. To create an account or login into an existing one click <a href="https://login.xilinx.com/">here</a> .<br> <img src="https://i.ibb.co/zNnq1B7/account.png"> </p> <h3>Software Download</h3> <p> ISE can be downloaded from Xilinx's webpage. Being the older version (Vivado is the new one), ISE can only be found in the <a href="https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive-ise.html">Downloads archive</a>. <img src="https://i.ibb.co/GQ6W6c7/archive.png"><br> ISE supports:<br> <ul> <li>Windows 7/XP/Server and Linux natively (14.7 version)</li> <li>Windows 10 through included-VM (14.7 Windows 10)</li> </ul> </p> <p> The Windows 10 installation can become quite problematic and so I suggest you use a Virtual Machine and install the 14.7 version on top of that or dual-boot with some Linux-Distro. I dual-boot Windows 10 and Ubuntu. <strong>Don't forget to scroll down to get the full product installation</strong>. Spartan-6 and Virtex-6 family FPGAs are supported by all versions, but older families like Spartan-3 might not!<br> <img src="https://i.ibb.co/vvTDqt0/full-product.png"> </p> <hr> <h2>Installation</h2> <h3>Installer Wizard</h3> <p> To install ISE on Ubuntu: <ul> <li>unzip the zipped archive (<em>Xilinx_ISE_DS_14.7_1015_1.tar</em> in my case)</li> <li><strong>IMPORTANT</strong>: run <em>xsetup</em> with root privileges <pre><code>sudo ./xsetup</code></pre></li> </ul> The following window should pop-up:<br><br> <img src="https://i.ibb.co/qnKMGbW/installer.png"><br><br> Hit Next and accept the licence agreements, until the <strong>Select Products to Install</strong> section comes up. There you can choose the Logic Edition for the minimal features, or go with the full-on Experience of the <strong>System Edition</strong>, as I have:<br><br> <img src="https://i.ibb.co/1Ggrv2d/product.png"> </p> <h3>USB JTAG Drivers</h3> <p> To get the drivers up and running for the Digilent USB JTAG Adapter, I used the steps from the YouTube video: <a href="https://www.youtube.com/watch?v=meO-b6Ib17Y&ab_channel=ApurvaNandan">How to install Xilinx ISE Design Suite 14.7 on Ubuntu 18.04 (with drivers)</a><br><br> The <strong>steps</strong> are: <ul> <li>Install Xilinx Drivers: <pre><code>sudo /opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/install_script/install_drivers/./install_drivers </code></pre></li> <li>Install Digilent Drivers: <pre><code>cd /opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/digilent/<br> sudo ./install_digilent.sh</code></pre></li> <li>Install various packages: <pre><code>sudo apt-get install gitk git-gui libusb-dev build-essential libc6-dev-i386 fxload libftdi-dev</code></pre></li> <li>Install USB Driver: <pre><code>cd /opt/Xilinx/14.7<br> sudo git clone git://git.zerfleddert.de/usb-driver<br> cd usb-driver<br> sudo make (Use make for both 32-bit and 64-bit)<br> ./setup_pcusb /opt/Xilinx/14.7/ISE_DS/ISE/</code></pre></li> <li>To solve <em>"WARNING:iMPACT - Module windrvr6 is not loaded"</em> we write the ffollowing in the terminal from which ISE/IMPACT gets started: <pre><code>export LD_PRELOAD=/opt/Xilinx/14.7/usb-driver/libusb-driver.so</code></pre> </li> </ul> </p> <h3>Bashing ISE</h3> <p> I also suggest "bashing" the settings file: <ul> <li><pre><code>sudo nano ~/.bashrc</code></pre></li> <li>Add <em>source /opt/Xilinx/14.7/ISE_DS/settings64.sh</em> to the end of the file</li> <li>Ctrl+O to save and then Ctrl+X to exit nano</li> </ul> Restarting the terminal you now simply write <em>ise</em> to start the ISE Design Suite 14.7:<br> <img src="https://i.ibb.co/kH7Qr45/terminal.png"><br><br> The ISE Project Navigator should pop up:<br> <img src="https://i.ibb.co/mNcFWHH/ise.png"> </p> <h2>Get Licence</h2> You can get a licence from the <a href="https://www.xilinx.com/support/licensing_solution_center.html">Licence Solution Center</a>. You simply open the <em>Xilinx.lic</em> file ( that you get from an email from Xilinx) from the <strong>Manage Licence</strong> Window that pops up the first time you open ISE or from <strong>Help/Manage License...</strong> in the Toolbar. <hr> <h2>Full-On Example</h2> Let's go through the steps of designing a simple complete FPGA Design. <h3>Project Set-Up</h3> While in the <strong>ISE Project Navigator</strong> on the left side are Project commands, one of which is called <strong>New Project</strong>. Clicking on that option the <strong>New Project Wizard</strong> should come forth:<br><br> <img src="https://i.ibb.co/sW4rXzq/project.png"><br><br> There we can define the name, location, directory, description and top-level source type. After hitting Next, the <strong>Project Settings</strong> come up, where we define more specific device and project properties. I have an <a href="https://artofcircuits.com/product/alinx-ax309-spartan-6-fpga-development-board-xc6slx9-2ftg256c">ALINX AX309 Spartan-6 FPGA Development Board</a> (boards are widely available on Ebay - I bought mine from Ebay as well) and we will be coding in <strong>VHDL</strong>, therefore I have to insert the following information:<br><br> <img src="https://i.ibb.co/BckXqDf/spartan6.png"><br><br> The Device Properties can be changed later on (for example to program a different device) by right clicking on the <strong>Hierarchy</strong> and choosing the <strong>Design Properties</strong> option from the drop-down menu:<br><br> <img src="https://i.ibb.co/G939KLH/design-properties.png"><br><br> <img src="https://i.ibb.co/5sD13CW/design-properties-2.png"> <h3>HDL Coding</h3> <p> Let's now write some VHDL code.<br><br> My FPGA has a total of 6 buttons that I can press, and 4 LEDs and a six-digit seven-segment display to output too, that we can play with. Let's use 2 buttons and 1 led to output the result of a XOR gate, for the purpose of this article.<br><br> Right-Clicking on the Hierarchy and choosing the <strong>New Source</strong> option the <strong>New Source Wizard</strong> comes up, where we will choose to create a <strong>VHDL Module</strong> with the name <em>xor2_gate</em>:<br><br> <img src="https://i.ibb.co/gDXBxcR/new-source.png"><br><br> After hitting next we got to <strong>Define Module</strong>, where we can define the input and output ports for the module:<br><br> <img src="https://i.ibb.co/KGqD3sw/define-module.png"><br><br> Double-clicking the <em>xor2_gate</em> component from the Hierarchy, we will see that the following VHDL code has been pre-generated (I like to remove the comments): <pre><code>library IEEE; use IEEE.STD_LOGIC_1164.ALL;<br> entity xor2_gate is Port ( A : in STD_LOGIC; B : in STD_LOGIC; C : out STD_LOGIC); end xor2_gate;<br> architecture Behavioral of xor2_gate is<br> begin<br> end Behavioral;</code></pre><br> We simply have to add <code>C <= A xor B;</code> after the begin "statement" of the architecture, to get the behavior that we want. </p> <h3>Constraints File (Pin Assignment)</h3> <p> Starting another <strong>New Source Wizard</strong> we choose <strong>Implementation Constraints File</strong> (UCF) and give the name <em>xor2_constraints</em> :<br> https://i.ibb.co/QMbgJ2R/constraints.png<br><br> Based on the <a href="https://github.com/alinxalinx/AX309">schematics</a> of my board, KEY1 is connected to FPGA pin C3, KEY2 to D3 and LED0 to P4.<br><br> The generic form of an <strong>port assignment constraint</strong> is:<br> <pre><code>NET "signal_name" LOC = "fpga_pin" ;</code></pre> Thus, the .ucf file for our design is:<br> <pre><code>NET "A" LOC = "C3" ; NET "B" LOC = "D3" ; NET "C" LOC = "P4" ;</code></pre> </p> <h3>Synthesis</h3> Having the source file <em>xor2_gate</em> selected, below the Hiearchy, we double click on <strong>Synthesize - XST</strong>. If no error occurs their should be a green tick to the left of that option, and the <strong>Design Summary</strong> on the right should become updated:<br><br> <img src="https://i.ibb.co/5xvBT5W/synthesis.png"><br><br> As we can see 1 LUT slice out of the 5720 available has been utilized (for the xor gate), as well as 3 IOB's have been bound for the corresponding 2 input pins and 1 output pin. There are no errors or warnings. <h3>Implementation</h3> In the same way, double-clicking on <strong>Implement Design</strong> the design gets implemented for the specific FPGA that I chose giving us a more advanced Design Utilization Summary:<br><br> <img src="https://i.ibb.co/vHccxq8/implement.png"> <h3>Device Programming</h3> Lastly, let's generate the programming file by double-clicking on <strong>Generate Programming File</strong>.<br><br> To program the FPGA we have to open up <strong>IMPACT</strong> from <strong>Configure Target Device</strong>:<br><br> <img src="https://i.ibb.co/BZL7RPw/programming-file.png"><br><br> <img src="https://i.ibb.co/fpCX843/impact-1.png"><br><br> Scanning for devices, my device shows up:<br><br> <img src="https://i.ibb.co/n8sR9tW/impact-2.png"><br><br> And Right-Clicking and hitting <strong>Program</strong> on the FPGA we see the following behavior:<br><br> <a href="https://i.ibb.co/M67qFVp/spartan.gif">GIF</a><br><br> Voila! A XOR Gate.<br><br> If you followed this steps you should now have successfuly programmed your first FPGA!<br><br> Remarkable! <hr> <h2>Resources</h2> <ol> <li><a href="https://www.xilinx.com/products/design-tools/ise-design-suite.html">https://www.xilinx.com/products/design-tools/ise-design-suite.html</a></li> <li><a href="https://www.xilinx.com/support/documentation/sw_manuals/xilinx11/ise_c_overview.htm">https://www.xilinx.com/support/documentation/sw_manuals/xilinx11/ise_c_overview.htm</a></li> <li><a href="https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive-ise.html">https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive-ise.html</a></li> <li><a href="https://www.xilinx.com/support/licensing_solution_center.html">https://www.xilinx.com/support/licensing_solution_center.html</a></li> <li><a href="https://artofcircuits.com/product/alinx-ax309-spartan-6-fpga-development-board-xc6slx9-2ftg256c">https://artofcircuits.com/product/alinx-ax309-spartan-6-fpga-development-board-xc6slx9-2ftg256c</a></li> <li><a href="https://github.com/alinxalinx/AX309">https://github.com/alinxalinx/AX309</a></li> </ol> <hr> <h2>Final Words | Next Up</h2> <p> And this is actually it for today's post! Thank you for your time! </p> <p> Now that we started getting into Xilinx FPGAs be sure that even more content around that will come soon! Maybe even Xilinx's Vivado software, but I don't own a newer board yet, so that might take a while... </p> <img src="https://images.hive.blog/0x0/https://steemitimages.com/0x0/https://media.giphy.com/media/ybITzMzIyabIs/giphy.gif"><br><br> Keep on Drifting!
👍 stemd, limka, andyblack, lydon.sipe, drsensor, drifter2, stem.alfa, gentleshaid, hadji, stemng, samest, kingabesh, joelagbo, menoski, temitayo-pelumi, loveforlove, thurllanie, teemike, empressteemah, the.chiomz, djoi, betterdev, giftgiver, deathwing, edicted, cadawg, mehmetfix, equeqtra, mecurry, hextech, crokkon, enforcer48, zorg67, yggdrasil.laguna, brofund-stem, chrono-stem, abh12345.stem, localgrower, slider2990, luppers, mhm-philippines, pboulet, drifter1, stemgeeks, stemcuration, pfwaus, rikarivka, apshamilton, yaelg, hamismsf, jpbliberty, lemouth, steemstem-trig, omstavan, madridbg, lesmouths-travel, minnowbooster, howo, aboutcoolscience, robotics101, khalil319, steemstem, roelandp, dna-replication, justtryme90, valth, mobbs, jga, noloafing, rbalzan79, geopolis, marcuz, urdreamscometrue, cowpatty, omegarojo827, mengene, skapaneas, curie, techslut, dhimmel, bloom, samminator, mahdiyari, enzor, gra, sankysanket18, kenadis, sco, intrepidphotos, fragmentarion, terrylovejoy, dexterdev, flugschwein, charitybot, de-stem, motherofalegend, javier.dejuan, zeruxanime, afarina46, joshmania, hjmarseille, hive-101493, lamouthe, alexander.alexis, ludmila.kyriakou, tsoldovieri, abigail-dantes, felixrodriguez, gotgame, postpromoter, pab.ink, alexdory, francostem, marcus0alameda, jansher, deholt, meanroosterfarm, stem.witness, aqua.nano, jtm.support, crowdwitness, walterprofe, delilhavores, jeffmackinnon, stemsocial, reddust, privex, betterthanhome, hijosdelhombre, croctopus, charitymemes, doctor-cog-diss, fi2eedom, shimozurdo, tyrionlens, thexbttrader, lastminuteman, professorbromide, tobias-g, kggymlife, liambu, bilpcoinbpc, shinyrygaming, jsalvage, alaqrab, thelordsharvest, bradfordtennyson, amritadeva, videosteemit, citizendog, dragonblades, zerotoone, kalinka, utube, fantasycrypto, zelenicic, doikao, blewitt, cacalillos, idkpdx, pavelsku, quello, communitybank, nateaguila, michaias, raynen, extravagante, mulletwang, stk-g, hadley4, hairgistix, gloriaolar, pipokinha, tngflx, upme, dauerossi, sameer777, giddyupngo, frissonsteemit, vietthuy, epicdice, briggsy, solips, fineartnow, bscrypto, khasa, entrepreneur.one, bella.bear, tristancarax, mariaalmeida, roomservice, jayna, manic.calm, peterpanpan, simba, scalextrix, felt.buzz, inciter, trisolaran, adrenalinejunkie, captaincryptic, redpalestino, notconvinced, majes.tytyty, kiemurainen, travelnepal, ilovecryptopl, holoferncro, yadamaniart, sokha, soufiani, irgendwo, dmoonfire, pipiczech, holbein81, beverages, photohunt, barbz, chucknun, ambyr00, yangoldberg, cryptocoinkb, andrewharland, hiveonboard, jaro-art, lightflares, vicesrus, chickenmeat, cakemonster, double-negative, bit4bit, fractalfrank, hornetsnest, bellaian, silentscreamer, miroslavrc, veteranforcrypto, sadbear, matt-a, touchman, rambutan.art, indigoocean, yourmind, tomiscurious, apsu, braaiboy, gravii4, steemstorage, redrica, lonelywolf, zipporah, movingman, veeart, forester-joe, roamingsparrow, modernzorker, drmake, incubot, damla, neneandy, citimillz, pialejoana, quentinvb, sallhiddles, sarahandsam, mejustandrew, foxon, davidcentenor, mindblast, wolven-znz, serylt, simonpeter35, investingpennies, mballesteros, calebotamus, the.success.club, rem-steem, tokensink, carn, didic, netzisde, perpetuum-lynx, xxxxxxxxxxxxxxxx, ninjace, kpine, michelle.gent, val.halla, appleskie, trevorpetrie, revisesociology, marcolino76, goblinknackers, spoke, the100, questcrypto, steemvault, sportscontest, superlotto, rihc94, gmedley, sustainablyyours, itchyfeetdonica, scottcbusiness, qberry, kylealex, deveney, precarious, behram, cataluz, norwegianbikeman, schroders, bflanagin, solarphasing, peter-bot, writertales, ninnu, thecryptodrive, neumannsalva, dipom98, torico, technologycorner, lefty619, yourtop3, eyeview, hhayweaver, kimzwarch, scholaris, rtron86, chris4210, driptorchpress, gunthertopp, stickchumpion, meno, city-of-berlin, dailyspam, freetissues, plantstoplanks, jeffandhisguitar, cheese4ead, edencourage, nexus08, lowlightart, uwelang, stayoutoftherz, revo, yangyanje, steveconnor, primersion, musicvoter2, myfreebtc, mind.force, daeshim, crypto.currents, gifmaster, aboutyourbiz, procryptix, braveboat, brianoflondon, waltermeth, fsm-core, cryptononymous, hanggggbeeee, stahlberg, vittoriozuccala, marcocasario, lichtblick, jlsplatts, greddyforce, jmjury, realkiki85, djennyfloro, iamjadeline, bil.prag, carolinaelly, alexxxdada, deeanndmathews, xerxes.alpha, appics.tutorial, jpvmoney, johnspalding, jasimg, hutty, urtrailer, prize.hoard, risingstar2, tfeldman, federacion45, positiveninja, filosof103, gazbaz4000, vonaurolacu, koenau, srijana-gurung, gwilberiol, smalltall, bedazzled, lays, theskmeister, deriyon, lyubo19, meanbees, deanlogic, leoumesh, verhp11, blainjones, anttn, ecency, ecency.stats, esteem.app, good-karma, esteemapp, mcsvi, firstamendment, techken, drlobes, ibt-survival, diverse, jacuzzi, charlie777pt, erick1, cloudspyder, rubia.michelle, bluefinstudios, gabrielatravels, mproxima, chungsu1, evepontes, paypalbis, sanderjansenart, cesarisaad, hiddendragon, morarnagringa, markwannabee, elements5, robibasa, titan-c, reggaesteem, wanderingmoon, hive.consultant, quinnertronics, pladozero, mister.reatard, lightcaptured, stem-espanol, iamphysical, carloserp-2000, miguelangel2801, delpilar, tomastonyperez, elvigia, josedelacruz, andrick, yusvelasquez, acont, reinaseq, fran.frey, giulyfarci52, capp, yehey, lorenzor, azulear, calatorulmiop, vjap55, emiliomoron, uche-nna, aleestra, dubignyp, wilmer14molina, thelogicaldude, peaceandwar, yjcps, fatkat, herzinfuck, amestyj, robmojo, ubaldonet, mammasitta, neddykelly, binkyprod, supriya1993, buttcoins, danile666, cordeta, warpedpoetic, sargewhale, silviomangum29, viagens, mariusfebruary, sincensura, embot, justlee87, dna.org, rodrigocassio, hafizullah, adalger, juanbg, nockzonk, medro-martin, seckorama, scruffy23, realblockchain, wesphilbin, acousticguitar, sardrt, massivevibration, marcoriccardi, bennettitalia, safrizal.mus, vaultec, sciencevienna, gribouille, eric-boucher, stevenwood, stevejhuggett, robertbira, eliaschess333, farizal, eniolw, yourfuture, egotheist, steepup, amansharma555, flatman, chrisdavidphoto, dranren, oghie, kitalee, cyemela, lk666, nwjordan, bitcome, cyrusemerson, cyprianj, gifty-e, ennyta, gaming.yer, endopediatria, anaestrada12, nutritree, ange.nkuru, jagged, akilie1029, stem.curate, balticbadger, samuel.steem, quantumdeveloper, nalacanecorso, axel-blaze, gadrian, jk6276.life, boomalex, meppij, gadrian-sp, sonofsatoshi, aiovo,