Hello,
I am trying to implement Andre's 65SPI (based on Daryll's) on a card for the Apple ][ series. I am trying to implement the ROM enable logic in the CPLD. The CPLD I am going to use is the Xilinx XC9572XL, as this one has 5V tolerant inputs.
I would like ask for help perfecting this VHDL code, as I am still a beginner with VHDL
I have attached two images which are the reference for my code:
Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity SLOTROM is
port (
n_iosel : in std_logic;
n_devsel : in std_logic;
n_iostrobe : in std_logic;
r_nw : in std_logic;
clk_7m : in std_logic;
cpu_addr : in std_logic_vector(10 downto 0);
n_ROM_oe : out std_logic;
n_ROM_cs : out std_logic;
n_ROM_we : out std_logic
);
end SLOTROM;
architecture RTL of SLOTROM is
signal n_CFFF : std_logic := '1';
signal rom_enable : std_logic;
signal rom_n_cs : std_logic;
signal rom_n_oe : std_logic;
signal rom_n_we : std_logic;
begin
-- Make sure we hold the status for the EEPROM/Flash
process (clk_7m, n_CFFF, n_iosel)
begin
if (n_CFFF = '0' or n_iosel = '1') then
rom_enable <= '0';
elsif (rising_edge(clk_7m) and n_iosel = '0') then
rom_enable <= '1';
end if;
end process;
-- These signals are active LOW
-- /CFFF is used to disable the card AUX ROM
n_CFFF <=
'0' when ((n_iostrobe = '0') and (cpu_addr(10 downto 0) = "11111111111")) else
'1';
-- Chip Select (active low) EEPROM/Flash
rom_n_cs <=
'0' when (n_iosel = '0' or n_iostrobe = '0') else
'1';
n_ROM_cs <= rom_n_cs;
-- Output Enable (active low) EEPROM/Flash
rom_n_oe <=
'0' when (rom_enable = '1' and r_nw = '1') else
'1';
n_ROM_oe <= rom_n_oe;
-- Currently we don't support Write access to the EEPROM (though we
-- might use it later? (Thanks Rich Dreher, for the inspiration ;))
rom_n_we <= '1';
n_ROM_oe <= rom_n_oe;
n_ROM_we <= rom_n_we;
end RTL;