Reset in Register
This commit is contained in:
@@ -40,8 +40,11 @@ architecture structure of registers is
|
|||||||
begin
|
begin
|
||||||
|
|
||||||
-- react only on clock changes
|
-- react only on clock changes
|
||||||
process (clk) -- runs only, when clk changed
|
process (clk, reset) -- runs only, when clk changed
|
||||||
begin
|
begin
|
||||||
|
if falling_edge(reset) then
|
||||||
|
registerbench <= initRegs;
|
||||||
|
else
|
||||||
if rising_edge(clk) then
|
if rising_edge(clk) then
|
||||||
-- check if write is enabled
|
-- check if write is enabled
|
||||||
if to_integer(unsigned(write_enable)) = 1 then
|
if to_integer(unsigned(write_enable)) = 1 then
|
||||||
@@ -50,13 +53,6 @@ begin
|
|||||||
end if;
|
end if;
|
||||||
registerbench(0) <= std_logic_vector(to_unsigned(0, wordWidth));
|
registerbench(0) <= std_logic_vector(to_unsigned(0, wordWidth));
|
||||||
end if;
|
end if;
|
||||||
end process;
|
|
||||||
|
|
||||||
-- reset if reset is activated
|
|
||||||
process (reset)
|
|
||||||
begin
|
|
||||||
if falling_edge(reset) then
|
|
||||||
registerbench <= initRegs;
|
|
||||||
end if;
|
end if;
|
||||||
end process;
|
end process;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user