Added the 'apio graph' command which generates a svg graph of the verilog code. #356
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a new 'apio graph' command which uses yosys to generate, a hardware.svg file with a visual representation of a verilog module. By default it shows the top module and this can be changed with the --top-module flag.
This is the yosys command that generates the graph
https://yosyshq.readthedocs.io/projects/yosys/en/manual-rewrite/cmd/show.html
Caveats
The command requires the graphviz dot command to be in the path. Ideally this can auto installed in future versions of apio.
The command generates the hardware.svg file but doesn't launch automatically a viewer (any web browser would do). Need to find a cross platform way to do that.
The graphs are not perfect, but hopefully will be improved over time. For example per this feature request Please add a flag to generate a simplified graphviz diagram. YosysHQ/yosys#4236 or with additions of post optimization graphs.