如何让Vivado正确支持Verilog递归模块例化?
我尝试在Verilog中递归例化模块,对应的RTL代码已提交至我的代码仓库。使用Icarus Verilog仿真时运行正常,但通过Vivado综合设计时失败,报错信息如下:
ERROR: [Synth 8-316] illegal module recursion detected [/home/centos/repos/aws-fpga/hdk/cl/examples/cl_hello_world/build/src_post_encryption/recursive_matrix.v:11]
失败前Vivado显示的模块例化参数信息:
INFO: [Synth 8-6157] synthesizing module 'recursive_matrix' [/home/centos/repos/aws-fpga/hdk/cl/examples/cl_hello_world/build/src_post_encryption/recursive_matrix.v:11]
Parameter N bound to: 0 - type: integer
Parameter NUM_WEIGHTS bound to: 31 - type: integer
Parameter WIRE_DELAY bound to: 32 - type: integer
Parameter NUM_LUTS bound to: 2 - type: integer
Parameter DIAGONAL bound to: 0 - type: integer
Parameter TRANSPOSE bound to: 0 - type: integer
按代码逻辑,参数N绑定为0的情况本不应出现,似乎子模块覆盖了父模块的N参数,这一行为不符合Verilog 2005规范。我已尝试使用localparam、修改参数名、添加包装模块避免直接递归、切换Verilog版本等方法,但问题仍未解决,请问这是什么原因?
内容的提问来源于stack exchange,提问作者zachbela

