Forum: FPGA, VHDL & Co. Unerklärlicher Type error mit std_logic_vector


von rhood (Gast)


Lesenswert?

Hallo habe hier für mich eine unklare Fehlerreihe.
1
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(27): Type error resolving infix expression "=" as type ieee.std_logic_1164.STD_ULOGIC_VECTOR.
2
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(27): Choice in selected signal assignment must be locally static.
3
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(28): Type error resolving infix expression "=" as type ieee.std_logic_1164.STD_ULOGIC_VECTOR.
4
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(28): Choice in selected signal assignment must be locally static.
5
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(31): Type error resolving infix expression "=" as type ieee.std_logic_1164.STD_ULOGIC_VECTOR.
6
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(31): Choice in selected signal assignment must be locally static.
7
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(32): Type error resolving infix expression "=" as type ieee.std_logic_1164.STD_ULOGIC_VECTOR.
8
# ** Error: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(32): Choice in selected signal assignment must be locally static.
9
# ** Warning: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(27): (vcom-1322) Selected waveforms choice cannot be checked for array length.
10
# 
11
# ** Warning: ../../../grpPwmGen/unitPwmGenCtrlpath/src/PwmGenCtrlpath-Beh-a.vhd(28): (vcom-1322) Selected waveforms choice cannot be checked for array length.

hier wäre ein auszug von der entity und vom architecutre:
1
library ieee;
2
use ieee.std_logic_1164.all;
3
use ieee.numeric_std.all;
4
5
use work.Global.all;
6
use work.PwmGenPack.all;
7
8
entity PwmGenCtrlpath is
9
  port(
10
    iClk                : in  std_ulogic;
11
    inRstAsync          : in  std_ulogic;
12
    -- inputs
13
    iRisingKeyEdge      : in  std_ulogic_vector(3 downto 0);
14
    -- WaveGen
15
    oSelLevel           : out natural range 0 to 2; -- reload/dec/inc
16
    oSelLevelA          : out natural range 0 to 2; -- reload/dec/inc
17
    oSelLevelB          : out natural range 0 to 2; -- reload/dec/inc
18
    oLevelA             : out unsigned(cCounterWidth - 1 downto 0);
19
    oLevelB             : out unsigned(cCounterWidth - 1 downto 0);
20
    iLevelLessADetected : in  std_ulogic;
21
    iLevelLessBDetected : in  std_ulogic;
22
    -- pwm signal
23
    oPwmSig             : out std_ulogic
24
  );
25
end PwmGenCtrlpath;
1
---------------------------------------------------------------------*-vhdl-*--
2
-- File        : PwmGenCtrlpath-Beh-a.vhd
3
-- Description : <short overview about functionality>
4
--
5
-------------------------------------------------------------------------------
6
-- History (yyyy-mm-dd):
7
-- yyyy-mm-dd last update by firstname lastname
8
-------------------------------------------------------------------------------
9
10
architecture Beh of PwmGenCtrlpath is
11
begin                                   -- Beh
12
13
  -----------------------------------------------------------------------------
14
  -- Insert your code here
15
  -----------------------------------------------------------------------------  
16
17
  -- dummy assignments FIXME
18
19
  --oPwmSig   <= '1' when (iLevelLessADetected = '1') 
20
  -- else '0';
21
22
  oPwmSig  <= '1' when (iLevelLessADetected = '1') else '0';
23
  oSelLevel  <= 0 when (iLevelLessBDetected = '0') else 2; --bei 0 wird iDin genommen und iDin bekommt Zero also RegLevel wird zurückgesetzt
24
  --oLevelA  <= "00011110" when (iRisingKeyEdge(0) = '1') else cDefaultLevelA; --30
25
  --oLevelB  <= "10111110" when (iRisingKeyEdge(0) = '1') else cDefaultLevelB; --190
26
  SelektorLevelA : with iRisingKeyEdge select oSelLevelA <= --Selektor mit der der korrekte Wert für die LevelRegister übernommen wird
27
    1 when (iRisingKeyEdge(0) = '1'),
28
    2 when (iRisingKeyEdge(1) = '1'),
29
    0 when others;
30
  SelektorLevelB : with iRisingKeyEdge select oSelLevelB <=
31
    1 when (iRisingKeyEdge(2) = '1'),
32
    2 when (iRisingKeyEdge(3) = '1'),
33
    0 when others;
34
35
end architecture Beh;

ist die Syntax vom with Select falsch oder darf man beim with kein array 
benutzen?

Für Hilfe wäre ich sehr dankbar!

von Georg A. (georga)


Lesenswert?

Ich habe das with-select-when zwar noch nie verwendet, würde aber sagen, 
dass das beim when im wesentlichen eine Konstante sein muss. Also kein 
() oder =, passt ja auch nicht zur ganzen Idee des with-Ausdrucks. Das 
Stichwort in der Fehlermeldung ist da "locally static". VHDL hat da zwei 
Varianten (globally static, locally static, etc.).

http://www.eda.org/comp.lang.vhdl/FAQ1.html#static

Für deinen Anwendungszweck reicht doch auch ein ganz altmodisches 
when-else.

: Bearbeitet durch User
von rhood (Gast)


Lesenswert?

Dank!
Hast Recht mit dem einfachen when-else ging das Problem, wollte eben mal 
with-select probieren weil es schöner zum Lesen war :)

nochmals vielen Dank!

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.