Attribute Question T'SUCC 
Author Message
 Attribute Question T'SUCC

To mix incoming data from different sources by avoiding incremental or decremantal
order I tried the following VHDL Code:

ARCHITECTURE
   TYPE gen_folge IS ARRAY (0 TO 7) OF INTEGER;
   CONSTANT reihenfolge : gen_folge := (1,4,2,5,6,3,7,0)  ; -- define order of gen's
   CONSTANT generatoren : INTEGER   := reihenfolge'LENGTH ;
BEGIN
 PROCESS
    VARIABLE ge   : INTEGER ;
 BEGIN
-- starting value:
       ge := reihenfolge'LEFT;
     LOOP ..
        FOR g in 1 TO generatoren LOOP
          ge := reihenfolge'SUCC(ge);          -- get next generator Nummer
-- - - - - - - - - - - - - ^ - - - - - - - - - -
        END LOOP;
     END LOOP;
 END PROCESS

END arch;

----------------------------------------------------------------------------------
SYNOPSYS VHDLAN produces the following error message:

      ge := reihenfolge'SUCC(ge);          -- get next generator Nummer
                       ^
**Error: vhdlan,545 pixwriter_beh_pe.vhd(149):
    Attribute is not defined for this prefix.

Where does this error message result from?
Can I use 'SUCC in this context at all?

English and German answers welcome.

Dieter



Sun, 09 Feb 1997 18:37:27 GMT  
 Attribute Question T'SUCC

Quote:

>To mix incoming data from different sources by avoiding incremental or decremantal
>order I tried the following VHDL Code:

>ARCHITECTURE
>   TYPE gen_folge IS ARRAY (0 TO 7) OF INTEGER;
>   CONSTANT reihenfolge : gen_folge := (1,4,2,5,6,3,7,0)  ; -- define order of gen's
>   CONSTANT generatoren : INTEGER   := reihenfolge'LENGTH ;
>BEGIN
> PROCESS
>    VARIABLE ge   : INTEGER ;
> BEGIN
>-- starting value:
>       ge := reihenfolge'LEFT;
>     LOOP ..
>        FOR g in 1 TO generatoren LOOP
>          ge := reihenfolge'SUCC(ge);          -- get next generator Nummer
>-- - - - - - - - - - - - - ^ - - - - - - - - - -
>        END LOOP;
>     END LOOP;
> END PROCESS

>END arch;

>----------------------------------------------------------------------------------
>SYNOPSYS VHDLAN produces the following error message:

>      ge := reihenfolge'SUCC(ge);          -- get next generator Nummer
>                       ^
>**Error: vhdlan,545 pixwriter_beh_pe.vhd(149):
>    Attribute is not defined for this prefix.

>Where does this error message result from?
>Can I use 'SUCC in this context at all?

The prefix for SUCC must be a type or subtype.  Here is a rewrite
which does what you wanted, I think.  The 'LEFT and 'SUCC aren't
doing much, just working in range 0 to 7.

ARCHITECTURE arch of a is
   TYPE gen_i IS range 0 TO 7;
   TYPE gen_folge IS ARRAY (gen_i) OF integer;
   CONSTANT reihenfolge : gen_folge := (1,4,2,5,6,3,7,0)  ;
                          -- define order of gen's
   CONSTANT generatoren : integer   := reihenfolge'LENGTH ;
BEGIN
 PROCESS
    VARIABLE ge   : integer ;
    VARIABLE ind  : gen_i ;
 BEGIN
   -- starting value:
   ind := gen_i'LEFT;
   ge := reihenfolge(ind);
   FOR g in 0 TO generatoren-2 LOOP
     ind := gen_i'SUCC(ind);          
     ge := reihenfolge(ind);    
     -- get next generator Number
   END LOOP;
   WAIT;
 END PROCESS;

END arch;



Sun, 09 Feb 1997 23:29:34 GMT  
 Attribute Question T'SUCC
|>
|> To mix incoming data from different sources by avoiding incremental or decremantal
|> order I tried the following VHDL Code:
|>
|>
|> ARCHITECTURE
|>    TYPE gen_folge IS ARRAY (0 TO 7) OF INTEGER;
|>    CONSTANT reihenfolge : gen_folge := (1,4,2,5,6,3,7,0)  ; -- define order of gen's
|>    CONSTANT generatoren : INTEGER   := reihenfolge'LENGTH ;
|> BEGIN
|>  PROCESS
|>     VARIABLE ge   : INTEGER ;
|>  BEGIN
|> -- starting value:
|>        ge := reihenfolge'LEFT;
|>      LOOP ..
|>         FOR g in 1 TO generatoren LOOP
|>           ge := reihenfolge'SUCC(ge);          -- get next generator Nummer
|> -- - - - - - - - - - - - - ^ - - - - - - - - - -
|>         END LOOP;
|>      END LOOP;
|>  END PROCESS
|>
|> END arch;
|>
|> ----------------------------------------------------------------------------------
|> SYNOPSYS VHDLAN produces the following error message:
|>
|>       ge := reihenfolge'SUCC(ge);          -- get next generator Nummer
|>                        ^
|> **Error: vhdlan,545 pixwriter_beh_pe.vhd(149):
|>     Attribute is not defined for this prefix.
|>

|> Where does this error message result from?

The SUCC attribute applies to expressions of discrete/physical
type/subtype. The expression "reihenfolge" is not of discrete
type (enumeration/interger type) nor of physical type, but a
composite type.

Some expressions that you could apply directly this attribute to
would be "g", "ge", "reihenfolge(g)", "reihenfolge(ge)",... because
they are all of an integer type.

Tchuess,

David Deharbe.



Sun, 09 Feb 1997 19:49:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Timesaver error: Unknown Variable '%TS'

2. Top Ten Consultants' DON'Ts

3. Top Ten Consultants' DON'Ts

4. 'Range attribute question.

5. Ts 3.1 src in Ts 1.17

6. What's with TS Marketing

7. SQL Does and Don'ts

8. Making the attribute 'self' preferred

9. 'Pre' attribute

10. 'Out of attribute space' error

11. Eiffel's attributes (was: Kent Beck's List)

12. Attributes 'Version and 'Body_Version

 

 
Powered by phpBB® Forum Software