如何模拟双向传输延迟

编程入门 行业动态 更新时间:2024-10-28 09:22:36
本文介绍了如何模拟双向传输延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

例如:连接的 IO A 和 B 之间有 10ns 的 io-to-io 延迟.IO 以 500MHz(2ns 周期)运行.

For example: IOs A and B are connected have a 10ns io-to-io delay between them. The IOs run at 500MHz (2ns period).

默认情况下,Verilog 使用惯性延迟作为过滤器.因此,将互连线定义为 wire #(10ns) io; 将不起作用,因为它会过滤掉数据.

By default Verilog uses inertial delay which acts as a filter. Therefore defining the interconnect wire as wire #(10ns) io; will not work since it will filter out the data.

wire #(10ns) io;

assign io = io_a_en ? a_data_500MHz : 'z;
assign io = io_b_en ? b_data_500MHz : 'z;

传输延迟是单向的.为 IO 上的每个方向创建一个将导致多个驱动程序和反馈循环.

Transport delay is unidirectional. Creating one for each direction on an IO will cause multiple drivers and a feedback loop.

always @(a) b_reg <= #(10ns) a;
always @(b) a_reg <= #(10ns) b;
assign a = b_reg; // feedback b_reg = b = a_reg = a ... and multi-driver
assign b = a_reg; // feedback a_reg = a = b_reg = b ... and multi-driver

assign a = io_a_en ? a_data_500MHz : 'z;
assign b = io_b_en ? b_data_500MHz : 'z;

一个双向传输延迟应该如何建模?

How should one model bidirectional transport delay?

推荐答案

可以使用驱动程序强度和两个单向传输延迟来实现双向传输延迟.模型应将网络分配给 IO 驱动程序的较弱驱动强度.这将优先考虑真正的驱动程序并防止驱动程序冲突.

Bidirectional transport delay can be achieved using driver strength with the two uni-directional transport delay. The model should assign the nets to a weaker drive strength the the IO drivers. This will give priority to the real driver and prevent driver conflict.

为了防止反馈回路,使用驱动强度作为限定符来决定传输延迟是否应该分配源值或高 Z.确定驱动强度的一种简单方法是使用 %v,请参阅 IEEE Std 1800-2012 §21.2.1.5 强度格式

To prevent a feedback loop, use the drive strength as the qualifier to decide if the transport delay should assign the source value or high-Z. An easy way to determine the drive strength is with with %v, see IEEE Std 1800-2012 § 21.2.1.5 Strength format

module bidi_delay #( parameter INERTIAL=0, TRANSPORT=10 ) (
    inout a, b
  );

  reg a2b, b2a;
  reg [23:0] a_strength, b_strength;

  always @(a) begin
    $sformat(a_strength, "%v", a);
    a2b <= #(TRANSPORT) (a_strength[23:16] == "S") ? a : 1'bz;
  end
  always @(b) begin
    $sformat(b_strength, "%v", b);
    b2a <= #(TRANSPORT) (b_strength[23:16] == "S") ? b : 1'bz;
  end

  assign (weak0,weak1) #(INERTIAL) a = b2a;
  assign (weak0,weak1) #(INERTIAL) b = a2b;
endmodule

在 EDAplayground 上使用 Aldec Riviera、Icarus Verilog 和 GPL Cver 进行测试

Tested on EDAplayground with Aldec Riviera, Icarus Verilog, and GPL Cver

这篇关于如何模拟双向传输延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 12:00:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1409761.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:双向

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!