Skip to content

Fix missing user objects in --lib-create mode. #3784

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

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

poemonsense
Copy link
Contributor

When Verilator is called with --lib-create and user-specified cpp files, it should generate make rules for these user objects.

Signed-off-by: Yinan Xu [email protected]

@poemonsense
Copy link
Contributor Author

Fix #3780

Copy link
Member

@wsnyder wsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks the fix seems reasonable.

Could you see if we can improve e.g. t_lib_prot.pl and t_lib_nolib.pl to check for this case, for example create a little t_lib_prot_c.cpp file that has a function in it, and add t_lib_prot_c.cpp to the verilator_flags2 command line when the library is made. That should fail without your patch then pass with it.

@poemonsense poemonsense force-pushed the patch-lib-create-objects branch 5 times, most recently from 479c44b to c8814be Compare November 29, 2022 07:51
@poemonsense
Copy link
Contributor Author

I've updated the t_lib_prot.pl test case, which fails before the last commit and succeeds after the fix.

Don't know really I did it in the correct way, but I found it not work as expected for the verilator_flags2. It seems verilator_flags2 will compile the simulation binary (elf) instead of a lib, where verilator always generates the objects rules.

@wsnyder
Copy link
Member

wsnyder commented Nov 29, 2022

Oh, test_regress has a special Makefile so that's conflicting, sorry about that suggestion. I guess I can take this without a test, so back out the test_regress changes and I'll merge, thanks.

When Verilator is called with `--lib-create` and user-specified cpp
files, it should generate make rules for these user objects.

Signed-off-by: Yinan Xu <[email protected]>
@poemonsense poemonsense force-pushed the patch-lib-create-objects branch from dd7a871 to bdbccfa Compare November 29, 2022 13:17
@poemonsense
Copy link
Contributor Author

Updated.

@wsnyder wsnyder merged commit ff9596b into verilator:master Nov 29, 2022
@poemonsense poemonsense deleted the patch-lib-create-objects branch November 29, 2022 14:06
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.

2 participants