This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Learning FPGAs > Introduction > Setting Up Your Environment

Setting Up Your Environment

FONT SIZE : AAA

The first step on your journey to becoming a digital hardware master is to install all the necessary tools. The FPGA on the Mojo is a Spartan 6 XC6SLX9 from Xilinx. Because of this, you need to download and install Xilinx’s tools to synthesize (build) your projects into configuration files (often called bit files) for the FPGA. Xilinx’s tools are a bit clunky, so we will be using the Mojo IDE to do all the work. Although you won’t need to use Xilinx’s tools directly, the Mojo IDE relies on them to build your designs. 

Synthesize

We use the term synthesize instead of compile and link, as you would for code, because the tools for hardware are quite different from software. With software, each file is compiled into instructions that are more or less a direct translation of your code. Each file is then linked with the other compiled files to create your program. 

With an FPGA, the tools use your design files as a description of the behavior the cir‐ cuit needs to have. It then looks at your entire design and synthesizes a circuit that will match its behavior. The tools we are using need to rebuild the entire project if you edit even the smallest thing in a single file. This can be a major headache for bigger FPGAs, when synthesis can take hours or days. Partial resynthesis to speed things up is an active area of development. Luckily for us, most projects on the Mojo synthesize within a few minutes. 

The tools require you to be using Windows or Linux. If you’re using Windows, Windows 7 or newer is recommended. Although Windows 8 and above isn’t officially supported by the tools, it should still work with some minor workarounds. Most versions of Linux should work fine, but CentOS is known to have issues with setting up the Mojo and is not recommended. Ubuntu and its derivatives should work out of the box. 

If you have a Mac, you can run Linux in a virtual machine or boot Linux from a USB drive. You can do the same for Windows if you have a license. If going this route, I recommend VirtualBox and Ubuntu. Both are free and known to work. 

Installing ISE

ISE is the name of the tool Xilinx provides to build projects for the Spartan 6 family of FPGAs. Xilinx has a newer tool called Vivado, but that doesn’t support Spartan 6 devices. 

Unfortunately, the installation process for ISE is a bit complicated. You are required to make an account with Xilinx to verify what you are using ISE for and where you live (export restrictions are imposed by the US government). ISE is a fairly large pro‐ gram. The download file is just over 6 GB, and the actual installation requires an additional 16 GB or so of space. After it is installed, you will then need to license it. The FPGA on the Mojo is covered by Xilinx’s free WebPACK license, but you still have to get the free license. 

Head over to the Xilinx Downloads page. You need to download version 14.7 of ISE. This is the latest and final version. It should already be selected. Scroll down past the Multi-File Download: ISE Design section to ISE Design Suite. In this section, select the full installer for your platform (Linux or Windows). You will likely be prompted to fill out a survey on your reasons for downloading it. Then you will be asked to sign in. Create an account to continue with the download. 

If you are on Windows, you need a way to extract the TAR file. Some TAR extractors don’t like this archive and fail to extract the entire thing. 7-Zip is known to work and is free. You can download it from the 7-Zip website. 

With the files extracted, you need to start the installer. On Windows, double-click the xsetup executable. On Linux, you need to run xsetup with root privileges: sudo ./xsetup Once in the setup, accept all the license agreements. On the page that asks which edi‐ tion to install, select ISE WebPACK, as shown in Figure 1-5. 

Figure 1-5. ISE edition selection.png

Figure 1-5. ISE edition selection

The next page, shown in Figure 1-6, asks which components you want to install. Make sure that Acquire or Manage a License Key is selected. If you are on Linux, make sure Ensure Linux System Generator Symlinks is also selected, as shown in Figure 1-7. You can uncheck the other options. They won’t hurt anything if you install them, but they aren’t needed. If you run into trouble with the installer, you can try to uncheck “Use multiple CPU cores for faster installation,” as it has been reported to cause problems in rare circumstances. 

Figure 1-6. ISE installation options for Windows.png

Figure 1-6. ISE installation options for Windows

Figure 1-7. ISE installation options for Linux.png

Figure 1-7. ISE installation options for Linux

On the next page, leaving the installation path as the default will make things a little easier later, but feel free to change it as long as you remember where it is.

If you are using Windows 8.1 or Windows 10 on a 64-bit machine and encounter problems, check out Embedded Micro’s ISE Installa‐ tion Tutorial for other OS specific fixes.

Once the installation is complete, a new window to set up a license should open. If for whatever reason it doesn’t, you can manually open it by launching ISE and going to Help → Obtain a License Key.

On Windows, you can double-click the ISE icon that should now be on your desktop. On Linux, if you installed ISE to the default directory, you can run the following commands to launch it on a 64-bit system: 

source /opt/Xilinx/14.7/ISE_DS/settings64.sh 

/opt/Xilinx/14.7/ISE_DS/ISE/bin/lin64/ise 

To launch ISE on a 32-bit system, use the following: 

source /opt/Xilinx/14.7/ISE_DS/settings32.sh

 /opt/Xilinx/14.7/ISE_DS/ISE/bin/lin/ise 

In the Xilinx License Configuration Manager, shown in Figure 1-8, select Get Free Vivado/ISE WebPack License and click Next.

A little dialog box showing your system’s information pops up. Click Connect Now to open a web browser to acquire the license. If the button fails to open a browser, you can go to the license page directly.

Figure 1-8. Select the WebPack license.png

Figure 1-8. Select the WebPack license

You need to log into your Xilinx account again. When you are on the Product Licensing page, shown in Figure 1-9, select ISE WebPACK License and click Generate Node-Locked License to create your license. If you don’t see this option, you may have already generated a license before. In this case, head over to the Manage Licenses tab and download your existing license by using the tiny download button in the bottom-left corner.

