Change a constant value, depending on a generic



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);
.



Relevant Pages

  • Re: [Starfall/ACRA] Metal Fire #10, False Maria 04
    ... concept was clever as hell, having seen it on other author's RACC ... Because of teh time between writing issue nine and writing ... The wrapping up of this arc, ...
    (rec.arts.comics.creative)
  • Re: [Starfall/ACRA] Metal Fire #10, False Maria 04
    ... Because of teh time between writing issue nine and writing ... The wrapping up of this arc, ... elements Tom encountered in issue seven. ... "look, I'm trying to be clever and set something ...
    (rec.arts.comics.creative)
  • Re: Thomas Covenant series
    ... Nicky said "put very clever stuff in". ... If the whole climax of your novel relies on the reader having read some ... then that's writing to show off and will lose you swathes of ...
    (rec.arts.sf.composition)
  • Re: The Middle Ground.
    ... English usage. ... I find most writing intolerably inept. ... That is, I know what the writer is trying to convey, just as you ... You are much less clever than you think. ...
    (talk.origins)
  • Re: The Middle Ground.
    ... I find most writing intolerably inept. ... That is, I know what the writer is trying to convey, just as you ... You are much less clever than you think. ... You're in the left tail of the distribution, ...
    (talk.origins)