EmbDev.net

Forum: FPGA, VHDL & Verilog Synthesis: Mix of sync and async assignments to register


von if else what when (Guest)


Rate this post
0 useful
not useful
During synthesis I get the following warning message stated:
"Mix of sync and async assignments to register 'Sig_Z' in module XXX in 
the same process may cause logic issues. Please split the sync and async 
parts into different processes."

The respective process is the following:
process(Sig_A, Sig_B)
begin
     for I in 0 to 3 loop
          Sig_Z(I) <= '0'
          if(Sig_A(I) > Sig_B(I) then
                    Sig_Z <= '1';
          end if;
     end loop;
end process;

I don't really get what the tool (Vivado) tries to tell me here. All the 
input signals (Sig_A, Sig_B) are coming from other flipflops, there is 
only one clock in the entire design. Synthesis completes fine and the 
result is working on my FPGA. However, I don't really trust this and 
asynchronous logic is not something I want to have in my design.
Does anybody recognize what I did wrong? Can I ignore this warning?

: Moved by Moderator
von Samuel C. (neoexacun)


Rate this post
0 useful
not useful
You mix Sig_Z and Sig_Z(I).

von if else what when (Guest)


Rate this post
0 useful
not useful
Ah shit, that was a mistake while copying it here, the code I used 
contains only Sig_Z(I)
process(Sig_A, Sig_B)
begin
     for I in 0 to 3 loop
          Sig_Z(I) <= '0'
          if(Sig_A(I) > Sig_B(I) then
                    Sig_Z(I) <= '1';
          end if;
     end loop;
end process;

von daniel__m (Guest)


Rate this post
0 useful
not useful
hi,

the issue is not in the provided code.

von Lothar M. (lkmiller) (Moderator)


Rate this post
0 useful
not useful
if else what when schrieb:
> Can I ignore this warning?
Only when you know why you get the message and only if you want that 
what the message tells.

daniel__m schrieb:
> the issue is not in the provided code.
So it is.

von if else what when (Guest)


Rate this post
0 useful
not useful
Lothar M. wrote:
> Only when you know why you get the message and only if you want that
> what the message tells.

Well that's why I was asking ;)

daniel__m wrote:
> the issue is not in the provided code.

Since tonight I doubt this because I was able to solve it with trial and 
error. The new code is this:
process(Sig_A, Sig_B)
begin
     for I in 0 to 3 loop
          -- Sig_Z(I) <= '0'  -- remove this line
          if(Sig_A(I) > Sig_B(I) then
                    Sig_Z(I) <= '1';
          else
                    Sig_Z(I) <= '0'      -- Put this in an else section instead of having it in front of the if statement
          end if;
     end loop;
end process;


In my opinion both pieces of code should do the same, simulation results 
are the same, testing on the FPGA results in the same. I didn't have 
time to check the synthesized logic so far.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig