1

找不到这个错误“检查器'xor_module_b'是什么。实例化 'x0_1' 必须是可见的检查器。'?我正在使用模块实例化在行为模型中编写 verilog 代码。编译时出现错误。附上部分代码和错误。

module CSSA4_4bit_modified_b(s,cin,g,G,GP,a,b);
input cin,g,G,GP;
input [7:0] a,b;
output wire [7:0] s;
wire [6:0] c0;
wire [3:0] c1;
wire [2:0] pro;
wire [7:0] s0;
wire [3:0] s1;

always@(a,b,cin,g,G,GP)
begin
//Subblock 1
//Sum bit 0
xor_module_b x0_1(.a(a[0]), .b(b[0]),.s0(s0[0]));
xor_module_b x0_2(.a(s0[0]),.b(cin), .s0(s[0]));
and_logic_b  a0 (.a(s0[0]), .b(cin), .out(pro[0]));
//end

//Sum bit 1
FA_b         FA_b1(.a(a[1]), .b(b[1]),  .c(g),.sum(s0[1]),.cout(c0[0]));
xor_module_b x1 (.a(s0[1]),.b(pro[0]),.s0(s[1]));
and_logic_b  a1 (.a(s0[1]),.b(pro[0]),   .out(pro[1]));
//end

//Sum bit 2
FA_b         FA_b2(.a(a[2]), .b(b[2]),  .c(c0[0]),.sum(s0[2]),.cout(c0[1]));
xor_module_b x2 (.a(s0[2]),.b(pro[1]),.s0(s[2]));
and_logic_b  a2 (.a(s0[2]),.b(pro[1]),.out(pro[2]));
//end.......continued
//Sum bit 7
FA_b FA_b1_7_1(.a(a[7]),.b(b[7]),.c(c0[5]), .sum(s0[7]),.cout(c0[6]));
FA_b FA_b1_7_2(.a(a[7]),.b(b[7]),.c(c1[2]), .sum(s1[3]),.cout(c1[3]));
sum_select_mux_b M1_7(.Sum(s[7]),.Sum0(s0[7]),.Sum1(s1[3]),.C8k(cin));
//End of subblock 2
//End of CSSA 4-4 bit
end
endmodule

错误快照

4

1 回答 1

0

您不能在 always 中实例化模块。

删除always@(a,b,cin,g,G,GP)


你不需要总是在这里,但如果你确实需要它:
在总是列出你的变量是危险的。如果你忘记了一个,你可能会在模拟和现实(门)之间得到不匹配。最好让编译器通过使用来解决它:always @( * )

您可以在测试台上使用它,但我不记得曾经需要它。

于 2018-03-17T17:48:29.527 回答