0

作为处理器设计的一部分,我正在使用 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 签名有关。

4

1 回答 1

3

我猜你的合成器一想到必须将向量算术移位 2^32 位(4,294,967,296)就爆炸了,并且在它的内部 RTL 到门合成中,它最终以循环循环结束。

既然我猜你不需要移动 40 亿位,也许你可以为你的移动量使用一个合理的数字?

于 2012-10-31T21:52:46.780 回答