URL
https://opencores.org/ocsvn/neorv32/neorv32/trunk
[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_pwm.vhd] - Diff between revs 66 and 70
Show entire file |
Details |
Blame |
View Log
Rev 66 |
Rev 70 |
Line 57... |
Line 57... |
ack_o : out std_ulogic; -- transfer acknowledge
|
ack_o : out std_ulogic; -- transfer acknowledge
|
-- clock generator --
|
-- clock generator --
|
clkgen_en_o : out std_ulogic; -- enable clock generator
|
clkgen_en_o : out std_ulogic; -- enable clock generator
|
clkgen_i : in std_ulogic_vector(07 downto 0);
|
clkgen_i : in std_ulogic_vector(07 downto 0);
|
-- pwm output channels --
|
-- pwm output channels --
|
pwm_o : out std_ulogic_vector(NUM_CHANNELS-1 downto 0)
|
pwm_o : out std_ulogic_vector(59 downto 0)
|
);
|
);
|
end neorv32_pwm;
|
end neorv32_pwm;
|
|
|
architecture neorv32_pwm_rtl of neorv32_pwm is
|
architecture neorv32_pwm_rtl of neorv32_pwm is
|
|
|
Line 184... |
Line 184... |
elsif (prsc_tick = '1') then
|
elsif (prsc_tick = '1') then
|
pwm_cnt <= std_ulogic_vector(unsigned(pwm_cnt) + 1);
|
pwm_cnt <= std_ulogic_vector(unsigned(pwm_cnt) + 1);
|
end if;
|
end if;
|
|
|
-- channels --
|
-- channels --
|
|
pwm_o <= (others => '0');
|
for i in 0 to NUM_CHANNELS-1 loop
|
for i in 0 to NUM_CHANNELS-1 loop
|
if (unsigned(pwm_cnt) >= unsigned(pwm_ch(i))) or (enable = '0') then
|
if (unsigned(pwm_cnt) >= unsigned(pwm_ch(i))) or (enable = '0') then
|
pwm_o(i) <= '0';
|
pwm_o(i) <= '0';
|
else
|
else
|
pwm_o(i) <= '1';
|
pwm_o(i) <= '1';
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.