aboutsummaryrefslogtreecommitdiffstats
path: root/passes/techmap/clkbufmap.cc
diff options
context:
space:
mode:
authorMarcin Kościelnicki <koriakin@0x04.net>2019-08-13 00:35:54 +0000
committerMarcin Kościelnicki <koriakin@0x04.net>2019-08-13 00:35:54 +0000
commitc6d5b97b98e6edc395ee14ad60430f7ebc264f01 (patch)
tree7cb2ac35a3c3fbe50b080a65761745773646c505 /passes/techmap/clkbufmap.cc
parentf4c62f33ac56bc5725c44ad822e75d2387f98061 (diff)
downloadyosys-c6d5b97b98e6edc395ee14ad60430f7ebc264f01.tar.gz
yosys-c6d5b97b98e6edc395ee14ad60430f7ebc264f01.tar.bz2
yosys-c6d5b97b98e6edc395ee14ad60430f7ebc264f01.zip
review fixes
Diffstat (limited to 'passes/techmap/clkbufmap.cc')
-rw-r--r--passes/techmap/clkbufmap.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/passes/techmap/clkbufmap.cc b/passes/techmap/clkbufmap.cc
index 9ecc83071..a2d10c48b 100644
--- a/passes/techmap/clkbufmap.cc
+++ b/passes/techmap/clkbufmap.cc
@@ -2,6 +2,7 @@
* yosys -- Yosys Open SYnthesis Suite
*
* Copyright (C) 2012 Clifford Wolf <clifford@clifford.at>
+ * Copyright (C) 2019 Marcin Kościelnicki <mwk@0x04.net>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -32,19 +33,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 ClkbufmapPass : public Pass {
ClkbufmapPass() : Pass("clkbufmap", "insert global buffers on clock networks") { }
void help() YS_OVERRIDE
@@ -127,7 +115,7 @@ struct ClkbufmapPass : public Pass {
auto it = module->attributes.find("\\clkbuf_driver");
if (it != module->attributes.end()) {
auto value = it->second.decode_string();
- for (auto name : split(value, ",")) {
+ for (auto name : split_tokens(value, ",")) {
auto wire = module->wire(RTLIL::escape_id(name));
if (!wire)
log_error("Module %s does not have port %s.\n", log_id(module), log_id(name));
@@ -138,7 +126,7 @@ struct ClkbufmapPass : public Pass {
it = module->attributes.find("\\clkbuf_sink");
if (it != module->attributes.end()) {
auto value = it->second.decode_string();
- for (auto name : split(value, ",")) {
+ for (auto name : split_tokens(value, ",")) {
auto wire = module->wire(RTLIL::escape_id(name));
if (!wire)
log_error("Module %s does not have port %s.\n", log_id(module), log_id(name));