使用自定义 IP 时块设计中的未定义类型

Undefined type in block design when using custom IP

我正忙着获得一些使用 Xilinx Vivado 的实践经验。

从 github (https://github.com/jorisvr/vhdl_sincos_gen) 中获取 VHDL 正弦发生器,我用它制作了一个 IP 包。我定义了端口:

因此 'in_phase' 端口是无符号类型。

打包 IP 后,我用块设计创建了一个新项目并实例化了 IP:

这有效,我可以综合设计。然而模拟失败。我在细化日志中收到以下错误:

Starting static elaboration
ERROR: [VRFC 10-619] entity port in_phase does not match with type std_logic_vector of component port [/home/dinne/Xilinx/projects/nexys4ddr_tst/nexys4ddr_tst.ip_user_files/bd/design_1/ip/design_1_sincos_gen_0_0/sim/design_1_sincos_gen_0_0.vhd:80]
ERROR: [VRFC 10-619] entity port out_sin does not match with type std_logic_vector of component port [/home/dinne/Xilinx/projects/nexys4ddr_tst/nexys4ddr_tst.ip_user_files/bd/design_1/ip/design_1_sincos_gen_0_0/sim/design_1_sincos_gen_0_0.vhd:81]
ERROR: [VRFC 10-619] entity port out_cos does not match with type std_logic_vector of component port [/home/dinne/Xilinx/projects/nexys4ddr_tst/nexys4ddr_tst.ip_user_files/bd/design_1/ip/design_1_sincos_gen_0_0/sim/design_1_sincos_gen_0_0.vhd:82]

端口类型以某种方式更改。如果我检查 "in_phase" 端口的端口属性,我会看到类型是 "undef"。

此外,如果我检查生成的 IP 包装器代码,我会发现端口类型已更改。同样,'in_phase' 端口应该是未签名的,但是 "std_logic_vector"。

如何修复 IP 端口类型并将模拟设置为 运行?

Vivado 仅允许 std_logicstd_logic_vector 类型的端口用于自定义 IP。可以找到详细信息 here。在本文档第 12 页的 顶级 HDL 要求 部分下,他们明确提到:

Regardless of the top-level port type, when you synthesize the IP out-of-context (OOC), the resulting IP netlist ports are converted to std_logic or std_logic_vector. The converted netlist ports could cause type mismatch issues with RTL simulation. For Verilog, module declarations with complex or split ports are not supported.

并且在同一文档的第 63 页,在 端口和接口 部分下:

° Type Name: The port type (std_logic or std_logic_vector).

由于每个自定义 IP 都被视为顶级实体,因此很遗憾,不支持在顶级端口中使用 unsigned 类型。