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

Reply

VHDL - ERROR: infix expression "<=" with simple vectors

 
Thread Tools Search this Thread
Old 02-23-2009, 02:56 PM   #1
Default ERROR: infix expression "<=" with simple vectors


I'm relatively inexperienced with VHDL but am doing a project
involving it. I'm currently systematically filtering out the usual
typos and rookie mistakes...but have a problem which I cant seem to
fix and would like some advice.

The problem is that the modelsim compiler doesnt seem to accept an
assignment of signals of type std_logic_vector using quote marks of
form <= "value"

Example (first two errors in compile) of the relevant code

Library IEEE;
use IEEE.std_logic_1164.all;
use Ieee.std_logic_unsigned.all;
..
..
signal waitbit_state : std_logic_vector (2 downto 0);
signal waitbit_nextstate : std_logic_vector (2 downto 0);
..
..

30: case waitbit_state is
31: -- wait state
32: when "00"=>
33: if(waitbit_start = '0') then waitbit_nextstate <= "00",
waitbit_end <= '0';
34: else waitbit_nextstate <= "01", waitbit_end <= '0';
35: end if;

error output is

** Error: E:/project...(33): Type error resolving infix expression
"<=" as type ieee.std_logic_1163.std_logic_vector.
** Error: E:/project...(34): Type error resolving infix expression
"<=" as type ieee.std_logic_1163.std_logic_vector.

and a few more of the same for the other occurances in the state
machine

Need it be said, not being able to assign like this is awkward in a
state machine, so does anyone know any ways to solve this? I'm
assuming the issue is the "00" isn't being interpreted as a logic
vector but as a numeric form?


Trit
  Reply With Quote
Old 02-23-2009, 03:34 PM   #2
nuckols.jeff@gmail.com
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On Feb 23, 9:56*am, Trit <tritous_cara...@hotmail.com> wrote:
> I'm relatively inexperienced with VHDL but am doing a project
> involving it. *I'm currently systematically filtering out the usual
> typos and rookie mistakes...but have a problem which I cant seem to
> fix and would like some advice.
>
> The problem is that the modelsim compiler doesnt seem to accept an
> assignment of signals of type std_logic_vector using quote marks of
> form <= "value"
>
> Example (first two errors in compile) of the relevant code
>
> Library IEEE;
> use IEEE.std_logic_1164.all;
> use Ieee.std_logic_unsigned.all;
> .
> .
> signal waitbit_state : std_logic_vector (2 downto 0);
> signal waitbit_nextstate : std_logic_vector (2 downto 0);
> .
> .
>
> 30: * * case waitbit_state is
> 31: * * -- wait state
> 32: * * when "00"=>
> 33: * * * * * * if(waitbit_start = '0') then waitbit_nextstate <= "00",
> waitbit_end <= '0';
> 34: * * * * * * else waitbit_nextstate <= "01", waitbit_end <= '0';
> 35: * * * * * * end if;
>
> error output is
>
> ** Error: E:/project...(33): Type error resolving infix expression
> "<=" as type ieee.std_logic_1163.std_logic_vector.
> ** Error: E:/project...(34): Type error resolving infix expression
> "<=" as type ieee.std_logic_1163.std_logic_vector.
>
> and a few more of the same for the other occurances in the state
> machine
>
> Need it be said, not being able to assign like this is awkward in a
> state machine, so does anyone know any ways to solve this? *I'm
> assuming the issue is the "00" isn't being interpreted as a logic
> vector but as a numeric form?


You could try writing it like this:

30: case waitbit_state is
31: -- wait state
32: when "00"=>
33: if(waitbit_start = '0') then
33a: waitbit_nextstate <= "00";
33b: waitbit_end <= '0';
34: else
34a: waitbit_nextstate <= "01";
34b: waitbit_end <= '0';
35: end if;


nuckols.jeff@gmail.com
  Reply With Quote
