Your question suggests ignorance of elementary logic hardware principles. Changing generics at runtime is like converting your compact car into a van and vice versa by pushing a button.
The solution is however simple, provide the necessary hardware for the maximum required address and data width and utilize it according to the current need.