0

我在运行magic vlsi 时遇到问题。问题是

couldn't load file "/usr/lib/x86_64-linux-gnu/magic/tcl/tclmagic.so": /usr/lib/x86_64-linux-gnu/magic/tcl/tclmagic.so: undefined symbol: Tk_GetCursorFromData

我认为这是由于:

 /usr/lib/x86_64-linux-gnu/magic/tcl/magic.tcl
in line 13: load /usr/lib/x86_64-linux-gnu/magic/tcl/tclmagic.so

文件/usr/lib/x86_64-linux-gnu/magic/tcl/tclmagic.so存在

运行魔法的错误来源来自 shellscript 中的 qflow display.sh

#!/bin/tcsh -f
#----------------------------------------------------------
# Qflow layout display script using magic-8.0
#----------------------------------------------------------
# Tim Edwards, April 2013
#----------------------------------------------------------

if ($#argv < 2) then    echo Usage:  display.sh [options] <project_path> <source_name>    exit 1 endif

# Split out options from the main arguments (no options---placeholder only) set argline=(`getopt "" $argv[1-]`) set cmdargs=`echo "$argline" | awk 'BEGIN {FS = "-- "} END {print $2}'` set argc=`echo $cmdargs | wc -w`

if ($argc == 2) then    set argv1=`echo $cmdargs | cut -d' ' -f1`    set argv2=`echo $cmdargs | cut -d' ' -f2` else    echo Usage:  display.sh [options] <project_path> <source_name>    echo   where    echo       <project_path> is the name of the project directory containing    echo                 a file called qflow_vars.sh.    echo       <source_name> is the root name of the verilog file, and    exit 1 endif

foreach option (${argline})    switch (${option})
      case --:   break    endsw end

set projectpath=$argv1 set sourcename=$argv2 set rootname=${sourcename:h}

# This script is called with the first argument <project_path>, which should
# have file "qflow_vars.sh".  Get all of our standard variable definitions
# from the qflow_vars.sh file.

if (! -f ${projectpath}/qflow_vars.sh ) then    echo "Error:  Cannot find file qflow_vars.sh in path ${projectpath}"    exit 1 endif

source ${projectpath}/qflow_vars.sh source ${techdir}/${techname}.sh cd ${projectpath}

#----------------------------------------------------------
# Copy the .magicrc file from the tech directory to the
# layout directory, if it does not have one.  This file
# automatically loads the correct technology file.
#----------------------------------------------------------

if (! -f ${layoutdir}/.magicrc ) then    if ( -f ${techdir}/${magicrc} ) then
      cp ${techdir}/${magicrc} ${layoutdir}/.magicrc    endif endif

#----------------------------------------------------------
# Done with initialization
#----------------------------------------------------------

cd ${layoutdir}

#---------------------------------------------------
# Create magic layout (.mag file) using the
# technology LEF file to determine route widths
# and other parameters.
#---------------------------------------------------

if ($techleffile == "") then    set lefcmd="lef read ${techdir}/${leffile}" else    set lefcmd="lef read ${techdir}/${techleffile}\nlef read ${techdir}/${techleffile}" endif

# Timestamp handling:  If the .mag file is more recent
# than the .def file, then print a message and do not
# overwrite.

set docreate=1 if ( -f ${rootname}.def && -f ${rootname}.mag) then    set defstamp=`stat --format="%Y" ${rootname}.def`    set magstamp=`stat --format="%Y" ${rootname}.mag`    if ( $magstamp > $defstamp ) then
      echo "Magic database file ${rootname}.mag is more recent than DEF file."
      echo "If you want to recreate the .mag file, remove or rename the existing one."
      set docreate=0    endif endif

# The following script reads in the DEF file and modifies labels so
# that they are rotated outward from the cell, since DEF files don't
# indicate label geometry.

if ( ${docreate} == 1) then ${bindir}/magic -dnull -noconsole <<EOF drc off box 0 0 0 0 snap int ${lefcmd} def read ${rootname} select top cell select area labels setlabel font FreeSans setlabel size 0.3um box grow s -[box height] box grow s 100 select area labels setlabel rotate 90 setlabel just e select top cell box height 100 select area labels setlabel rotate 270 setlabel just w select top cell box width 100 select area labels setlabel just w select top cell box grow w -[box width] box grow w 100 select area labels setlabel just e save ${sourcename} quit -noprompt EOF

endif

# Run magic and query what graphics device types are
# available.  Use OpenGL if available, fall back on
# X11, or else exit with a message

${bindir}/magic -noconsole -d <<EOF >& .magic_displays exit EOF

set magicogl=`cat .magic_displays | grep OGL | wc -l` set magicx11=`cat .magic_displays | grep X11 | wc -l`

rm -f .magic_displays

# Run magic again, this time interactively.  The script
# exits when the user exits magic.


#if ( ${magicogl} >= 1 ) then    magic -d OGL ${rootname}  if ( ${magicx11} >= 1) then    magic -d X11 ${rootname} else    echo "Magic does not support OpenGL or X11 graphics on this host." endif

#------------------------------------------------------------
# Done!
#------------------------------------------------------------

在此处输入图像描述

我该如何解决这个问题?

4

4 回答 4

1

我应该修改我的答案,因为听起来魔法可能是在调用 Tcl 8.5 而不是 8.6,如果您将魔法作为一个包下载可能会发生这种情况。“加载”的“-lazy”选项仅在 Tcl 8.6 中实现,因此在 Tcl 8.5 中根本不起作用。我建议从 opencircuitdesign.com 获得魔法并从源代码编译,这在 Linux 系统上通常没有问题。autoconf 脚本应该能够找到 Tcl 版本 8.6。

您也可以忽略 qflow 中的“显示”选项并以交互方式运行魔术。使用“lef read”命令读取标准单元定义,然后使用“def read”从 qflow 读取布线布局。

于 2016-06-11T03:09:22.377 回答
0

这是一个已知问题(也是一个非常烦人的问题),它来自某些操作系统版本的运行时链接器,它不想链接包含对未知例程的引用的文件,即使该例程从未被调用。在这种情况下,Tcl 在没有 Tk 图形的情况下运行,因此基本 Tcl 对象库没有定义任何 Tk 例程,并且链接器在出现的第一个此类例程上停止(Tk_GetCursorFromData)。出于某种原因,Fedora 链接器(或关于我的设置)没有这样做,否则我很久以前就会解决这个问题。事实上,我最近才修复它,解决方案是在最新版本的 magic-8.1 中。由于您拥有 Tcl/Tk 8.6,因此该解决方案应该可以工作(该解决方案仅适用于 Tcl/Tk 8.6)。您可以更新到最新的魔术版本 8.1,或者您可以只编辑文件 magic.tcl(在源代码中,它是tcltk/magic.tcl.in,安装时,它是/usr/local/lib/magic/tcl/magic.tcl)。在第 13 行,将开关添加-lazy到加载命令:

load -lazy /usr/local/lib/magic/tcl/tclmagic.so
于 2016-06-11T02:58:18.907 回答
0

谢谢 R. Timothy Edwards 和 Tim Edwards。你的回答很有帮助,我已经解决了这个问题。下周,我将在此处为遇到相同问题的用户添加如何在 ubuntu 14.04 上解决此问题的分步指南:

在此处输入图像描述

于 2016-06-11T20:28:48.530 回答
0

魔术配置...:./configure --with-tcl=/opt/ActiveTcl-8.6 --with-tk=/usr/local/lib/tk8.6

qflow- 配置... : ./configure --with-magic=/usr/local/bin/magic

安装 qflow 后

sudo apt-get magic(它将下载magic 7.5而不会覆盖magic 8.0,我们只需要那里的.so文件)

打开/usr/local/lib/magic/tcl/magic.tcl(作为sudo)

并将第 13 行编辑为: load -lazy /usr/lib/x86_64-linux-gnu/magic/tcl/tclmagic.so

于 2016-09-18T17:26:33.313 回答