3

ModelSim Student Edition 10.2c で Verilog プロジェクトを実行できません。すべてがエラーなしでコンパイルされますが、実行時に次のエラーが発生します。

# vsim -gui work.testbench 
# Loading work.testbench
# Loading work.circuit1_assign
# ** Error: (vsim-3033) C:/Modeltech_pe_edu_10.2c/examples/circuit1_assign.v(14): Instantiation of 'OR' failed. The design unit was not found.
# 
#         Region: /testbench/c
#         Searched libraries:
#             C:/Modeltech_pe_edu_10.2c/examples/hw4
# ** Error: (vsim-3033) C:/Modeltech_pe_edu_10.2c/examples/circuit1_assign.v(16): Instantiation of 'NOT' failed. The design unit was not found.
# 
#         Region: /testbench/c
#         Searched libraries:
#             C:/Modeltech_pe_edu_10.2c/examples/hw4
# ** Error: (vsim-3033) C:/Modeltech_pe_edu_10.2c/examples/circuit1_assign.v(18): Instantiation of 'AND' failed. The design unit was not found.
# 
#         Region: /testbench/c
#         Searched libraries:
#             C:/Modeltech_pe_edu_10.2c/examples/hw4
# Loading work.t1
# Error loading design

私は Verilog を初めて使用するので、これが何を意味するのかわかりません。これは私が犯している単純な間違いだと思いますが、解決できないようで、Google で解決策を見つけられませんでした。私のプロジェクトが機能するために何ができるか知っている人はいますか?

編集:ANDこれは、 、 、ORおよびNOTが定義されているファイルを含めることができないことに関係していると思います。グーグルで調べたところ、ファイルmodelsim.iniをプロジェクトディレクトリに配置する必要があることがわかりました。ただし、modelsim.ini正しいディレクトリに配置しましたが、まだ機能しません。

編集:私は自分のプロジェクトの 3 つのソース ファイルをすべて投稿しました (組み合わせ回路をテストするだけです...)。 circuit1_assign.v のコードは次のとおりです。

module circuit1_assign
  (
    input x,

    input y,

    input z,

    output f
  );

  wire w1, w2;

  OR  o1 (.i0(x), .i1(y), .o(w1));

  NOT n1 (.i2(z), .o(w2));

  AND a1 (.i3(w1), .i4(w2), .o(f));


endmodule

テスト用のコードは次のとおりです。

`タイムスケール 1ns/1ps

モジュール t1 (出力 reg a、出力 reg b、出力 reg c );

initial
  begin
      a = 0;        //Do all combinations of possible input values    
      b = 0;
      c = 0;
      #10 a = 0;
      #10 b = 0;
      #10 c = 1;
      #10 a = 0;
      #10 b = 1;
      #10 c = 0;
      #10 a = 0;
      #10 b = 1;
      #10 c = 1;
      #10 a = 1;
      #10 b = 0;
      #10 c = 0;
      #10 a = 1;
      #10 b = 0;
      #10 c = 1;
      #10 a = 1;
      #10 b = 1;
      #10 c = 0;
      #10 a = 1;
      #10 b = 1;
      #10 c = 1;
      #10 $finish;
  end
endmodule

テストベンチのコードは次のとおりです。

`timescale 1ns/1ps
module testbench();
    wire l, m, n, o;

    circuit1_assign c
    (
      .x (l),
      .y (m),
      .z (n),
      .f (o)
    );

    t1 t
    (
      .a (l),
      .b (m),
      .c (n)
    );

    initial 
    begin
      $monitor ($time,,"l=%b, m=%b, n=%b, o=%b",
                      l, m, n, o);
  end

endmodule

前もって感謝します。

4

2 に答える 2

4

小文字のゲート ( 、 など) を使用してみましたandor?

Verilog でのゲート レベル モデリングのすべての例で、これらのプリミティブは大文字ではなく小文字で表示されています。

参照: http://www.asic-world.com/verilog/gate1.html

于 2013-11-25T16:55:16.243 に答える
1

circuit1_assign は、OR、NOT、AND と呼ばれる他のモジュールをインスタンス化しています。ツールはそれらのモジュールを探していますが、見つからないため、エラーがスローされます。これらのモジュールを使用する場合は、自分で作成する必要があります。それ以外の場合は、Verilog で assign ステートメントを使用して目的を達成できます。circuit1_assign を次のように変更できます。

assign w1 = x | y;
assign w2 = ~z;  //I think this is right?  
assign f  = w1 & w2;
于 2013-11-25T14:41:17.943 に答える