Welcome Notice

Register Log in

\\\"Non-static aggregate with multiple choices has non-static others choice.\\\"...

R

Rick C

Guest
On Saturday, March 23, 2013 at 6:20:27 PM UTC-4, rickman wrote:
This is the code,

Bias <= (Bias(Bias\'high-1) => \'1\', others => \'0\');

This is the error,

\"Non-static aggregate with multiple choices has non-static others choice.\"

When I looked this up on the web they talk about things like using a
loop index to select the bit in the word. Another page mentions that
the items in an aggregate must be non-overlapping. If they need to be
non-overlapping what is the point of the others? I could have sworn
that I was told using others to fill in the remainder of a vector was ok
as long as it was last in the aggregate.

A post from 2003 used a fixed index into the vector, so it seems the
problem is not from the use of Bias\'high in the index.

This kind of thing is what drives people nuts about VHDL. For some of
us it is a short trip.
I still run into this problem from time to time. For whatever reason this is still not an intuitive matter for me. I guess I don\'t have a clear understanding of globally and locally static to recognize the issue before I get the error message.

Anyway, in my current matter I am trying to set a single bit to \'1\' in an unsigned and the rest \'0\'. I decided the least annoying way to deal with this is two separate assignments.

Temp := (others => \'0\');
Temp(Index) := \'1\';

rather than

Temp := (Index => \'1\', others => \'0\');

Index is passed into a procedure while Temp is a variable.

procedure Test_Button (signal Button_Action : in unsigned;
DelayA : in time;
DelayB : in time;
Index : integer ) is
variable Temp : unsigned (Button_Action\'range) := Button_Action;


I like to keep my code tight and neat as it helps me with understanding it when I return to it later. But at some point you have to accept your losses and move on. This is not just me working, but a team effort with total strangers working together using different tools, so the code needs to work across platforms. One guy is a total Xilinx freak. So obviously he is using Vivado or whatever name Xilinx gave their tools.

Consider this as a note to self, but comment if you wish. When I search for problems these days I\'m as likely to find my own posts on a topic as much as anything else.

--

Rick C.

- Get 1,000 miles of free Supercharging
- Tesla referral code - https://ts.la/richard11209
 
Toggle Sidebar

Welcome to EDABoard.com

Sponsor

Top