- 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:
@@ -77,6 +77,8 @@ architecture Behavioral of cop is
|
|||||||
signal EB_reg : STD_LOGIC;
|
signal EB_reg : STD_LOGIC;
|
||||||
signal icache_info : unsigned(7 downto 0);
|
signal icache_info : unsigned(7 downto 0);
|
||||||
signal dcache_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
|
type cop_pipe_t is record
|
||||||
opc : opcode_t;
|
opc : opcode_t;
|
||||||
@@ -364,15 +366,22 @@ cop_pipe:
|
|||||||
cop_pipe_EX.re <= '0';
|
cop_pipe_EX.re <= '0';
|
||||||
elsif ctrl_in.sdu.stall_all = '0' then
|
elsif ctrl_in.sdu.stall_all = '0' then
|
||||||
cop_pipe_EX <= cop_pipe_ID;
|
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 if;
|
end if;
|
||||||
end process;
|
end process;
|
||||||
|
|
||||||
cop_register_read:
|
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;
|
variable reg : word_t;
|
||||||
begin
|
begin
|
||||||
case cop_pipe_EX.reg_ptr is
|
|
||||||
|
case reg_rptr is
|
||||||
when "01000" => -- BadVAddr
|
when "01000" => -- BadVAddr
|
||||||
reg := BadVAddr;
|
reg := BadVAddr;
|
||||||
|
|
||||||
@@ -396,10 +405,7 @@ cop_register_read:
|
|||||||
|
|
||||||
end case;
|
end case;
|
||||||
|
|
||||||
-- Output latch
|
dout <= reg after 2 ns;
|
||||||
if cop_pipe_EX.re = '1' then
|
|
||||||
dout <= reg after 2 ns;
|
|
||||||
end if;
|
|
||||||
|
|
||||||
end process;
|
end process;
|
||||||
|
|
||||||
@@ -420,7 +426,7 @@ cop_we_gen:
|
|||||||
ip_reg_we <= '0';
|
ip_reg_we <= '0';
|
||||||
if cop_pipe_EX.we = '1' then
|
if cop_pipe_EX.we = '1' then
|
||||||
|
|
||||||
case cop_pipe_EX.reg_ptr is
|
case reg_wptr is
|
||||||
|
|
||||||
when "01100" =>
|
when "01100" =>
|
||||||
stat_reg_we <= '1'; -- not status(1) or status(28);
|
stat_reg_we <= '1'; -- not status(1) or status(28);
|
||||||
|
|||||||
Reference in New Issue
Block a user