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
}