Repository navigation
API: auto-add top files + compile-order printout (0.3.0.dev1) - #13
Merged
Merged
Conversation
analyse(top_file=...) now parses and adds a top file not listed in the config instead of raising "not in the project", inferring the file type from its extension (new config.add_top_file_by_path / TOP_FILE_EXT_TYPES). This restores the old --top-file-type behaviour so a testbench top level need not be added to the config just to produce a basic compile order. Adds Resolver.verilog_include_dirs so an auto-added Verilog top can resolve its `include directives against the project's search dirs.
Bump __version__ from 0.2.0 to the PEP 440 development release 0.3.0.dev0 and add a CHANGELOG section for the top_file auto-add fix. The config-schema version (HDL_DEPENDS_VERSION_NUM) is independent and unchanged.
Add AnalysisResult.format_compile_order() -> str and AnalysisResult.print_compile_order(), giving API callers the same human-readable, tree-indented listing the CLI prints. AnalysisResult now retains the resolved SourceFile order in a non-serialised `source_files` field (to_dict()/JSON output unchanged); the shared rendering moves to output.format_compile_order, which output.print_compile_order and the CLI now delegate to. Add examples/python_api (analyse_example.py + a small VHDL project) as a runnable walkthrough of the API -- the compile-order printout and the top_file auto-add -- exercised by test_examples.py.
CHANGELOG section for the AnalysisResult compile-order printout API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
top_fileauto-add —analyse(top_file=...)now adds a file that isn't inthe config (type inferred from extension) instead of erroring, so testbench tops
needn't be listed.
hdldepends.analyse("hdldeps.yaml", top_file="sim/tb.vhd")Compile-order printout on
AnalysisResult— get the CLI's tree-indentedlisting from the API, as text or to stdout.
result.print_compile_order()/text = result.format_compile_order()