Forum Discussion
Altera_Forum
Honored Contributor
15 years ago --- Quote Start --- I would say "this is not always true". --- Quote End --- It is always true. When anything is assigned in a single process, you cannot get conflicts, because A is only ever given a single value. Even if it assigned in two seperate branches, it is the final one that gets assigned that gives the value to A. in this example:
if T_sum>=x"410" then
A <=TTA;
B <=T_sum;
end if;
if T_sum>=x"410" then
A <=TTB;
B <=T_sum;
end if;
A is always assigned TTB. The synthesisor will just remove the circuit for assinging A to TTA, because it is never used as it overrides the assignment from TTA (signals always take the last value assigned to them before the process suspends). This practice is used all the time with state machines and other code, otherwise you wouldnt be allowed to give signals a default value. In 2 process state machines its even considered bad practice to forget the default assignment. eg:
a <= '1';
if input = '1' then
a <= '0';
end if;
I agree OPs code can be bad practice because you have redundant code, but A will NEVER be X. You will never get a conflict when A is assigned in a single process.