Reset in program counter matched with clock

This commit is contained in:
Yannick Reiß 2024-08-08 06:28:36 +02:00
parent 83c6632415
commit 8b5b3095a0
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
2 changed files with 17 additions and 22 deletions

View File

@ -327,10 +327,9 @@ begin
when stEXEC => s_cycle_cnt <= stWB; when stEXEC => s_cycle_cnt <= stWB;
when others => s_cycle_cnt <= stIF; when others => s_cycle_cnt <= stIF;
end case; end case;
else end if;
if falling_edge(reset) then if falling_edge(reset) then
s_cycle_cnt <= stIF; s_cycle_cnt <= stIF;
end if;
end if; end if;
end process pc_cycle_control; end process pc_cycle_control;

View File

@ -26,26 +26,22 @@ architecture pro_count of pc is
signal addr_out : ram_addr_t := (others => '0'); signal addr_out : ram_addr_t := (others => '0');
signal addr_out_plus : ram_addr_t := (others => '0'); signal addr_out_plus : ram_addr_t := (others => '0');
begin begin
process (clk) process (clk, reset)
begin
if rising_edge(clk) then
if en_pc = "1" then
-- count
if doJump = "1" then
addr_out <= addr_calc;
-- jump
else
addr_out <= addr_out_plus;
end if;
end if;
end if;
end process;
process (reset)
begin begin
if falling_edge(reset) then if falling_edge(reset) then
addr_out <= (others => '0'); addr_out <= (others => '0');
addr_out_plus <= (others => '0'); else
if rising_edge(clk) then
if en_pc = "1" then
-- count
if doJump = "1" then
addr_out <= addr_calc;
-- jump
else
addr_out <= addr_out_plus;
end if;
end if;
end if;
end if; end if;
end process; end process;