@@ -876,9 +876,20 @@ static void select_stmt(RTLIL::Design *design, std::string arg, bool disable_emp
876876 sel.selected_members [mod->name ].insert (cell->name );
877877 } else
878878 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+ }
882893 } else
883894 if (arg_memb.compare (0 , 2 , " p:" ) == 0 ) {
884895 for (auto &it : mod->processes )
@@ -1164,6 +1175,9 @@ struct SelectPass : public Pass {
11641175 log (" t:<pattern>\n " );
11651176 log (" all cells with a type matching the given pattern\n " );
11661177 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 " );
11671181 log (" p:<pattern>\n " );
11681182 log (" all processes with a name matching the given pattern\n " );
11691183 log (" \n " );
0 commit comments