-
Notifications
You must be signed in to change notification settings - Fork 20
ebmc language interface implementation for Verilog #1454
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
Conversation
231757d to
113faf9
Compare
113faf9 to
0741ed9
Compare
| for(unsigned i = 0; i < cmdline.args.size(); i++) | ||
| { | ||
| if(parse(cmdline, cmdline.args[i], language_files, message_handler)) | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code modernisation: use ranged for
src/verilog/verilog_ebmc_language.h
Outdated
| verilog_ebmc_languaget(cmdlinet &_cmdline, message_handlert &_message_handler) | ||
| : ebmc_languaget(_cmdline, _message_handler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be const cmdlinet &?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but will require change to base class; will do with separate PR.
| } | ||
|
|
||
| // produce the transition system, and return it | ||
| std::optional<transition_systemt> transition_system() override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should likely be marked nodiscard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, will go into base class.
| return {}; | ||
| } | ||
|
|
||
| transition_systemt transition_system; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd move that declaration closer to where it will actually be used.
| std::string top_module; | ||
|
|
||
| if(cmdline.isset("module")) | ||
| top_module = cmdline.get_value("module"); | ||
| else if(cmdline.isset("top")) | ||
| top_module = cmdline.get_value("top"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it ok if top_module remains unset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, get_module handles that.
| // do -I | ||
| if(cmdline.isset('I')) | ||
| options.set_option("I", cmdline.get_values('I')); | ||
|
|
||
| options.set_option("force-systemverilog", cmdline.isset("systemverilog")); | ||
|
|
||
| // do -D | ||
| if(cmdline.isset('D')) | ||
| options.set_option("defines", cmdline.get_values('D')); | ||
|
|
||
| language->set_language_options(options, message_handler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have rather similar code in parse below, perhaps this should be factored out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will do separately.
0741ed9 to
6fc2de8
Compare
It is unlikely that a language will want to modify the command line; hence, pass a const reference.
This adds an implementation of the ebmc_languaget interface for Verilog.
6fc2de8 to
916ff1f
Compare
This adds an implementation of the
ebmc_languagetinterface for Verilog.