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