The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Mar 29th, 2024, 3:22am
Pages: 1
Send Topic Print
Generic parameter passing in a record (Read 1870 times)
nicolas
New Member
*
Offline



Posts: 1
Dresden, Germany
Generic parameter passing in a record
Jan 28th, 2005, 11:39am
 
Hello !

I have the following problem, I hope some can help me.

I've written an entity with a lot of parameters, so I decided to put them all in a type record in a package together with a constant declaration of this same type, where all default values are given:

package pck is
 type param_rec is record
   p1 : real;
   p2 : real;
   ...
 end record param_rec;
 constant default_params : param_rec :=
 ( p1 => 1.0, p2 => 2.0, ...);
end package pck;

So the bottom level entity is initialized with the default
parameter values:

entity bottom_entity is
 generic( param : param_rec := default_params );
 port( ... );
end entity bottom_entity;

In the upper level entity I would like to redeclare
only a couple of parameters, not all of them:

E1 : entity bottom_entity ( my_struct )
    generic map( param.p1 => 2.0 )
    port map ( ... );

Here the compiler issues the error: "too few values for
record aggregate". I thought one could reassign individual
fields of a record without the need to reassign all of them,
particularly because the other fields should have their default values. Does someone know a better solution or see an error above?

Thanks

Nicolas.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.