GHDL:如何绑定组件?

GHDL: How do I bind components?

我正在 运行使用 ghdl (0.32rc1) 进行自动化测试。我的一些测试平台需要 Xilinx ISE 的 unisim 原语。

我准备了两个external files,如果有人想测试我的例子。对于 运行 我的示例,您需要安装 Xilinx ISE 或 Vivado,以便找到 MUXCY 原语。它位于文件夹 <InstallDir>\ISE_DS\ISE\vhdl\src\unisims\primitive.

我用以下ghdl命令分析了这三个文件:

PS D:\Temp\ghdl> C:\Tools\GHDL[=10=].32RC1\bin\ghdl.exe -a --work=work C:\Xilinx.7\ISE_DS\ISE\vhdl\src\unisims\primitive\MUXCY.vhd
PS D:\Temp\ghdl> C:\Tools\GHDL[=10=].32RC1\bin\ghdl.exe -a --work=poc .\arith_prefix_and.vhdl
PS D:\Temp\ghdl> C:\Tools\GHDL[=10=].32RC1\bin\ghdl.exe -a --work=test .\arith_prefix_and_tb.vhdl
.\arith_prefix_and_tb.vhdl:96:16:warning: universal integer bound must be numeric literal or attribute

到目前为止没有错误。
现在我开始模拟,这只是 ghdl.exe -r on Windows (Linux: -e and -r):

PS D:\Temp\ghdl> C:\Tools\GHDL[=11=].32RC1\bin\ghdl.exe -r --work=test arith_prefix_and_tb
.\arith_prefix_and.vhdl:79:40:warning: 'mux' is not bound
.\arith_prefix_and.vhdl:43:14:warning: (in default configuration of arith_prefix_and(rtl))

现在 ghdl 报告 mux 无法绑定。
我也尝试了参数 --syn-binding-P.,但没有任何改变。

绑定MUXCY组件需要做什么?

P.S。有人可以创建 'ghdl' 标签吗?我没有足够的声望:)

以下是我将如何解决这个问题:

首先,分析unisim库中的MUXCY,就像这样:

ghdl -a --work=unisim C:\Xilinx.7\ISE_DS\ISE\vhdl\src\unisims\primitive\MUXCY.vhd

注意该命令中的 --work=unisim

然后,确保在 arith_prefix_and.vhdl 文件的顶部添加 library UNISIM;

应该可以了。

我认为这里发生的事情是,由于您在分析 arith_prefix_and.vhdl 时用 --work=pocwork 库的名称覆盖为 poc,它没有看到在名为 work 的实际库中分析的 MUXCY 实体,因此它找不到要绑定 MUXCY 组件的默认实体。