mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-20 21:03:40 +00:00
stoi -> atoi
This commit is contained in:
parent
ee7c970367
commit
48d0f99406
41 changed files with 121 additions and 121 deletions
|
@ -343,7 +343,7 @@ std::string remap_name(RTLIL::IdString abc_name, RTLIL::Wire **orig_wire = nullp
|
|||
abc_sname.erase(0, 5);
|
||||
if (std::isdigit(abc_sname.at(0)))
|
||||
{
|
||||
int sid = std::stoi(abc_sname);
|
||||
int sid = std::atoi(abc_sname.c_str());
|
||||
size_t postfix_start = abc_sname.find_first_not_of("0123456789");
|
||||
std::string postfix = postfix_start != std::string::npos ? abc_sname.substr(postfix_start) : "";
|
||||
|
||||
|
@ -1564,10 +1564,10 @@ struct AbcPass : public Pass {
|
|||
size_t pos = arg.find_first_of(':');
|
||||
int lut_mode = 0, lut_mode2 = 0;
|
||||
if (pos != string::npos) {
|
||||
lut_mode = std::stoi(arg.substr(0, pos));
|
||||
lut_mode2 = std::stoi(arg.substr(pos+1));
|
||||
lut_mode = std::atoi(arg.substr(0, pos).c_str());
|
||||
lut_mode2 = std::atoi(arg.substr(pos+1).c_str());
|
||||
} else {
|
||||
lut_mode = std::stoi(arg);
|
||||
lut_mode = std::atoi(arg.c_str());
|
||||
lut_mode2 = lut_mode;
|
||||
}
|
||||
lut_costs.clear();
|
||||
|
@ -1584,10 +1584,10 @@ struct AbcPass : public Pass {
|
|||
if (GetSize(parts) == 0 && !lut_costs.empty())
|
||||
lut_costs.push_back(lut_costs.back());
|
||||
else if (GetSize(parts) == 1)
|
||||
lut_costs.push_back(std::stoi(parts.at(0)));
|
||||
lut_costs.push_back(atoi(parts.at(0).c_str()));
|
||||
else if (GetSize(parts) == 2)
|
||||
while (GetSize(lut_costs) < std::stoi(parts.at(0)))
|
||||
lut_costs.push_back(std::stoi(parts.at(1)));
|
||||
while (GetSize(lut_costs) < std::atoi(parts.at(0).c_str()))
|
||||
lut_costs.push_back(atoi(parts.at(1).c_str()));
|
||||
else
|
||||
log_cmd_error("Invalid -luts syntax.\n");
|
||||
}
|
||||
|
|
|
@ -999,8 +999,8 @@ struct Abc9Pass : public Pass {
|
|||
size_t pos = arg.find_first_of(':');
|
||||
int lut_mode = 0, lut_mode2 = 0;
|
||||
if (pos != string::npos) {
|
||||
lut_mode = std::stoi(arg.substr(0, pos));
|
||||
lut_mode2 = std::stoi(arg.substr(pos+1));
|
||||
lut_mode = atoi(arg.substr(0, pos).c_str());
|
||||
lut_mode2 = atoi(arg.substr(pos+1).c_str());
|
||||
} else {
|
||||
pos = arg.find_first_of('.');
|
||||
if (pos != string::npos) {
|
||||
|
@ -1010,7 +1010,7 @@ struct Abc9Pass : public Pass {
|
|||
lut_file = std::string(pwd) + "/" + lut_file;
|
||||
}
|
||||
else {
|
||||
lut_mode = std::stoi(arg);
|
||||
lut_mode = atoi(arg.c_str());
|
||||
lut_mode2 = lut_mode;
|
||||
}
|
||||
}
|
||||
|
@ -1028,10 +1028,10 @@ struct Abc9Pass : public Pass {
|
|||
if (GetSize(parts) == 0 && !lut_costs.empty())
|
||||
lut_costs.push_back(lut_costs.back());
|
||||
else if (GetSize(parts) == 1)
|
||||
lut_costs.push_back(std::stoi(parts.at(0)));
|
||||
lut_costs.push_back(atoi(parts.at(0).c_str()));
|
||||
else if (GetSize(parts) == 2)
|
||||
while (GetSize(lut_costs) < std::stoi(parts.at(0)))
|
||||
lut_costs.push_back(std::stoi(parts.at(1)));
|
||||
while (GetSize(lut_costs) < atoi(parts.at(0).c_str()))
|
||||
lut_costs.push_back(atoi(parts.at(1).c_str()));
|
||||
else
|
||||
log_cmd_error("Invalid -luts syntax.\n");
|
||||
}
|
||||
|
|
|
@ -304,7 +304,7 @@ struct Dff2dffePass : public Pass {
|
|||
}
|
||||
if (args[argidx] == "-unmap-mince" && argidx + 1 < args.size()) {
|
||||
unmap_mode = true;
|
||||
min_ce_use = std::stoi(args[++argidx]);
|
||||
min_ce_use = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-direct" && argidx + 2 < args.size()) {
|
||||
|
|
|
@ -476,16 +476,16 @@ struct ExtractPass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-mine_cells_span" && argidx+2 < args.size()) {
|
||||
mine_cells_min = std::stoi(args[++argidx]);
|
||||
mine_cells_max = std::stoi(args[++argidx]);
|
||||
mine_cells_min = atoi(args[++argidx].c_str());
|
||||
mine_cells_max = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-mine_min_freq" && argidx+1 < args.size()) {
|
||||
mine_min_freq = std::stoi(args[++argidx]);
|
||||
mine_min_freq = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-mine_limit_matches_per_module" && argidx+1 < args.size()) {
|
||||
mine_limit_mod = std::stoi(args[++argidx]);
|
||||
mine_limit_mod = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-mine_split" && argidx+2 < args.size()) {
|
||||
|
@ -494,7 +494,7 @@ struct ExtractPass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-mine_max_fanout" && argidx+1 < args.size()) {
|
||||
mine_max_fanout = std::stoi(args[++argidx]);
|
||||
mine_max_fanout = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-verbose") {
|
||||
|
|
|
@ -613,7 +613,7 @@ struct ExtractCounterPass : public Pass {
|
|||
|
||||
if (args[argidx] == "-maxwidth" && argidx+1 < args.size())
|
||||
{
|
||||
maxwidth = std::stoi(args[++argidx]);
|
||||
maxwidth = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -580,11 +580,11 @@ struct ExtractFaPass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-d" && argidx+2 < args.size()) {
|
||||
config.maxdepth = std::stoi(args[++argidx]);
|
||||
config.maxdepth = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-b" && argidx+2 < args.size()) {
|
||||
config.maxbreadth = std::stoi(args[++argidx]);
|
||||
config.maxbreadth = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1525,12 +1525,12 @@ struct FlowmapPass : public Pass {
|
|||
{
|
||||
if (args[argidx] == "-maxlut" && argidx + 1 < args.size())
|
||||
{
|
||||
order = std::stoi(args[++argidx]);
|
||||
order = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-minlut" && argidx + 1 < args.size())
|
||||
{
|
||||
minlut = std::stoi(args[++argidx]);
|
||||
minlut = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-cells" && argidx + 1 < args.size())
|
||||
|
@ -1545,23 +1545,23 @@ struct FlowmapPass : public Pass {
|
|||
}
|
||||
if (args[argidx] == "-r-alpha" && argidx + 1 < args.size())
|
||||
{
|
||||
r_alpha = std::stoi(args[++argidx]);
|
||||
r_alpha = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-r-beta" && argidx + 1 < args.size())
|
||||
{
|
||||
r_beta = std::stoi(args[++argidx]);
|
||||
r_beta = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-r-gamma" && argidx + 1 < args.size())
|
||||
{
|
||||
r_gamma = std::stoi(args[++argidx]);
|
||||
r_gamma = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-optarea" && argidx + 1 < args.size())
|
||||
{
|
||||
relax = true;
|
||||
optarea = std::stoi(args[++argidx]);
|
||||
optarea = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-debug")
|
||||
|
|
|
@ -676,14 +676,14 @@ struct MuxcoverPass : public Pass {
|
|||
{
|
||||
const auto &arg = args[argidx];
|
||||
if (arg.size() >= 6 && arg.substr(0,6) == "-mux2=") {
|
||||
cost_mux2 = std::stoi(arg.substr(6));
|
||||
cost_mux2 = atoi(arg.substr(6).c_str());
|
||||
continue;
|
||||
}
|
||||
if (arg.size() >= 5 && arg.substr(0,5) == "-mux4") {
|
||||
use_mux4 = true;
|
||||
if (arg.size() > 5) {
|
||||
if (arg[5] != '=') break;
|
||||
cost_mux4 = std::stoi(arg.substr(6));
|
||||
cost_mux4 = atoi(arg.substr(6).c_str());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -691,7 +691,7 @@ struct MuxcoverPass : public Pass {
|
|||
use_mux8 = true;
|
||||
if (arg.size() > 5) {
|
||||
if (arg[5] != '=') break;
|
||||
cost_mux8 = std::stoi(arg.substr(6));
|
||||
cost_mux8 = atoi(arg.substr(6).c_str());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -699,12 +699,12 @@ struct MuxcoverPass : public Pass {
|
|||
use_mux16 = true;
|
||||
if (arg.size() > 6) {
|
||||
if (arg[6] != '=') break;
|
||||
cost_mux16 = std::stoi(arg.substr(7));
|
||||
cost_mux16 = atoi(arg.substr(7).c_str());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (arg.size() >= 6 && arg.substr(0,6) == "-dmux=") {
|
||||
cost_dmux = std::stoi(arg.substr(6));
|
||||
cost_dmux = atoi(arg.substr(6).c_str());
|
||||
continue;
|
||||
}
|
||||
if (arg == "-nodecode") {
|
||||
|
|
|
@ -163,7 +163,7 @@ struct NlutmapPass : public Pass {
|
|||
vector<string> tokens = split_tokens(args[++argidx], ",");
|
||||
config.luts.clear();
|
||||
for (auto &token : tokens)
|
||||
config.luts.push_back(std::stoi(token));
|
||||
config.luts.push_back(atoi(token.c_str()));
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-assert") {
|
||||
|
|
|
@ -655,19 +655,19 @@ struct ShregmapPass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-minlen" && argidx+1 < args.size()) {
|
||||
opts.minlen = std::stoi(args[++argidx]);
|
||||
opts.minlen = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-maxlen" && argidx+1 < args.size()) {
|
||||
opts.maxlen = std::stoi(args[++argidx]);
|
||||
opts.maxlen = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-keep_before" && argidx+1 < args.size()) {
|
||||
opts.keep_before = std::stoi(args[++argidx]);
|
||||
opts.keep_before = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-keep_after" && argidx+1 < args.size()) {
|
||||
opts.keep_after = std::stoi(args[++argidx]);
|
||||
opts.keep_after = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-tech" && argidx+1 < args.size() && opts.tech == nullptr) {
|
||||
|
|
|
@ -1072,7 +1072,7 @@ struct TechmapPass : public Pass {
|
|||
continue;
|
||||
}
|
||||
if (args[argidx] == "-max_iter" && argidx+1 < args.size()) {
|
||||
max_iter = std::stoi(args[++argidx]);
|
||||
max_iter = atoi(args[++argidx].c_str());
|
||||
continue;
|
||||
}
|
||||
if (args[argidx] == "-D" && argidx+1 < args.size()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue