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

Reply

VHDL - Compilation error

 
Thread Tools Search this Thread
Old 08-08-2003, 11:47 AM   #1
Default Compilation error


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




YesMann
  Reply With Quote
Old 08-08-2003, 12:19 PM   #2
Jonathan Bromley
 
Posts: n/a
Default Re: Compilation error

"YesMann" <> wrote in message
news:...

[...]
> 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.




Jonathan Bromley
  Reply With Quote
Old 08-08-2003, 01:51 PM   #3
YesMann
 
Posts: n/a
Default Re: Compilation error


> 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






YesMann
  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
URGENT Help needed with ASP.NET Compilation error nunu_bug General Help Related Topics 0 08-06-2009 01:26 PM
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
Parser Error Message: Could not load type 'Microsoft.SharePoint.ApplicationPages.Glob rasmita General Help Related Topics 0 09-05-2006 05:49 AM




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