Packages

p

tutorial

lesson2

package lesson2

Type Members

  1. class AnalyzeCircuit extends Transform

    AnalyzeCircuit Transform

    AnalyzeCircuit Transform

    Walks firrtl.ir.Circuit, and records the number of muxes and instances it finds, per module.

    While the Firrtl IR specification describes a written format, the AST nodes used internally by the implementation have additional "analysis" fields.

    Take a look at Reference to see how a reference to a component name is augmented with relevant type, kind (memory, wire, etc), and flow information.

    Future lessons will explain the IR's additional fields. For now, it is enough to know that declaring firrtl.stage.Forms.Resolved as a prerequisite is a handy shorthand for ensuring that all of these fields will be populated with accurant information before your transform runs. If you create new IR nodes and do not wish to calculate the proper final values for all these fields, you can populate them with default 'unknown' values.

    • Kind -> ExpKind
    • Flow -> UnknownFlow
    • Type -> UnknownType
  2. class Ledger extends AnyRef

    Ledger tracks firrtl.ir.Circuit statistics

    Ledger tracks firrtl.ir.Circuit statistics

    In this lesson, we want to calculate the number of muxes, not just in a module, but also in any instances it has of other modules, etc.

    To do this, we need to update our Ledger class to keep track of this module instance information

    See lesson2.AnalyzeCircuit

Ungrouped