Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.

Latest commit

 

History

History
58 lines (46 loc) · 2.65 KB

File metadata and controls

58 lines (46 loc) · 2.65 KB

Utilities used when generating FIRRTL for a LazyModule.


case class ParsedInputNames

Representation of the information this Generator needs to collect from external sources.

case class ParsedInputNames(
    targetDir: String,
    topModuleProject: String,
    topModuleClass: String,
    configProject: String,
    configs: String)
  • targetDir String (param) the target file directory for the generated FIRRTL code.
  • topModuleProject String (param) name of the scala package that the target design (LazyModule) belongs to.
  • topModuleClass String (param) name of the target design (LazyModule) to be compiled into FIRRTL.
  • configProject String (param) name of the scala package that the configure parameter class belings to.
  • configs String (param) names of the configure parameter classes used for the target design.
  • fullConfigClasses Seq[String] a list of the configure classes.
  • fullTopModuleClass String the full name of the target design.

trait GeneratorApp

The scala trait acting as the main entry point of FIRRTL generation.

trait GeneratorApp extends App with HasGeneratorUtilities
  • names ParsedInputNames (lazy) the names of the target design, configure classes and file directoy from user input.

    #sbt example
    run TargetDir TopModuleProjectName TopModuleName ConfigProjectName ConfigNameString
    
  • generateArtefacts () => Unit execute all callbacks to generate the files defined in ElaborationArtefacts.

object ElaborationArtefacts

Record the files that will be generated beside the FIRRTL during the Chisel compilation process.

  • files Seq[(ext:String, func:() => String)] list of callback functions.
    • ext String the file extension used by this generated file.
    • func () => String the callback that will be executed by the code generator.
  • add (ext:String, content: => String) push (ext, ()=>content) to the callback list files.




Last updated: 08/08/2017
CC BY-NC-SA 4.0, © (2017) Wei Song
Apache 2.0, © (2016-2017) SiFive, Inc
BSD, © (2012-2014, 2016) The Regents of the University of California (Regents)