- removed register output latch (latch introduced global clock buffer, which is deprecated)

- added separate reg_pointer for read/write
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@470 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2009-05-05 11:07:02 +00:00
parent 1c17d74ae1
commit 3de1c312bb
+13 -7
View File
@@ -77,6 +77,8 @@ architecture Behavioral of cop is
signal EB_reg : STD_LOGIC;
signal icache_info : unsigned(7 downto 0);
signal dcache_info : unsigned(7 downto 0);
signal reg_rptr : reg_ptr_t;
signal reg_wptr : reg_ptr_t;
type cop_pipe_t is record
opc : opcode_t;
@@ -364,15 +366,22 @@ cop_pipe:
cop_pipe_EX.re <= '0';
elsif ctrl_in.sdu.stall_all = '0' then
cop_pipe_EX <= cop_pipe_ID;
if cop_pipe_ID.we = '1' then
reg_wptr <= cop_pipe_ID.reg_ptr;
end if;
if cop_pipe_ID.re = '1' then
reg_rptr <= cop_pipe_ID.reg_ptr;
end if;
end if;
end if;
end process;
cop_register_read:
process(cop_pipe_EX, BadVAddr, status, cause, epc, dcache_info, icache_info, test_reg)
process(reg_rptr, BadVAddr, status, cause, epc, dcache_info, icache_info, test_reg)
variable reg : word_t;
begin
case cop_pipe_EX.reg_ptr is
case reg_rptr is
when "01000" => -- BadVAddr
reg := BadVAddr;
@@ -396,10 +405,7 @@ cop_register_read:
end case;
-- Output latch
if cop_pipe_EX.re = '1' then
dout <= reg after 2 ns;
end if;
dout <= reg after 2 ns;
end process;
@@ -420,7 +426,7 @@ cop_we_gen:
ip_reg_we <= '0';
if cop_pipe_EX.we = '1' then
case cop_pipe_EX.reg_ptr is
case reg_wptr is
when "01100" =>
stat_reg_we <= '1'; -- not status(1) or status(28);