Line 201... |
Line 201... |
-- until the lower priority ISR returns or clears
|
-- until the lower priority ISR returns or clears
|
-- the I bit.
|
-- the I bit.
|
-- Also added the I bit to the exported flags for
|
-- Also added the I bit to the exported flags for
|
-- use in memory protection schemes.
|
-- use in memory protection schemes.
|
-- Seth Henry 04/16/20 Modified to use new Open8 bus record. Also added
|
-- Seth Henry 04/16/20 Modified to use new Open8 bus record. Also added
|
-- reset and usec_tick logic to drive utility signals
|
-- reset and usec_tick logic to drive utility
|
|
-- signals. Also added Halt_Ack output.
|
|
|
library ieee;
|
library ieee;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_unsigned.all;
|
use ieee.std_logic_arith.all;
|
use ieee.std_logic_arith.all;
|
Line 230... |
Line 231... |
Clock_Frequency : real -- Clock Frequency
|
Clock_Frequency : real -- Clock Frequency
|
);
|
);
|
port(
|
port(
|
Clock : in std_logic;
|
Clock : in std_logic;
|
PLL_Locked : in std_logic;
|
PLL_Locked : in std_logic;
|
CPU_Halt : in std_logic := '0';
|
--
|
|
Halt_Req : in std_logic := '0';
|
|
Halt_Ack : out std_logic;
|
--
|
--
|
Open8_Bus : out OPEN8_BUS_TYPE;
|
Open8_Bus : out OPEN8_BUS_TYPE;
|
Rd_Data : in DATA_TYPE;
|
Rd_Data : in DATA_TYPE;
|
Interrupts : in INTERRUPT_BUNDLE := x"00"
|
Interrupts : in INTERRUPT_BUNDLE := x"00"
|
);
|
);
|
Line 262... |
Line 265... |
constant INT_VECTOR_7 : ADDRESS_TYPE := ISR_Start_Addr+14;
|
constant INT_VECTOR_7 : ADDRESS_TYPE := ISR_Start_Addr+14;
|
|
|
signal CPU_Next_State : CPU_STATES := IPF_C0;
|
signal CPU_Next_State : CPU_STATES := IPF_C0;
|
signal CPU_State : CPU_STATES := IPF_C0;
|
signal CPU_State : CPU_STATES := IPF_C0;
|
|
|
signal CPU_Halt_Req : std_logic;
|
signal CPU_Halt_Req : std_logic := '0';
|
|
signal CPU_Halt_Ack : std_logic := '0';
|
|
|
signal Cache_Ctrl : CACHE_MODES := CACHE_IDLE;
|
signal Cache_Ctrl : CACHE_MODES := CACHE_IDLE;
|
|
|
signal Opcode : OPCODE_TYPE := (others => '0');
|
signal Opcode : OPCODE_TYPE := (others => '0');
|
signal SubOp, SubOp_p1 : SUBOP_TYPE := (others => '0');
|
signal SubOp, SubOp_p1 : SUBOP_TYPE := (others => '0');
|
Line 404... |
Line 408... |
--
|
--
|
INT_Ctrl.Mask_Set <= '0';
|
INT_Ctrl.Mask_Set <= '0';
|
INT_Ctrl.Soft_Ints <= x"00";
|
INT_Ctrl.Soft_Ints <= x"00";
|
INT_Ctrl.Incr_ISR <= '0';
|
INT_Ctrl.Incr_ISR <= '0';
|
Ack_D <= '0';
|
Ack_D <= '0';
|
|
--
|
Reg := conv_integer(SubOp);
|
Reg := conv_integer(SubOp);
|
|
--
|
|
CPU_Halt_Ack <= '0';
|
|
|
case CPU_State is
|
case CPU_State is
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
-- Initial Instruction fetch & decode
|
-- Initial Instruction fetch & decode
|
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
Line 828... |
Line 834... |
-- operation due to the current instruction
|
-- operation due to the current instruction
|
DP_Ctrl.Src <= DATA_RD_MEM;
|
DP_Ctrl.Src <= DATA_RD_MEM;
|
end if;
|
end if;
|
|
|
when WAH_Cx => -- Holds until CPU_Halt_Req is deasserted.
|
when WAH_Cx => -- Holds until CPU_Halt_Req is deasserted.
|
|
CPU_Halt_Ack <= '1';
|
DP_Ctrl.Src <= DATA_BUS_IDLE;
|
DP_Ctrl.Src <= DATA_BUS_IDLE;
|
if( CPU_Halt_Req = '0' )then
|
if( CPU_Halt_Req = '0' )then
|
CPU_Next_State <= IPF_C0;
|
CPU_Next_State <= IPF_C0;
|
DP_Ctrl.Src <= DATA_RD_MEM;
|
DP_Ctrl.Src <= DATA_RD_MEM;
|
end if;
|
end if;
|
Line 930... |
Line 937... |
Operand2 <= x"00";
|
Operand2 <= x"00";
|
Instr_Prefetch <= '0';
|
Instr_Prefetch <= '0';
|
Prefetch <= x"00";
|
Prefetch <= x"00";
|
|
|
CPU_Halt_Req <= '0';
|
CPU_Halt_Req <= '0';
|
|
Halt_Ack <= '0';
|
|
|
Open8_Bus.Wr_En <= '0';
|
Open8_Bus.Wr_En <= '0';
|
Open8_Bus.Wr_Data <= OPEN8_NULLBUS;
|
Open8_Bus.Wr_Data <= OPEN8_NULLBUS;
|
Open8_Bus.Rd_En <= '1';
|
Open8_Bus.Rd_En <= '1';
|
|
|
Line 962... |
Line 970... |
|
|
Open8_Bus.GP_Flags <= (others => '0');
|
Open8_Bus.GP_Flags <= (others => '0');
|
|
|
elsif( rising_edge(Clock) )then
|
elsif( rising_edge(Clock) )then
|
|
|
CPU_Halt_Req <= CPU_Halt;
|
CPU_Halt_Req <= Halt_Req;
|
|
Halt_Ack <= CPU_Halt_Ack;
|
|
|
Open8_Bus.Wr_En <= '0';
|
Open8_Bus.Wr_En <= '0';
|
Open8_Bus.Wr_Data <= OPEN8_NULLBUS;
|
Open8_Bus.Wr_Data <= OPEN8_NULLBUS;
|
Open8_Bus.Rd_En <= '0';
|
Open8_Bus.Rd_En <= '0';
|
|
|