Pae*_*els 2 simulation vhdl xilinx ghdl
我试图用GHDL模拟Xilinx GTXE2收发器.在GTXE2_CHANNEL.vhd中,我收到一个错误,即在'ieee'库中找不到'std_logic_arith'.
首先,这是我的机器设置:
问题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文件的修改版本):
# 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"
Run Code Online (Sandbox Code Playgroud)
此列表将转换为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"
Run Code Online (Sandbox Code Playgroud)
最后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
Run Code Online (Sandbox Code Playgroud)
问题2:如何编译ieee.std_logic_1164?
每个安装了GHDL环境的人都可以测试这个例子.Xilinx库不需要my_config_KC705.vhdl.
这样做的目的是什么?
是的,这个包包含在ghdl中
在ghdl手册或手册页中,您会发现可以选择--ieee=synopsys 或--ieee=mentor作为命令行选项进行分析并详细说明命令.
查看您的库目录:
david_koontz@Macbook: ls /opt/ghdl/ghdl_mcode/libraries/synopsys
std_logic_arith.vhdl std_logic_misc.vhdl std_logic_textio.vhdl
std_logic_misc-body.vhdl std_logic_signed.vhdl std_logic_unsigned.vhdl
david_koontz@Macbook: ls /opt/ghdl/ghdl_mcode/libraries/mentor
std_logic_arith.vhdl std_logic_arith_body.vhdl
Run Code Online (Sandbox Code Playgroud)
你会找到包裹std_logic_arith.
因为存在冲突的声明,您可以发现-fexplicit在分析和详细说明期间还必须使用命令行选项.
分析(-a)或精化(-e)期间给出的选项遵循命令.
我怎样编译ieee.std_logic_1164?
您不需要分析包ieee.std_logic_1164,它们是预先分析的.首先尝试以上(更常见的是synopsys).请注意,指导者和synopsys包都不包含任何FOREIGN属性.FOREIGN属性修饰以外部编程语言实现的子程序声明(函数).
info ghdl或ghdl.html(GHDL指南)第5节VHDL的GHDL实现(使用供应商库的小节,它提供了一些关于处理unisim的建议).还有一节与其他语言接口,介绍如何使用FOREIGN属性.
另请参阅3.10 IEEE库陷阱,解释非IEEE"标准"库的问题,除了Tristan的非母语英语拼写错误.
如果您真的想分析IEEE库,请先阅读整个GHDL指南.它涉及应首先理解的几个命令行选项.Windows ghdl发行版基于一个即时代码生成系统(mcode),它将代码分析为库文件(以.cf后缀结尾),并重新分析在发布过程中发行版库中的源代码.
我已成功分析并在OS X下的mhd版本的ghdl上使用了unisim库,而没有修改IEEE库.
你会发现ghdl在内存利用方面并不是最快的,也不是最快的.
还有一个Ghdl讨论的邮件列表,你可以加入.ghdl正在Sourceforge上积极开发.请参阅ghdl-updates.ghdl-0.32应该会在今年发布(希望如此),并且会增加-2008的支持以及无数的修复.
Windows版本可能是取代mcode版本(32位二进制)的新解释版本.所有的开发工作目前都由Tristan Gingold完成.他还在实施一个全方位的LLVM后端版本,这可能有望在Windows上获得更好的性能.
在FOREIGN属性上
我发现我有几个std_logic_arith包含FOREIGN属性的Xilinx 包源文件,尽管行号减去4.
属性和编译器编译指示的组合,例如:
-- pragma map_to_operator MULT_TC_OP
-- pragma type_function MULT_SIGNED_ARG
-- pragma return_port_name Z
Run Code Online (Sandbox Code Playgroud)
用于允许加速功能执行.ghdl无法使用外语库,mcode(Windows)版本无论如何都无法使用它们.另外,在5.8.1外部声明中,FOREIGN属性的字符串值包含前缀为"VHPIDIRECT" 的GHDL指南中的要求是一个限制,允许在gcc版本中进行链接,如果找到这些库的ABI,将无法保证无论如何要兼容.
您可以简单地注释掉错误消息找到的属性.加速执行是不可能的,在任何情况下都需要gcc版本的ghdl.
与使用ghdl的Synopsys软件包相比,没有性能优势.
| 归档时间: |
|
| 查看次数: |
3951 次 |
| 最近记录: |