要求:T Chisel 错误

Required: T Chisel Error

我收到 io.out(i) := Cat(io.in1(0) ,io.in2) 行的以下凿子错误。这是什么意思?我该如何纠正这个问题?请帮忙

type mismatch;
[error]  found   : chisel3.core.UInt
[error]  required: T
[error]     io.out(i) := Cat(io.in1(0) ,io.in2)

type mismatch;
[error]  found   : chisel3.core.Vec[chisel3.core.UInt]
[error]  required: T
[error]     io.out(i) := Cat(io.in1(0) ,io.in2)

正如 Chick 所提到的,我们确实需要了解更多背景信息,但我认为我已经足够了解正在发生的事情。我怀疑您遗漏的错误消息的一部分是:

[error] inferred type arguments [chisel3.core.Data] do not conform to method apply's type parameter bounds [T <: chisel3.Bits]
[error]   io.out(i) := Cat(io.in1(0), io.in2)
[error]

这说明 Cat 的参数类型必须是 chisel3.Bits 的子类型。 Vec 不是 Bits 的子类型,因此您不能将 Vec 传递给 Cat

获得更多关于您正在尝试做的事情的信息以提供更好的建议会很有帮助,但是如果您正在尝试构建一个 UInt 是 [=17= 的串联] 和 Vec,您可以通过调用 .asUIntVec 转换为 UInt,例如。 Cat(io.in1(0), io.in2.asUInt)。如果你想通过在 UInt 前面加上一个 Vec 来构造一个更大的 Vec ,你可以尝试 io.in1(0) +: io.in2.