我创建了两个不同的 Verilog 模块(shiftByImm
和immShifter
)。我想要做的是只选择两者之一的输出作为我正在创建的这个小多路复用器模块的输出。
module superShifter(input [0:31] in, input select, input [0:4] shift_value, input[0:1] shift, output reg [0:31] out);
shiftByImm shift0(in, shift_value, shift, out);
immShifter shift1(in, shift_value, out);
assign {out} = select == 1'b0 ? shift0 : shift1;
endmodule
但是,这给了我两个完全可以理解的错误:
非法引用接口“shift0”
and
非法引用接口“shift1”
我知道这里缺少一些东西。如何选择SuperShifter
模块的输出与预制模块之一的输出相同?