chuanchuan304

使用FPGA时,可以在testbench中将输入信号直接赋值给输出信号,以形成环路,具体用法如下:

wire  [15:0] lvds_rx_buf;

assign lvds_rx_buf[15:0] = lvds_tx[15:0];

initial
begin
#0 lvds_rx[15:0] = 16\'d0;
repeat (3000) #4 lvds_rx[15:0] = lvds_rx_buf[15:0];
end

注意:1 lvds_rx 是reg型,不能直接用

assign       lvds_rx[15:0]=lvds_tx[15:0];

       2 repeat 语句中,必须加时间戳#4,否则lvds_rx[15:0]会一直为初始化的值,即等于0。

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-09
  • 2022-12-23
  • 2021-06-27
  • 2021-09-12
  • 2022-12-23
  • 2021-12-30
相关资源
相似解决方案