Skip to content

How to parse firrtl file/string to Circuit instance? #4899

@canxin121

Description

@canxin121

I can convert a Circuit instance into string FIRRTL code using Serializer.serialize(circuit). So, how can I do the reverse: parse FIRRTL code (or a file) back into a Circuit instance?

I asked AI, and it suggested val circuit = Parser.parseFile(inputFile). However, the Parser object actually no longer has this parseFile method. Instead, the file as follows:

package firrtl

object Parser {

  sealed abstract class InfoMode

  case object IgnoreInfo extends InfoMode

  case object UseInfo extends InfoMode

  case class GenInfo(filename: String) extends InfoMode

  case class AppendInfo(filename: String) extends InfoMode

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions