在ubuntu中安装modelsim

(1)下载modesim

wget http://download.altera.com/akdlm/software/acdsinst/13.1/162/ib_installers/ModelSimSetup-13.1.0.162.run

chmod +x ModelSimSetup-13.1.0.162.run

(2)安装依赖

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 libpng16-16: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

(3)安装modelsim

sudo ./ModelSimSetup-13.1.0.162.run

(4)编译freetype

wget https:``//ftp``.osuosl.org``/pub/blfs/conglomeration/freetype/freetype-2``.4.12.``tar``.bz2

tar -xjvf freetype-2.4.12.tar.bz2

cd freetype-2.4.12

./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

make -j$(nproc)

mkdir /opt/altera/13.1/modelsim_ase/lib32

cp freetype-2.4.12/objs/.libs/libfreetype.so* /opt/altera/13.1/modelsim_ase/lib32/

(5)修改vco

cd /opt/altera/13.1/modelsim_ase

sudo chmod +w vco

vi vco:

Step 1 - Path to the FreeType folder

Search for the following line:

dir=`dirname $arg0`

and underneath add the following new line:

export LD_LIBRARY_PATH=${dir}/lib32

Step2 - Modify the RedHat only support

Search for the following string:

vco="linux_rh60"

and replace by:

vco="linux"

Step 3 - Change VCO mode

Search for the following line:

mode=${MTI_VCO_MODE:-" "}

and replace by:

mode=${MTI_VCO_MODE:-"32"}

修改后的vco如下:

bash 复制代码
#!/bin/sh
#
#Copyright 1991-2012 Mentor Graphics Corporation
#
#All Rights Reserved.
#
#THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS THE PROPERTY OF 
#MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS SUBJECT TO LICENSE TERMS.
#

# MTI_VCO_MODE environment variable may be set to "32" or "64"
# to force selection of 32-bit or 64-bit platform directory for executables.
mode=${MTI_VCO_MODE:-"32"}

PATH="/bin:$PATH"

arg0=$0
cmd=`basename $arg0`

uname=`uname`
utype=`uname -r`
umach=`uname -m`

case $uname in
  AIX)
    islink=-L
    ;;
  CYGWIN_NT*)
    arg0=`dirname $arg0`
    islink=-h
    ;;
  Win*)
    uname=CYGWIN_NT
    islink=-h
    ;;
  *)
    islink=-h
    ;;
esac

