- added pin non-maskable interrupt (NMI).

Exception vector is reset vector at (X"BFC00000")
-  Interrupt pending flags (IP) are not masked in hardware by IM.

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@489 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2009-10-03 16:40:29 +00:00
parent 63b60eee52
commit c5027772aa
+13 -2
View File
@@ -42,6 +42,7 @@ entity cop is
clk : in STD_LOGIC; clk : in STD_LOGIC;
eb : in STD_LOGIC; eb : in STD_LOGIC;
int : in unsigned(5 downto 0); int : in unsigned(5 downto 0);
nmi : in STD_LOGIC;
ir_en : in STD_LOGIC; ir_en : in STD_LOGIC;
ir : in word_t; ir : in word_t;
ctrl_in : in cop0_ctrl_in_t; ctrl_in : in cop0_ctrl_in_t;
@@ -80,6 +81,7 @@ architecture Behavioral of cop is
signal reg_rptr : reg_ptr_t; signal reg_rptr : reg_ptr_t;
signal reg_wptr : reg_ptr_t; signal reg_wptr : reg_ptr_t;
signal inject_exc : STD_LOGIC; signal inject_exc : STD_LOGIC;
signal latch_vect_en : STD_LOGIC;
type cop_pipe_t is record type cop_pipe_t is record
opc : opcode_t; opc : opcode_t;
@@ -158,6 +160,7 @@ exception_state:
status_rest <= '0'; status_rest <= '0';
inject_exc <= '0'; inject_exc <= '0';
imem_addr_we <= '0'; imem_addr_we <= '0';
latch_vect_en <= '0';
exc_staten <= exc_state; exc_staten <= exc_state;
@@ -181,6 +184,7 @@ exception_state:
end if; end if;
when exc_commit => when exc_commit =>
latch_vect_en <= '1';
ctrl_out.exc_pending <= '1'; ctrl_out.exc_pending <= '1';
ctrl_out.exc_commit <= '1'; ctrl_out.exc_commit <= '1';
if ctrl_in.sdu.ID_stall = '0' then if ctrl_in.sdu.ID_stall = '0' then
@@ -331,6 +335,7 @@ cop_cache_op:
cop_ip_reg_write: cop_ip_reg_write:
process(clk) process(clk)
variable ip_v : unsigned(7 downto 0); variable ip_v : unsigned(7 downto 0);
variable ipm_v : unsigned(7 downto 0);
begin begin
if rising_edge(clk) then if rising_edge(clk) then
if rst = '1' then if rst = '1' then
@@ -340,9 +345,11 @@ cop_ip_reg_write:
sw_int <= din(9 downto 8); sw_int <= din(9 downto 8);
end if; end if;
end if; end if;
ip_v := (int & sw_int) and im; ip_v := (int & sw_int);
ipm_v := ip_v and im;
ip <= ip_v; ip <= ip_v;
ctrl_out.int <= eval_int(ip_v) and status(0); ctrl_out.int <= (eval_int(ipm_v) and status(0));
ctrl_out.NMI <= nmi;
end if; end if;
end process; end process;
@@ -352,6 +359,9 @@ cop_exc_vector:
if rising_edge(clk) then if rising_edge(clk) then
if rst = '1' then if rst = '1' then
ctrl_out.exc_vec <= X"BFC00000"; ctrl_out.exc_vec <= X"BFC00000";
elsif latch_vect_en = '1' then
if ctrl_in.events.nmi = '1' then
ctrl_out.exc_vec <= X"BFC00000";
else else
ctrl_out.exc_vec <= X"80000080"; ctrl_out.exc_vec <= X"80000080";
if status(22) = '1' then if status(22) = '1' then
@@ -359,6 +369,7 @@ cop_exc_vector:
end if; end if;
end if; end if;
end if; end if;
end if;
end process; end process;
cop_pipe: cop_pipe: