3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-17 12:45:44 +00:00

Merge pull request #207 from Silimate/override_version_str

Allow override for version string
This commit is contained in:
Akash Levy 2026-07-08 20:22:47 -07:00 committed by GitHub
commit 5b0f0a266e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;