Change a constant value, depending on a generic
- From: Barry <barry374@xxxxxxxxx>
- Date: Tue, 13 Jan 2009 09:34:10 -0800 (PST)
Is there a more clever and compact way to do this, rather than writing
a function? The constant INIT_40_VAL is assigned to a generic in a
component instantiation later on.
TIA
entity v5_sysmon is
generic ( SIM_ONLY : integer := 0 ); -- = 1 to set averaging to 1
instead of 16
......
architecture rtl of v5_sysmon is
function set_init_40(sim_only : in integer) return bit_vector is
constant init_40_avg1 : bit_vector := X"0000";
constant init_40_avg16 : bit_vector := X"1000";
begin
if sim_only = 1 then
return init_40_avg1;
else
return init_40_avg16;
end if;
end function set_init_40;
constant INIT_40_VAL : bit_vector := set_init_40(SIM_ONLY);
.
- Follow-Ups:
- Re: Change a constant value, depending on a generic
- From: Brian Drummond
- Re: Change a constant value, depending on a generic
- From: Andy
- Re: Change a constant value, depending on a generic
- From: Tricky
- Re: Change a constant value, depending on a generic
- From: Dave
- Re: Change a constant value, depending on a generic
- Prev by Date: Re: Unassigned register decode
- Next by Date: Re: Change a constant value, depending on a generic
- Previous by thread: Re: MOD operator
- Next by thread: Re: Change a constant value, depending on a generic
- Index(es):
Relevant Pages
|