aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/annotations/JsonProtocol.scala
AgeCommit message (Collapse)Author
2022-04-21Update json4s-native to 4.0.5 (#2519)Lucheng Zhang
2022-03-25Fix anno deserialization when class field is not first (#2501)Fabian Schuiki
Update `findTypeHints` to allow for the "class" field in JSON objects to appear anywhere in the object. This used to rely on the field being the very first in the object, which is easily violated when reading JSON data generated externally, since an object's order of fields is unspecified and can be arbitrarily scrambled. Fixes #2497.
2021-11-12Let firrtl based applications run despite loading unknown annotations (#2387)Chick Markley
An application like barstools may contain a main that loads an annotations file containing annotation classes that are not on it's classpath. This change allows unknown annotations to be preserved by wrapping them in a UnrecognizedAnnotation. If annotations are then output to a file, they will be unwrapped during serialization This feature can be enabled via an AllowUnrecognizedAnnotations annotation Co-authored-by: chick <chick.markley@sifive.com> Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-05-14Add JsonProtocol.serializeRecover (#2227)Jack Koenig
This function will safely wrap any unserializeable annotations in UnserializeableAnnotations so that they can be safely serialized to JSON for logging.
2020-09-16Change to Apache 2.0 License (#1901)Chick Markley
2020-09-05Better error messages for unserializable annotations (#1885)Jack Koenig
2020-08-14All of src/ formatted with scalafmtchick
2020-04-10Add ground type serializer (#1502)Albert Chen
* update JsonProtocolSpec to test GroundType * add custom serializer for GroundType * get rid of trailing comma Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-07Add firrtl-json serializers (#1430)Adam Izraelevitz
* Add firrtl-json serializers * Added support for ports, info. Added docs and tests
2020-01-28add IsModule, IsMember, CompleteTarget serializers (#1321)Albert Chen
2019-11-14Use getName instead of getSimpleNameSchuyler Eldridge
This changes uses of `getSimpleName` to `getName`. The former throws idiotic exceptions under Java 8, e.g., `getSimpleName` will fail if used on a class inside an object. This fixes a bug where any call to the `name` method of a custom transform defined inside an object (or in an environment wrapping things in objects like a REPL) will throw a malformed class name exception. E.g., if you do this and run with `-ll info` or your custom transform deletes annotations. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2019-10-29Remove an unneeded castDavid Biancolin
2019-10-29Some cleanupDavid Biancolin
2019-10-29Update src/main/scala/firrtl/annotations/JsonProtocol.scalaDavid Biancolin
Co-Authored-By: Jack Koenig <koenig@sifive.com>
2019-10-29Check that all annotations provide the typeHintDavid Biancolin
2019-10-29Try implementing recursive typeHint look upDavid Biancolin
2019-10-25Only emit the DeserilizationTypeHintsAnno when neededDavid Biancolin
2019-10-24Supply a trait to allow user annotations to provide SERDES type hintsDavid Biancolin
2019-08-19Refactor exceptions to remove stack trace from user errors (#1157)Jack Koenig
2019-06-18Use scalafix to remove unused import and deprecated procedure syntax (#1074)Leway Colin
* Add sbt-scalafix * Add scalafix guide to README * Remove Unused Import * Remove deprecated procedure syntax
2019-03-18Add serialization support for LoadMemoryFileType in LoadMemoryAnnotation (#1056)Jim Lawson
* Add serialization support for LoadMemoryFileType in LoadMemoryAnnotation Add custom LoadMemoryFileTypeSerializer. Add test to verify LoadMemoryAnnotation can be correctly serialized/deserialized. * Simplify and focus LoadMemoryAnnotation serialization/deserialization. Respond to comments on earlier implementations. * Add type FileType definition for current chisel3 code.
2018-11-07Add FirrtlOptionsSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-10-30Instance Annotations (#926)Adam Izraelevitz
Formerly #865 Major Code Changes/Features Added: Added Target trait as replacement for Named Added TargetToken as token in building Target Added GenericTarget as a catch-all Target Added CircuitTarget, ModuleTarget, ReferenceTarget, and InstanceTarget Added ResolvePaths annotation Added EliminateTargetPaths (and helper class DuplicationHelper) Updated Dedup to work with instance annotations Updated RenameMap to work with instance annotations DCE & ConstantProp extend ResolveAnnotationPaths
2018-10-27Revert "Instance Annotations (#865)" (#925)Adam Izraelevitz
This reverts commit 7e2f787e125227dc389d5cf1d09717748ecfed2e.
2018-10-24Instance Annotations (#865)Adam Izraelevitz
Added Target, which now supports Instance Annotations. See #865 for details.
2018-03-22Better bad annotation file error reporting (#771)Jack Koenig
* Propagate exceptions from JsonProtocol deserialization * Add AnnotationFileNotFoundException for better error reporting * Add AnnotationClassNotFoundException for better error reporting * Better propagate JSON parsing errors Also report the file if there is a error deserializing a JSON file * Make exception for non-array JSON file more explicit
2018-02-27Refactor Annotations (#721)Jack Koenig
- Old Annotation renamed to deprecated LegacyAnnotation - Annotation is now a trait that can be extended - New JsonProtocol for Annotation [de]serialization - Replace AnnotationMap with AnnotationSeq - Deprecate Transform.getMyAnnotations - Update Transforms - Turn on deprecation warnings - Remove deprecated Driver.compile - Make AnnotationTests abstract with Legacy and Json subclasses - Add functionality to convert LegacyAnnotations of built-in annos This will give a noisy warning and is more of a best effort than a robust solution. Fixes #475 Closes #609