3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-13 13:11:27 +00:00

review fixes

This commit is contained in:
Marcin Kościelnicki 2019-08-13 00:35:54 +00:00
parent f4c62f33ac
commit c6d5b97b98
4 changed files with 34 additions and 47 deletions

View file

@ -32,19 +32,6 @@ void split_portname_pair(std::string &port1, std::string &port2)
}
}
std::vector<std::string> split(std::string text, const char *delim)
{
std::vector<std::string> list;
char *p = strdup(text.c_str());
char *t = strtok(p, delim);
while (t != NULL) {
list.push_back(t);
t = strtok(NULL, delim);
}
free(p);
return list;
}
struct IopadmapPass : public Pass {
IopadmapPass() : Pass("iopadmap", "technology mapping of i/o pads (or buffers)") { }
void help() YS_OVERRIDE
@ -190,7 +177,7 @@ struct IopadmapPass : public Pass {
auto it = module->attributes.find("\\iopad_external_pin");
if (it != module->attributes.end()) {
auto value = it->second.decode_string();
for (auto name : split(value, ",")) {
for (auto name : split_tokens(value, ",")) {
ignore.insert(make_pair(module->name, RTLIL::escape_id(name)));
}
}