Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

VHDL Configuring generics

Hi,

i have written a VHDL Model wich is configured by a set of generics in the top level entity. The Ports of the model are always the same. No i want to give a number to every set of generics, and choose the generic set by only changing the number in the code. What is the right VHDL keyword?

For example:

Set# 1:

Generic Map(

gen1 := 17

gen2 := 22

gen3 := 14

..

..

)

Set# 2:

Generic Map(

gen1 := 1

gen2 := 4

gen3 := 12

..

..

)

Now i only want to change the set# to select the generics.

Thanks in advance,

paddy

12 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    As said, you can use a constant array

       TYPE GEN_ARRAY IS ARRAY (1 TO 6,1 TO 3) OF INTEGER;
       CONSTANT gen : GEN_ARRAY := 
       ((2,3,3),
        (1,2,4),
        (2,2,1),
        (1,3,4),
        (1,5,4),
        (2,2,5));
       generic map
       ( gen1 =>gen(gen_sel,1), gen2 => gen(gen_sel,2))
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    many thanks to all. I tried the solution with the "generic record" and it works very fine. Now i have defined all sets of generics in the array and select one by only changing the set#. Thats what i wanted!!!

    Thanks again

    Paddy