@@ -876,9 +876,20 @@ static void select_stmt(RTLIL::Design *design, std::string arg, bool disable_emp
876
876
sel.selected_members [mod->name ].insert (cell->name );
877
877
} else
878
878
if (arg_memb.compare (0 , 2 , " t:" ) == 0 ) {
879
- for (auto cell : mod->cells ())
880
- if (match_ids (cell->type , arg_memb.substr (2 )))
881
- sel.selected_members [mod->name ].insert (cell->name );
879
+ if (arg_memb.compare (2 , 1 , " @" ) == 0 ) {
880
+ std::string set_name = RTLIL::escape_id (arg_memb.substr (3 ));
881
+ if (!design->selection_vars .count (set_name))
882
+ log_cmd_error (" Selection @%s is not defined!\n " , RTLIL::unescape_id (set_name).c_str ());
883
+
884
+ auto &muster = design->selection_vars [set_name];
885
+ for (auto cell : mod->cells ())
886
+ if (muster.selected_modules .count (cell->type ))
887
+ sel.selected_members [mod->name ].insert (cell->name );
888
+ } else {
889
+ for (auto cell : mod->cells ())
890
+ if (match_ids (cell->type , arg_memb.substr (2 )))
891
+ sel.selected_members [mod->name ].insert (cell->name );
892
+ }
882
893
} else
883
894
if (arg_memb.compare (0 , 2 , " p:" ) == 0 ) {
884
895
for (auto &it : mod->processes )
@@ -1164,6 +1175,9 @@ struct SelectPass : public Pass {
1164
1175
log (" t:<pattern>\n " );
1165
1176
log (" all cells with a type matching the given pattern\n " );
1166
1177
log (" \n " );
1178
+ log (" t:@<name>\n " );
1179
+ log (" all cells with a type matching a module in the saved selection <name>\n " );
1180
+ log (" \n " );
1167
1181
log (" p:<pattern>\n " );
1168
1182
log (" all processes with a name matching the given pattern\n " );
1169
1183
log (" \n " );
0 commit comments