如何编译Xilinx Vivado的模拟库,例如QuestaSim?

时间:2021-07-20 06:13:32

I want to compile the Xilinx Vivado simulation primitives for QuestaSim (ModelSim). The documentation lists a TCL command, but I would like to use a common shell command like the old one for ISE:

我想为QuestaSim (ModelSim)编译Xilinx Vivado仿真原语。文档列出了一个TCL命令,但我想使用一个常见的shell命令,如ISE的旧命令:

<ISEDirectory>\bin\nt64\compxlib.exe -family all - language all -library all -simulator questa ....

As far as I can see, the TCL command should be entered in the Vivado GUI.

在我看来,应该在Vivado GUI中输入TCL命令。

How can I run the compilation from an user defined PowerShell or Bash script?

如何从用户定义的PowerShell或Bash脚本运行编译?

1 个解决方案

#1


0  

Just to answer my own question for completeness ...

为了完整地回答我自己的问题……

There is no other way then running the compile command from the Vivado Tcl shell, either in the GUI or on command line.

除了在GUI或命令行中运行Vivado Tcl shell的编译命令之外,没有其他方法。

Compiling Vivado libraries from Bash:

从Bash编译Vivado库:

VSimBinDir=/opt/questasim/10.4d/bin
DestDir=xilinx-vivado

Simulator=questa
Language=vhdl
Library=all
Family=all

CommandFile=vivado.tcl

echo "compile_simlib -force -library $Library -family $Family -language $Language -simulator $Simulator -simulator_exec_path $VSimBinDir -directory $DestDir" > $CommandFile
if [ $? -ne 0 ]; then
  echo 1>&2 -e "${COLORED_ERROR} Cannot create temporary tcl script.${ANSI_NOCOLOR}"
  exit -1;
fi
echo "exit" >> $CommandFile

# compile common libraries
$Vivado_tcl -mode tcl -source $CommandFile
if [ $? -ne 0 ]; then
  echo 1>&2 -e "${COLORED_ERROR} Error while compiling Xilinx Vivado libraries.${ANSI_NOCOLOR}"
  exit -1;
fi

#1


0  

Just to answer my own question for completeness ...

为了完整地回答我自己的问题……

There is no other way then running the compile command from the Vivado Tcl shell, either in the GUI or on command line.

除了在GUI或命令行中运行Vivado Tcl shell的编译命令之外,没有其他方法。

Compiling Vivado libraries from Bash:

从Bash编译Vivado库:

VSimBinDir=/opt/questasim/10.4d/bin
DestDir=xilinx-vivado

Simulator=questa
Language=vhdl
Library=all
Family=all

CommandFile=vivado.tcl

echo "compile_simlib -force -library $Library -family $Family -language $Language -simulator $Simulator -simulator_exec_path $VSimBinDir -directory $DestDir" > $CommandFile
if [ $? -ne 0 ]; then
  echo 1>&2 -e "${COLORED_ERROR} Cannot create temporary tcl script.${ANSI_NOCOLOR}"
  exit -1;
fi
echo "exit" >> $CommandFile

# compile common libraries
$Vivado_tcl -mode tcl -source $CommandFile
if [ $? -ne 0 ]; then
  echo 1>&2 -e "${COLORED_ERROR} Error while compiling Xilinx Vivado libraries.${ANSI_NOCOLOR}"
  exit -1;
fi