Forum: FPGA, VHDL & Co. Simulation Fehler: Aggregate with multiple choices has a non-static or null choice


von Fpga I. (fpga-ing)


Lesenswert?

Hallo zusammen,

ich habe mir in einer Testbench folgendes konstrukt gebaut:
1
signal InjectError : std_logic_vector(31 downto 0);
2
3
myProcess:process
4
begin
5
...
6
  for i in 0 to 31 loop
7
    InjectError <= (i => '1', others => '0');
8
    wait for 1 us;
9
    InjectError <= (others => '0');
10
    -- auswertung...
11
  end loop;
12
...
13
end process;

Die Zeile InjectError <= (i => '1', others => '0'); gibt mir dabei die 
Fehlermeldung "Aggregate with multiple choices has a non-static or null 
choice. Use -relax to compile aggregates composed of one non-static or 
null choice and choice others."
Natürlich kann ich mit der relax Option die Simulation starten, jedoch 
möchte ich zunächst die Warning genauer verstehen.
Warum führt das potenziell zu Problemen, diese Zuweisung mit mit einem 
Schleifenindex i vorzunehmen? Ersetze ich das i durch eine 1, tritt der 
Fehler nicht mehr auf (statischer Wert).
Wird das others bereits beim kompilieren / elaborieren aufgelöst?
Wie würdet Ihr die InjectError Zuweisung vornehmen? Mir fällt spontan 
folgendes ein:
1
...
2
  sInjectError <= (others => '0');
3
  for i in 0 to 31 loop
4
    sInjectError(i) <= '1';
5
    wait for 1 us;
6
    sInjectError(i) <= '0';
7
    -- auswertung...
8
  end loop;
9
...

von Markus F. (mfro)


Lesenswert?

eine "non locally-static choice" ist nur ohne "others" erlaubt.
1
  for i in 0 to 31 loop
2
    InjectError <= (others => '0');
3
    InjectError(i) <= '1';
4
    wait for 1 us;
5
    InjectError <= (others => '0');
6
    -- auswertung...
7
  end loop;

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.