I have two blocks in design, which functionality is almost similar (about 5% difference) and working together. It is quite obvious it need to be a single RTL file with selectors, activating each instance in the appropriate mode - "this is block A", "this is block B". What should be preferred - defines (`ifdef IS_BLOCK_A) or parameters (if(instance==BLOCK_A))? All relevant considerations are welcome.
Defines are evaluated during compilation. When the RTL file containing the module is compiled (read) the define IS_BLOCK_A will have a value which will determine the result of the `ifdef IS_BLOCK_A statement. Since a module is only compiled once it is not possible to have two instances of a module that sees different define values.
Parameters values, on the other hand, are calculated during elaboration. Then the parameter value for every instance of the module is calculated, and it is possible to have multiple instances of the same module with different parameter values.