3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 03:35:40 +00:00

Allow override for version string

This commit is contained in:
Akash Levy 2026-07-08 19:14:47 -07:00
parent ae74af906a
commit 1c0cf67479
2 changed files with 11 additions and 3 deletions

View file

@ -86,11 +86,18 @@ YOSYS_NAMESPACE_BEGIN
Autoidx autoidx(1);
int yosys_xtrace = 0;
bool yosys_write_versions = true;
static std::string yosys_version_override;
const char* yosys_maybe_version() {
if (yosys_write_versions)
return yosys_version_str;
else
if (!yosys_write_versions)
return "Yosys";
if (!yosys_version_override.empty())
return yosys_version_override.c_str();
return yosys_version_str;
}
void yosys_set_version_str(const std::string &s) {
yosys_version_override = s;
}
RTLIL::Design *yosys_design = NULL;

View file

@ -83,6 +83,7 @@ extern std::set<std::string> yosys_input_files, yosys_output_files;
extern const char *yosys_version_str;
extern const char *yosys_git_hash_str;
const char* yosys_maybe_version();
void yosys_set_version_str(const std::string &s);
// from passes/cmds/design.cc
extern std::map<std::string, RTLIL::Design*> saved_designs;