T
titi
Is it better to write p1 and p2, or to write p_1_and_2?
Will p1 and p2, or p_1_and_2 have the same behaviour/be equally
synthetisable?
inputs:
clock, something,Reset, some_condition : std_logic ;
outputs:
s1 : std_logic ;
signal clock2 : std_logic ;
signal Not_clock : std_logic ;
signal over : std_logic ;
clock2 <= clock;
Not_clock <= not clock;
p_1rocess(Reset,clock2,something, over)
begin
if Reset ='1' then
s1 <= '0';
elsif (something ='1') then
if clock2'event and clock2 ='0' then
s1 <= '1';
end if;
elsif over ='1' then
s1 <= '0';
end if;
end process;
p_2rocess(Not_clock,some_condition)
begin
if Not_clock'event and Not_clock ='1' then
if(some_condition) then
over <= '0';
else
over <= '1';
end if;
end if;
end process;
p_1_and_2rocess(clock,some_condition)
begin
if Reset ='1' then
s1 <= '0';
elsif falling_edge(clock) then
if(some_condition) then
over <= '0';
else
over <= '1';
end if;
if (something ='1') then
s1 <= '1';
end if;
elsif over ='1' and (something /= '1') then
s1 <= '0';
end if;
end process;
Will p1 and p2, or p_1_and_2 have the same behaviour/be equally
synthetisable?
inputs:
clock, something,Reset, some_condition : std_logic ;
outputs:
s1 : std_logic ;
signal clock2 : std_logic ;
signal Not_clock : std_logic ;
signal over : std_logic ;
clock2 <= clock;
Not_clock <= not clock;
p_1rocess(Reset,clock2,something, over)
begin
if Reset ='1' then
s1 <= '0';
elsif (something ='1') then
if clock2'event and clock2 ='0' then
s1 <= '1';
end if;
elsif over ='1' then
s1 <= '0';
end if;
end process;
p_2rocess(Not_clock,some_condition)
begin
if Not_clock'event and Not_clock ='1' then
if(some_condition) then
over <= '0';
else
over <= '1';
end if;
end if;
end process;
p_1_and_2rocess(clock,some_condition)
begin
if Reset ='1' then
s1 <= '0';
elsif falling_edge(clock) then
if(some_condition) then
over <= '0';
else
over <= '1';
end if;
if (something ='1') then
s1 <= '1';
end if;
elsif over ='1' and (something /= '1') then
s1 <= '0';
end if;
end process;