Old 02-23-2009, 03:42 PM   #3
nuckols.jeff@gmail.com
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On Feb 23, 10:34*am, nuckols.j...@gmail.com wrote:
> On Feb 23, 9:56*am, Trit <tritous_cara...@hotmail.com> wrote:
>
>
>
>
>
> > I'm relatively inexperienced with VHDL but am doing a project
> > involving it. *I'm currently systematically filtering out the usual
> > typos and rookie mistakes...but have a problem which I cant seem to
> > fix and would like some advice.

>
> > The problem is that the modelsim compiler doesnt seem to accept an
> > assignment of signals of type std_logic_vector using quote marks of
> > form <= "value"

>
> > Example (first two errors in compile) of the relevant code

>
> > Library IEEE;
> > use IEEE.std_logic_1164.all;
> > use Ieee.std_logic_unsigned.all;
> > .
> > .
> > signal waitbit_state : std_logic_vector (2 downto 0);
> > signal waitbit_nextstate : std_logic_vector (2 downto 0);
> > .
> > .

>
> > 30: * * case waitbit_state is
> > 31: * * -- wait state
> > 32: * * when "00"=>
> > 33: * * * * * * if(waitbit_start = '0') then waitbit_nextstate <= "00",
> > waitbit_end <= '0';
> > 34: * * * * * * else waitbit_nextstate <= "01", waitbit_end <= '0';
> > 35: * * * * * * end if;

>
> > error output is

>
> > ** Error: E:/project...(33): Type error resolving infix expression
> > "<=" as type ieee.std_logic_1163.std_logic_vector.
> > ** Error: E:/project...(34): Type error resolving infix expression
> > "<=" as type ieee.std_logic_1163.std_logic_vector.

>
> > and a few more of the same for the other occurances in the state
> > machine

>
> > Need it be said, not being able to assign like this is awkward in a
> > state machine, so does anyone know any ways to solve this? *I'm
> > assuming the issue is the "00" isn't being interpreted as a logic
> > vector but as a numeric form?

>
> You could try writing it like this:
>
> 30: * * case waitbit_state is
> 31: * * -- wait state
> 32: * * when "00"=>
> 33: * * * * * * if(waitbit_start = '0') then
> 33a: * * * * * * * *waitbit_nextstate * <= "00";
> 33b: * * * * * * * *waitbit_end * * * * <= '0';
> 34: * * * * * * else
> 34a: * * * * * * * waitbit_nextstate * *<= "01";
> 34b: * * * * * * * waitbit_end * * * * *<= '0';
> 35: * * * * * * end if;- Hide quoted text -
>
> - Show quoted text -


Whoops! Now I see the problem. The vectors are 3 bits (2 downto 0) and
you've assigned only 2 bits ("00" and "01"). Maybe you really want
"000" and "001".


nuckols.jeff@gmail.com
  Reply With Quote
Old 02-23-2009, 03:43 PM   #4
Trit
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On 23 Feb, 15:34, nuckols.j...@gmail.com wrote:
> On Feb 23, 9:56*am, Trit <tritous_cara...@hotmail.com> wrote:
>
>
>
>
>
> > I'm relatively inexperienced with VHDL but am doing a project
> > involving it. *I'm currently systematically filtering out the usual
> > typos and rookie mistakes...but have a problem which I cant seem to
> > fix and would like some advice.

>
> > The problem is that the modelsim compiler doesnt seem to accept an
> > assignment of signals of type std_logic_vector using quote marks of
> > form <= "value"

>
> > Example (first two errors in compile) of the relevant code

>
> > Library IEEE;
> > use IEEE.std_logic_1164.all;
> > use Ieee.std_logic_unsigned.all;
> > .
> > .
> > signal waitbit_state : std_logic_vector (2 downto 0);
> > signal waitbit_nextstate : std_logic_vector (2 downto 0);
> > .
> > .

>
> > 30: * * case waitbit_state is
> > 31: * * -- wait state
> > 32: * * when "00"=>
> > 33: * * * * * * if(waitbit_start = '0') then waitbit_nextstate <= "00",
> > waitbit_end <= '0';
> > 34: * * * * * * else waitbit_nextstate <= "01", waitbit_end <= '0';
> > 35: * * * * * * end if;

