![]() |
|
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
does not work for me
try slvec <= (others => '0'); slvec(0) <= '1'; mfg ciry ciry |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |