6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 12:06 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Mon Nov 05, 2018 4:15 pm 
Offline

Joined: Tue May 03, 2016 11:32 am
Posts: 41
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;


Attachments:
File comment: Schematic /CFFF creation
n_CFFF_grey.jpg
n_CFFF_grey.jpg [ 90.39 KiB | Viewed 4752 times ]
File comment: Schematic ROM /OE and /CS creation
OE_CS_ROM_grey.jpg
OE_CS_ROM_grey.jpg [ 118.5 KiB | Viewed 4752 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: