0

入力が異なるモジュールから来る 2*1 マルチプレクサ用の小さなコードを作成したかったのですが (より実用的にするため)、常に高インピーダンス ('Z') として出力されます。助言がありますか?

module  mux_using_assign(
  din_0      , // Mux first input
  din_1      , // Mux Second input
  sel        , // Select input
  mux_out      // Mux output
  );
  input din_0, din_1, sel ;
  output mux_out;
  wire  mux_out;
  assign mux_out = (sel) ? din_1 : din_0;

  endmodule //End Of Module mux


  module ip1();
  wire a;
  mux_using_assign dut1(.din_0(a));
  assign a = 1;
  endmodule


  module ip2();
  wire b;
  mux_using_assign dut1(.din_1(b));
  assign b = 0;
  endmodule



  module test();
  wire sel        ; // Select input
  wire mux_out;
  ip1 aa();    // tried commenting this and following line also
  ip2 bb();
  mux_using_assign dut1(.sel(sel),.mux_out(mux_out));
  assign sel=1;
  endmodule
4

1 に答える 1

0

問題はdut1、各モジュールのインスタンスが他のモジュールとは別のインスタンスであることです。つまり、ip1ip2、およびのtestそれぞれに独自のdut1マルチプレクサがあります。mux_using_assign入力/出力ワイヤを使用し、それらすべてを 1 つの宣言にリンクする必要があります。

于 2015-05-09T13:43:40.323 に答える