+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Member level 1
    Points: 640, Level: 5

    Join Date
    May 2015
    Posts
    37
    Helped
    0 / 0
    Points
    640
    Level
    5

    ERROR:HDLParsers:3375

    I have a vhdl code, which has a line as below:
    Code:
    variable thrsh : STD_LOGIC_VECTOR(7 downto 0);
    SIGNAL n : INTEGER RANGE 0 TO 7 := 7;
    thrsh := (n => '1', OTHERS => '0');
    'n' initially is the position of MSB bit. In next iteration, it gives the position of MSB-1 bit and so on... It gives the following error:
    Code:
    ERROR:HDLParsers:3375 - "FSM_all.vhd" Line 439. Choices for an array aggregate (Signal 'n') must be locally static unless there is only one choice. (LRM 7.3.2.2)
    As the value of 'n' keeps on changing. How can I assign it with a local value?
    Last edited by rafimiet; 11th September 2017 at 18:21.

    •   Alt11th September 2017, 18:04

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 34,223, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,273
    Helped
    1832 / 1832
    Points
    34,223
    Level
    45

    Re: ERROR:HDLParsers:3375

    Yes, when assigning an aggregate like this, indexes must be integer literals or constant (Generics are not locally static either, but constants are).

    The way to do it would be to do this in a process (if it isnt already and do this)

    Code VHDL - [expand]
    1
    2
    3
    4
    5
    
    process(thrsh)
    begin
      thrsh <= (others => '0');
      thrsh(n) <= '1';
    end process;


    1 members found this post helpful.

--[[ ]]--