feat(verilator): Support Verilator target build to shared library#6281
Merged
waruqi merged 1 commit intoxmake-io:devfrom Apr 7, 2025
Merged
feat(verilator): Support Verilator target build to shared library#6281waruqi merged 1 commit intoxmake-io:devfrom
waruqi merged 1 commit intoxmake-io:devfrom
Conversation
Signed-off-by: wenjiu <2784307979@qq.com>
Member
|
wait for #6209 We need to add support for the new jobgraph to replace batchjobs |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for building the Verilator target into a shared library by adding a new simulation main file for testing purposes.
- Added sim_main.cpp to initialize simulation using VerilatedContext and a hello instance.
- Implements the simulation loop to run until completion.
Files not reviewed (3)
- tests/projects/embed/verilator/shared/src/main.v: Language not supported
- tests/projects/embed/verilator/shared/xmake.lua: Language not supported
- xmake/rules/verilator/xmake.lua: Language not supported
Comments suppressed due to low confidence (2)
tests/projects/embed/verilator/shared/src/sim_main.cpp:7
- [nitpick] Consider using std::unique_ptr to manage the lifetime of VerilatedContext, which can improve exception safety and simplify resource cleanup.
VerilatedContext* contextp = new VerilatedContext;
tests/projects/embed/verilator/shared/src/sim_main.cpp:9
- [nitpick] Consider using std::unique_ptr for the hello instance to take advantage of RAII, reducing the risk of memory leaks if an exception is thrown.
hello* top = new hello{contextp};
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.
close #6280