Figure 1-9. Generate the WebPACK license.png

Figure 1-9. Generate the WebPACK license

Click through the little pop-up window until the license is created and you are taken to the Manage Licenses tab. On this page, you should see your newly generated license. To download it, click the tiny blue arrow in the lower-left corner, as shown in Figure 1-10. 

Figure 1-10. Click the little arrow in the bottom-left corner to download your license.png

Figure 1-10. Click the little arrow in the bottom-left corner to download your license

A file named Xilinx.lic should be downloaded.

Back in the Xilinx License Configuration Manager, navigate to the Manage Licenses tab, if you’re not already there, and click Load License. Locate the Xilinx.lic file you just downloaded and select it. With the license loaded, the license manager should look like Figure 1-11.

Figure 1-11. License manager with the WebPACK license loaded.png

Figure 1-11. License manager with the WebPACK license loaded

Note that it might not look exactly like this, but ISE_WebPACK and PlanAhead should now be green.

ISE should now be ready to build your projects. You can close any ISE-related windows still open.

Installing the Mojo IDE

Installing the Mojo IDE is substantially simpler than setting up ISE. Head over to Embedded Micro and download the latest version. If you are on Windows, the installer is the recommended way to go.

The installer is pretty straightforward. Just follow the instructions until everything is installed. At the end of the installation, it should also install the necessary drivers.

On Linux, you just have the files and you can place them anywhere you want. You also need to have a JRE version 7 or newer to run the IDE. If you are using Ubuntu, you can install it by entering the following command: 

sudo apt-get install openjdk-7-jre-headless

You also need access to serial ports. Again on Ubuntu, you can use the following to add yourself to the dialout group to get permission:

sudo usermod -a -G dialout `whoami`

In the Linux Mojo IDE files, there is a folder named driver with a file 99-mojo.rules.You should copy this file to /etc/udev/rules.d/. This ensures that you have permission to connect to the Mojo and prevents Ubuntu from thinking it is a modem and locking it up for a while whenever it is plugged in.

You should log out or restart your computer to make sure all these changes take effect.

Mojo IDE Settings

Before you create your first project, you need to tell the Mojo IDE where you installed ISE and what serial port the Mojo connects to.

Launch the Mojo IDE. If you installed it using the Windows installer, you should have a Start Menu entry and/or a desktop icon that you can use to launch it. If you down‐ loaded the Windows files, you can double-click the mojo-ide.exe file after extracting the archive. On Linux, you need to run the mojo-ide script. This can be done with the following command: ./mojo-ide

You will be greeted by a welcome dialog box that has a little info about the version of the IDE you downloaded. You can get this welcome dialog back by going to Help →About Mojo IDE.

Go ahead and plug in the Mojo if you haven’t already. You need to figure out what serial port the Mojo is connected to. On Windows, you need to open the Device Man‐ ager. Launch the Control Panel and navigate to Hardware and Sound. You should then see Device Manager under Devices and Printers. 

In the Device Manager, expand Ports (COM & LPT). You should see an entry such as Mojo V3 (COM3), as shown in Figure 1-12. The number following COM may be different. This is the port it is connected to. Remember this.

Figure 1-12. The Mojo is connected to COM3. The COM port number may be different.png


Figure 1-12. The Mojo is connected to COM3. The COM port number may be different for you.

On Linux, the Mojo will most likely connect to /dev/ttyACM0 or /dev/ttyUSB0. If you have more than one USB-to-serial device, the last number may be nonzero. You can list the ports on your computer with the following command: ls /dev/tty*

If you unplug the Mojo and list the ports, and then plug it back in and list them again, the new one is what the Mojo is connected to.

Back in the Mojo IDE, open the Serial Port Selector by going to Settings → Serial Port and select the correct serial port, as shown in Figure 1-13.

Figure 1-13. Select the serial port you found in the preceding step.png

Figure 1-13. Select the serial port you found in the preceding step

The last step is to tell the IDE where to find the Xilinx tools. If you installed them in the default location, C:\\Xilinx\14.7 on Windows or /opt/Xilinx/14.7 on Linux, then 

you can skip this step because the IDE will check these by default. Otherwise, go to Settings → ISE Location and locate the 14.7 directory in your installation.

Everything should now be good to go! It’s time to start your first project.

  • XC4VLX40-10FFG668I

    Manufacturer:Xilinx

  • FPGA Virtex-4 LX Family 41472 Cells 90nm Technology 1.2V 668-Pin FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Active Active

    RoHS:

  • XC17V01VO8C

    Manufacturer:Xilinx

  • PROM Parallel/Serial 1.6M-bit 3.3V 8-Pin TSOP
  • Product Categories: Memory - Configuration Proms for FPGA's

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC17V02PC44C

    Manufacturer:Xilinx

  • PROM Parallel/Serial 2M-bit 3.3V 44-Pin PLCC
  • Product Categories: Memory - Configuration Proms for FPGA's

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XCR3384XL-FT256C

    Manufacturer:Xilinx

  • Xilinx BGA
  • Product Categories:

    Lifecycle:Any -

    RoHS: -

  • XCR3512XL-10FT256C

    Manufacturer:Xilinx

  • CPLD CoolRunner XPLA3 Family 12K Gates 512 Macro Cells 97MHz 0.35um Technology 3.3V 256-Pin FTBGA
  • Product Categories: Programmable logic array

    Lifecycle:Active Active

    RoHS: No RoHS

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.