1

代码编译正确,但我收到警告:

[warn] PC_RVI.scala:22: Mux of Bits instantiated, emits SInt in class TOP_pack.PC_RVI

给出警告的代码部分如下所示:

PC_input1 := Mux(io.branch, io.imme, UInt(4))
PC_input2 := Mux(io.PC_or_rs1, io.rs1, PC_reg)

whereimmers1are 的类型SInt

4

1 回答 1

3

您的所有信号都必须属于同一类型的 SInt。正如我们在给定的代码上看到的那样:

PC_input1 := Mux(io.branch, io.imme, UInt(4))

io.imme 是 SInt() 而 UInt(4) 不是。您的 PC_input1 是 SInt() 吗?

如果您想避免警告,请对所有变量使用相同的类型。

于 2016-09-28T07:36:15.400 回答