I used to do my programs in behavioral description type as functions. Fortunately, I could call functions inside another function. Then I realized that they are not synthesizable. After that I tried port mapping and I had so many components with each having distinct names in my program. The problem is that when I write my statements inside my program, I could not call other components using port mapping (illegal!).