Thank You for a quick answer

I agree with You on this. But ...
Timer module doesn't "know" if it is being copied with a generate statement.
And how many times. So it can't know address of its registers. Example:
Timers : for i in 0 to n_of_timers - 1 generate
begin
Timer : entity work.FROG1_Timer(rtl)
port map (
clk => clk,
reg_bus => reg_bus,
reg_adr => reg_adr,
reg_rd => reg_rd,
reg_wr => reg_wr,
A => A(i),
B => B(i),
tmr_int => tmr_int_vec(i)
);
end generate;
In the package constants are declared like this:
constant adr_tmr : std_logic_vector(4 downto 0) := "10000";
constant adr_tmr_cfg : std_logic_vector(4 downto 0) := "10001";
So every timer that is copied has the same address for data and cfg
registers.
This is bad. There is no difference between them.
But if I could somehow create array of constants which size depend of
generic parameter, perhaps I could access these constants and make all
timers have diferent address. Which is my goal. By changing one generic
parameter I'm allocating address space for these timers so I can access them
all because their address is diferent.
Maybe this could be achived in some other, simpler way.
Any sugestions?
Thanks,
M.
--
Veselic Mladen
Laboratorija Sigma
"Nicolas Matringe" <> wrote in message
news:...
> Maki a écrit:
> [...]
> > I other words I need to generate constants in the package depending on
the
> > value of generic. These constants should be diferent for every timer
that is
> > generated.
> > Any simple solution for this?
>
> Hello
> In my opinion, packages are for constants, not parameters. If you want
> your constants to depend on a generic parameter, declare them directly
> in your architecture.
> Since packages must be compiled/analyzed before being used, you can't
> make a constant in the package depend on an entity generic.
>
> --
> ____ _ __ ___
> | _ \_)/ _|/ _ \ Adresse de retour invalide: retirez le -
> | | | | | (_| |_| | Invalid return address: remove the -
> |_| |_|_|\__|\___/
>