Line 146... |
Line 146... |
-- RS232_CTS : in Std_Logic;
|
-- RS232_CTS : in Std_Logic;
|
-- RS232_RTS : out Std_Logic;
|
-- RS232_RTS : out Std_Logic;
|
RS232_RXD : in Std_Logic;
|
RS232_RXD : in Std_Logic;
|
RS232_TXD : out Std_Logic;
|
RS232_TXD : out Std_Logic;
|
|
|
|
-- SPI Interface Signals (Pmod-SDCard)
|
|
spi_miso : in std_logic;
|
|
spi_mosi : out std_logic;
|
|
spi_clk : out std_logic;
|
|
spi_cs_n : out std_logic_vector(7 downto 0);
|
|
|
-- slide switches
|
-- slide switches
|
sw : in std_logic_vector(2 downto 0);
|
sw : in std_logic_vector(3 downto 0);
|
-- Status 7 segment LED
|
-- Status 7 segment LED
|
S : out std_logic_vector(7 downto 0)
|
S : out std_logic_vector(7 downto 0)
|
|
|
-- CPU Debug Interface signals
|
-- CPU Debug Interface signals
|
-- cpu_reset_o : out Std_Logic;
|
-- cpu_reset_o : out Std_Logic;
|
Line 244... |
Line 250... |
-- Video Display Unit
|
-- Video Display Unit
|
signal vdu_clk : std_logic;
|
signal vdu_clk : std_logic;
|
signal vdu_cs : std_logic;
|
signal vdu_cs : std_logic;
|
signal vdu_data_out : std_logic_vector(7 downto 0);
|
signal vdu_data_out : std_logic_vector(7 downto 0);
|
|
|
|
-- SPI-master to SDcard
|
|
signal spi_data_out : std_logic_vector(7 downto 0);
|
|
signal spi_cs : std_logic;
|
|
signal spi_irq : std_logic;
|
|
|
-- timer
|
-- timer
|
signal timer_data_out : std_logic_vector(7 downto 0);
|
signal timer_data_out : std_logic_vector(7 downto 0);
|
signal timer_cs : std_logic;
|
signal timer_cs : std_logic;
|
signal timer_irq : std_logic;
|
signal timer_irq : std_logic;
|
|
|
Line 469... |
Line 480... |
);
|
);
|
end component;
|
end component;
|
|
|
----------------------------------------
|
----------------------------------------
|
--
|
--
|
|
-- SPI master module
|
|
--
|
|
----------------------------------------
|
|
|
|
component spi_master
|
|
port (
|
|
--
|
|
-- CPU Interface Signals
|
|
--
|
|
clk : in std_logic;
|
|
reset : in std_logic;
|
|
cs : in std_logic;
|
|
rw : in std_logic;
|
|
addr : in std_logic_vector(1 downto 0);
|
|
data_in : in std_logic_vector(7 downto 0);
|
|
data_out : out std_logic_vector(7 downto 0);
|
|
irq : out std_logic;
|
|
--
|
|
-- SPI Interface Signals
|
|
--
|
|
spi_miso : in std_logic;
|
|
spi_mosi : out std_logic;
|
|
spi_clk : out std_logic;
|
|
spi_cs_n : out std_logic_vector(7 downto 0)
|
|
);
|
|
end component;
|
|
|
|
----------------------------------------
|
|
--
|
-- Timer module
|
-- Timer module
|
--
|
--
|
----------------------------------------
|
----------------------------------------
|
|
|
component timer
|
component timer
|
Line 740... |
Line 780... |
TMDSn => TMDSn,
|
TMDSn => TMDSn,
|
TMDSp_clock => TMDSp_clock,
|
TMDSp_clock => TMDSp_clock,
|
TMDSn_clock => TMDSn_clock
|
TMDSn_clock => TMDSn_clock
|
);
|
);
|
|
|
|
----------------------------------------
|
|
--
|
|
-- SPI-Master to SDcard
|
|
--
|
|
----------------------------------------
|
|
my_spi_master : spi_master
|
|
port map (
|
|
clk => cpu_clk,
|
|
reset => cpu_reset,
|
|
cs => spi_cs,
|
|
rw => cpu_rw,
|
|
addr => cpu_addr(1 downto 0),
|
|
data_in => cpu_data_out,
|
|
data_out => spi_data_out,
|
|
irq => spi_irq,
|
|
spi_miso => spi_miso,
|
|
spi_mosi => spi_mosi,
|
|
spi_clk => spi_clk,
|
|
spi_cs_n => spi_cs_n
|
|
);
|
|
|
----------------------------------------
|
----------------------------------------
|
--
|
--
|
-- Timer Module
|
-- Timer Module
|
--
|
--
|
Line 807... |
Line 867... |
rom_data_out,
|
rom_data_out,
|
flex_data_out,
|
flex_data_out,
|
acia_data_out,
|
acia_data_out,
|
keyboard_data_out,
|
keyboard_data_out,
|
vdu_data_out,
|
vdu_data_out,
|
|
spi_data_out,
|
timer_data_out,
|
timer_data_out,
|
trap_data_out,
|
trap_data_out,
|
ram1_data_out, ram2_data_out
|
ram1_data_out, ram2_data_out
|
)
|
)
|
begin
|
begin
|
Line 819... |
Line 880... |
rom_cs <= '0';
|
rom_cs <= '0';
|
flex_cs <= '0';
|
flex_cs <= '0';
|
acia_cs <= '0';
|
acia_cs <= '0';
|
keyboard_cs <= '0';
|
keyboard_cs <= '0';
|
vdu_cs <= '0';
|
vdu_cs <= '0';
|
|
spi_cs <= '0';
|
timer_cs <= '0';
|
timer_cs <= '0';
|
trap_cs <= '0';
|
trap_cs <= '0';
|
ram1_cs <= '0';
|
ram1_cs <= '0';
|
ram2_cs <= '0';
|
ram2_cs <= '0';
|
ram3_cs <= '0';
|
ram3_cs <= '0';
|
Line 902... |
Line 964... |
--
|
--
|
-- Reserved SWTPc MP-ID PTM 6840 Timer Port $E090 - $E09F
|
-- Reserved SWTPc MP-ID PTM 6840 Timer Port $E090 - $E09F
|
--
|
--
|
|
|
--
|
--
|
|
-- SPI-master $E0A0 - $E0AF
|
|
--
|
|
when "1010" => -- $E0A0
|
|
cpu_data_in <= spi_data_out;
|
|
spi_cs <= cpu_vma;
|
|
|
|
--
|
-- Remaining 6 slots reserved for non SWTPc Peripherals
|
-- Remaining 6 slots reserved for non SWTPc Peripherals
|
--
|
--
|
when others => -- $E0A0 to $E0FF
|
when others => -- $E0A0 to $E0FF
|
null;
|
null;
|
end case;
|
end case;
|
Line 952... |
Line 1021... |
-- Interrupts and other bus control signals
|
-- Interrupts and other bus control signals
|
--
|
--
|
interrupts : process( NMI,
|
interrupts : process( NMI,
|
acia_irq,
|
acia_irq,
|
keyboard_irq,
|
keyboard_irq,
|
|
spi_irq,
|
trap_irq,
|
trap_irq,
|
timer_irq
|
timer_irq
|
)
|
)
|
begin
|
begin
|
cpu_irq <= acia_irq or keyboard_irq;
|
cpu_irq <= acia_irq or keyboard_irq or spi_irq;
|
cpu_nmi <= trap_irq or NMI;
|
cpu_nmi <= trap_irq or NMI;
|
cpu_firq <= timer_irq;
|
cpu_firq <= timer_irq;
|
cpu_halt <= '0';
|
cpu_halt <= '0';
|
cpu_hold <= '0'; -- pb_hold or ram_hold;
|
cpu_hold <= '0'; -- pb_hold or ram_hold;
|
end process;
|
end process;
|
Line 982... |
Line 1052... |
S(7) <= '0';
|
S(7) <= '0';
|
S(6) <= CountL(24);
|
S(6) <= CountL(24);
|
S(5) <= cpu_reset;
|
S(5) <= cpu_reset;
|
S(4) <= NMI;
|
S(4) <= NMI;
|
case sw is
|
case sw is
|
when "000" =>
|
when "0000" =>
|
S(3 downto 0) <= cpu_addr(3 downto 0);
|
S(3 downto 0) <= cpu_addr(3 downto 0);
|
when "001" =>
|
when "0001" =>
|
S(3 downto 0) <= cpu_addr(7 downto 4);
|
S(3 downto 0) <= cpu_addr(7 downto 4);
|
when "010" =>
|
when "0010" =>
|
S(3 downto 0) <= cpu_addr(11 downto 8);
|
S(3 downto 0) <= cpu_addr(11 downto 8);
|
when "011" =>
|
when "0011" =>
|
S(3 downto 0) <= cpu_addr(15 downto 12);
|
S(3 downto 0) <= cpu_addr(15 downto 12);
|
when "100" =>
|
when "0100" =>
|
S(3 downto 0) <= cpu_data_in(3 downto 0);
|
S(3 downto 0) <= cpu_data_in(3 downto 0);
|
when "101" =>
|
when "0101" =>
|
S(3 downto 0) <= cpu_data_in(7 downto 4);
|
S(3 downto 0) <= cpu_data_in(7 downto 4);
|
when "110" =>
|
when "0110" =>
|
S(3 downto 0) <= keyboard_data_out(3 downto 0);
|
S(3 downto 0) <= keyboard_data_out(3 downto 0);
|
when "111" =>
|
when "0111" =>
|
S(3 downto 0) <= keyboard_data_out(7 downto 4);
|
S(3 downto 0) <= keyboard_data_out(7 downto 4);
|
|
when "1000" =>
|
|
S(3 downto 0) <= spi_data_out(3 downto 0);
|
|
when "1001" =>
|
|
S(3 downto 0) <= spi_data_out(7 downto 4);
|
when others => S(3 downto 0) <= (others => '0');
|
when others => S(3 downto 0) <= (others => '0');
|
end case;
|
end case;
|
end process;
|
end process;
|
|
|
-- debug_proc : process( cpu_reset, cpu_clk, cpu_rw, cpu_vma,
|
-- debug_proc : process( cpu_reset, cpu_clk, cpu_rw, cpu_vma,
|