>
> > error output is

>
> > ** Error: E:/project...(33): Type error resolving infix expression
> > "<=" as type ieee.std_logic_1163.std_logic_vector.
> > ** Error: E:/project...(34): Type error resolving infix expression
> > "<=" as type ieee.std_logic_1163.std_logic_vector.

>
> > and a few more of the same for the other occurances in the state
> > machine

>
> > Need it be said, not being able to assign like this is awkward in a
> > state machine, so does anyone know any ways to solve this? *I'm
> > assuming the issue is the "00" isn't being interpreted as a logic
> > vector but as a numeric form?

>
> You could try writing it like this:
>
> 30: * * case waitbit_state is
> 31: * * -- wait state
> 32: * * when "00"=>
> 33: * * * * * * if(waitbit_start = '0') then
> 33a: * * * * * * * *waitbit_nextstate * <= "00";
> 33b: * * * * * * * *waitbit_end * * * * <= '0';
> 34: * * * * * * else
> 34a: * * * * * * * waitbit_nextstate * *<= "01";
> 34b: * * * * * * * waitbit_end * * * * *<= '0';
> 35: * * * * * * end if;- Hide quoted text -
>
> - Show quoted text -


I did originally try this and it didn't work (probably forgot to save
before compiling, stare at code enough and that happens).

Splitting the lines does seem to be working now, however, so thanks.
It was originally separated lines but it shifted to single line when I
changed editors. Guess I can focus on my typos now (much more fun).



Trit
  Reply With Quote
Old 02-23-2009, 03:48 PM   #5
Trit
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On 23 Feb, 15:42, nuckols.j...@gmail.com wrote:
> On Feb 23, 10:34*am, nuckols.j...@gmail.com wrote:
>
>
>
>
>
> > On Feb 23, 9:56*am, Trit <tritous_cara...@hotmail.com> wrote:

>
> > > I'm relatively inexperienced with VHDL but am doing a project
> > > involving it. *I'm currently systematically filtering out the usual
> > > typos and rookie mistakes...but have a problem which I cant seem to
> > > fix and would like some advice.

>
> > > The problem is that the modelsim compiler doesnt seem to accept an
> > > assignment of signals of type std_logic_vector using quote marks of
> > > form <= "value"

>
> > > Example (first two errors in compile) of the relevant code

>
> > > Library IEEE;
> > > use IEEE.std_logic_1164.all;
> > > use Ieee.std_logic_unsigned.all;
> > > .
> > > .
> > > signal waitbit_state : std_logic_vector (2 downto 0);
> > > signal waitbit_nextstate : std_logic_vector (2 downto 0);
> > > .
> > > .

>
> > > 30: * * case waitbit_state is
> > > 31: * * -- wait state
> > > 32: * * when "00"=>
> > > 33: * * * * * * if(waitbit_start = '0') then waitbit_nextstate <= "00",
> > > waitbit_end <= '0';
> > > 34: * * * * * * else waitbit_nextstate <= "01", waitbit_end <= '0';
> > > 35: * * * * * * end if;

>
> > > error output is

>
> > > ** Error: E:/project...(33): Type error resolving infix expression
> > > "<=" as type ieee.std_logic_1163.std_logic_vector.
> > > ** Error: E:/project...(34): Type error resolving infix expression
> > > "<=" as type ieee.std_logic_1163.std_logic_vector.

>
> > > and a few more of the same for the other occurances in the state
> > > machine

>
> > > Need it be said, not being able to assign like this is awkward in a
> > > state machine, so does anyone know any ways to solve this? *I'm
> > > assuming the issue is the "00" isn't being interpreted as a logic
> > > vector but as a numeric form?

>
> > You could try writing it like this:

>
> > 30: * * case waitbit_state is
> > 31: * * -- wait state
> > 32: * * when "00"=>
> > 33: * * * * * * if(waitbit_start = '0') then
> > 33a: * * * * * * * *waitbit_nextstate * <= "00";
> > 33b: * * * * * * * *waitbit_end * * * * <= '0';
> > 34: * * * * * * else
> > 34a: * * * * * * * waitbit_nextstate * *<= "01";
> > 34b: * * * * * * * waitbit_end * * * * *<= '0';
> > 35: * * * * * * end if;- Hide quoted text -

>
> > - Show quoted text -

>
> Whoops! Now I see the problem. The vectors are 3 bits (2 downto 0) and
> you've assigned only 2 bits ("00" and "01"). Maybe you really want
> "000" and "001".- Hide quoted text -
>
> - Show quoted text -


yeah, that problem I corrected earlier. Bad day = disorganised heap
of files in various states of debugging. I've just spent 5 mins
putting them in order so I can be more systematic lol. I'll make sure
the version i end up with has that one fixed, (it's a pretty
distictive error anyway). Mostly I have to worry about else if ->
elsif and missing underscores in signal names. Sorry about that
confusion.


Trit
  Reply With Quote
Old 02-23-2009, 04:17 PM   #6
Tricky
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
May I recommend, as you are new to VHDL, that you stop using
std_logic_unsigned/arith/signed and instead use the package
ieee.numeric_std instead? (As it is an IEEE standard, the others are
not).
Getting into the habit now will save you grief on here later.


Tricky
  Reply With Quote
Old 02-23-2009, 04:58 PM   #7
Trit
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On 23 Feb, 16:17, Tricky <Trickyh...@gmail.com> wrote:
> May I recommend, as you are new to VHDL, that you stop using
> std_logic_unsigned/arith/signed and instead use the package
> ieee.numeric_std instead? *(As it is an IEEE standard, the others are
> not).
> Getting into the habit now will save you grief on here later.


Yeah, 99% of the time I don't need it and dont include it (especially
since I've seen the grief others have, and especially since the
libraries are defined per entity). There are just a few cases such as
counters where I need to add 1 and need the unsigned library, unless
there is a way to do a increment without it?


Trit
  Reply With Quote
Old 02-23-2009, 06:17 PM   #8
Andy Peters
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On Feb 23, 9:58*am, Trit <tritous_cara...@hotmail.com> wrote:
> On 23 Feb, 16:17, Tricky <Trickyh...@gmail.com> wrote:
>
> > May I recommend, as you are new to VHDL, that you stop using
> > std_logic_unsigned/arith/signed and instead use the package
> > ieee.numeric_std instead? *(As it is an IEEE standard, the others are
> > not).
> > Getting into the habit now will save you grief on here later.

>
> Yeah, 99% of the time I don't need it and dont include it (especially
> since I've seen the grief others have, and especially since the
> libraries are defined per entity). *There are just a few cases such as
> counters where I need to add 1 and need the unsigned library, unless
> there is a way to do a increment without it?


Use numeric_std instead.

-a


Andy Peters
  Reply With Quote
Old 02-23-2009, 08:09 PM   #9
Trit
 
Posts: n/a
Default Re: ERROR: infix expression "<=" with simple vectors
On 23 Feb, 18:17, Andy Peters <goo...@latke.net> wrote:
> On Feb 23, 9:58*am, Trit <tritous_cara...@hotmail.com> wrote:
>
> > On 23 Feb, 16:17, Tricky <Trickyh...@gmail.com> wrote:

>
> > > May I recommend, as you are new to VHDL, that you stop using
> > > std_logic_unsigned/arith/signed and instead use the package
> > > ieee.numeric_std instead? *(As it is an IEEE standard, the others are
> > > not).
> > > Getting into the habit now will save you grief on here later.

>
> > Yeah, 99% of the time I don't need it and dont include it (especially
> > since I've seen the grief others have, and especially since the
> > libraries are defined per entity). *There are just a few cases such as
> > counters where I need to add 1 and need the unsigned library, unless
> > there is a way to do a increment without it?

>
> Use numeric_std instead.
>
> -a


that will still allow simple assignment of type x <= x + '1'; ?
convenient. I'll do that thanks

Cheers for the help all, finally managed to turn today around into a
productive session (after an appallingly disappointing weekend of
downloading useless applications) thanks to your advice


Trit
  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
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 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