Design of AWG devices for both frequency and mode multiplexing