aboutsummaryrefslogtreecommitdiffstats
path: root/passes/cmds/select.cc
diff options
context:
space:
mode:
authorAhmed Irfan <ahmedirfan1983@gmail.com>2014-01-03 10:54:54 +0100
committerAhmed Irfan <ahmedirfan1983@gmail.com>2014-01-03 10:54:54 +0100
commit06482c046bcab4e2b9603f8954ce0f2fd501a73b (patch)
treed160ad05402768e4f468ff0685593b81658e6a5a /passes/cmds/select.cc
parent5da334fc2efd66c8a5efde925bb18212c34d0cef (diff)
parentfb2bf934dc6d2c969906b350c9a1b09a972bfdd7 (diff)
downloadyosys-06482c046bcab4e2b9603f8954ce0f2fd501a73b.tar.gz
yosys-06482c046bcab4e2b9603f8954ce0f2fd501a73b.tar.bz2
yosys-06482c046bcab4e2b9603f8954ce0f2fd501a73b.zip
Merge branch 'master' of https://github.com/cliffordwolf/yosys into btor
Diffstat (limited to 'passes/cmds/select.cc')
-rw-r--r--passes/cmds/select.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/passes/cmds/select.cc b/passes/cmds/select.cc
index 137f8618a..ec560772e 100644
--- a/passes/cmds/select.cc
+++ b/passes/cmds/select.cc
@@ -272,6 +272,21 @@ static int select_op_expand(RTLIL::Design *design, RTLIL::Selection &lhs, std::v
if (lhs.selected_member(mod_it.first, it.first) && limits.count(it.first) == 0)
selected_wires.insert(it.second);
+ for (auto &conn : mod->connections)
+ {
+ std::vector<RTLIL::SigBit> conn_lhs = conn.first.to_sigbit_vector();
+ std::vector<RTLIL::SigBit> conn_rhs = conn.second.to_sigbit_vector();
+
+ for (size_t i = 0; i < conn_lhs.size(); i++) {
+ if (conn_lhs[i].wire == NULL || conn_rhs[i].wire == NULL)
+ continue;
+ if (mode != 'i' && selected_wires.count(conn_rhs[i].wire) && lhs.selected_members[mod->name].count(conn_lhs[i].wire->name) == 0)
+ lhs.selected_members[mod->name].insert(conn_lhs[i].wire->name), sel_objects++, max_objects--;
+ if (mode != 'o' && selected_wires.count(conn_lhs[i].wire) && lhs.selected_members[mod->name].count(conn_rhs[i].wire->name) == 0)
+ lhs.selected_members[mod->name].insert(conn_rhs[i].wire->name), sel_objects++, max_objects--;
+ }
+ }
+
for (auto &cell : mod->cells)
for (auto &conn : cell.second->connections)
{
@@ -514,7 +529,10 @@ static void select_stmt(RTLIL::Design *design, std::string arg)
} else {
size_t pos = arg.find('/');
if (pos == std::string::npos) {
- arg_mod = arg;
+ if (arg.find(':') == std::string::npos)
+ arg_mod = arg;
+ else
+ arg_mod = "*", arg_memb = arg;
} else {
arg_mod = arg.substr(0, pos);
arg_memb = arg.substr(pos+1);