Hi
I have problem with my code, need some help please.
If I erase the comment-dashes so I get State A3 from A2 when
C_In go from 0 to 1, then I get the error message :
VHDL error : can't infer register for signal State.a3 because signal does not
hold its value outside clock edge
Why does it work from State A1 to A2 but not for A2 to A3 ?
Thanks in advance
--------------------------------------------------------------
Entity Driver Is
port
(
A_In, C_In ,reset: In Std_Logic;
Data_Out : Out Std_Logic
);
End Entity;
architecture structure of Driver is
type State_type is (START,A1,A2);
--type State_type is (START,A1,A2,A3);
signal State : State_type;
begin
process(reset,C_In,A_In,State)
begin
if reset = '1' then
State <= START;
elsif (A_In='0' AND State = START) then
State <= A1;
elsif (rising_edge(C_In) AND State = A1) then
State <= A2;
-- elsif (rising_edge(C_In) AND State = A2) then
-- State <= A3;
end if;
end process;
process(State)
begin
case State is
When START =>
Data_Out <='Z';
when A1 =>
Data_Out <='0';
when A2 =>
Data_Out <='Z';
-- when A3 =>
-- Data_Out <= '1';
end case;
end process;
end structure;
I have problem with my code, need some help please.
If I erase the comment-dashes so I get State A3 from A2 when
C_In go from 0 to 1, then I get the error message :
VHDL error : can't infer register for signal State.a3 because signal does not
hold its value outside clock edge
Why does it work from State A1 to A2 but not for A2 to A3 ?
Thanks in advance
--------------------------------------------------------------
Entity Driver Is
port
(
A_In, C_In ,reset: In Std_Logic;
Data_Out : Out Std_Logic
);
End Entity;
architecture structure of Driver is
type State_type is (START,A1,A2);
--type State_type is (START,A1,A2,A3);
signal State : State_type;
begin
process(reset,C_In,A_In,State)
begin
if reset = '1' then
State <= START;
elsif (A_In='0' AND State = START) then
State <= A1;
elsif (rising_edge(C_In) AND State = A1) then
State <= A2;
-- elsif (rising_edge(C_In) AND State = A2) then
-- State <= A3;
end if;
end process;
process(State)
begin
case State is
When START =>
Data_Out <='Z';
when A1 =>
Data_Out <='0';
when A2 =>
Data_Out <='Z';
-- when A3 =>
-- Data_Out <= '1';
end case;
end process;
end structure;