-
Thread
PS/2 im FPGA
Input_Buffer(10 downto 1); end if; case PS2_State is when RESET_STATE => -- Controller reseten Data_Out <= (others => '0'); Data_Ready <= '0'; Input_Buffer <= (others =>
end if; when WAIT_BREAK1 => Input_Buffer <= (others => '1'); if((PS2_DataSR(1) = '0') and (PS2_ClockSR(1) = '1')) then PS2_State <= RECEIVE_BREAK1
-
Thread
VHDL Timing Constraints nicht erfüllt
result := (others => '0'); --Zurücksetzen des Ergebnisspeichers --Neues sample einlesen. Array wird von vorne --nach hinten aufgefüllt when
case (current_state) is --Alles zurücksetzen when startup => result := (others => '0'); temp_result := (others => '0'); counter_filter := 0;
-
Thread
Ansteuerung Grafic Display
1'; busy <= '1'; state <= sDVAL_HIGH; when others => null; end case; end if; when sDVAL_HIGH => state <= sWAIT; when sWAIT => if (busyi = '0') then
cmd_i <= NO_CMD; -- store command state <= sIDLE; end if; when others => state <= sIDLE; end case; end if; end process; end behavioral; [/vhdl]
-
Thread
Syntax Fragen for/case
implementieren: [vhdl] for i in (1,4,6,13) loop ... end loop; [/vhdl] [vhdl] case i is when 1 => ... when 2 => ... when 3-6 => when other => NULL; emd case; [/vhdl] Ist sowas möglich? Lässt sich ausserdem folgendes Konstrukt in einer Zeile schreiben? [vhdl] myStdLogicVector
g_case: case i generate when 0 => when 1|3|5|11|13 => l_arr(i * l + l - 1 downto i * l) <= s_arr; when others => end generate; end generate; ... AddressdecoderInst : entity work.Addressdecoder
-
Thread
Newbie - 7-Segment-Zähler funktioniert nicht
"; when 8 => SEG <= "1111000";--"1111111"; when 9 => SEG <= "1110000";--"1111101"; when others => SEG <= "1111111"; end case; end if; end process; end Behavioral
Flanken weiter zu zählen. Langsam blicke ich das nicht mehr ;) edit2: Und wenn er erstmal in dem "when others" Fall ist (alle Segmente an), dauert es ein paar Takte (Also Flankenwechsel am Zähleingang), bis er da wieder rauskommt. Gruß, Lasse
-
Thread
Vektorinhalt variabel zuweisen
when "1101" => m := 8192; when "1110" => m := 16348; when others => m := 32786; end case; din_u := resize(unsigned(Vin), Vout'length); din_u := din_u * m;
geworden: [vhdl] -- Number of Slices 9 -- Number of 4 input LUTs 16 -- S3AN 12.047ns : when "1110" => m := 16384; when others => m := 32768; : [/vhdl]
-
Thread
VHDL Einsteigerfragen
Schreibweise realisieren, also z.B.: [vhdl] with ASI_ASIC_IN_DUTY select duty_cycle <= 3300 when "01", 6600 when "10", 10000 when "11", 0 when others; [/vhdl] oder auch [vhdl] duty_cycle <= 3300 when ASI_ASIC_IN_DUTY = "01" else
='0'; when GETDATA => Data_Buffer<=ADC_PARALLEL_IN_OUT; next_s<=GETDATA_FINISH; when GETDATA_FINISH => ADC_CS<='1'; ADC_RD<='1'; next_s<=START; when others
-
Thread
Lauflicht Ws2812B
unsigned (13 downto 0) ; signal clk32: STD_LOGIC; signal clkctr : unsigned(2 downto 0) := (others => '0'); signal in_data_phase : std_logic := '0'; signal bit_count : unsigned(10 downto 0) := (others => '0'); signal count : unsigned(11 downto 0) := (others => '0'); signal
blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & kugel ; when others => data <= gruen & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot & blau & rot
-
Thread
VHDL Verbindung nur wenn "enabled"
<= "0010000"; when others => segments <= "0111111"; end case; end process; -- nebenläufig: segments <= "1000000" when digit=0 else "1111001" when digit=1 else "0100100" when digit
"0000000" when 8, "0010000" when 9, "0111111" when others; [/vhdl] Man sieht hier, dass die if-Abfragerei die Fehleranfälligste ist, weil man sich da um den Defaultwert selbst kümmern muss und bei
-
Thread
Scheinbar gleicher Code verursacht Unterschiedliches
stehen. Die anderen 50% deines Problems, warum das case tut und das If nicht, ist sicherlich der Others Zweig mit dem Null. IMHO heisst das, das die Signale nicht vom Prozess getrieben werden, wenn die When bedingungen nicht erfüllt werden. Du kannst ja mal schreiben [vhdl] when others => ; -
aber nur Du und nicht der Compiler. Änder doch mal den letzten case -Fall, dass Du 10 und 11 zu "when others" zusammenfasst. Rick
-
Thread
Case mit don't care
Hallo, Funktioniert sowas? [vhdl] case foo is when "0101" => ... when "1---" => ... when others => ... end case; [/vhdl] Muss foo dabei wirklich "1---" enthalten, oder kann es auch "1010" sein? Also eben egal sein was die hinteren 3
macht natürlich noch wesentlich mehr :-) Sowas hier geht grad noch: [vhdl] case foo(3) is when '1' => ... when '0' => case foo(2 downto 0) is when "101" => ... when others => ... end case; when others => ... end case; [/vhdl]
-
Thread
Wie viele States sollte ein FSM haben?
dann der Synthesizer wieder komplett anders implementiert. > Kann man auch anders erreichen ('when others'). Synthesizer ignorieren den 'when others' Pfad (kann ich definitiv bestätigen für Synplify). Ist auch so dokumentiert bzw. wird als Warnung ausgegeben. Um das gewünschte Ziel zu erreichen
> erwähnten Pragmas zur Verfügung. Ja stimmt, wenn der 'when others state' als nicht erreichbar erkannt wird und keine Attribute für die Synthese gesetzt sind. Ich habe auch schon gesehen, dass der 'when others state' im Reset gesetzt wird, um die Erreichbarkeit
-
Thread
Meinung zum Anfänger-Code
) when "0011", (0 =>ledOff, 3 => ledOff, 4=> ledOff, others => ledOn) when "0100", (1 => ledOff, 4=> ledOff, others => ledOn) when "0101", (1 => ledOff, others => ledOn) when "0110", (0 => ledOn, 1 => ledOn, 2 => ledOn, others => ledOff) when "0111", (others => ledOn) when "1000", (4 => ledOff,others => ledOn) when "1001", (others => ledOff) when others; [/vhdl] Man kann kein /Muster/ erkennen. Und die 7Segment-LEDs
-
Thread
vhdl Anfang mal wieder
segments <= "1111110" when "0000", "0110000" when "0001", "1101101" when "0010", "1111001" when "0011", : "1001111" when "1110", "1000111" when others; [/vhdl] .... wäre auf diese Art einfacher lesbar: [vhdl] segments <= "1111110" when x"0", "0110000" when x"1", "1101101" when x"2", "1111001" when x"3", : "1001111" when x"E", "1000111" when others; [/vhdl]
-
Thread
ist es eine extension?
is signal ored, anded: bit; signal vec: bit_vector(3 downto 0); begin anded <= '1' when vec = (others => '1') else '0'; ored <= '0' when vec = (others => '0') else '1'; end; [/vhdl] $ ghdl -a --std=02 main.vhd 'others' choice not allowed for an aggregate in this context 'others
XST beschwert sich auch: [vhdl] 40: anded <= '1' when vec = (others => '1') else '0'; 41: ored <= '0' when vec = (others => '0') else '1'; [/vhdl] [pre] ========================================================================= *
-
Thread
Zuweisung zund zusammensetzen
nachzuschauen. Das ist trivial, ich weiss. Stehe gerade nur auf dem Schlauch. [vhdl] mem_data_r<= (others=>'Z') when uart_select='0' else "ZZZZZZZZZZZZZZZZZZZZZZZZ"& receive_data when mem_address(2)='0' -- ((7 downto 0)=> receive_data,others=>'Z') when mem_address(2)='0' --
else vergessen? mem_data_r<= (others=>'Z') when uart_select='0' else "ZZZZZZZZZZZZZZZZZZZZZZZZ"& receive_data when mem_address(2)='0' else ((7 downto 0)=> receive_data,others=>'Z') when mem_address(2)='0' else (0=>send_busy
-
Thread
Fehlermeldung: Type error resolving infix expression "<=" as type ieee.std_logic_1164.STD_LOGIC.
begin p_demu : process (e_i, sel_i, en_i) begin if en_i = '1' then q_o <= (others => 'Z'); else case sel_i is when "00" => q_o(0) <= e_i, q_o(3 downto 1) <= (others => 'Z'); when "01" => q_o(1) <= e_i,
when others => q_o(3) <= 'Z', q_o(2 downto 0) <= (others => 'Z'); end case; end if; end process p_demu; end architecture rtl; [/vhdl] Irgendwie habe ich
-
Thread
Modelsim Problem- bidirektionaler Bus
case; elsif (wr = '0') and (rd = '1') then case address is when MY_ADDRESS => data <= m_register; when others => null; end case; else data <= (others => 'Z'); end if; end if; end process
when MY_ADDRESS1 => data <= m_register1; when MY_ADDRESS2 => data <= m_register2; when others => null; end case; else
-
Thread
RS232 zum PC mit dem DE1
0); constant tick : integer := (clk_freq/baudrate); begin send_busy <= '1' when (nextwrite+1 = nextread) else '0'; send_empty <= '1' when nextwrite=nextread else '0'; process(clk) begin if rising_edge(clk) then if reset = '1' then nextread <= (others
(others => '0'); case state is when idle => if nextwrite /= nextread then nextstate <= start; data_tx <= fifo(to_integer(nextread));
-
Thread
3 Sensoren in ein Register
when others => null; end case; when S00 => case SLV2'(A & B) is when "10" => State <= S10; Count <= Count + 1;
S10; when others => null; end case; when others => State <= Boot; end case; end if; end process; end behavioral; [/vhdl]
-
Thread
Beim SRAM-Daten-übertragen wird immer als erstes Bit7 gesendet.
process (clk50) begin if rising_edge(clk50) then case state is --- idle state when "000" => rdata <= (others => 'Z'); --- write state when "001" => raddr <= addr; rdata <= data_sw; ce <= '0';
process (clk50) begin if rising_edge(clk50) then case state is --- idle state when "000" => rdata <= (others => 'Z'); --- write state when "001" => raddr <= addr; rdata <= "00000000" & data_sw; ce
-
Thread
Generisches oder
when vector /= (others => '0')?
... when vector /= (others => '0') .. ... kann nicht funktionieren, denn sonst müsste Typ von (others => '0') aus dem Operator /= abgeleitet werden, der den Typ wiederum aus vector ableitet, das funktioniert
-
Thread
VHDL + RS232 Problem
-- when there were 8 zeros the startbit is finished nextstate <= DATS; dat1 := (others => '0') ; dat0 := (others => '1'); count := (others
--when there were five times a zero the Bit is set to 0 end if; if count = conv_std_logic_vector(8,4) then pos := pos + 1; dat1 := (others
-
Thread
VHDL Eingänge werden nicht übernommen
rising_edge(clk) then if sync_rst='1' then zähler => 0; else case state is when s1 => state <= s2; when s2 => state <= s3 zähler => zähler +1; when others => state => s1 end case; end if; end if; end
<= "10"; when S5 => AutoAmpel <= "110"; Fussampel <= "10"; when others => AutoAmpel <= "100"; Fussampel <= "10";
-
Thread
Anfänger: Wieder mal 7-Segment
"; when "1111" => SEG7 <= "11100001"; when others => SEG7 <= "11111101"; end case; end if; end process; end V1; [/vhdl] Leider sehe ich auf der Anzeige
Doch, über [vhdl] when others => ANODE <= "1111"; [/vhdl] bei "--1-----".
-
Thread
Test Bench Takt erstellen
Sprache zusammen, "if" ist eben nicht gleichbedeutend mit "when"! Ein "when" beschreibt eine Bedingung die dauernd/laufend gilt. Ein "if" beschreibt eine Entscheidung, die nur zu einem bestimmten Zeitpunkt" getroffen wird, und zwar in der SEQUENTIELLEN Abarbeitung
aggregat is --signal ir_temp : std_logic_vector(15 downto 0); begin -- OK a <= ( '0', x, y, z, others => '0' ); -- OK b <= ( 5=>x, 3=>y, 2=>z, others => '0' ); -- OK c <= ( 6 downto 4 =>'1', others => '0' ); -- ISIM: Type std_ulogic does not match with a string literal -- ALDEC
-
Thread
Taktfrequenzerhöhung
end case; end if; end process uc_iface; DATA <= tmp_data when cmd_state = DATA_READ else (others => 'Z'); BUSY <= '0' when cmd_state = IDLE else '1'; end Behavioral; [/vhdl]
end if; end if; end process uc_iface; DATA <= data_out when WR = '0' else (others => 'Z'); data_in <= DATA; BUSY <= '0' when WR = '0' else '1'; [/vhdl] Performance Summary Min. Clock Period 14.000 ns. Max. Clock Frequency (fSYSTEM
-
Thread
VHDL: umständlicher Code?
when others => wave <= shiftreg(7); shiftreg(7 downto 1) <= shiftreg(6 downto 0); end case; [/vhdl] kann man (funktionsgleich) auch so schreiben: [vhdl] wave <= shiftreg
shiftreg <= ram_data; wave <= ram_data(7); when others => null; end case; [/vhdl] indem man alles, was redundant ist, aus dem case rauszieht und nur die Ausnahmen drin läßt. Da muss man sich als "normaler" Programmierer (wo
-
Thread
Brauche dringend Hilfe mit 4Gewinnt
ledout(7+i) <= '1'; ledout(18+i) <= '1'; when others => ledout(7+i) <= '0'; ledout(18+i) <= '0'; end case; end loop; if (x = spaltenAnz) then
(18+i) <= '1'; when others => ledout(7+i) <= '0'; ledout(18+i) <= '0'; end case; end loop; if (x = spaltenAnz) then x := 1; else x := x + 1;
-
Thread
VHDL: case-Anwendung ohne clk
end if; -- do nothing. Stay here. when others => ns <= y7; end case; end process SET_NS; [/vhdl] wie bzw. wann wird denn nun so eine case-Anweisung abgearbeitet, wenn sie nicht von clk abhängig ist?
--end if; when y6 => if we = '1' then ns <= y5; end if; -- do nothing. Stay here. when others => ns <= y1; end case; end process SET_NS; [/vhdl] Mir geht
-
Thread
Erzeugung von Tri - State Signalen?
elsif (A="001000") then ADDR_MUX <= D(2 downto 0); end process; -- Lesen DATA_BUF <= PA when (ADDR="000000") else PB when (ADDR="000001") else PC when (ADDR="000010") else PD when (ADDR="000011") else (others => '0'); DATA <= DATA_BUF when NE1='0' and NOE='0' else (others => 'Z'); end VERHALTEN; [/vhdl]
-
Thread
VHDL einfache FSM Implementierung geht nicht
nextState <= idleState; end if; case nextState is when idleState => bitCount <= (others => '0'); counter <= (others => '0'); nrOnes <= (others => '0'); s_tx_o <= '1'; if load
FSM schrieb im Beitrag #3939482: > when parityState => > counter <= (others => '0'); > > ... > > if counter = (counterEnd-1) then > > nextState <= idleState; > else
-
Thread
Primzahlgenerator
; when 6 => Q_o <= "1101"; when others => Q_o <= (others => '0'); end case c_switch; exit; end loop f_cnt; end if; end process p_prim; end architecture rtl; [/
; when 6 => Q_o <= "1101"; when others => Q_o <= (others => '0'); end case c_switch; v_var := v_var + 1; if (v_var > 6) then v_var := 0; end
-
Thread
Endlicher Automat hängt
when others => state <= "00"; end case; end if; end process; STATE_OUT <= to_stdlogicvector(state); end Behavioral; Soll ein RESET_IN Signal entgegennehmen, für zwei CLK_IN
Gray-Version hat ja durch die Synthese als OneHot zusätzliche "illegale" States erzeugt, die sich mit when others nicht abfangen liessen, weil es semantisch vollständig auscodiert war.
-
Thread
Force auf records anwenden - Modelsim VHDL
und dann einen sicheren State anzuspringen. PS : Das ist nicht das selbe, wie das Einfügen eines when others Pfades. Auch für den Compiler hat Dein Type nur genau 4 Zustände.
im Forum ist Gold wert: http://www.mikrocontroller.net/search?query=when+others
-
Thread
Latchs bei FSM
when OTHERS => FOLGE_Z <= S_WAIT; end case; end process PROCESS2; PROCESS3: process( ZUSTAND,QX_INT,QY_INT ) BEGIN if ZUSTAND = S_OUT or ZUSTAND = S_STOP then
Defaultzuweisungen in Process2: READY <= '0'; FOLGE_Z <= S_WAIT; X_INT <= (OTHERS => '0'); Y_INT <= (OTHERS => '0'); QX_INT <= (OTHERS => '0'); QY_INT <= (OTHERS => '0'); und in Process3 X_OUT <= (OTHERS => '0'); Y_OUT <=
-
Thread
Drehgeber-Auswertung: Frage zu Syntheseergebnis
"0100" => down <= '1'; when "0111" => up <= '1'; when "1000" => up <= '1'; when "1011" => down <= '1'; when "1101" => down <= '1'; when "1110" => up <= '1'; when others => null
<= '1'; when "1101" => down <= '1'; when "1110" => up <= '1'; when others => null; -- up <= '0' könnte auch hier stehen. end case; end if; end if; [/pre] Gruss ----
-
Thread
Statemachine springt in falsche "states" warum?
debug <= NOT "00011100"; when others => null; end case; end if; [/vhdl] delay ist [vhdl] signal delay : integer range 0 to CLOCK*5 := 0; [/vhdl]
Oszillator sauber läuft? Wird evtl. das FPGA laufend neu geladen? Noch ein Wort zum hier unnötigen "when others": http://www.lothar-miller.de/s9y/archives/30-when-others.html
-
Thread
Bidirektionaler I/O will nicht
when state_reset0 => -- wait fore reset time (500µs) to be over if timer=std_logic_vector(to_unsigned(8000,timer'length)) then state <= state_reset1; timer <= (others
state <= state_reset2; timer <= (others => '0'); -- reset the timer for the next state end if; when state_reset2 => -- the response has been recorded, wait for rising edge on the bus if dq_invalue='1' then
-
Thread
Der Process soll sich selber ausschalten
.... blablabla END CASE; WHEN '0'=> SET_VREF<='0'; ----STOP TRANMISSION WAITING<='1';----wait for new command WHEN OTHERS =>NULL; END CASE; END IF; ---END OF MAIN PROCESS END PROCESS; END MAIN;
" => SYNC <=NOT "100"; WHEN "111"=> SYNC <=NOT "111"; WHEN OTHERS => ERROR <='1'; END CASE; IF (DA_COUNTER<9) THEN DA_COUNTER<=DA_COUNTER+1; ELSE DA_COUNTER
-
Thread
FSM möglichst einfach und übersichtlich
reset = '0' then state <= r; elsif rising_edge(clk) then case state is when y => state <= r; when g => state <= y; when ry => state <= g; when r => state <= ry; when others => null; end case; end if; end process state_selector
reset = '0' then state <= r; elsif rising_edge(clk) then case state is when y => state <= r; when g => state <= y; when ry => state <= g; when r => state <= ry; when others => null; end case; end if; end process state_selector
-
Thread
Finite-State-Machine stürzt ab
end if; when 1 => if SPI_RDY = '1' then SPI_sel <= '0'; zaehler_prog := 2; end if; when others =>
; when others=> zaehler_prog := 0; programmcounter := programmcounter + 1; end case; when "0110" => -- 6 for start, Schleifendurchläufe
-
Thread
Problem bei AC97-Codec Ansteuerung (LM4550)
16 => ac97_sdata_out <= '0'; -- write when 22 => ac97_sdata_out <= '1'; -- master volume register 02h when others => ac97_sdata_out <= '0'; end case; elsif volcontrol
case bit_cnt is -- bit_cnt : 16 .. 35 when 16 => ac97_sdata_out <= '0'; -- write when 21 => ac97_sdata_out <= '1'; -- headphone volume register 04h when others => ac97
-
Thread
vhdl anfänger mit problem
"; when "1000" => DIG0_SEG(7 downto 0) <= "11111110"; when "1001" => DIG0_SEG(7 downto 0) <= "11110110"; when others => DIG0_SEG(7 downto 0) <= "XXXXXXXX"; end case; case bcd1 is when "0000
"; when "1001" => DIG1_SEG(7 downto 0) <= "11110110"; when others => DIG1_SEG(7 downto 0) <= "XXXXXXXX"; end case; case bcd2 is when "0000" => DIG2_SEG(7 downto 0) <= "11111100"; when "0001
-
Thread
Befehl in zwei Takten Ausführen
"0001" => F <= P; when others => F <= (others => '-'); end case; end if; end process; [/vhdl]
when "0001" => F <= P; > when others => F <= (others => '-'); > end case; > end if; > end process; [/code] Ist das ja equivalent zum zweiten Beispiel. Nehmen
-
Thread
Ultraschallsensor HC-SR04 mit FPGA
die DIG_0 Anzeige von 1 bis 9 einmal komplett hintereinander ausgegeben wurden. Danach trifft der "when others" Fall ein und blieb bei jeder neuen Periode ebenfalls auf "when others". Wie bekomme ich das hin, dass ich nur den Wert bekomme, der auch der distance zugeordnet ist? Ich habe versucht am
7 when 8 => DIG_0 <= "0000000"; -- 8 when 9 => DIG_0 <= "0001100"; -- 9 --when others => DIG_0 <= "1111110"; -- - when others => DIG_0 <= "0000000";
-
Thread
Inferring latch
(63 downto 55); when others => curctr := (others=>'0'); end case; indexu := curctr (6 downto 0); -- index f�r die tabelle case abschnittu(1) is when '1' => data <= conv_std_logic_vector
when '0' => adr <= conv_std_logic_vector(indexu,7); when '1' => adr <= conv_std_logic_vector(127-indexu,7); when others => adr <= (others=>'0'); end case; end if; end
-
Thread
Dringend Hilfe gesucht - XC9572xl
--when "110" => led <= x"fd"; --when "111" => led <= x"fe"; --when others => led <= x"00"; -- S5 Schleife --when "000" => led <= x"7e"; --when "001" => led <= x"bd"; --when
when "1010" => led <= x"07"; when "1011" => led <= x"0f"; when "1100" => led <= x"1f"; when "1101" => led <= x"3f"; when "1111" => led <= x"7f"; when others => led <= x"ff";
-
Thread
-no case static error
begin process (RES_N, CLK) begin if RES_N = '0' then TEST <= (others => '0'); elsif rising_edge(CLK) then case ADR is when a_adr => TEST <= x"001"; when b_adr => TEST <= x"002"; when others => null; end
CLK) then case ADR is when a_adr => TEST <= x"001"; when b_adr => TEST <= x"002"; when others => null; end case; end if; end process; end arch; Die Konvertierung integer ->
-
Thread
nochmal Problem mit Spartan 3 Multiplier
sdc_a_data_src, input, sdc_b_rdata, sdc_mac_out) begin if res = '1' then sdc_a_wdata <= (others => '0'); elsif clk'event and clk = '1' then case sdc_a_data_src is when "00" => sdc_a_wdata <= std_logic_vector (input); when "01" => sdc_a_wdata <= sdc_b_rdata; when "10" => sdc_a_wdata <= std_logic_vector (sdc_mac_val_32); when "11" => sdc_a_wdata <= (others => '0'); when others => sdc_a_wdata <= (others => '0'); end case; end