1 ------------------------------------------------------------------------------- 3 --! @author Hipolito Guzman-Miranda 4 --! @brief Generates reset and clock for simulation purposes. 5 ------------------------------------------------------------------------------- 7 --! Use IEEE standard definitions library 9 --! Use std_logic* signal types 10 USE ieee.std_logic_1164.
ALL;
12 --! @brief Generates a clock and reset for simulation purposes 14 --! @details Generates a clock, \c clk, with period \c CLK_PERIOD, and also a \c reset pulse, which 15 --! takes the value \c RST_ACTIVE_VALUE during \c RST_CYCLES (of the generated clock), and 16 --! after that time switches to the opposite value 21 RST_CYCLES : := 10 --! Number of cycles that reset will be asserted at the beginning of the simulation 24 endsim : in ;
--! \c clk stops changing when endsim='1', which effectively stops the simulation 25 clk : out ;
--! Generated clock 26 rst : out --! Generated reset 30 --! @brief Architecture is based on two different non-synthesizable processes to manage \c clk and \c rst 32 --! @detailed A process is dedicated to toggle \c clk while \c endsim is not \c '1', and another one manages \c rst 37 -- CLK_PERIOD must be positive and non-zero 39 report "clkmanager: CLK_PERIOD must be positive and non-zero" 42 -- RST_ACTIVE_VALUE must be either '0' or '1' (no other values supported) 44 report "clkmanager: RST_ACTIVE_VALUE must be either '0' or '1'" 47 -- RST_CYCLES must be positive and non-zero 49 report "clkmanager: RST_CYCLES must be a positive non-zero integer" 54 --! @details To stop the simulation without a failure message, 55 --! stop toggling the clk when endsim = '1', 68 --! @brief Manage reset 70 --! @details Sets rst to RST_ACTIVE_VALUE for CLK_PERIOD*RST_CYCLES 71 --! and toggles it to NOT RST_ACTIVE_VALUE after that time 80 end two_simulation_processes;
RST_ACTIVE_VALUEstd_logic := '0'
Reset polarity.
out rststd_logic
Generated reset.
out clkstd_logic
Generated clock.
Generates a clock and reset for simulation purposes.
in endsimstd_logic
clk stops changing when endsim='1', which effectively stops the simulation
RST_CYCLESinteger := 10
Number of cycles that reset will be asserted at the beginning of the simulation.
CLK_PERIODtime := 10 ns
Period of generated clock.