sbt无法识别包。错误是这些:
[error] /home/xxx/src/main/scala/NoC.scala:12:8: value Grant is not a member of chisel3.Bundle
[error] io.Grant := io.Req & !io.Rls
[error] ^
[error] /home/xxx/src/main/scala/NoC.scala:12:20: value Req is not a member of chisel3.Bundle
[error] io.Grant := io.Req & !io.Rls
[error] ^
[error] /home/xxx/src/main/scala/NoC.scala:12:30: value Rls is not a member of chisel3.Bundle
[error] io.Grant := io.Req & !io.Rls
[error] ^
可复制的代码是;
//Priority Encoder
class P_Encoder() extends Module {
val io = IO(new Bundle {
val Req = Input(Bool()) //Requests
val Rls = Input(Bool()) //Releases
val Grant = Output(Bool()) //Grants
})
io.Grant := io.Req & !io.Rls
}
可能我错过了一些关于语法的东西,但是还没有发现。 有人可以指出吗?
答案 0 :(得分:1)
这是由于Scala 2.11和2.12之间的类型推断发生了变化。您可以通过将-Xsource:2.11
添加到scalacOptions
中的build.sbt
中来解决此问题。在大多数chisel-template,rocket-chip和sifive/freedom等chisel3项目中,您都会看到这一点。从chisel-template创建新项目通常是一个好主意,直到您熟悉Scala生态系统和相关工具(如SBT)为止。