[GUIDE] INSTALLING THE MIPSFPGA INFRASTRUCTURE ON A LINUX SYSTEM

This topic contains 0 replies, has 1 voice, and was last updated by  Dennis 1 year, 8 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #52966

    Dennis
    Member

    Warning about the guide
    I could not format correctly the post, so please, keep in mind that most of the commands are in typographic format and will not work if copypasted. The problem is in double dash and quotation marks.
    For example, the following command can not be copypasted…

    ./configure –build=i686-pc-linux-gnu “CFLAGS=-m32” “CXXFLAGS=-m32” “LDFLAGS=-m32”

    BACKGROUND:
    This document recompiles most of the knowledge acquired during the installation of the MIPSfpga infrastructure under a Linux OS. Although it was originally conceived as a guide to resolve isolated problems found during the installation of MIPSfpga, it can be used as a complete installation guide. In order to make this document self-contained, the whole process is described in detail, the url sites used are provided, and a package is included (look the attacked file at the end of the post) with the scripts
    used in the “Fundamentals” course and the configuration files mentioned in this guide.

    TESTED SYSTEMS:
    Some Linux distributions, like openSUSE13, incur many problems related with the tools used by the MIPSfpga infrastructure, especially with Vivado. For that reason, we recommend using Ubuntu14_04 or a good alternative, like Mint17.

    The installation described in this document has been tested in LinuxMint17.2 and UbuntuLinux14_04. The “Getting-started” and the “Fundamentals” packages of MIPSfpga have been tested under linuxMint17.2.

    We must highlight that the following openOCD commands, mentioned in the getting-started-guide (pages 59-60), may not work under this version:

    • monitor mips32 cp0
    • monitor mips32 perfcnt0 0xff
    • monitor mips32 invalidate all

    Fortunately, these commands are not used in any of the Labs included with MIPSfpga.

    TOOLS USED BY MIPSfpga:

    • Modelsim
    • Vivado
    • Codescape
    • OpenOCD

    SPECIFIC TOPICS COVERED IN THIS GUIDE:

    Modelsim:

    • Mentor doesn’t provide a linux version.
    • Crash at launch: “** Fatal: Read failure in vlm process (0,0)”

    Vivado:

    • Can’t license vivado >= 14
    • Weird error launching clocking wizard.
    • Hardware manager’s open device/auto-connect option doesn’t recognize the fpga.

    OpenOCD:

    • MIPSfpga doesn’t provide a linux version.

    MODELSIM:
    The following links provide more information:
    http://mattaw.blogspot.co.uk/2014/05/making-modelsim-altera-starter-edition.html
    http://vineeshvs.blogspot.com.es/2014/02/installing-and-using-modelsim-in-ubuntu.html

    We are going to use the application provided by Altera for Linux, which can be downloaded at:
    http://download.altera.com/akdlm/software/acdsinst/13.1/162/ib_installers/ModelSimSetup-13.1.0.162.run

    Given that this version in 32-bit only, if we have a 64-bit computer, we also need to install the 32-bit versions of the dependencies:

    sudo dpkg –add-architecture i386
    sudo apt-get update
    sudo apt-get install build-essential
    sudo apt-get install gcc-multilib g++-multilib \
    lib32z1 lib32stdc++6 lib32gcc1 \
    expat:i386 fontconfig:i386 libfreetype6:i386 libexpat1:i386 libc6:i386 libgtk-3-0:i386 \
    libcanberra0:i386 libpng12-0:i386 libice6:i386 libsm6:i386 libncurses5:i386 zlib1g:i386 \
    libx11-6:i386 libxau6:i386 libxdmcp6:i386 libxext6:i386 libxft2:i386 libxrender1:i386 \
    libxt6:i386 libxtst6:i386
    

    Now, our system is ready to install Modelsim, executing ModelSimSetup-13.1.0.162.run.

    Some modern versions of freetype can cause Modelsim to crash “** Fatal: Read failure in vlm process (0,0)”. For that reason, we need an old version, which can be downloaded from: http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2

    First, we install the build dependencies:

    sudo apt-get build-dep -a i386 libfreetype6
    

    Then, we extract, configure and compile:

    tar -xvf freetype-2.4.12.tar.bz2
    cd freetype-2.4.12
    ./configure –build=i686-pc-linux-gnu “CFLAGS=-m32” “CXXFLAGS=-m32” “LDFLAGS=-m32”
    make -j8
    

    Next, we create the directory “lib32” under “altera/13.1/modelsim_ase/” and copy there the compiled binaries, “freetype-2.4.12/objs/.libs/libfreetype.so*”.

    Finally, we force modelsim to use those libraries, by editing the file “altera/13.1/modelsim_ase/bin/vsim”.
    Look for the line:

    dir=dirname $arg0

    and write below it the following text:

    export LD_LIBRARY_PATH=${dir}/lib32 

    VIVADO:
    If the activation license is grey (the red text on the top won’t help at all), you should install a compatible system as recommended at the beginning of the guide.

    In some installations you may experience an error when running “clocking wizard” in the IP manager. That happens due to the language, and the solution is as simple as changing into US english. For doing it, you can edit the file “Vivado/2015.2/bin/vivado” at the beginning, including the following text:

    # Set lenguage to en_US
    export LC_CTYPE=”en_US.UTF-8″ 
    export LC_NUMERIC=”en_US.UTF-8″
    
    LC_TIME=”en_US.UTF-8″ 
    LC_COLLATE=”en_US.UTF-8″ 
    LC_MONETARY=”en_US.UTF-8″ 
    LC_MESSAGES=”en_US.UTF-8″ 
    LC_PAPER=”en_US.UTF-8″ 
    LC_NAME=”en_US.UTF-8″ 
    LC_ADDRESS=”en_US.UTF-8″ 
    LC_TELEPHONE=”en_US.UTF-8″ 
    LC_MEASUREMENT=”en_US.UTF-8″ 
    LC_IDENTIFICATION=”en_US.UTF-8″ 
    LC_ALL=”en_US.UTF-8″
    

    Also, the drivers for connecting the fpga are required. Those drivers can be found in our vivado installation directory. Browse to: “Vivado/2015.2/data/xicom/cable_drivers/lin64/install_script/install_drivers/”, and execute “install_drivers” with root permissions.

    OPENOCD:
    As long as MIPSfpga doesn’t include a linux version of openocd, we have to download and compile one by ourselves.

    We also require ftdi drivers to connect openOCD to our busBlaster device, which can be obtained from the following link: http://www.intra2net.com/en/developer/libftdi/download.php
    (If you are using a different bus device, you have to follow similar steps).

    First, we install the ftdi drivers following the instructions in the README file included in the ftdi package. Make sure that you install all the dependencies, listed and provided in the download page.

    Now we connect our busBlaster to an usb port and check with “lsusb” or “dmesg | grep usb” whether it has been recognized by the system.

    Once we are sure that the busBlaster has been recognized, we create a udev rule so that there is no need to use root permissions to access the device. For that, we create the file “/etc/udev/rules.d/35-busblaster.rules”, included as “udev_rules/busblaster-usb.rules” in the attached package (use a different number if 35 is already used for another rule).

    Then, we execute

    sudo udevadm control –reload
    

    to reload system device rules.
    The next step is to install OpenOCD. The patched version with microAptiv support used in this guide can be obtained by cloning the following repo:

    git clone https://github.com/Kuronogard/mips_interAptiv.git
    

    Then, compile and install:

    cd mips_interAptiv
    ./configure –disable-werror –enable-ftdi
    make
    sudo make install
    

    Note that some guides use “–enable-ft2232_libftdi”. Given that it is a deprecated driver, the script will ask for confirmation.

    To connect openocd to busblaster, we need some configuration scripts, included in the attached package as “openocd_config_files/*.cfg”. After creating them in their respective directories:
    – /usr/local/share/openocd/scripts/interface/mips_busblaster.cfg
    – /usr/local/share/openocd/scripts/target/xilinx_nexys4_mips.cfg
    – /usr/local/share/openocd/scripts/mipsfpga.cfg (openocd.cfg)

    you can invoke openocd as:

    openocd -f interface/mips_busblaster.cfg -f target/xilinx_nexys4_mips.cfg
    

    or:

    openocd -f mipsfpga.cfg
    

    This files have been extracted from the OpenOCD provided in the MIPSfpga package for windows, and are kept untouched. Note that we are using a “busblasterv3c”, whose pid is “0x0403 0x6010” instead of “0x0403 0x7780”, so it may exist an error in mips_busblaster.cfg. You can check your device’s pid with “lsusb” and comment/uncomment the proper lines.

    Attachments:
    You must be logged in to view attached files.
    1 user thanked author for this post.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.