Skip to content

Comments

Add verific -set interface for Yosys-Verific settings#5619

Open
dhvll wants to merge 4 commits intoYosysHQ:mainfrom
dhvll:verific-set-interface
Open

Add verific -set interface for Yosys-Verific settings#5619
dhvll wants to merge 4 commits intoYosysHQ:mainfrom
dhvll:verific-set-interface

Conversation

@dhvll
Copy link

@dhvll dhvll commented Jan 20, 2026

This PR introduces a verific -set command interface for managing Yosys-specific Verific options, similar to the existing verific -cfg for Verific runtime flags.

Implemented Features :

verific -set                    # List all settings with current/default values
verific -set <name>             # Show specific setting
verific -set <name> <value>     # Set a value
verific -set-reset              # Reset all to defaults

Usage Examples :
verific -set ignore_translate_off true
verific -set vlog_file_extensions ".v,.sv,.vh,.svh,.h,.inc"

ref: https://yosyshq.discourse.group/t/rfc-upstreaming-a-small-set-of-verific-frontend-options-from-silimate-fork/113

Introduce a new structure for managing Yosys-Verific settings, allowing users to get, set, and reset options related to Verific integration. Implement options for ignoring translate pragmas and specifying file extensions for SystemVerilog. Update command-line interface to support these settings, including help documentation for usage examples.
@mmicko mmicko self-assigned this Jan 20, 2026
Copy link
Member

@mmicko mmicko left a comment

Choose a reason for hiding this comment

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

Have to think if there is better way to store current/default data in general, but let's clean it first according to comments

@dhvll dhvll requested a review from mmicko January 20, 2026 12:44
@dhvll
Copy link
Author

dhvll commented Feb 6, 2026

hey @mmicko any update related to PR?

@mmicko
Copy link
Member

mmicko commented Feb 18, 2026

@KrystalDelusion Would appreciate another pair of eyes, also on user/docs perspective not just code part.

Copy link
Member

@KrystalDelusion KrystalDelusion left a comment

Choose a reason for hiding this comment

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

I would like the question about RemoveFileExt to be addressed before merging. The rest are minor/non-blocking.

goto check_error;
}

if (argidx < GetSize(args) && args[argidx] == "-set")
Copy link
Member

Choose a reason for hiding this comment

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

Being able to call verific -set <opt1> <val1> -set <opt2> <val2> might be a nice addition, but current behavior is consistent with verific -cfg so I don't think it's a requirement here.

case YosysVerificSettings::Type::BOOL:
log(" %s = %s (bool, default: %s)\n", name.c_str(),
opt.get<bool>() ? "true" : "false",
opt.get_default<bool>() ? "true" : "false");
Copy link
Member

Choose a reason for hiding this comment

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

Inconsistent with verific -cfg, but I think the inclusion of a default is an improvement.

break;
case YosysVerificSettings::Type::STRING:
log("verific -set %s \"%s\"\n", name.c_str(),
opt.get_default<std::string>().c_str());
Copy link
Member

Choose a reason for hiding this comment

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

I think this one is incorrect (it should be opt.get instead), but we don't have any Type::STRING options yet that would show it.

Comment on lines 213 to 214
// Remove default .v extension and add user-specified ones
veri_file::RemoveFileExt(".v");
Copy link
Member

Choose a reason for hiding this comment

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

Why do we remove ".v" here before adding the user ones? There is also a problem here where if we set (and apply) the setting, and then set it again we don't remove the previous extensions (nor does resetting it), requiring a full restart of Yosys to be able to remove an extension from being parsed as SystemVerilog.

Enhance YosysVerificSettings by introducing a vector to track applied SystemVerilog file extensions, ensuring stale mappings are removed before adding new extensions. Implement an apply_all method to apply all settings to Verific APIs after a reset, improving settings management and consistency.
@dhvll dhvll force-pushed the verific-set-interface branch from 7205c3b to 6435b4a Compare February 20, 2026 04:57
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.

3 participants