while [ $islink $arg0 ] ; do
  x=`/bin/ls -ld $arg0`
  x=`expr "$x" : '.* \(.*\)'`
  case $x in
    /*) arg0=$x                 ;;
    *)  arg0=`dirname $arg0`/$x ;;
  esac
done

dir=`dirname $arg0`
export LD_LIBRARY_PATH=${dir}/lib32

vco=${uname}${utype}
case $vco in
  SunOS4*)
    echo "Error: $cmd is not supported on ${uname} ${utype}"
    exit 1
    ;;
  SunOS5.5*)
    echo "Error: $cmd is not supported on ${uname} ${utype}"
    exit 1
    ;;
  SunOS5.6*)
    echo "Error: $cmd is not supported on ${uname} ${utype}"
    exit 1
    ;;
  SunOS5.7*)
    echo "Error: $cmd is not supported on ${uname} ${utype}"
    exit 1
    ;;
  SunOS5*)
    # Use 64-bit platform only if 32-bit is not installed and OS and cpu
    # support 64-bit. User may set PATH to platform-specific directory or set
    # environment variable MTI_VCO_MODE to 32 or 64 to override default
    # behavior.
    #
    if [ -x /bin/isainfo ] ; then
      isa="`/bin/isainfo -n 2>&1`"
    else
      isa=""
    fi
    case $mode.$isa in
      32.amd*)          vco="sunos5x86"         ;;
      64.amd*)          vco="sunos5x86_64"      ;;
      .amd32*)          vco="sunos5x86"         ;;
      .amd*)
       if [ -x /bin/getconf ] \
        && /bin/getconf _XBS5_LP64_OFF64 > /dev/null 2>&1 \
        && [ ! -x $dir/sunos5x86/vsim ] \
        && [ -x $dir/sunos5x86_64/vsim ] ; then
          vco="sunos5x86_64"
        else
          vco="sunos5x86"
        fi
        ;;
      32.i386*)         vco="sunos5x86"         ;;
      64.i386*)         vco="sunos5x86_64"      ;;
      .i386*)
        if [ -x /bin/getconf ] \
        && /bin/getconf _XBS5_LP64_OFF64 > /dev/null 2>&1 \
        && [ ! -x $dir/sunos5x86/vsim ] \
        && [ -x $dir/sunos5x86_64/vsim ] ; then
          vco="sunos5x86_64"
        else
          vco="sunos5x86"
        fi
        ;;
      32.sparc*)        vco="sunos5"            ;;
      64.sparc*)        vco="sunos5v9"          ;;
      .sparcv9*)
        if [ -x /bin/getconf ] \
        && /bin/getconf _XBS5_LP64_OFF64 > /dev/null 2>&1 \
        && [ ! -x $dir/sunos5/vsim ] \
        && [ -x $dir/sunos5v9/vsim ] ; then
          vco="sunos5v9"
        else
          vco="sunos5"
        fi
        ;;
      *)                vco="sunos5"            ;;
    esac
    ;;
  HP-UX*)
    # Use hpux_ia64 if IA-64 architecture.
    #
    # Use hppa64 platform only if hp700 is not installed
    # and OS and cpu support 64-bit. User should set PATH to
    # platform-specific directory to override default behavior.
    #
    # Use hp700_1020 platform only if hp700 is not installed
    # and hppa64 is not installed or OS/CPU doesn't support it.
    if [ "$mode" != "32"  ]           \
    && [ "$umach" = "ia64" ]          \
    && ( [ "$mode" = "64" ]           \
      || [ -x $dir/hpux_$umach/vsim ] \
      || [ ! -x $dir/hp700/vsim ] ) ; then
      vco="hpux_ia64"
    elif [ "$mode" != "32"  ]         \
      && [ "$umach" != "ia64" ]       \
      && ( [ "$mode" = "64" ]         \
        || ( [ ! -x $dir/hp700/vsim ] \
          && [ -x $dir/hppa64/vsim ]  \
          && [ -x /bin/getconf ]      \
          && [ "`/bin/getconf KERNEL_BITS 2>&1`" = "64" ] ) ) ; then
      vco="hppa64"
    elif [ ! -x $dir/hp700/vsim ] \
      && [ -x $dir/hp700_1020/vsim ] ; then
      vco="hp700_1020"
    else
      vco="hp700"
    fi
    ;;
  AIX*)
    # Use rs64 platform only if rs6000 is not installed
    # and OS and cpu support 64-bit. User should set PATH to
    # platform-specific directory to override default behavior.
    if [ "$mode" != "32"  ]                                 \
    && ( [ "$mode" = "64" ]                                 \
      || ( [ ! -x $dir/rs6000/vsim ]                        \
        && [ -x $dir/rs64/vsim ]                            \
        && [ -x /bin/getconf ]                              \
        && [ "`/bin/getconf _XBS5_LP64_OFF64 2>&1`" = "1" ] \
        && /bin/locale64 > /dev/null 2>&1 ) ) ; then
      vco="rs64"
    else
      vco="rs6000"
    fi
    ;;
  Linux*)

  	# On Linux, default to 32 bit unless MTI_VCO_MODE is set
	if  [ "$mode" = "" ] \
	&&  ( [ -x $dir/linux_gcc3/vsim ] \
	||    [ -x $dir/linux/vsim ] \
	||    [ -x $dir/linuxle/vsim ] \
	||    [ -x $dir/linuxpe/vsim ] ) ; then
		mode="32";
	fi

    # If IA-64 or X86-64 architecture and machine-specific vsim is not
    # installed but linux vsim is available, use linux platform.
    # Otherwise use machine-specific platform.
    #
    if [ "$mode" != "32"  ]            \
    && ( [ "$umach" = "ia64" ]         \
      || [ "$umach" = "x86_64" ] )     \
    && ( [ "$mode" = "64" ]            \
      || [ -x $dir/linux_$umach/vsim ] \
      || [ ! -x $dir/linux/vsim ] ) ; then
      if [ "$umach" = "ia64" ] && [ -x $dir/linux_ia64_gcc3/vsim ]; then
        vco="linux_ia64_gcc3"
      else
        vco="linux_$umach"
      fi
    else
      if [ -x $dir/linux_gcc3/vsim ] \
      && [ ! -x $dir/linux/vsim ]; then
        vco="linux_gcc3"
      else
        case $utype in
          2.4.[7-9]*)       vco="linux" ;;
          2.4.[1-9][0-9]*)  vco="linux" ;;
          2.[5-9]*)         vco="linux" ;;
          2.[1-9][0-9]*)    vco="linux" ;;
          3.[0-9]*)    		vco="linux" ;;
          *)                vco="linux" ;;
        esac
        if [ ! -x "$dir/$vco/vsim" ]; then
          if [ -x "$dir/linuxle/vsim" ]; then
            vco="linuxle"
          elif [ -x "$dir/linuxpe/vsim" ]; then
            vco="linuxpe"
          fi
        fi
      fi
    fi
    ;;
  CYGWIN_NT*)
    if [ -x "$dir/win32/vsim" ]; then
      vco="win32"
    elif [ -x "$dir/win32pe/vsim" ]; then
      vco="win32pe"
    fi
    if [ "$mode" =  ""  ] ||
       [ "$mode" = "64" ] ; then
      sysostype="`systeminfo 2>&1 | grep -i 'System Type' | cut -f1 -d- | sed s@x@X@ | cut -f2 -dX`"
      if [ "$sysostype" == "64" ] ; then
        vco="win64"
      fi
    fi
  ;;
*)
    vco="unknown"
    ;;
esac

case $cmd in
  qhdir)
    cmd=vdir
    ;;
  qhmap)
    cmd=vmap
    ;;
  qvlcom)
    cmd=vlog
    ;;
  qhcvt)
    cmd=../convert.tcl
    ;;
  qhlib)
    cmd=vlib
    ;;
  qhsim)
    cmd=vsim
    ;;
  qhdel)
    cmd=vdel
    ;;
  qhmake)
    cmd=vmake
    ;;
  qvhcom)
    cmd=vcom
    ;;
  qhgencomp)
    cmd=vgencomp
    ;;
  vco)
    echo $vco
    exit
    ;;
esac

# verify that we can find the command to execute.
if [ -x $dir/$vco/$cmd ] ; then
  arg0=$dir/$vco/$cmd
else
  # if bin nolonger has symbolic links in it then
  # we need to look up and over
  f2=$dir/$vco/$cmd
  if [ -x $f2 ] ; then
    arg0=$f2
  elif [ -x $dir/${vco}pe/$cmd ] ; then
    arg0=$dir/${vco}pe/$cmd
  elif [ -x $dir/${vco}le/$cmd ] ; then
    arg0=$dir/${vco}le/$cmd
  else
    # Last ditch effort.  Use original arg0 and try it!
    d2=`dirname $0`
    f2=$d2/$vco/$cmd
    if [ -x $f2 ] ; then
      arg0=$f2
    else
      echo "Error: cannot find $dir/$vco/$cmd"
      exit 1
    fi
  fi
fi

if [ -z "$*" ] ; then
  exec $arg0
else
  exec $arg0 "$@"
fi

(6)运行bin/vsim

相关推荐
碎碎思7 小时前
SURF:SLAC 开源 FPGA 与 ASIC 通用 RTL 框架详解
fpga开发
FPGA小迷弟10 小时前
FPGA在工业控制行业的应用,行业研究文章
fpga开发·制造·数据采集·fpga·工业控制
洋洋Young11 小时前
【Xilinx FPGA】CLB SliceL 与 SliceM
fpga开发·xilinx·clb
集芯微电科技有限公司11 小时前
PC1001超高频率(50HMZ)单通单低侧GaN FET驱动器支持正负相位配置
数据结构·人工智能·单片机·嵌入式硬件·神经网络·生成对抗网络·fpga开发
stars-he13 小时前
FPGA学习笔记(8)以太网UDP数据报文发送电路设计(二)
网络·笔记·学习·fpga开发
FPGA_小田老师13 小时前
FPGA例程(3):按键检测实验
fpga开发·verilog·vivado·led灯·按键测试
博览鸿蒙14 小时前
想考研到电子类,未来从事 FPGA/IC方向,目前该怎么准备?
考研·fpga开发
m0_5557629014 小时前
FPGA + AD7768-4 实现数据采集的可能方案
fpga开发
ShiMetaPi15 小时前
GM-3568JHF丨ARM+FPGA异构开发板系列教程:外设教程 09 CAN
arm开发·fpga开发·fpga·rk3568