aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/firrtl/graph
AgeCommit message (Collapse)Author
2021-02-17Allow Side Effecting Statement to have Names (#2057)Kevin Laeufer
* firrtl: add optional statement labels for stop, printf, assert, assume and cover * test: parsing of statement labels * ir: ensure that name is properly retained * SymbolTable: add support for labled statements * test: parsing statement labels * test: lower types name collisions with named statements * ignore empty names * Inline: deal with named and unnamed statements * RemoveWires: treat stop, printf and verification statements as "others" * test: fix InlineInstance tests * DeadCodeEliminations: statements are now als declarations * CheckHighForm: ensure that statement names are not used as references * CheckSpec: throw error if statement name collides * add pass to automatically add missing statement names * check: make sure that two statements cannot have the same name * stmtLabel -> stmtName * scalafmt * add statement names to spec * spec: meta data -> metadata * EnsureStatementNames: explain naming algorithm * remove returns * better namespace use * ir: add CanBeReferenced trait * ir: add newline as jack requested
2021-02-16Add DiGraph factory method and prettyTreeJack Koenig
* New factory method enables direct construction of DiGraphs from edges * DiGraph.prettyTree enables visualization of tree or multi-tree diagraphs
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-07-31[WIP] Implement CircuitGraph and IRLookup to firrtl.analyses (#1603)Jiuyang Liu
* WIP Commit * Add EdgeDataDiGraph with views to amortize graph construction * WIP, got basic structure, need tests to pipeclean * First tests pass. Need more. * Tests pass, more need to be written * More tests pass! Things should work, except for memories * Added clearPrev to fix digraph uses where caching prev breaks * Removed old Component. Documented IRLookup * Added comments. Make prev arg to getEdges * WIP: Refactoring for CircuitGraph * Refactored into CircuitGraph. Can do topological module analysis * Removed old versions * Added support for memories * Added cached test * More stufffff * Added implicit caching of connectivity * Added tests for IRLookup, and others * Many major changes. Replaced CircuitGraph as ConnectionGraph Added CircuitGraph to be top-level user-facing object ConnectionGraph now automatically shortcuts getEdges ConnectionGraph overwrites BFS as PriorityBFS Added leafModule to Target Added lookup by kind to IRLookup Added more tests * Reordered stuff in ConnectionGraph * Made path work with deep hierarchies. Added PML for IllegalClockCrossings * Made pathsInDAG work with current shortcut semantics * Bugfix: check pathless targets when shortcutting paths * Added documentation/licenses * Removed UnnamedToken and related functionality * Added documentation of ConnectionGraph * Added back topo, needed for correct solving of intermediate modules * Bugfix. Cache intermediate clockSources from same BFS with same root, but not BFS with different root * Added literal/invalid clock source, and unknown top for getclocksource * Bugfix for clocks in bundles * Add CompleteTargetSerializer and test * remove ClockFinder, be able to compile. * test is able to compile, but need to fix. * public and abstract DiGraph, remove DiGraphLike. * revert some DiGraph code, ConnectionGraphSpec passed. * CircuitGraphSpec passed. * minimize diff between master * codes clean up * override linearize and revert DiGraph * keep DiGraph unchanged. * make ci happy again. * codes clean up. * bug fix for rebase * remove wir * make scaladoc happy again. * update for review. * add some documentation. * remove tag * wip IRLookup * code clean up and add some doucmentations. * IRLookup cache with ModuleTarget guarded. * make unidoc and 2.13 happy Co-authored-by: Adam Izraelevitz <azidar@gmail.com> Co-authored-by: Albert Magyar <albert.magyar@gmail.com> Co-authored-by: Jack Koenig <koenig@sifive.com>
2020-07-29[2.13] convert toSeq and toMap where necessary to compileKevin Laeufer
2020-03-26Eliminate warnings on `sbt doc` and `sbt unidoc` (#1470)Chick Markley
* Eliminate warnings on `sbt doc` and `sbt unidoc` - removed toFirrtl reference on MultiTargetAnnotation - lots of places where package path has to be added to comment references - Change to use `/** text starts here` convention when wrong in comment with a doc fix. - Did not exhaustively change these - Wrestled doc example in RenderDiGraph#renderNode, not sure if I won - Cleaned up InferWidths & CatchExceptions imports - Added missing license message to a couple of files. - fixed a couple of stale parameter names in scaladoc - Added @unchecked to stop erasure warning in Emitting where emission annotations are collected - Change types to [_] on match in RenameMap#recordAll to fix erasure warning * Where possible change [[firrtl.ir.X]] to [[firrtl.ir.X X]] for better display in scaladoc Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-10Fix copy-paste error in DiGraph.linearize documentation (#1324)Sahand Kashani-Akhavan
Co-authored-by: Albert Magyar <albert.magyar@gmail.com>
2020-03-02Remove DiGraph.seededLinearize (#1413)Schuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-02-18Update reachableFrom ScalaDocAlbert Magyar
2019-10-24Add EdgeData trait to mix in to graphsAlbert Magyar
* Add Scaladoc for EdgeData API * Include stringified vertices in EdgeNotFoundException
2019-07-08Remove some warnings (#1118)Leway Colin
2019-07-03Add seeded topological sort to DiGraphSchuyler Eldridge
This adds a method to DiGraph called "seededLinearize". This generalizes the original topological sort ("linearize") to be parametric in an initial set of vertices. This enables the user to massage the DFS to produce a better topological sort if they have information about how the DFS should proceed. The initial set of vertices is expected to be made ordered via a LinkedHashSet. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2019-02-27Create a simple generic GraphViz renderer for DiGraph (#1034)Chick Markley
* Create a simple generic graphviz renderer for DiGraph There are three basic kinds - A simple default renderer - A ranked renderer that places nodes in columns based on depth from sources - A sub-graph render for graphs that contain a loop - Renders just nodes that are part of first loop found - Plus the neighbors of the loop - Loop edges are shown in red. * Create a simple generic graphviz renderer for DiGraph - Moved the graph loop finder into DiGraph - Fixed scala doc per Edward's comments
2018-12-12Remove side effect from DiGraph summationSchuyler Eldridge
This fixes a bug where DiGraph summation (using the `+` operator) would mutate the DiGraph. This occurred because the underlying edges set was not being cloned. This is fixed to explicitly clone the underlying edges set. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-07-11Make InstanceGraph have deterministic and use defined iteration order (#843)Jack Koenig
2018-06-08Add a blacklist option for paths (#810)Colin Schmidt
Useful if you want to find out how a node was reachable and you used a blacklist during the reachability analysis
2018-04-11Make DiGraph.linearize be iterative instead of recursive (#785)Jack Koenig
Also make DiGraphTests more ScalaTest-y
2018-04-02CyclicException identifies a problem node. (#778)Chick Markley
Needed for special handling in Treadle. Small refactor that allows users of DiGraph#linearize to return the first node found in a cycle. Fixed RemoveWiresTransfrom to handle this. Added test to show usage of this feature.
2018-03-21GroupModule Transform (#766)Adam Izraelevitz
* Added grouping pass * Added InfoMagnet and infomappers * Changed return type of execute to allow final CircuitState inspection * Updated dedup. Now is name-agnostic * Added GroupAndDedup transform
2018-02-23Add graph summation "+" to DiGraph (#744)Schuyler Eldridge
* Add DiGraph sum and DiGraph sum test Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Make DiGraph sum deterministic Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Remove ordered hashes/sets from DiGraphTests Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-02-07Fix EulerTour for circuits with one module (#736)Schuyler Eldridge
A circuit with a single module would fail to properly compute BV RMQs due to a divide by zero bug. This changes the computation of the number of blocks an Euler Tour is broken up into to be, at minimum, one. This also changes one of the test cases ("wire with source and sink in the same module") to exercise this. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-01-15WiringTransform Refactor (#648)Schuyler Eldridge
Massive refactoring to WiringTransform with the use of a new EulerTour class to speed things up via fast least common ancestor (LCA) queries. Changes include (but are not limited to): * Use lowest common ancestor when wiring * Add EulerTour class with naive and Berkman-Vishkin RMQ * Adds LCA method for Instance Graph * Enables "Two Sources" using "Top" wiring test as this is now valid * Remove TopAnnotation from WiringTransform * Represent WiringTransform sink as `Seq[Named]` * Remove WiringUtils.countInstances, fix imports * Support sources under sinks in WiringTransform * Enable internal module wiring * Support Wiring of Aggregates h/t @edcote fixes #728 Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> Reviewed-by: Jack Koenig<jack.koenig3@gmail.com>
2017-12-20Fix bug in ConstProp where module dependency edges were dropped (#696)Jack Koenig
This resulted in parent modules sometimes being constant proppagated before a child module. If the child module has a constant driving one of its outputs, the parent module would thus not see the constant. This resulted in strange unstable constant propagation behavior where sometimes constant outputs would not propagate. Also add test illustrating why this occurs with uses of InstanceGraph
2017-11-16Move digraph exceptions out of digraph class (#688)Albert Magyar
2017-11-10Make digraph methods deterministic (#653)Albert Magyar
2017-09-12Make pathsInDAG walk all possible paths (#655)Schuyler Eldridge
* Make pathsInDAG walk all possible paths Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Use linearization order when finding all paths in DAG
2017-07-14Fix bug in DiGraph.reverse on an graph with one vertex, no edges (#628)Jack Koenig
2017-04-03Find a single cycle from potentially many in a combinational SCCAlbert Magyar
2017-03-30Change findSCCs to iterative implementation (#513)Albert Magyar
2017-03-17Add utilites for digraphs and netlist analysesAlbert Magyar