作为处理器设计的一部分,我正在使用 Verilog 实现一个简单的行为右移器。
移位器输入一个 32 位变量,并根据变量(输入)选择输出右逻辑移位或右算术移位。
以下是代码:
module ShiftRight(
input signed[31:0] inp,
input [31:0] shamt,
output [31:0] out,
input choice
);
assign out = (choice)? (inp>>>shamt):(inp>>shamt);
endmodule
这会导致正确的行为实现,但会在综合过程中发出以下警告:
Unit ShiftRight : the following signal(s) form a combinatorial loop: out_shift0000<31>.
(括号中的系数基本上是 inp 的最重要位,在我的例子中是 31)。所以我想知道这是否与 inp bein 签名有关。