Z
Zenock
Guest
Hello:
I'm new to VHDL and am running into some trouble. I know the code
listed below doesn't work. I don't understand exactly why it doesn't
work.
Basically, I can't figure out why I can't trigger off a rising AND a
falling edge only one or the other. So in essence, I want to know, what
is the correct way to do this?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity light_seqv is
Port(
Pulse_in :in std_logic;
Pulse_out ut std_logic;
Run_stop ut std_logic
);
end light_seqv;
architecture Behavioral of light_seqv is
Constant FALSE : std_logic := '0';
Constant TRUE : std_logic := '1';
Constant zero4 : std_logic_vector(3 downto 0) := "0000";
signal count_up : std_logic_vector(3 downto 0) :=zero4;
signal i_cnt : std_logic := '0';
signal run : std_logic := '0';
begin
process (Pulse_in)
begin
if Rising_edge(Pulse_in) Then
if count_up = 0 or count_up = 2 or count_up = 12 Then
i_cnt <= TRUE;
count_up <= count_up + 1;
elsif count_up = 14 Then
i_cnt <= TRUE;
count_up <= zero4;
run <= TRUE;
else
i_cnt <=FALSE;
count_up <= count_up + 1;
end if;
elsif Falling_edge(Pulse_in) Then
i_cnt <= FALSE;
run <= FALSE;
end if;
end process;
Pulse_out <= i_cnt;
Run_stop <= run;
end Behavioral;
Trying to do this in XILINX Web Pac repeatedly gives me...
Signal i_cnt cannot be synthesized, bad synchronous description
Basically what the module is count the clock pulses, on the very 1st,
3rd, 12th, and 15th pulse it needs to output a pulse. On the 15th
pulse it needs to set the count back to 0 so it can start over again
and send an additional signal to let another module no that the 15th
pulse was reached.
I'm new to VHDL and am running into some trouble. I know the code
listed below doesn't work. I don't understand exactly why it doesn't
work.
Basically, I can't figure out why I can't trigger off a rising AND a
falling edge only one or the other. So in essence, I want to know, what
is the correct way to do this?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity light_seqv is
Port(
Pulse_in :in std_logic;
Pulse_out ut std_logic;
Run_stop ut std_logic
);
end light_seqv;
architecture Behavioral of light_seqv is
Constant FALSE : std_logic := '0';
Constant TRUE : std_logic := '1';
Constant zero4 : std_logic_vector(3 downto 0) := "0000";
signal count_up : std_logic_vector(3 downto 0) :=zero4;
signal i_cnt : std_logic := '0';
signal run : std_logic := '0';
begin
process (Pulse_in)
begin
if Rising_edge(Pulse_in) Then
if count_up = 0 or count_up = 2 or count_up = 12 Then
i_cnt <= TRUE;
count_up <= count_up + 1;
elsif count_up = 14 Then
i_cnt <= TRUE;
count_up <= zero4;
run <= TRUE;
else
i_cnt <=FALSE;
count_up <= count_up + 1;
end if;
elsif Falling_edge(Pulse_in) Then
i_cnt <= FALSE;
run <= FALSE;
end if;
end process;
Pulse_out <= i_cnt;
Run_stop <= run;
end Behavioral;
Trying to do this in XILINX Web Pac repeatedly gives me...
Signal i_cnt cannot be synthesized, bad synchronous description
Basically what the module is count the clock pulses, on the very 1st,
3rd, 12th, and 15th pulse it needs to output a pulse. On the 15th
pulse it needs to set the count back to 0 so it can start over again
and send an additional signal to let another module no that the 15th
pulse was reached.