【发布时间】:2023-03-19 11:50:02
【问题描述】:
我正在尝试模拟脉冲宽度调制 (PMW) 波形发生器并在 ISE 中遇到语法错误。检查了 fuse.xmsgs 并发现它在柜台附近。有人能指出语法错误吗?
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.numeric_std.all;
entity pwm_gen is
port
(
clock, reset : in std_logic;
width : in std_logic_vector(7 downto 0);
pwm : out std_logic);
end pwm_gen;
architecture bhv of pwm_gen is
type counter is range 0 to 255;
counter count := 0;
begin
process (clock)
begin
if (reset = '1') then
count <= 0;
elsif (clock'event and clock = '1') then
if (count <= width) then
count <= count + 1;
pwm <= '1';
else
count <= count + 1;
pwm <= '0';
end if;
end if;
end process;
end bhv;
【问题讨论】:
标签: syntax-error vhdl simulation pwm xilinx-ise