-- External data bus address decoder and data multiplexer.
------------------------------------------------------------------------------
- -- This statement leads to priority encoder (which should be avoided), but for
- -- a small mux it doesn't matter and it's better readable.
- dmem_dout <= DPA_DAT_O when DPA_SEL = '1' else
- (others => 'X');
+ -- When connection more memories, be aware that 'dmem_dout' can vary only when
+ -- reading cycle is performed. I.e. mux variable must be registered.
+ dmem_dout <= DPA_DAT_O;
DPA_SEL <= '1' when dmem_addr (11 downto 10) = "00" else '0';
DPA_STB <= dmem_ce and DPA_SEL;