non-static others choice

N

Nicolas Matringe

Hi
I have a warning and I wonder if I should worry about it or not (I think
it's safe but maybe there's a hidden trap there):

....
generic (length : natural := 4);
....
signal slvec : std_logic_vector(length - 1 downto 0)
....
process (clk, rst)
begin
if rst = '1' then
slvec <= (0 => '1', others => '0');
elsif rising_edge(clk) then
....

ModelSim issues a warning:
"Non-static aggregate with multiple choices has non-static others choice."

Any advice?

Thanks in advance
Nicolas
 
D

Deb P

Nicolas Matringe said:
Hi
I have a warning and I wonder if I should worry about it or not (I think
it's safe but maybe there's a hidden trap there):

...
generic (length : natural := 4);
...
signal slvec : std_logic_vector(length - 1 downto 0)
...
process (clk, rst)
begin
if rst = '1' then
slvec <= (0 => '1', others => '0');
elsif rising_edge(clk) then
...

ModelSim issues a warning:
"Non-static aggregate with multiple choices has non-static others choice."

Any advice?

Thanks in advance
Nicolas

Since the range of the signal "slvec" is globally static (should be
locally static), this assignment is illegal as per VHDL LRM. Same
rules are cases switches and "when" assignments. However, some(most ?)
simulators allow this with a warning which you are seeing. It should
be fine.

I feel this restriction in VHDL is unnecessary and a simplification
made to make elaboration easier. Lord knows it is complicated enough
already.

Good Luck
Debjyoti
 
P

Paul Uiterlinden

Nicolas said:
Hi
I have a warning and I wonder if I should worry about it or not (I think
it's safe but maybe there's a hidden trap there):

...
generic (length : natural := 4);
...
signal slvec : std_logic_vector(length - 1 downto 0)
...
process (clk, rst)
begin
if rst = '1' then
slvec <= (0 => '1', others => '0');
elsif rising_edge(clk) then
...

ModelSim issues a warning:
"Non-static aggregate with multiple choices has non-static others choice."

Any advice?

Use:

if rst = '1' then
slvec(slvec'range => '0');
slvec(0 <= '1');
elsif rising_edge(clk) then

Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top