Usage of parameter inside a function

In reply to dave_59:

Hi Dave,
Thanks for your response. Both the solutions that you have suggested does not work. The point to be noted here is that the hierarchical reference top.abc.xyz does NOT exist (ie, abc module does not get instantiated when speed is high speed. SImilarly, def module does NOT get instantiated in the design when speed is full speed. So, when the above assignments are used, the compilation gives out error saying its not able to find one of the paths (depending on the mode in which the test is run).

The speed is being passed into the module as a parameter. How can a parameter variable be used as a define? Can a parameter be used as a define at all?
like: ifdef speed (will the compiler enter tthis section when speed is 1) and go to the else part when speed is 0?

The main problem here is that only one hierarchy exists at any point of time and the other does NOT exist. So, how do we tell the compiler not to compile the part of code whose hierarchy does not exist .

Thanks