aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2020-04-01 09:35:35 -0700
committerGitHub <noreply@github.com>2020-04-01 09:35:35 -0700
commit86380e02121f05d2761a4ddc45e953de4c6a5680 (patch)
treef575741ec2b5bea112b0db52b415f2cc35206d21
parent903cec84f4d7131304d4608f319505e90a204b92 (diff)
parentae05795f5464878126ee248e291030106d41e32c (diff)
downloadyosys-86380e02121f05d2761a4ddc45e953de4c6a5680.tar.gz
yosys-86380e02121f05d2761a4ddc45e953de4c6a5680.tar.bz2
yosys-86380e02121f05d2761a4ddc45e953de4c6a5680.zip
Merge pull request #1849 from boqwxp/cleanup_kernel_yosys
Clean up pseudo-private member usage in `kernel/yosys.cc`.
-rw-r--r--kernel/yosys.cc27
1 files changed, 13 insertions, 14 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc
index 4cb53f05d..6d64e2e90 100644
--- a/kernel/yosys.cc
+++ b/kernel/yosys.cc
@@ -1098,30 +1098,29 @@ static char *readline_obj_generator(const char *text, int state)
if (design->selected_active_module.empty())
{
- for (auto &it : design->modules_)
- if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
- obj_names.push_back(strdup(RTLIL::id2cstr(it.first)));
+ for (auto mod : design->modules())
+ if (RTLIL::unescape_id(mod->name).compare(0, len, text) == 0)
+ obj_names.push_back(strdup(log_id(mod->name)));
}
- else
- if (design->modules_.count(design->selected_active_module) > 0)
+ else if (design->module(design->selected_active_module) != nullptr)
{
- RTLIL::Module *module = design->modules_.at(design->selected_active_module);
+ RTLIL::Module *module = design->module(design->selected_active_module);
- for (auto &it : module->wires_)
- if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
- obj_names.push_back(strdup(RTLIL::id2cstr(it.first)));
+ for (auto w : module->wires())
+ if (RTLIL::unescape_id(w->name).compare(0, len, text) == 0)
+ obj_names.push_back(strdup(log_id(w->name)));
for (auto &it : module->memories)
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
- obj_names.push_back(strdup(RTLIL::id2cstr(it.first)));
+ obj_names.push_back(strdup(log_id(it.first)));
- for (auto &it : module->cells_)
- if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
- obj_names.push_back(strdup(RTLIL::id2cstr(it.first)));
+ for (auto cell : module->cells())
+ if (RTLIL::unescape_id(cell->name).compare(0, len, text) == 0)
+ obj_names.push_back(strdup(log_id(cell->name)));
for (auto &it : module->processes)
if (RTLIL::unescape_id(it.first).compare(0, len, text) == 0)
- obj_names.push_back(strdup(RTLIL::id2cstr(it.first)));
+ obj_names.push_back(strdup(log_id(it.first)));
}
std::sort(obj_names.begin(), obj_names.end());