1 ------------------------------------------------------------------------------- 3 --! @author Hipolito Guzman-Miranda 4 --! @brief Emulates on-board leds. 5 ------------------------------------------------------------------------------- 7 --! Use IEEE standard definitions library 9 --! Use std_logic* signal types 10 use ieee.std_logic_1164.
all;
11 --! Use the slv2string function present in the vhdl_verification package 14 --! @brief Emulates on-board leds 16 --! @details Checks for events on \c led_input port, and reports the current 17 --! state of the leds each time any the input bit changes. Does not keep any 18 --! internal memory, \c led_input is assumed to be directly connected to the 23 NUM_LEDS : := 4 --! How many leds are we emulating 26 led_input : in (NUM_LEDS-1 downto 0) --! Connect here the signal that drives the leds 30 --! @brief Architecture is based on just a single process 32 --! @detailed An assertion has also been added to check that \c ACTIVE_VALUE is 33 --! set to a non-ambiguous strong value (either '0' or '1'). 38 -- ACTIVE_VALUE must be either '0' or '1' (no other values supported) 40 report "led_emu: ACTIVE_VALUE must be either '0' or '1'" 43 --! @brief Report led state each time there is an event in \c led_input 45 --! @detailed We don't actually need to check for \c led_input'event, since 46 --! putting \c led_input in the sensitivity list of the process does it for 47 --! us. We use the report statement to print a string to the simulation log, 48 --! and the slv2string function in the vhdl_verification package to convert 49 --! the std_logic_vector value to a printable string. 52 report "led_emu: current state of leds: " & slv2string(led_input);
_library_ ieeeieee
Use IEEE standard definitions library.
in led_inputstd_logic_vector( NUM_LEDS- 1 downto 0)
Connect here the signal that drives the leds.
Common datatypes and component declarations.
ACTIVE_VALUEstd_logic := '0'
Led polarity.
NUM_LEDSinteger := 4
How many leds are we emulating.