Building block based design of photonic integrated circuits for generic photonic foundries