Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - non-static others choice

 
Thread Tools Search this Thread
Old 12-11-2003, 09:44 AM   #1
Default non-static others choice


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



Nicolas Matringe
  Reply With Quote
Old 12-12-2003, 10:14 PM   #2
Deb P
 
Posts: n/a
Default Re: non-static others choice
Nicolas Matringe <> wrote in message news:<>...
> 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


Deb P
  Reply With Quote
Old 01-12-2004, 01:05 PM   #3
Paul Uiterlinden
 
Posts: n/a
Default Re: non-static others choice
Nicolas Matringe wrote:
> 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.



Paul Uiterlinden
  Reply With Quote
Old 12-20-2005, 01:35 PM   #4
ciry
 
Posts: n/a
Default Re: non-static others choice
does not work for me

try
slvec <= (others => '0');
slvec(0) <= '1';

mfg
ciry



ciry
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco 2620 static natting help biomed32uk Hardware 1 10-22-2009 03:25 PM
please help: simple java coding error 'cannot be referenced from a static context' clm90 General Help Related Topics 0 10-17-2009 06:49 AM
Shag Floor danger? Dave Hardenbrook A+ Certification 3 02-28-2008 05:13 AM
Can a DVD-ROM disc be damaged by static electricity? curious DVD Video 8 03-01-2006 01:53 PM
Re: Anti Static Mats David Hough A+ Certification 3 05-08-2004 03:46 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46