You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a proposal to extend, or change, the current way header files are "tracked" by Bender.
Current implementation
Currently, header files are not tracked at all, i.e. Bender has no knowledge about the header files a design depends on. Instead, only the directories containing these files are tracked, as needed to update the search path for invoked tools, e.g. through incdir directives.
The include directories are manually tracked through the export_include_dirs entry in the package manifest.
Limitation
Through the flist command, Bender can be successfully used to generate dependency lists for use in Makefiles, at least including all source files a target depends on.
To properly encode all dependencies, header files would also have to be included in this list.
A first attempt to achieve this would be to recursively list all files under the include directories tracked by Bender. While this might obviously provide a gross approximation, the information might not even be complete, e.g. if a source file uses the following include directive ``include "../some_file.sv"`.
Proposal
To solve this, we could explicitly track header files in the manifest file. Include directories could then be specified manually using export_include_dirs, or derived from the header files themselves, e.g. as the parent directories of the specified header files.
I believe explicitly tracking the header files provided within a package would also be a good self-documenting practice.
The text was updated successfully, but these errors were encountered:
After some more experimentation, I was able to generate a dependency list using Verilator and sed.
This is a better approach, as the header prerequisites can be fully derived from the source files and include directories, removing the need to explicitly declare what header files are exported by a package, which would be in some sense redundant.
This is a proposal to extend, or change, the current way header files are "tracked" by Bender.
Current implementation
Currently, header files are not tracked at all, i.e. Bender has no knowledge about the header files a design depends on. Instead, only the directories containing these files are tracked, as needed to update the search path for invoked tools, e.g. through
incdir
directives.The include directories are manually tracked through the
export_include_dirs
entry in the package manifest.Limitation
Through the
flist
command, Bender can be successfully used to generate dependency lists for use in Makefiles, at least including all source files a target depends on.To properly encode all dependencies, header files would also have to be included in this list.
A first attempt to achieve this would be to recursively list all files under the include directories tracked by Bender. While this might obviously provide a gross approximation, the information might not even be complete, e.g. if a source file uses the following include directive ``include "../some_file.sv"`.
Proposal
To solve this, we could explicitly track header files in the manifest file. Include directories could then be specified manually using
export_include_dirs
, or derived from the header files themselves, e.g. as the parent directories of the specified header files.I believe explicitly tracking the header files provided within a package would also be a good self-documenting practice.
The text was updated successfully, but these errors were encountered: