freechipsproject/www.chisel-lang.org

Add Stage/Phase/DependencyAPI Documentation

seldridge opened this issue · 2 comments

Under the FIRRTL tab, include documentation about the Stage/Phase refactor and the Dependency API.

This should include:

  • a cookbook with recipes on how to do basic operations, e.g., compile Chisel to Verilog (@chick)
  • ???

Possible people who can provide feedback include: @chick, @davidbiancolin

This is gated by #5.

Seems like "e.g., compile Chisel to Verilog" would be for advanced users who want to use Stage/Phase etc to manually control this process as opposed to using the Chisel default?

@edwardcwang: Maybe there's a better way to put it, but I think @chick was asking for a counterpart to the "Get me Verilog" website/wiki FAQ with answer:

object HelloWorld extends App {
  chisel3.Driver.execute(args, () => new HelloWorld)
}

That would be something like the following:

object HelloWorld extends App {
  (new ChiselStage).run(Seq(ChiselGeneratorAnnotation(() => new HelloWorld)))
}

ChiselStage doesn't have any helper methods, yet, but it's not unreasonable to add in the following signatures:

  • toVerilog(gen: () => RawModule): String
  • toFirrtl(gen: () => RawModule): String