Help!!!! Async internal signal generation

S

sonny

Hi

i am just a newbie and need some help...... i need to generate reset
signal using many internal signals... in simulations, it works fine,
but not sure how it synthesizes the process down below.... i know this
code is not really nice, but have no clue how to make it better....
plz help me out with this.... any help would be very helpful.... thx
in advance.

sonny


p_rst : process(dly_ctrl_a_i, dly_rst_i, int_flg_s, over_flow_s,
ctlr_rst_s, mix_subphase, capt_en_mix_s)
begin
if ctlr_rst_s = '1' or capt_en_mix_s = '1' or mix_subphase
= '1' then
if dly_ctrl_a_i = '1' then
rst_s <= '1';
end if;
if rising_edge(over_flow_s) then
rst_s <= '0';
elsif falling_edge(int_flg_s) then
rst_s <= '0';
elsif falling_edge (dly_rst_i) then
rst_s <= '0';
end if;
else
rst_s <= '0';
end if;
end process;
 
R

Ralf Hildebrandt

sonny schrieb:

p_rst : process(dly_ctrl_a_i, dly_rst_i, int_flg_s, over_flow_s,
ctlr_rst_s, mix_subphase, capt_en_mix_s)
begin
if ctlr_rst_s = '1' or capt_en_mix_s = '1' or mix_subphase
= '1' then
if dly_ctrl_a_i = '1' then
rst_s <= '1';
end if;
if rising_edge(over_flow_s) then
rst_s <= '0';
elsif falling_edge(int_flg_s) then
rst_s <= '0';
elsif falling_edge (dly_rst_i) then
rst_s <= '0';
end if;
else
rst_s <= '0';
end if;
end process;

Don't use rising_edge / falling_edge nested in if clauses.
Don't use twice rising_endge / falling_edge.


Stick to the synchronous process template:

process(async_reset,clk)
begin
if (async_reset='0') then
-- do some asynchronous reset
elsif rising_edge(clk) then
-- do some synchronous stuff
end if;
end process;


Ask yourself: Do you really need both the falling_edge of int_flg_s and
the falling_edge of dly_rst_i? Is it possible to just use the level of
one of these signals? What about sampling these signals with a (fast) clock?


Remember, that rst_s needs a reset itself!


Ralf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top