aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/options/DependencyManager.scala
AgeCommit message (Collapse)Author
2021-07-25Add typedef in DependencyManager.Jiuyang Liu
This is a bug fix, before this PR, Scala compiler will infer `Nothing`, which makes code below failed to compile: ``` class UserCompiler extends TransformManager(Seq(Dependency(UserPass))) { override def optionalPrerequisiteOf: Seq[TransformDependency] = Seq( Dependency[DedupModules] ) } ```
2021-04-19Hoist Transform timing to the Phase level (#2190)Jack Koenig
With Stage/Phase, users can provide complex functionality at the phase level rather than just the transform level. It is useful to have the same logging information at that level. Note that this change still logs transforms in the same way, but now the time in inclusive of annotation renaming which can also [unfortunately] be slow. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-01-26Fix post-merge publishing (#2055)Jack Koenig
* Check Unidoc on all versions of Scala It is required for publishing and we publish every version * Fix conflicting cross-version suffixes issue When running `sbt ++2.13.4 unidoc`, SBT would set the Scala version for the fuzzer and benchmark projects even though they aren't really relevant to the command. This may be a misconfiguration or a bug in the unidoc plugin. Whatever the case, simply making it possible for them to use the same version of Scala as the firrtl project (on which they depend) fixes the issue. * Match versions of Scala in build.sbt and CI * Fix unidoc issues in 2.13.4 There is some bug in ScalaDoc not finding some links in firrtl.options so those links were made absolute as a workaround.
2020-09-16Change to Apache 2.0 License (#1901)Chick Markley
2020-08-14All of src/ formatted with scalafmtchick
2020-06-12delete usages of toSet for determinism (#1686)Albert Chen
* delete usages of toSet for determinism * add formatting suggestion from code review
2020-04-22Add optionalPrerequisiteOf, deprecate dependentsSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-04-22Mixin DependencyAPIMigration to all TransformsSchuyler Eldridge
This mixes in the new DependencyAPIMigration trait into all Transforms and Passes. This enables in-tree transforms/passes to build without deprecation warnings associated with the deprecated CircuitForm. As a consequence of this, every Transform now has UnknownForm as both its inputForm and outputForm. This PR modifies legacy Compiler and testing infrastructure to schedule transforms NOT using mergeTransforms/getLoweringTransforms (which rely on inputForm and outputForm not being UnknownForm), but instead using the Dependency API. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-04-22Use private LinkedHashSets in DependencyManagerSchuyler Eldridge
Changes the DependencyManager to use the private[options] LinkedHashSet members that shadow the public Seq[_] dependencies. This should avoid some unnecessary set construction and also improves readability of the DependencyManager code. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-02-19Add optionalPrerequisites to Dependency APISchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-02-19Add dependency prettyPrint, visualization updatesSchuyler Eldridge
This adds a prettyPrint method to the DependencyManager to enable textual visualization of the TransformLikes that a DependencyManager determines need to be run. This also cleans up the GraphViz visualization with better edge coloring and now uses the `name` method when labeling graphviz nodes. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-02-19Support Singleton Dependencies (#1275)Albert Magyar
This makes a change to the Dependency API that breaks chisel3. This needs to [skip chisel tests], but is fixed with https://github.com/freechipsproject/chisel3/pull/1270. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
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-07-15Add type aliases for dependenciesSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2019-07-11Change Dependency API to Class[_ <: A]Schuyler Eldridge
This changes the Dependency API to specify dependencies in terms of classes subtyping the DependencyAPI trait. Previously, this was invariant which caused a bunch of ugly, unneeded .asInstanceOf jank. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2019-07-03Add DependencyManager and PhaseManagerSchuyler Eldridge
Adds the DependencyManager class which can be used to determine a legal sequence of TransformLikes given their Dependency API constraints. A DependencyManager determines an ordering that results in some target TransformLikes being run (without invalidations) given an initial state (some other set of TransformLikes). Algorithmically, this works as follows: 1. A DAG of TransformLikes w/ invalidation edges is constructed (the "invalidate graph") 2. A DAG of TransformLikes w/ prerequisite and dependent edges is constructed (the "dependents graph") 3. A toplogical sort of the dependents graph, seeded with the reverse topological sort of the invalidate graph, gives an ordering of TransformLikes. 4. This ordering is examined, node by node, cleaning up any mismatches between TransformLikes by solving DependencyManager sub-problems. As new graph nodes (which are classes) are found, these are lazily constructed. Data structures are maintained that map from classes to objects and back. All discovered classes will point to the same object. Determinism is maintained internally using LinkedHashMap and LinkedHashSet. Other changes: - Some methods that generate Graphviz for a DependencyManager are added. - One concrete implementation of a DependencyManager is added for Phases called "PhaseManager". Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>