Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Regular Visitor
wfedorko
Posts: 24
Registered: ‎01-17-2012
0

XST:1710 and XST:2385 unexpected ff trimming and multiplier performance

Hello,

 

I have a problem with unexpected ff trimming. The code below is a minaturized version that displays the problem (not 'real' code for my design).

 

The module has two 12-bit inputs One and Two which are each 'interpreted' as composed of 2 signals A and B 6 bits each which are 'unsigned'.

 

I take a difference diffOne of OneA and OneB and also diffTwo of TwoA and TwoB, then I take calculate squares of the differences and output the sum.

 

 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;


use IEEE.NUMERIC_STD.ALL;

library UNISIM;
use UNISIM.VComponents.all;


entity demobug_top is
    Port ( clk_in : in  STD_LOGIC;
           rst_in : in STD_LOGIC;
           BigVarA: in std_logic_vector(11 downto 0);
           BigVarB: in std_logic_vector(11 downto 0);
           diffSq: out unsigned(12 downto 0));
           
           
end demobug_top;

architecture Behavioral of demobug_top is

  
  signal VarOneA:  unsigned(5 downto 0);
  signal VarOneB:  unsigned(5 downto 0);
  signal VarTwoA:  unsigned(5 downto 0);
  signal VarTwoB:  unsigned(5 downto 0);

  signal VarOneA_reg : unsigned(5 downto 0);
  signal VarOneB_reg : unsigned(5 downto 0);
  signal VarTwoA_reg : unsigned(5 downto 0);
  signal VarTwoB_reg : unsigned(5 downto 0);

  signal diffOne_sig : unsigned(5 downto 0);
  signal diffTwo_sig : unsigned(5 downto 0);

  signal diffOne_reg : unsigned(5 downto 0);
  signal diffTwo_reg : unsigned(5 downto 0);

  signal diffOneSq_reg : unsigned(11 downto 0) := (others=>'0');
--  signal diffOneSq_reg : unsigned(11 downto 0);
  signal diffTwoSq_reg : unsigned(11 downto 0) := (others=>'0');
--  signal diffTwoSq_reg : unsigned(11 downto 0);

  signal diffSq_sig : unsigned(12 downto 0);

begin

  VarOneA<=unsigned(BigVarA(11 downto 6));
  VarTwoA<=unsigned(BigVarA(5 downto 0));

  VarOneB<=unsigned(BigVarB(11 downto 6));
  VarTwoB<=unsigned(BigVarB(5 downto 0));

  

  process(clk_in)
  begin
    if rising_edge(clk_in) then
      if rst_in='1' then
        VarOneA_reg<=(others => '0');
        VarOneB_reg<=(others => '0');
        VarTwoA_reg<=(others => '0');
        VarTwoB_reg<=(others => '0');
      else
        VarOneA_reg<=VarOneA;
        VarOneB_reg<=VarOneB;
        VarTwoA_reg<=VarTwoA;
        VarTwoB_reg<=VarTwoB;
      end if;
    end if;
  end process;
  

  diffOne_sig<=VarOneB_reg-VarOneA_reg;
  diffTwo_sig<=VarTwoB_reg-VarTwoA_reg;

  process(clk_in)
  begin
    if rising_edge(clk_in) then
      if rst_in='1' then
        diffOne_reg<=(others => '0');
        diffTwo_reg<=(others => '0');
      else
        diffOne_reg<=diffOne_sig;
        diffTwo_reg<=diffTwo_sig;
      end if;
    end if;
  end process;
  
  process(clk_in)
  begin
    if rising_edge(clk_in) then
      if rst_in='1' then
        diffOneSq_reg<=(others => '0');
        diffTwoSq_reg<=(others => '0');
      else
        diffOneSq_reg<=diffOne_reg*diffOne_reg;
        diffTwoSq_reg<=diffTwo_reg*diffTwo_reg;
      end if;
    end if;
  end process;

  diffSq<=diffOneSq_reg+('0'&(diffTwoSq_reg));

  
end Behavioral;

 

Synthesis displays a warning and an info message that I find worrying:

Xst:1710 - FF/Latch <Maddsub_diffOne_reg[5]_diffOne_reg[5]_MuLt_18_OUT_12> (without init value) has a constant value of 0 in block <demobug_top>. This FF/Latch will be trimmed during the optimization process.
Xst:2677 - Node <Maddsub_diffOne_reg[5]_diffOne_reg[5]_MuLt_18_OUT_1> of sequential type is unconnected in block <demobug_top>.
Xst:2677 - Node <Maddsub_diffOne_reg[5]_diffOne_reg[5]_MuLt_18_OUT_0> of sequential type is unconnected in block <demobug_top>.
Xst:2385 - HDL ADVISOR - You can improve the performance of the multiplier Mmult_diffTwo_reg[5]_diffTwo_reg[5]_MuLt_19_OUT by adding 1 register level(s).

 

The question is - why does the synthesis flag this - I think the values in the register should not in general be constant...

Why does this happen? Why only the FF for One is trimmed and not the FF for Two ?

The latter two warnings are most likely the result of the first one. 

Ant then the second question - about the Xst:2385 - why does this happen. I thought I already did the right thing with putting a sync reset register so that the FF inside the DSP48E1 would be used.  In fact the snip from the console seems to say that but still I get this message - why?

 

 Here is the XST console snip:

=========================================================================
*                       Advanced HDL Synthesis                          *
=========================================================================


Synthesizing (advanced) Unit <demobug_top>.
	Multiplier <Mmult_diffOne_reg[5]_diffOne_reg[5]_MuLt_18_OUT> in block <demobug_top> and adder/subtractor <Madd_diffSq> in block <demobug_top> are combined into a MAC<Maddsub_diffOne_reg[5]_diffOne_reg[5]_MuLt_18_OUT>.
	The following registers are also absorbed by the MAC: <diffOneSq_reg> in block <demobug_top>.
	Found pipelined multiplier on signal <diffTwo_reg[5]_diffTwo_reg[5]_MuLt_19_OUT>:
		- 1 pipeline level(s) found in a register connected to the multiplier macro output.
		Pushing register(s) into the multiplier macro.
INFO:Xst:2385 - HDL ADVISOR - You can improve the performance of the multiplier Mmult_diffTwo_reg[5]_diffTwo_reg[5]_MuLt_19_OUT by adding 1 register level(s).
Unit <demobug_top> synthesized (advanced).

=========================================================================
Advanced HDL Synthesis Report

Macro Statistics
# MACs                                                 : 1
 6x6-to-13-bit MAC                                     : 1
# Multipliers                                          : 1
 6x6-bit registered multiplier                         : 1
# Adders/Subtractors                                   : 2
 6-bit subtractor                                      : 2
# Registers                                            : 36
 Flip-Flops                                            : 36

 

In fact why only one registered 6x6 multiplier is infered?

 

I am working with Virtex 6 (hc6vhx565t-1ff1924).

 

 

Thank you for your help,

Wojtek

 

 

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: XST:1710 and XST:2385 unexpected ff trimming and multiplier performance

See logic trimming in ISE:  link#1

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Regular Visitor
wfedorko
Posts: 24
Registered: ‎01-17-2012
0

Re: XST:1710 and XST:2385 unexpected ff trimming and multiplier performance

Hello,

 

In the link pointed to describes behavior of map while here the problem occurs already at synthesis. In any case in the code attached I don't see undriven or loadless or constant signals or cycles. The link advises to look at sections 4 and 5 of the mrp. So I run map and I get this:

Section 4 - Removed Logic Summary
---------------------------------
   2 block(s) optimized away

Section 5 - Removed Logic
-------------------------

Optimized Block(s):
TYPE            BLOCK
GND             XST_GND
VCC             XST_VCC

To enable printing of redundant blocks removed and signals merged, set the
detailed map report option and rerun map.

 So it seems that the component is already removed.

 

In the full design it's harder to see if I have any cycles, constants etc (and if I do have any of these this would most likely indicate a bug - this is why I am worried). However in the design described by the code attached I really don't see any of such problems. If you do can you point it out? 

 

Additional piece of information (I just tried that) is that when I change the last line to:

 diffSq<=diffOneSq_reg+diffTwoSq_reg;

 The warning disappears. However I do want to keep the ... +('0'&(diffTwoSq_reg)) to make the the output 13 bit in case both 12 bit numbers. It is a constant but I don't understand how this '0' is part of the register described before that line in the code. 

 

Also does anyone have any pointers on the Xst:2385 message? Why is the design described by this code not already 'optimal' as fas as maximizing the DSP block performance? I already do have sync reset at the input and output. As far as I understand these FFs should be pushed into the DSP.

 

Thank you,

Wojtek

 

 

 

Regular Visitor
wfedorko
Posts: 24
Registered: ‎01-17-2012
0

Re: XST:1710 and XST:2385 unexpected ff trimming and multiplier performance

Hi,

 

I have reduced the code further, I would really appreciate if someone took a look.

What this circuit does is it takes two signals VarA and VarB (both unsigned), calculates squares of both VarA*VarA and VarB*VarB, both results are put into register; the values in the register are added and connected to the output. The addition is done with values with a '0' pre-pended so that I get an adder which is one bit wider (so that carry is not lost). Another part is doing something very similar with input cignals VarC and VarD except without squaring. I.e. VarC,VarD -> register -> sum with pre-pending -> output.

 

Code:

 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

use IEEE.NUMERIC_STD.ALL;

library UNISIM;
use UNISIM.VComponents.all;

entity demobug_top is
    Port ( clk_in : in  STD_LOGIC;
           rst_in : in STD_LOGIC;
           VarA: in unsigned(5 downto 0);
           VarB: in unsigned(5 downto 0);
           VarC: in unsigned(5 downto 0);
           VarD: in unsigned(5 downto 0);
           sumAsqBsq: out unsigned(12 downto 0);
           sumCD: out unsigned(6 downto 0));
           
           
end demobug_top;

architecture Behavioral of demobug_top is

  signal VarASq : unsigned(11 downto 0);
  signal VarBSq : unsigned(11 downto 0);
  
  signal VarASq_reg : unsigned(11 downto 0) := (others=>'0');
  signal VarBSq_reg : unsigned(11 downto 0) := (others=>'0');

  signal VarC_reg : unsigned(5 downto 0);
  signal VarD_reg : unsigned(5 downto 0);

begin

  VarASq<=VarA*VarA;
  VarBSq<=VarB*VarB;
  

  process(clk_in)
  begin
    if rising_edge(clk_in) then
      if rst_in='1' then
        VarASq_reg<=(others => '0');
        VarBSq_reg<=(others => '0');
        VarC_reg<=(others => '0');
        VarD_reg<=(others => '0');
        
      else
        VarASq_reg<=VarASq;
        VarBSq_reg<=VarBSq;
        VarC_reg<=VarC;
        VarD_reg<=VarD;       
      end if;
    end if;
  end process;
  
  sumAsqBsq<=('0'&(VarBSq_reg))+('0'&(VarASq_reg));
  sumCD<=('0'&(VarC_reg))+('0'&(VarD_reg));            
    
end Behavioral;

 

I am getting warnings about logic trimming and unconnected signals which I do not understand the reason for. No value in register should be constant and there shouldn't be any unconnected signals. Moreover I am only getting these warnings for the register holding the squared value and not the value straight from the input. So there seems to be something odd going on with the multiplier register.

 

Here is paste of the warnings:

Xst:1710 - FF/Latch <Maddsub_VarBSq_12> (without init value) has a constant value of 0 in block <demobug_top>. This FF/Latch will be trimmed during the optimization process.
Xst:2677 - Node <Maddsub_VarBSq_1> of sequential type is unconnected in block <demobug_top>.
Xst:2677 - Node <Maddsub_VarBSq_0> of sequential type is unconnected in block <demobug_top>.

 

I really appreciate your help. I have already spent quite a bit of time on this and can't solve this.

 

Thank you,

Wojtek

 

 

Expert Contributor
bassman59
Posts: 4,739
Registered: ‎02-25-2008

Re: XST:1710 and XST:2385 unexpected ff trimming and multiplier performance

Humor me, and try something.

 

Instead of explictly zero-extending VarASq_reg and VarBSq_reg before the addition, use the resize() function:

 

    sumAsqBsq <= resize(VarASq_reg, sumAsqBsq'length) + resize(VarBSq_reg, sumAsqBsq'length);

 

What I suspect might be happening is that the synthesizer is baffled by the concatenation of a constant '0' and an unsigned. I don't know what type that ends up being. When you use the resize(), you get two unsigneds of the size of the sum, and the synthesizer knows how to handle adding two unsigneds.

 

 


----------------------------------------------------------------
Yes, I do this for a living.
Regular Visitor
wfedorko
Posts: 24
Registered: ‎01-17-2012
0

Re: XST:1710 and XST:2385 unexpected ff trimming and multiplier performance

Hi,

 

That is indeed much cleaner but doesn't solve the problem (same warnings about ff trimming - I tried).

 

However I just solved this (thanks to an expert friend).

The problem most likely is a manifestation of the xst bug described here

Adding KEEP on the registers:

 

attribute KEEP of VarBSq_reg,VarASq_reg : signal is "TRUE";

helps.

 

To optimize performance of the multiplier one needs to simply add one more stage in the pipeline just as the XST suggests. If one does this the KEEP must be put on that second stage of the registers otherwise they will not be both pushed into the DSP.

 

Could someone from Xilinx confirm that logic trimming is indeed due to a bug? 

Thank you,

Wojtek

Expert Contributor
bassman59
Posts: 4,739
Registered: ‎02-25-2008
0

Re: XST:1710 and XST:2385 unexpected ff trimming and multiplier performance


wfedorko wrote:

Hi,

 

That is indeed much cleaner but doesn't solve the problem (same warnings about ff trimming - I tried).

 

However I just solved this (thanks to an expert friend).

The problem most likely is a manifestation of the xst bug described here

Adding KEEP on the registers:

 

attribute KEEP of VarBSq_reg,VarASq_reg : signal is "TRUE";

helps.

 

To optimize performance of the multiplier one needs to simply add one more stage in the pipeline just as the XST suggests. If one does this the KEEP must be put on that second stage of the registers otherwise they will not be both pushed into the DSP.

 

Could someone from Xilinx confirm that logic trimming is indeed due to a bug? 

Thank you,

Wojtek


Yikes. Ugly. It's worth opening a WebCase to get an official response.


----------------------------------------------------------------
Yes, I do this for a living.