--
-- generate chip selects for 8/16 bit operation
--
chip_selects: process(cs0, bhe, a0)
begin
ce0 <= '1';
ce1 <= '1';
if cs0='0' and a0='0' then
ce0 <= '0';
end if;
if cs0='0' and bhe='0' then
ce1 <= '0';
end if;
end process chip_selects;
--
-- generate read and write strobes
--
read_strobes: process(rd, a11)
begin
oe <= '1';
iord <= '1';
if rd='0' and a11='0' then
oe <= '0';
end if;
if rd='0' and a11='1' then
iord <= '0';
end if;
end process read_strobes;
write_strobes: process(wr, a11)
begin
we <= '1';
iowr <= '1';
if wr='0' and a11='0' then
we <= '0';
end if;
if wr='0' and a11='1' then
iowr <= '0';
end if;
end process write_strobes;
Listing 1—The VHDL glue
logic statements connect the CompactFlash memory interface to the M32C/84 microcontroller’s
expansion bus. Address line A11 controls the multiplexing between I/O and common
memory.