Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Compilation error

Reply
Thread Tools

Compilation error

 
 
YesMann
Guest
Posts: n/a
 
      08-08-2003
Hello,
I have error in the process below;
My process is:

1. process(cycle)
2. begin
3. case cycle is
4.
5.
6. WHEN "000000" | "000001" | "000010" => REG <= "001000";
7. WHEN "000011" to "011101" => REG <= "000000";
8. WHEN "011110" | "011111" | "100000" => REG <= "001010";
9. WHEN "100001" => REG <=
"000010";
10. WHEN "100010" | "100011" | "100100" => REG <= "001101";
11. WHEN "100101" to "101000" => REG <= "000101";
12.
13. WHEN OTHERS => REG <="000000";
14.
15. end case;
16. end process;

The line 7 and 11 are considered as error : " Range must be a scalar type".
What can I specified the range "000011" to "011101" in VHDL language ?

Thanks in advance


 
Reply With Quote
 
 
 
 
Jonathan Bromley
Guest
Posts: n/a
 
      08-08-2003

"YesMann" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

[...]
> 3. case cycle is

[...]
> 7. WHEN "000011" to "011101" => REG <= "000000";

[...]

> The line 7 and 11 are considered as error : " Range must be a scalar

type".
> What can I specified the range "000011" to "011101" in VHDL language ?


You can't. However, you are using these values rather like numbers,
so it may be easier to convert them to integers for use in the case
statement:

case to_integer(cycle) is
...
when 3 to 29 => REG <= "000000";
...

Of course, the precise form of "to_integer" depends on what
numeric packages you are using, and the data type of "cycle".
If "cycle" is the output of a counter, and you have been
sensible and used ieee.numeric_std, and cycle is of type
UNSIGNED, then to_integer() is correct.


 
Reply With Quote
 
 
 
 
YesMann
Guest
Posts: n/a
 
      08-08-2003


> case to_integer(cycle) is
> ...
> when 3 to 29 => REG <= "000000";
> ...
>
> Of course, the precise form of "to_integer" depends on what
> numeric packages you are using, and the data type of "cycle".
> If "cycle" is the output of a counter, and you have been
> sensible and used ieee.numeric_std, and cycle is of type
> UNSIGNED, then to_integer() is correct.

_______________________________

Thanks you for your response;
But if I process as your description, I have another message error:
"Type error in range expression";
What happened?

Thanks in advance




 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
const string error compilation - error C2679 Tassador C++ 0 07-19-2009 05:26 AM
Compilation error with seperate compilation C__chp C++ 4 02-15-2008 03:57 PM
[compilation error] debugging this error message "Object() in java.lang.Object cannot be applied to" Gavin Java 3 03-28-2007 05:57 AM
compilation error: "error: no matching function for call to 'String::String(String)' =?ISO-8859-1?Q?Martin_J=F8rgensen?= C++ 5 05-06-2006 03:48 PM
compilation error /usr/include/_G_config.h:29: parse error before "__mbstate_t" Vittal C Programming 2 07-08-2003 10:14 PM



Advertisments