我试图用 GHDL 模拟 Xilinx GTXE2 收发器。在 GTXE2_CHANNEL.vhd 中,我收到一个错误,即在库“ieee”中找不到“std_logic_arith”。
首先,这是我的机器设置:
- Windows 7(专业版、x64、德语)
- PowerShell 4.0
- 蟒蛇 3.4
- Xilinx ISE 14.7(x64,英文)
- Xilinx Vivado 2014.2(x64,英文)
- 适用于 Windows 的 GHDL 0.31 ( http://sourceforge.net/projects/ghdl-updates/ )
所以问题1:这个包是否包含在GHDL中?
我试图将 VHDL 标准更改为 VHDL-2008 --std=08
,但是 ghdl 无法识别此选项,因此我目前正在使用 VHDL-2002 进行编译。但什么都没有改变。
我还尝试从 Xilinx 的 vhdl 源文件夹中手动包含 IEEE 源C:\Xilinx\14.7\ISE_DS \ISE\vhdl\src\ieee
。但是,当我编译std_logic_arith时,它会抱怨缺少std_logic_1164,这通常是可以找到的。除此之外,std_logic_1164中的 FOREIGN 属性也存在问题。
所以这是我要编译的文件列表/编译顺序(Xilinx' *.prj-files 的修改版本):
# board and device configuration
#vhdl poc "tb/common/my_config_KC705.vhdl"
# IEEE packages
#xilinx ieee "ieee/std_logic_1164.vhd"
#xilinx ieee "ieee/std_logic_arith.vhd"
# Xilinx Packages and Primitives
xilinx unisim "unisims/unisim_VCOMP.vhd"
xilinx unisim "unisims/unisim_VPKG.vhd"
xilinx work "unisims/primitive/FD.vhd"
xilinx work "unisims/primitive/BUFG.vhd"
xilinx work "unisims/primitive/BUFR.vhd"
xilinx work "unisims/secureip/GTXE2_CHANNEL.vhd"
该列表被翻译成 GHDL 命令,这些命令在临时目录中执行:
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=poc "D:\VHDL\git\SATAController\lib\PoC\tb\common\my_config_KC705.vhdl"
GHDL Messages:
D:\VHDL\git\SATAController\lib\PoC\tb\common\my_config_KC705.vhdl:52:14:warning: package "my_config" does not require a body
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=unisim "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\unisim_VCOMP.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=unisim "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\unisim_VPKG.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\FD.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\BUFG.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\primitive\BUFR.vhd"
C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe -a --std=02 -P. --work=work "C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\secureip\GTXE2_CHANNEL.vhd"
GHDL Messages:
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\unisims\secureip\GTXE2_CHANNEL.vhd:34:10: primary unit "std_logic_arith" not found in library "ieee"
最后是ieee.std_logic_1164中的 FOREIGN 属性错误:
PS D:\VHDL\git\SATAController\lib\PoC\temp\ghdl> & 'C:\Program Files (x86)\GHDL\0.31\bin\ghdl.exe' -a --std=02 '-P.' --work=ieee 'C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd'
GHDL Messages:
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:211:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:212:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:213:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:214:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:215:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:216:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:218:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:219:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:220:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:221:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:223:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:224:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:225:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:227:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:228:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:229:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:231:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:232:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:233:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:235:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:236:15: value of 'FOREIGN attribute does not begin with VHPIDIRECT
C:\Xilinx\14.7\ISE_DS\ISE\vhdl\src\ieee\std_logic_arith.vhd:238:15: 'FOREIGN allowed only for architectures and subprograms
问题2:如何编译ieee.std_logic_1164?
每个安装了 GHDL 环境的人都可以测试这个示例。赛灵思库不需要 my_config_KC705.vhdl。
这样做的目的是什么?
- iSim 模拟非常慢 -> 大约 15 ns sim-time 在 1 秒 cpu-time 中计算;100 us -> 40 分钟的等待
- iSim 使用大约 2.6 GiB 的主存储器 - 可能是 GHDL 更节省
- xSim 对我们的 VHDL 库有些抱怨 - 所以 iSim 目前是选项 #1
- 我之前用 Xilinx 原语测试过 GHDL 并且它工作正常,所以下一个挑战是模拟一个 secureip 组件 :)
- 如果我有足够的时间,我也会尝试 QuestaSim