cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
393 Views
Registered: ‎02-10-2020

Bug in systemverilog synthesis?

Jump to solution

Hi,

Synthesizing the SV code below, in Vivado 2019.2:

module test_one(
  input logic a,
  input logic b,
  input logic c,
  output logic always_d,
  output logic always_comb_d);

  function logic my_func(input logic m_c);
    my_func = a | b | m_c;
  endfunction : my_func

  always @*
    always_d = my_func(c);

  always_comb
    always_comb_d = my_func(c);

endmodule

results in the following design:Design.PNG

so both always have the same truth table which is wrong. Is this a known bug in Vivado?

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
375 Views
Registered: ‎06-14-2018

Re: Bug in systemverilog synthesis?

Jump to solution

Hi @tii.hardware.developer.1 ,

For synthesis, here, always@* and always_comb both are same. 

Hence o/p is tied to same driver.

Thanks,

Ajay

View solution in original post

5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
376 Views
Registered: ‎06-14-2018

Re: Bug in systemverilog synthesis?

Jump to solution

Hi @tii.hardware.developer.1 ,

For synthesis, here, always@* and always_comb both are same. 

Hence o/p is tied to same driver.

Thanks,

Ajay

View solution in original post

Highlighted
Xilinx Employee
Xilinx Employee
324 Views
Registered: ‎05-14-2008

Re: Bug in systemverilog synthesis?

Jump to solution

It is a result of logic sharing optimization.

For the functions that generate the same result, only one of them is kept and the other one is removed.

If you'd like to keep both, you can add "keep" or "dont_touch" attributes.

-vivian

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 Kudos
Highlighted
281 Views
Registered: ‎02-10-2020

Re: Bug in systemverilog synthesis?

Jump to solution

Thanks @apetley, I was not aware of this behavior when synthesizing the always@* and always_comb with the Xilinx toolchain.

0 Kudos
Highlighted
278 Views
Registered: ‎02-10-2020

Re: Bug in systemverilog synthesis?

Jump to solution

Hi @viviany,

After @apetley's answer that makes sense, otherwise the optimization you mentioned could not be applied (i.e., the two outputs would not be always the same).

0 Kudos
Highlighted
Contributor
Contributor
224 Views
Registered: ‎10-25-2018

Re: Bug in systemverilog synthesis?

Jump to solution

@tii.hardware.developer.1 I am confused. Why do you think the truth tables would be different based on always_comb versus always @*?

0 Kudos