[an error occurred while processing this directive]
Разборка процесса формирования ШИМ
(«Телесистемы»: Конференция «Языки описания аппаратуры (VHDL и др.))

миниатюрный аудио-видеорекордер mAVR

Отправлено timurNSTU 31 января 2005 г. 06:51

Как из этого куска кода PWM0 и PWM1 выделить в отдельный процесс, причём так, чтобы после этого мог быть синтез, ну или по крайней мере моделирование без красных линий. Среда: ISE+Modelsim
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

-- Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;

entity PWM is
Port ( CompareValue : in std_logic_vector(7 downto 0);
Period : in std_logic_vector(7 downto 0);
Reset : in std_logic;
Clk : in std_logic;
OutputEnable : in std_logic;
PWM0 : out std_logic;
PWM1 : out std_logic;
Counter : inout std_logic_vector (7 downto 0);
Compared : inout std_logic;
PWMOutputEnable : inout std_logic;
Direction : inout std_logic
);
end entity PWM;

architecture Behavioral of PWM is

begin
PWM_Reset_And_Clock: process (Reset, Clk)
begin
if Reset = '0' then
PWM0 <= '0';
PWM1 <= '0';
Counter <= "00000000";
Direction <= '0';
PWMOutputEnable <= '0';
elsif Rising_Edge(Clk) then
if Direction = '0' then
Counter <= Counter+"00000001";
if Counter = (Period-"00000001") then
Direction <= '1';
end if;
else
Counter <= Counter-"00000001";
if Counter = "00000001" then
Direction <= '0';
end if;
end if;
if PWMOutputEnable = '1' then
if Counter = CompareValue then
PWM0 <= '1';
PWM1 <= '0';
else
PWM0 <= '0';
PWM1 <= '1';
end if;
end if;
PWMOutputEnable <= OutputEnable;
end if;
end process PWM_Reset_And_Clock;

end architecture Behavioral;

В ентити вводы-выводы натыканы для отладки. В принципе их можно разместить в теле архитектуры. Но тогда этих сигналов в Modelsim не видно.

Составить ответ  |||  Конференция  |||  Архив

Ответы


Отправка ответа

Имя (обязательно): 
Пароль: 
E-mail: 

Тема (обязательно):
Сообщение:

Ссылка на URL: 
Название ссылки: 

URL изображения: 


Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru