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
前もって感謝します。