将Chisel3 REPL Vec分配到模块中只能在评估之后

猴子

如果我们运行以下Chisel3代码

class Controller extends Module {

  val io = IO(new Bundle {
  })
  val sff = Module(new SFF)

  val frame: Vec[UInt] = Reg(Vec(ProcedureSpaceSize, Integer32Bit))
  for(i <- 0 until ProcedureSpaceSize)
    frame(i) := 99.U

  sff.io.inputDataVector := frame
}

class SFF extends Module {

  val io = IO(new Bundle {
    val inputDataVector: Vec[UInt] = Input(Vec(ProcedureSpaceSize, Integer32Bit))
  })

}

在REPL调试模式下。先做

reset;step

peek sff.io_inputDataVector_0;peek sff.io_inputDataVector_1;peek sff.io_inputDataVector_2

REPL返回

Error: exception Error: getValue(sff.io_inputDataVector_0) returns value not found
Error: exception Error: getValue(sff.io_inputDataVector_1) returns value not found
Error: exception Error: getValue(sff.io_inputDataVector_2) returns value not found

然后做

eval sff.io_inputDataVector_0

这将是成功的,产生

...
resolve dependencies
  evaluate     sff.io_inputDataVector_0 <= frame_0
  evaluated    sff.io_inputDataVector_0 <= 99.U<32>

然后再次执行以上偷看

peek sff.io_inputDataVector_0;peek sff.io_inputDataVector_1;peek sff.io_inputDataVector_2;

这次,它返回

peek sff.io_inputDataVector_0  99
peek sff.io_inputDataVector_1  99
peek sff.io_inputDataVector_2  99

这是更期望的。

为什么REPL会采取这种方式?还是我错过了什么?谢谢!

*chisel-iotesters为版本1.4.2,且chiseltest为版本0.2.2两者都应该是最新版本。

小鸡马克利

第一解释器REPL不必计算或存储mux未使用的分支上的值这可能会导致上述问题,例如

Error: exception Error: getValue(sff.io_inputDataVector_0) returns value not found

eval可以用于强制对未使用的分支进行评估。REPL是一项实验性功能,并未得到太多使用。

踏板是更现代的基于凿子scala的模拟器。它比解释器更好地支持并且更快。它具有自己的REPL,但没有executeFirrtlRepl等效项。

它必须通过根目录中的./treadle.sh脚本从命令行运行。还可以运行sbt assembly以创建一个更快的启动jar,并将其放在utils / bin中。这个REPL也没有被广泛使用,但是我对可以使其变得更好,更容易使用的反馈很感兴趣。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章