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

Reply

VHDL - another array ranges mystery

 
Thread Tools Search this Thread
Old 06-18-2005, 06:30 PM   #1
Default another array ranges mystery


Code:
// declarations // lots of declarations // VHDL is all ablout declarations type TPASSWORD is array (0 to 6) of CHARACTER; type TLETTERS is array (NATURAL range <>) of CHARACTER; constant LETTERS: TLETTERS := ('k', 'a', 'l'); type TCOUNTER is range LETTERS'range; -- letter iterator type TINDEX is range PASSWORD'range; type TCOUNTERS is array (TINDEX) of TCOUNTER; -- iterate all letters in the pwd variable COUNTERS: TCOUNTERS; variable I: TINDEX; variable C: TCOUNTER; variable L: CHARACTER; // a small piece of code assign_outputs: for I in TINDEX loop -- PASSWORD(I) <= LETTERS(COUNTERS(I)); C := COUNTERS(I); // ok L := LETTERS(C); // error PASSWORD(I) <= L; //error end loop;


QQ:
The double error message is: "the index types in the reference to the array
object are incompatible with its range type". I do not understand. The
counter's value must be in range of LETTERS by definition. The same about I,
it is the index in the PASSWORD array. So, what is going on? Is it realy my
fault, is it expected vhdl complaint behaviour or is it a mistake made by
tool?

Thanks.




valentin tihomirov
  Reply With Quote
Old 06-18-2005, 06:43 PM   #2
valentin tihomirov
 
Posts: n/a
Default Re: another array ranges mystery
got subtypes. thanks. understanding works better talking to myself on the
public forums.




valentin tihomirov
  Reply With Quote
Old 06-18-2005, 06:53 PM   #3
Mike Treseler
 
Posts: n/a
Default Re: another array ranges mystery
valentin tihomirov wrote:
> got subtypes. thanks.


Got the built-in type string ?

-- Mike Treseler


Mike Treseler
  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
constants as of array of integers, for loops octavsly Hardware 0 04-25-2009 11:53 AM
How to retrieve array parameter ( JAVA ) naruponk Software 1 04-16-2009 10:20 AM
Array Programme rits Software 2 03-04-2009 05:18 PM
Re: Mystery card question Tony A+ Certification 0 06-13-2006 03:29 AM
DVD Verdict reviews: THE GREATEST SHOW ON EARTH, MYSTERY SCIENCE THEATER 3000 COLLECTION, VOLUME 5, and more! DVD Verdict DVD Video 0 04-14-2004 10:04 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