From 3243f05a69b4b77761699be412f349a9b8b9193f Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Thu, 28 Jun 2018 16:57:03 -0700 Subject: Protobuf (#832) Add support for ProtoBuf serialization and deserialization * Add support for additional features in .proto description Features added: Info, Fixed[Type|Literal], AnalogType, Attach, Params * Add support for .pb input files This involves an API change where FIRRTL no longer implicitly adds .fir to input file names--- src/test/scala/firrtlTests/FirrtlSpec.scala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/test/scala/firrtlTests/FirrtlSpec.scala') diff --git a/src/test/scala/firrtlTests/FirrtlSpec.scala b/src/test/scala/firrtlTests/FirrtlSpec.scala index 861d1745..01ae0431 100644 --- a/src/test/scala/firrtlTests/FirrtlSpec.scala +++ b/src/test/scala/firrtlTests/FirrtlSpec.scala @@ -101,6 +101,12 @@ trait FirrtlMatchers extends Matchers { require(!s.contains("\n")) s.replaceAll("\\s+", " ").trim } + /** Helper to make circuits that are the same appear the same */ + def canonicalize(circuit: Circuit): Circuit = { + import firrtl.Mappers._ + def onModule(mod: DefModule) = mod.map(firrtl.Utils.squashEmpty) + circuit.map(onModule) + } def parse(str: String) = Parser.parse(str.split("\n").toIterator, UseInfo) /** Helper for executing tests * compiler will be run on input then emitted result will each be split into -- cgit v1.2.3