要打印所有pass的fir文件,可以使用以下命令:

sbt "runMain chisel3.Driver --firrtl-circuit-annotations-file <path-to-annotations-file> --no-run"

其中,<path-to-annotations-file>是FIRRTL注释文件的路径,该文件包含有关生成的FIRRTL电路的注释。此命令将生成所有通过的FIRRTL文件,并将它们打印到控制台输出。请注意,此命令不会运行任何仿真或生成Verilog文件。

如果您使用的是ChiselTest,可以在测试中添加以下代码来生成注释文件:

import chiseltest.experimental.TestOptionBuilder._
import chiseltest.internal.{TreadleBackendAnnotation, WriteVcdAnnotation}

test(new MyModule()).withAnnotations(Seq(TreadleBackendAnnotation, WriteVcdAnnotation, DumpFirrtlAtLoadAnnotation))

这将在测试期间生成FIRRTL注释文件,并将其保存在默认位置(test_run_dir/<module-name>.anno)中。然后,您可以使用上面的命令打印所有通过的FIRRTL文件。


原文地址: https://www.cveoy.top/t/topic/9iU 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录