Forum Discussion

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

Quartus - altera_europa_support warnings

During Quartus elaboration step, I can see a lot a warnings messages from

altera_europa_support_lib.vhd file, delivered/provided by Altera.

This trouble (already reported in previous forum posts) "should be fixed in next Quartus release". We are on Quartus V10 and it is not the case.

Can provide a fix on this topic ?

WARNINGS messages:

my_design.rpt:Warning (10542): VHDL Variable Declaration warning at altera_europa_support_lib.vhd(340): used initial value expression for variable "arg_copy" because variable was never assigned a value

my_design.map.rpt:Warning (10542): VHDL Variable Declaration warning at altera_europa_support_lib.vhd(344): used initial value expression for variable "arg_length" because variable was never assigned a value

==> Error is under VHD definition of "a_ext" function

NOTE: I agree we can ignore/parse these msgs from Message Suppression Manager but

is not the best way.

Regards,

Jerome

4 Replies

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

    Unfortunately (all of?) Altera's IP generates a lot of warnings ...

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

    Why don't you provide a 'patched' version of "altera_europa_support_lib" file ?

    All warnings are derived of following VHD function :

    -- a_ext is the Altera version of the EXT function. It is used to both

    -- zero-extend a signal to a new length, and to extract a signal of 'size'

    -- length from a larger signal.

    FUNCTION a_ext (arg : STD_LOGIC_VECTOR; size : INTEGER) RETURN STD_LOGIC_VECTOR IS

    VARIABLE arg_copy : STD_LOGIC_VECTOR ((arg'length - 1)DOWNTO 0) := arg ;

    VARIABLE result : STD_LOGIC_VECTOR((size-1) DOWNTO 0) := (others => '0');

    VARIABLE i : integer := 0;

    VARIABLE bits_to_copy : integer := 0;

    VARIABLE arg_length : integer := arg'length ;

    VARIABLE LSB_bit : integer := 0;

    BEGIN

    bits_to_copy := a_min(arg_length, size);

    FOR i IN 0 TO (bits_to_copy - 1) LOOP

    result(i) := arg_copy(i);

    end LOOP;

    RETURN(result);

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

    I'm not working for Altera ...

    I just wanted to add that you will find a lot of warnings generated by Altera's IP and I personally find that a nuisance. Of course my own work doesn't cover all cases (as Altera's has to) but I strive to make my building blocks warning free, it saves a lot of unnecessary rereading the same warning over and over again ....

    The warnings in this case are easily remedied as shown in the following code:

    FUNCTION a_ext (arg : STD_LOGIC_VECTOR; size : INTEGER) RETURN STD_LOGIC_VECTOR IS
    VARIABLE arg_copy : STD_LOGIC_VECTOR ((arg'length - 1) DOWNTO 0) ;
    VARIABLE result : STD_LOGIC_VECTOR((size-1) DOWNTO 0);
    --VARIABLE i : integer := 0; 
    VARIABLE bits_to_copy : integer ;
    VARIABLE arg_length : integer ;
    --VARIABLE LSB_bit : integer := 0;
    BEGIN 
    result  := (others => '0') ;
    arg_copy := arg ;
    arg_length := arg'length ;
    bits_to_copy := a_min(arg_length, size);
    FOR i IN 0 TO (bits_to_copy - 1) LOOP 
    result(i) := arg_copy(i);
    end LOOP;
    RETURN(result); 
    END;

    You see that I moved the the assign from the variable declaration into the body of the function. With hindsight: they could have done without the most of the variables, i.e. only the variable 'result' is necessary. Furthermore the variable 'LSB_bit' is not used. Also there is no need to declare the loop variable (maybe it was in VHDL 87). It could have looked like this:
    FUNCTION a_ext (arg : STD_LOGIC_VECTOR; size : INTEGER) RETURN STD_LOGIC_VECTOR IS
    VARIABLE result : STD_LOGIC_VECTOR((size-1) DOWNTO 0);
    BEGIN 
    result  := (others => '0') ;
    FOR i IN 0 TO ( a_min(arg'length, size) - 1) LOOP 
    result(i) := arg(i);
    end LOOP;
    RETURN(result); 
    END;
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanx a lot for your previous feedback ! ;)

    So, I have manually 'hacked' my Altera_europa_support_lib.vhd file

    with following new a_ext definition, and now, I cannot see any warning messages

    in Quartus LOG files.

    new code:

    FUNCTION a_ext (arg : std_logic_vector; size : integer) RETURN std_logic_vector IS

    VARIABLE result : std_logic_vector((size-1) DOWNTO 0);

    VARIABLE arg_length : integer;

    VARIABLE arg_copy : STD_LOGIC_VECTOR ((arg'length - 1) DOWNTO 0) ;

    VARIABLE bits_to_copy : integer;

    BEGIN

    result := (others => '0');

    arg_copy := arg ;

    arg_length := arg'length;

    --

    bits_to_copy := a_min(arg_length, size);

    FOR i IN 0 TO ( bits_to_copy - 1) LOOP

    result(i) := arg_copy(i);

    end LOOP;

    RETURN(result);

    END;