1 ------------------------------------------------------------------------------- 4 ------------------------------------------------------------------------------- 9 --! Using IEEE standard logic components 10 USE ieee.std_logic_1164.
ALL;
12 --! Using IEE standard numeric components 17 --! @image html pwm_entity.png "PWM Entity" 19 --! This entity is a configurable PWM generator. The 'count_max' determines 20 --! how high the PWM will count to before rolling over. The 'pwm_duty' input 21 --! determines when the PWM will turn off in the cycle. 23 --! A pwm_duty of '0' causes the pwm to stay low all the time; where-as a 24 --! pwm_duty of 'count_max + 1' causes the pwm to stay high all the time. 27 bit_width : RANGE 2 TO 32 := 8 --! PWM width 38 --! Architecture rtl of pwm entity 39 ARCHITECTURE rtl
OF pwm IS
52 --! @brief Process for PWM generation 58 count <= (OTHERS => '0');
60 ELSIF (rising_edge(clk_in)) THEN 71 count <= (OTHERS => '0');
in rst_instd_logic
Asynchronous reset.
unsigned(pwm_duty_in'range ) count
PWM count.
in pwm_duty_instd_logic_vector( bit_width- 1 DOWNTO 0)
PWM duty cycle.
_library_ ieeeieee
Using IEEE library.
std_logic state
PWM state.
bit_widthnatural range 2 TO 32:= 8
PWM width.
in pwm_adv_instd_logic
PWM Advance flag.
in clk_instd_logic
Clock.
natural :=( 2** bit_width)- 2 c_count_max
Maximum PWM count.
out pwm_outstd_logic
PWM output.