3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-14 14:55:26 +00:00

driver: add --hash-seed

This commit is contained in:
Emil J. Tywoniak 2024-10-01 16:02:41 +02:00
parent d071489ab1
commit 953508f6d2
5 changed files with 21 additions and 35 deletions

View file

@ -18,6 +18,7 @@
*/
#include "kernel/yosys.h"
#include "kernel/hashlib.h"
#include "libs/sha1/sha1.h"
#include "libs/cxxopts/include/cxxopts.hpp"
#include <iostream>
@ -282,6 +283,8 @@ int main(int argc, char **argv)
("M,randomize-pointers", "will slightly randomize allocated pointer addresses. for debugging")
("autoidx", "start counting autoidx up from <seed>, similar effect to --hash-seed",
cxxopts::value<uint64_t>(), "<idx>")
("hash-seed", "mix up hashing values with <seed>, for extreme optimization and testing",
cxxopts::value<uint64_t>(), "<seed>")
("A,abort", "will call abort() at the end of the script. for debugging")
("x,experimental", "do not print warnings for the experimental <feature>",
cxxopts::value<std::vector<std::string>>(), "<feature>")
@ -437,6 +440,10 @@ int main(int argc, char **argv)
int idx = result["autoidx"].as<uint64_t>();
autoidx = idx;
}
if (result.count("hash-seed")) {
int seed = result["hash-seed"].as<uint64_t>();
Hasher::set_fudge((Hasher::hash_t)seed);
}
if (log_errfile == NULL) {
log_files.push_back(stdout);