我在运行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 display.sh
中的qflow:
#!/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!
#------------------------------------------------------------
如何解决此问题?
答案 0 :(得分:1)
我应该修改我的答案,因为听起来魔术可能会调用Tcl 8.5而不是8.6,如果您将魔法作为包下载,则可能会发生这种情况。 “加载”的“-lazy”选项仅在Tcl 8.6中实现,因此它在Tcl 8.5中根本不起作用。我建议从opencircuitdesign.com获取魔法并从源代码编译,这通常在Linux系统上没有问题。 autoconf脚本应该能够找到Tcl版本8.6。
您也可以忽略qflow中的“display”选项并以交互方式运行magic。使用“lef read”命令读入标准单元格定义,然后使用“def read”从qflow读取路由布局。
答案 1 :(得分:0)
这是一个已知的问题(也是一个非常讨厌的问题)来自某些OS版本的运行时链接程序,它们不希望链接包含对未知例程的引用的文件,即使该例程从未被调用过。在这种情况下,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
答案 2 :(得分:0)
谢谢R. Timothy Edwards和Tim Edwards。你的答案很有帮助 我已经解决了这个问题。下周,我将在这里添加如何在ubuntu 14.04上为具有相同问题的用户解决此问题的分步指南:
答案 3 :(得分:0)
magic- configure ...:./ configure --with-tcl = / opt / ActiveTcl-8.6 --with-tk = / usr / local / lib / tk8.6
qflow- configure ...:./ configure --with-magic = / usr / local / bin / magic
安装qflow后
sudo apt-get magic(它将下载魔法7.5,不包括覆盖魔法8.0,我们只需要.so文件)
打开/usr/local/lib/magic/tcl/magic.tcl(作为sudo)
并将第13行编辑为: load -lazy /usr/lib/x86_64-linux-gnu/magic/tcl/tclmagic.so