我试图模拟一个Xilinx GTXE2收发信机。在GTXE2_CHANNEL.vhd中,我得到了一个错误,在库'ieee‘中找不到'std_logic_arith’。
首先,这是我的机器设置:
所以问题1:包含在GHDL中吗?
我试图将VHDL标准更改为VHDL-2008 --std=08
,但这个选项未被ghdl所认可,因此我目前正在使用VHDL-2002进行编译。但什么都没变。
我还尝试从Xilinx的vhdl源文件夹C:\Xilinx\14.7\ISE_DS \ISE\vhdl\src\ieee
手动包含IEEE源代码。但是,当我编译std_logic_arith时,它会抱怨缺少std_logic_1164,这通常是被找到的。除此之外,std_logic_1164中的外部性属性也存在一个问题。
这就是我要编译的文件列表/编译顺序( Xilinx‘*..prj file的修改版本):
# 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中的外部属性错误
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环境的人都可以测试这个示例。Xilinx库不需要my_config_KC705.vhdl。
这样做的目的是什么?
发布于 2014-09-14 21:19:08
是的,这个包包含在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
你会找到包裹std_logic_arith
。
因为有冲突的声明,所以在分析和精化过程中也需要使用-fexplicit
命令行选项。
在分析(-a
)或精化(-e
)期间给出的选项遵循以下命令。
如何编译ieee.std_logic_1164?
您不应该需要分析包ieee.std_logic_1164
,它们是预先分析的.首先尝试上面的内容(更常见的是synopsys)。注意,导师包和synopsys包都不包含任何外部属性。外接属性装饰用外文编程语言实现的子程序声明(函数)。
info ghdl
或ghdl.html
( GHDL指南)第5节: VHDL的GHDL实现(使用供应商库的部分,它给出了处理unisim的一些建议)。还有一个与其他语言的接口部分,讨论如何使用外文属性。
也见3.10 IEEE图书馆的陷阱,解释问题与非IEEE‘标准’库,特里斯坦的非母语英语拼写错误。
如果您真的想自己分析IEEE库,请先阅读整个GHDL指南。它涉及几个应该首先理解的命令行选项。Windows发行版基于一个实时代码生成系统(mcode),它将代码分析到库文件中(以.cf后缀结尾),并在精化过程中重新分析发行版库中的相同源代码。
我已经成功地分析和使用了OS下ghdl的mcode版本的unisim库,而没有修改IEEE库。
您会发现,就内存利用率而言,ghdl不是最节俭的,也不是最快的。
还有一个可以加入的古德尔-讨论邮件列表。ghdl正积极地在Sourceforge上开发。见ghdl-更新。ghdl-0.32应该在今年发布(希望如此),并将增加-2008年的支持以及无数的修复。
Windows版本可能是一个新的解释版本,取代了mcode版本( 32位二进制)。目前,所有的开发工作都是由特里斯坦·金戈尔德完成的。他还实现了一个全方位的LLVM后端版本,这可能会带来更好的Windows性能。
外部属性的()
我发现我有几个包含外部属性的Xilinx std_logic_arith
包源文件,尽管行号为4行。
属性的组合和编译器的实用程序,例如:
-- pragma map_to_operator MULT_TC_OP
-- pragma type_function MULT_SIGNED_ARG
-- pragma return_port_name Z
用于允许加速函数执行。外国语库对ghdl是不可用的,mcode (Windows)版本无论如何都不能使用它们。此外,GHDL指南中的5.8.1外部声明中的要求是,外部属性的字符串值必须以"VHPIDIRECT“作为前缀,这是在gcc版本中允许链接的限制,在该版本中,如果找到这些库的ABI,无论如何也不能保证兼容。
您可以简单地注释掉错误消息发现的属性。这是不可能的加速处决,这将需要gcc版本的ghdl目前在任何情况下。
与使用ghdl的Synopsys包相比,没有任何性能优势。
https://stackoverflow.com/questions/25837237
复制相似问题