On Mon, 24 Mar 2014 12:55:12 +0000, alb wrote:
> Hi everyone,
>
> it seems the above warning is filed when some of my signals/variables
> are not initialized and therefore some metavalue is either propagated
> or, as in this case, forced to some value.
>
> These warnings happens only at time 0 and do not bother me too much in
> general, but I hate discarding these long list of warnings everytime I
> run a sim. Any option to force vsim to *not* report warnings is not
> acceptable since I want to be able to see other potential problems.
>
> Any idea on how to get rid of those? AFAIK assigning default
> signal/variable values at declaration is not good habit since it may
> lead to a mismatch between pre-synth and post-synth behavior.
>
> BTW I also receive the same type of warning but filed from
> std_logic_arith: Warning: There is an 'U'|'X'|'W'|'Z'|'-' in an
> arithmetic operand, the result will be 'X'(es)
>
> the funny thing is that I'm not using std_logic_arith in my design (I do
> have std_logic_unsigned though[1])! Does this make any sense?
>
> Any comment is appreciated.
>
> Al
>
> [1] and yes, I know I shouldn't be using std_logic_unsigned since is not
> standard but the code is verified and I do not want to break something
> that has been delivered to us only because of the library.
Consider the following:
signal sig1 : std_logic := '1';
signal sig2 : std_logic;
...
statement1 : sig2 <= sig1;
Note that a signal declaration without an initialiser is equivalent to a
declaration with an initialiser of the leftmost value of the type, in
this case 'U'.
At the start of simulation, sig1 has the value '1', and sig2 has the
value 'U'.
The implicit process associated with the assignment in statement1 then
runs, and 1 delta cycle later, (the driver of) sig2 gets the value '1'.
So, sig2 starts with the value 'U', then 1 delta later (but still at time
0 ns) it gets the value '1'.
If you had a process which had sig2 in its sensitivity list, it would run
once at the start of simultion, when sig2 was 'U', then once more when
sig2 has the value '1'.
My guess is that in your code you have something like this:
signal u1 : unsigned(1 downto 0); -- no initialiser
signal u2 : unsigned(1 downto 0) := (others => '0');
signal u3 : unsigned(1 downto 0);
...
statement2 : u1 <= u2;
statement3 : u3 <= u1 + 1;
Initial: u1 is "UU', u2 is "00", u2 is "UU"
Then the statement3 process runs, and the warning about metavalues is
generated because u1 is "UU". U3 gets assigned the value "XX".
The next delta u1 is "00".
The statement3 process runs again. This time, no warning is generated
and u3 gets assigned the value "01".
Now consider what would happen if you'd given u1 an initialiser.
You should be able to join the dots from there.
Regards,
Allan