要使用 C/RTL 协同仿真功能来验证 RTL 设计,必须满足以下至少 1 项条件:
- 顶层函数必须使用
ap_ctrl_chain
或ap_ctrl_hs
块级协议来进行综合。 - 必须采用纯组合型设计
- 顶层函数的启动时间间隔必须为 1
- 接口包含的阵列必须全部使用
axis
或ap_hs
接口模式来进行串流和实现注释:hls::stream
变量作为ap_fifo
接口自动实现。
如果这些条件都未能满足,C/RTL 协同仿真将中止并提示下列消息:
@E [SIM-345] Cosim only supports the following 'ap_ctrl_none' designs: (1)
combinational designs; (2) pipelined design with task interval of 1; (3) designs with
array streaming or hls_stream ports.
@E [SIM-4] *** C/RTL co-simulation finished: FAIL ***
重要: 如果设计指定为使用块级 I/O 协议
ap_ctrl_none
且设计包含采用非阻塞行为的任意 hls::stream
变量,则无法保证能否完成 C/RTL 协同仿真。如果任意顶层函数实参指定为 AXI4-Lite 接口,则函数返回也必须指定为 AXI4-Lite 接口。