【问题标题】:How to link output of a module to the input of another in System Verilog如何在 System Verilog 中将模块的输出链接到另一个模块的输入
【发布时间】:2017-11-27 18:52:33
【问题描述】:

我不太清楚如何制作一个允许一个模块的输出(B)成为另一个模块(C)的输入的模块。

【问题讨论】:

标签: verilog system-verilog


【解决方案1】:

1) 你需要用输入和输出端口声明你的模块

 module A(input clk, input sig, output out);
          .. do somethign here
 endmodule

 module B(input clk, output val);
         ... do something to generate val.
 endmodule

2) 您需要在顶层实例中创建实例层次结构,实例化这些模块。后者将声明应该用于连接这两者的电线:

module top(output topout);
  wire clk;
  wire sig;
  wire out;

  A a(clk, sig, topout);
  B b(clk, sig);
endmodule

因此,在上面的示例中,模块B 的实例b 的输出端口val 分配给顶级模块的线sig。同一根线sig连接到模块A的实例a的输入端口sig

实例a的输出端口out也连接到顶层模块的输出端口topout端口。

在这两种情况下,clk 线都连接到两个输入端口:实例a 和实例b

这是基本思想。

【讨论】:

    猜你喜欢
    • 2013-10-20
    • 1970-01-01
    • 1970-01-01
    • 2019-06-14
    • 1970-01-01
    • 2021-01-11
    • 1970-01-01
    • 1970-01-01
    • 2021-11-27
    相关资源
    最近更新 更多