Skip to content
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

verilog: adds support for include headers #367

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

filmil
Copy link

@filmil filmil commented Nov 11, 2024

Include headers should not appear in the verilator command line, but should be available in the compilation sandbox.

It seems that verilator rules did not allow hdrs files into the sandbox, so this change fixes the issue.

Furthermore, very often core authors use the include directive to read an include file from the directory where the include file is located:

`include "file.h"

This will not work in bazel, because the expected include path is:

`include "directory/where/file/resides/file.h"

This rule adds the includes parameter to verilog_library to allow the user to specify a set of include directories, therefore allowing verilation of included cores.

The verilator_cc_library rules is fixed to suport this. It is also fixed to use the hdrs files as inputs to the verilation rule.

Include headers should not appear in the verilator command
line, but should be available in the compilation sandbox.

It seems that verilator rules did not allow `hdrs` files into
the sandbox, so this change fixes the issue.

Furthermore, very often core authors use the include directive
to read an include file from the directory where the include
file is located:

```
`include "file.h"
```

This will not work in bazel, because the expected include path is:

```
`include "directory/where/file/resides/file.h"
```

This rule adds the `includes` parameter to `verilog_library` to allow
the user to specify a set of include directories, therefore allowing
verilation of included cores.

The `verilator_cc_library` rules is fixed to suport this. It is also
fixed to use the `hdrs` files as inputs to the verilation rule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant