3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-10-11 02:08:08 +00:00

driver: add --no-private-id-locs and NEWER_ID

This commit is contained in:
Emil J. Tywoniak 2025-09-16 17:41:55 +02:00
parent c0577890f0
commit 6b9082fa64
3 changed files with 29 additions and 1 deletions

View file

@ -82,6 +82,7 @@ YOSYS_NAMESPACE_BEGIN
int autoidx = 1;
int yosys_xtrace = 0;
bool yosys_write_versions = true;
bool yosys_private_id_locs = true;
const char* yosys_maybe_version() {
if (yosys_write_versions)
return yosys_version_str;
@ -272,6 +273,16 @@ void yosys_shutdown()
}
RTLIL::IdString new_id(std::string file, int line, std::string func)
{
return newer_id(file, line, func);
}
RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std::string suffix)
{
return newer_id_suffix(file, line, func, suffix);
}
RTLIL::IdString newer_id(std::string file, int line, std::string func)
{
#ifdef _WIN32
size_t pos = file.find_last_of("/\\");
@ -288,7 +299,7 @@ RTLIL::IdString new_id(std::string file, int line, std::string func)
return stringf("$auto$%s:%d:%s$%d", file, line, func, autoidx++);
}
RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std::string suffix)
RTLIL::IdString newer_id_suffix(std::string file, int line, std::string func, std::string suffix)
{
#ifdef _WIN32
size_t pos = file.find_last_of("/\\");