I can set the MUX selector to switch to s1's testbench. But this solution requires that testbenches for all the submodules must be there in advance. What I was searching for is the facility to create testbench of s1 and connect it to s1. Then detach s1 from testbench once again connect to M and destroy s1's testbench. Regards, Milind Movasha.
Implementation appear to be different.
For one, It gets forced to be created in static initialization phase. It would be a hack, worth trying. Assume you have DUT - D1. However I advise against this methodology in general. I do not see what you are attempting to solve in the bigger picture.