-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Hierarchical netlists #92
base: master
Are you sure you want to change the base?
Conversation
Awesome! This will take me a little bit to review. Some first impressions: Rather than using another config file, just pass configuration through the skin file. Options like color can be done in CSS of the skin file if the generated SVG elements have a class names and IDs. |
I agree that the styling options, like colour, are better suited for the skin file. The skin file is, as far as I know, less suited for the other options, as it is more difficult to add lists (which are used to define which modules to expand). It might also get cluttered when more options are added, because it is not possible to create sections as I did in the JSON configuration file. The main reason I've chosen for a separate JSON file for the configuration options is that it is easy to use and suitable for all options that were planned. As the options can be divided in sections, I think it would be less cluttered and easier to understand. I think it would be best to have all skin and style related options in the skin file and to have a separate file for the other configuration options. Another option that can be considered is the use of command line arguments, which would be easy to explain via an |
This is a great feature! When it will be available in |
It probably will not be available in the main branch. I am not actively developing this anymore, as this feature was part of a university project, for which this version was sufficient. The main branch is only maintained, so small bugs get fixed, but no new features are in development afaik. There are multiple reasons that netlistsvg is in maintenance mode. The main reasons are the limitations from the layout engine and a messy code base. Regarding the second question, the core functionality of hierarchical netlists is fully implemented. Some issues, which are also in the main branch, still remain (e.g. #93). The main point which may require some work are the configuration options, when it is decided that they should not be in a separate configuration file. Another point which may require some work is the routing of wires, but this is mostly done by the layout engine, and thus hard to influence. |
Yeah... Sorry about that. I shouldve been more on top of this and netlistsvg is quite messy and does need a cleanup. I haven't spent much time on it for the past ahem years. Thank you, @djwubs for contributing this PR and good luck on your future endeavors. The code quality for the PR looks sound from what I've looked over but I haven't reviewed it too closely. I could probably get it across the finish line. Or honestly anybody else could look it over, tell me it looks good to them, resolve the conflicts and I'd believe then and get it merged. I think it's important that code is reviewed but I'm not picky about who reviews it. So if someone else assures me it's fine and resolves the merge conflicts then I'm happy. |
I have merged this with the current master on my fork here, fixing merge issues. I've tested it extensively and the only issue I've run into is a stack frame overflow due to there being too many nodes/edges in a drawing. Otherwise, I think this works well. I'm not sure if I should make a new PR or have someone change this PR to that branch. |
I have a problem with signal names (right side in the graph).
|
Hierarchical netlists
This adds support for hierarchical netlists (#64). It is now possible to show the inner schematic of the submodules. The settings for the hierarchy are controlled by a configuration file, which is explained in the next subsection. This configuration file can be passed to netlistsvg, otherwise it selects the default configuration file, which has hierarchy turned off. This is the new command line format:
A simple example of an hierarchical netlist is shown below.
JSON Source
Configuration file
Besides the support for hierarchical netlists, some other minor changes have been made, which are listed in the changelog.
Configuration file
The configuration contains multiple options to customize the layout. The default configuration file turns off hierarchy and uses the top defined in the input JSON file. The default configuration file can be found in the lib directory and looks like this:
In the
"hierarchy"
subsection, hierarchical schematics can be enabled and configured. The options contained in this subsection are:"enable"
: In this option the hierarchy can be enabled. There are four different options."off"
turns of the hierarchy,"all"
expands all submodules,"level"
expands all submodules until a specified level of hierarchy and"modules"
expands all specified submodules."expandLevel"
: The maximum level until which submodules are expanded for the"level"
option."expandModules"
: The modules which will be expanded for the"modules"
option. Through the suboptions, it is possible to expand based on the module type using"types"
and on the module name using"ids"
."colour"
: This option defines the background colour used for the submodules. If there are more colours in the list, each colour is used for deeper level of hierarchy.The
"top"
subsection can be used to define a different top module. If"enable"
is true, then the module defined in"module"
will be used as top module, instead of the top module defined in the input JSON file.Changelog
Status
Currently, this is ready for review. It has been tested on multiple inputs, ranging from small to large designs. The main functionality is working properly.
The main improvement which may be necessary before merging is the routing of wires. For the larger designs, wires take a lot of strange detours, but this is already the case for large non hierarchical designs. Since the layout is done by elkjs, it is hard to improve this.