Skip to content

Conversation

@kroening
Copy link
Collaborator

@kroening kroening commented Dec 2, 2025

This adds an implementation of the ebmc_languaget interface for Verilog.

@kroening kroening force-pushed the verilog-language-api branch 2 times, most recently from 231757d to 113faf9 Compare December 3, 2025 02:21
@kroening kroening force-pushed the verilog-language-api branch from 113faf9 to 0741ed9 Compare December 22, 2025 21:57
@kroening kroening marked this pull request as ready for review December 22, 2025 21:58
Comment on lines 134 to 138
for(unsigned i = 0; i < cmdline.args.size(); i++)
{
if(parse(cmdline, cmdline.args[i], language_files, message_handler))
return true;
}
Copy link
Collaborator

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

Comment on lines 22 to 23
verilog_ebmc_languaget(cmdlinet &_cmdline, message_handlert &_message_handler)
: ebmc_languaget(_cmdline, _message_handler)
Copy link
Collaborator

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 &?

Copy link
Collaborator Author

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;
Copy link
Collaborator

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

Copy link
Collaborator Author

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;
Copy link
Collaborator

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.

Comment on lines +147 to +152
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");
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Comment on lines +54 to +64
// 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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, will do separately.

@kroening kroening force-pushed the verilog-language-api branch from 0741ed9 to 6fc2de8 Compare December 23, 2025 17:49
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.
@kroening kroening force-pushed the verilog-language-api branch from 6fc2de8 to 916ff1f Compare December 23, 2025 17:54
@kroening kroening merged commit 747ed9a into main Dec 23, 2025
11 checks passed
@kroening kroening deleted the verilog-language-api branch December 23, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants