UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor kloadside
Visitor
9,077 Views
Registered: ‎08-06-2013

Xst doesn't realize that a signal is used ...

Jump to solution

For text display on a standard terminal application, I push data on a simple Rs-232 Tx interface. All that works fine.

 

I was in a rush while coding this, and since I'm not so familiar with manipulations of types string and character, I couldn't spend time to refactor it then, so the code is a mess. Now I want to clean it up, using the 'pos attribute and clean string message definition.

 

In doing so, I made a few tests, and the temporary character type(Tesss) that I use, is transmitted and displayed correctly. But just for its initial value !! 

 

signal Tesss                      : character := 'B';

 

The problem is that I can't assign it at runtime, like here :

 

  Tesss_l : process (i_clkDebugPort_p)
  begin
    if rising_edge(i_clkDebugPort_p) then
      Tesss <= 'K';
      IntegTess <= Character'pos(Tesss);
    end if;
  end process Tesss_l;

 

because Xst disolves the assignement, according to the following reported warning :

 

WARNING:HDLCompiler:1127 - "C:\Projets\Cam\ImtPrj\DesignFolders\Src\serialdebugport.vhd" Line 404: Assignment to tesss ignored, since the identifier is never used

 

but it is used in :

 

  av8_ClkErrorString_s(1) <= std_logic_vector(to_unsigned(Character'pos(Tesss),8));

 

and I can see the 'B' character, of the initial value, being displayed properly on my terminal ...  ???

 

I'm very well aware about resource removal when a given signal as no load, but this is obviously not the case here. There seems to be something special about string or character type that I don't know about ...

 

I'm not stuck right now, so feel free to take the time you need for answering.

 

Thanks,

Regards,

Kload

0 Kudos
1 Solution

Accepted Solutions
Visitor kloadside
Visitor
7,773 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

I confirm that when the warning is gone, it also works fine in real life(with code of message 9).

 

Many thanks everyone !

0 Kudos
13 Replies
Instructor
Instructor
9,062 Views
Registered: ‎08-14-2007

Re: Xst doesn't realize that a signal is used ...

Jump to solution

My first guess is that there's something in your code that prevents the assignment of

av8_ClkErrorString_s(1) from happening.  I'd check for warnings about this.  You don't

show the process containing this assignment, so I can't comment on how it might be

prevented from happening, but typical cases are unconnected clocks or always asserted

resets.

 

-- Gabor
0 Kudos
Historian
Historian
9,058 Views
Registered: ‎02-25-2008

Re: Xst doesn't realize that a signal is used ...

Jump to solution

@kloadside wrote:

For text display on a standard terminal application, I push data on a simple Rs-232 Tx interface. All that works fine.

 

I was in a rush while coding this, and since I'm not so familiar with manipulations of types string and character, I couldn't spend time to refactor it then, so the code is a mess. Now I want to clean it up, using the 'pos attribute and clean string message definition.

 

In doing so, I made a few tests, and the temporary character type(Tesss) that I use, is transmitted and displayed correctly. But just for its initial value !! 

 

signal Tesss                      : character := 'B';

 

The problem is that I can't assign it at runtime, like here :

 

  Tesss_l : process (i_clkDebugPort_p)
  begin
    if rising_edge(i_clkDebugPort_p) then
      Tesss <= 'K';
      IntegTess <= Character'pos(Tesss);
    end if;
  end process Tesss_l;

 

because Xst disolves the assignement, according to the following reported warning :

 

WARNING:HDLCompiler:1127 - "C:\Projets\Cam\ImtPrj\DesignFolders\Src\serialdebugport.vhd" Line 404: Assignment to tesss ignored, since the identifier is never used

 

but it is used in :

 

  av8_ClkErrorString_s(1) <= std_logic_vector(to_unsigned(Character'pos(Tesss),8));

 

and I can see the 'B' character, of the initial value, being displayed properly on my terminal ...  ???

 

I'm very well aware about resource removal when a given signal as no load, but this is obviously not the case here. There seems to be something special about string or character type that I don't know about ...

 

I'm not stuck right now, so feel free to take the time you need for answering.

 

Thanks,

Regards,

Kload


In your example, you hard-code the assignment to Tesss in the process. The tools correctly recognize that as a constant assignment and toss it out. That the assignment of Tesss to IntegTess takes place on the next clock tick doesn't matter, because it still boils down to a constant.

 

The 'pos attribute does work with recent versions of XST.

----------------------------Yes, I do this for a living.
0 Kudos
Visitor kloadside
Visitor
9,016 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

It is a simple concurrent signal assignement(not in a synchronous process), as displayed in the text.

 

I have boiled down the code to its simplest expression, as follows(some names have changed, but the issue is the same) :

 


library ieee;
  use ieee.std_logic_1164.all;
  use ieee.numeric_std.all;


entity SerialDebugPort is port
  (
    i_clkDebugPort_p            : in std_logic;

    ov8_DataToSend_p            : out std_logic_vector(7 downto 0);
    IntegTess                   : out integer
  );
end SerialDebugPort;


architecture Beh of SerialDebugPort is

  signal Tesss                      : character := 'B';

begin

  Tesss_l : process (i_clkDebugPort_p)
  begin
    if rising_edge(i_clkDebugPort_p) then
      Tesss <= 'K';
      IntegTess <= Character'pos(Tesss);
    end if;
  end process Tesss_l;

  ov8_DataToSend_p <= std_logic_vector(to_unsigned(Character'pos(Tesss),8));

end Beh;

 

I also included another assignement using Tesss, but in a synchronous process this time, without noticing changes.

 

Reducing the code, I noticed another warning which I think is of great interest(even though I don't get what it means ...) :

 

WARNING:HDLCompiler:634 - "C:\Projets\Cam\ImtPrj\DesignFolders\Src\serialdebugport.vhd" Line 19: Net <Tesss[7]> does not have a driver.

0 Kudos
Visitor kloadside
Visitor
9,014 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

The initial value of Tesss is different than the one in the assignement, therefore, Xst should not bring it down to a simple constant, since it should have a different value, before vs after the first rising edge of the clock..

0 Kudos
Instructor
Instructor
9,003 Views
Registered: ‎08-14-2007

Re: Xst doesn't realize that a signal is used ...

Jump to solution

Can you reproduce the problem with the boiled-down code?

 

I was wondiring if there was something about the assignment to an element of an array

in your original code that may have caused the problem, i.e. is there a difference going

from:

 

av8_ClkErrorString_s(1) <= std_logic_vector(to_unsigned(Character'pos(Tesss),8));

 

to:

 

ov8_DataToSend_p <= std_logic_vector(to_unsigned(Character'pos(Tesss),8));

 

Also I'm not sure why you get the "no driver" warning, unless this happens after some

optimization.  I've seen cases where XST decides that a net is constant '0' (as in this case)

and therefore reduces it to GND, later compaining that the original net has no driver.  However

the default action in XST for undriven nets is to tie them to GND.

-- Gabor
0 Kudos
Visitor kloadside
Visitor
8,998 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

Yes Gabor, I get the same warning :

 

WARNING:HDLCompiler:1127 - "C:\Projets\Cam\ImtPrj\DesignFolders\Src\serialdebugport.vhd" Line 404: Assignment to tesss ignored, since the identifier is never used

 

The array thing was intriguing me too, so that's why I replaced it with a simple std_logic_vector.

 

For the bit 7 that gets trimmed away, I also tought about what you wrote, and I tried narrowing down the datapath to (6 downto 0), to see what I would get, but at that time, the warning was still there, but on bit 6 instead ... ??

0 Kudos
Instructor
Instructor
8,994 Views
Registered: ‎08-14-2007

Re: Xst doesn't realize that a signal is used ...

Jump to solution

Perhaps this is related to the 'pos problem as noted by bassman.

 

As to the bit 6 issue, I'm not sure why you'd only get this on the MSB.  However if you look

at the two codes for "B" and "K" you'll see that Bits 7, 6, 5, 4, 2, and 1 never change.  So

unless you change the "K" to something more interesting, I'd expect there to be something

similar to the original warning.

-- Gabor
0 Kudos
Visitor kloadside
Visitor
8,990 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

Bingo !

 

Slightly changing the assignement in the code as follows :

 

  Tesss_l : process (i_clkDebugPort_p)
  begin
    if rising_edge(i_clkDebugPort_p) then
      if Tesss = 'B' then
        Tesss <= 'K';
      else
        Tesss <= 'B';
      end if;

      IntegTess <= Character'pos(Tesss);
    end if;
  end process Tesss_l;

just to make sure that Tesss would not be seen static, throughout operation, and the warning disappeared !

Well, it seems like initial conditions are not treated the same way with character type, as with std_logic ...

 

I will rebuild the project and test it on my board, to validate the issue is fixed, but it is looking good !

0 Kudos
Explorer
Explorer
8,981 Views
Registered: ‎12-01-2010

Re: Xst doesn't realize that a signal is used ...

Jump to solution

Hi,

It delete the signal because you do not use it or the algorithm may sometimes does not realize that it is useful. You can either rewrite the code or use keep statement, I guess.

0 Kudos
Visitor kloadside
Visitor
7,774 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

I confirm that when the warning is gone, it also works fine in real life(with code of message 9).

 

Many thanks everyone !

0 Kudos
Instructor
Instructor
5,117 Views
Registered: ‎08-14-2007

Re: Xst doesn't realize that a signal is used ...

Jump to solution

It's still troubling that when the design didn't work you saw "B" on the output rather than "K".  Given

the change that fixed this problem, it makes little sense why you would have seen "B"

-- Gabor
0 Kudos
Visitor kloadside
Visitor
5,070 Views
Registered: ‎08-06-2013

Re: Xst doesn't realize that a signal is used ...

Jump to solution

You are right Gabor, but it matches the warning message though, saying that the assignement to the signal will be ignored, since the signal is not used.

 

So 'B' being the initial value, and 'K' the assigned value; since the assignement is ignored, it is expected to see 'B' as an output.

 

Maybe it would be good to have someone at Xilinx to look at it in deeper details ...

 

Regards,

Kload

0 Kudos
Highlighted
Participant aiman_alabdo
Participant
4,808 Views
Registered: ‎11-09-2012

Re: Xst doesn't realize that a signal is used ...

Jump to solution

You can solve it by define Tesss as VARIABLE!

Tags (1)
0 Kudos